Commit Graph

1163407 Commits

Author SHA1 Message Date
Dezhi Huang
f949397a1b ANDROID: GKI: net: add vendor hooks for link data path
add vendor hooks to support link data path feature.
1.android_vh_dc_send_copy
For send copy pkt on the other ways
2.android_vh_dc_receive
For Drop duplicated pkt when dual connection connected

Bug: 343838581
Change-Id: I31acba1827205c366a4f54c4b940d4d8f2c21bff
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
(cherry picked from commit 86dd89554f8308fcd58af6156fd67ac2ac7facbf)
2024-10-28 17:49:41 +00:00
John Stultz
3165cd1163 ANDROID: ABI: Update symbol list for spi-geni-qcom updates
This adds:
  geni_se_rx_init_dma
  geni_se_tx_init_dma

to the symbol list for db845c as it uses the spi-geni drivers,
and recent changes would break building modules for db845c
without the new exported symbols.

Bug: 370629635
Change-Id: I3325c7f4f4de5de736d7bb6f89c1a9c797a0f744
Signed-off-by: John Stultz <jstultz@google.com>
2024-10-26 07:36:16 +00:00
Vijaya Krishna Nivarthi
3b727b0154 UPSTREAM: spi: spi-geni-qcom: Do not do DMA map/unmap inside driver, use framework instead
The spi geni driver in SE DMA mode, unlike GSI DMA, is not making use of
DMA mapping functionality available in the framework.
The driver does mapping internally which makes dma buffer fields available
in spi_transfer struct superfluous while requiring additional members in
spi_geni_master struct.

Conform to the design by having framework handle map/unmap and do only
DMA transfer in the driver; this also simplifies code a bit.

Fixes: e5f0dfa78a ("spi: spi-geni-qcom: Add support for SE DMA mode")
Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/1684325894-30252-3-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 370629635
Change-Id: I4140cf94b0efe0cdebe3d998915a19e2e3d7e172
(cherry picked from commit 3a76c7ca9e)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-25 14:52:01 -07:00
Douglas Anderson
a874ed06eb UPSTREAM: Revert "tty: serial: simplify qcom_geni_serial_send_chunk_fifo()"
This reverts commit 5c7e105cd1.

As identified by KASAN, the simplification done by the cleanup patch
was not legal.

>From tracing through the code, it can be seen that we're transmitting
from a 4096-byte circular buffer. We copy anywhere from 1-4 bytes from
it each time. The simplification runs into trouble when we get near
the end of the circular buffer. For instance, we might start out with
xmit->tail = 4094 and we want to transfer 4 bytes. With the code
before simplification this was no problem. We'd read buf[4094],
buf[4095], buf[0], and buf[1]. With the new code we'll do a
memcpy(&buf[4094], 4) which reads 2 bytes past the end of the buffer
and then skips transmitting what's at buf[0] and buf[1].

KASAN isn't 100% consistent at reporting this for me, but to be extra
confident in the analysis, I added traces of the tail and tx_bytes and
then wrote a test program:

  while true; do
    echo -n "abcdefghijklmnopqrstuvwxyz0" > /dev/ttyMSM0
    sleep .1
  done

I watched the traces over SSH and saw:
  qcom_geni_serial_send_chunk_fifo: 4093 4
  qcom_geni_serial_send_chunk_fifo: 1 3

Which indicated that one byte should be missing. Sure enough the
output that should have been:

  abcdefghijklmnopqrstuvwxyz0

In one case was actually missing a byte:

  abcdefghijklmnopqrstuvwyz0

Running "ls -al" on large directories also made the missing bytes
obvious since columns didn't line up.

While the original code may not be the most elegant, we only talking
about copying up to 4 bytes here. Let's just go back to the code that
worked.

Fixes: 5c7e105cd1 ("tty: serial: simplify qcom_geni_serial_send_chunk_fifo()")
Cc: stable <stable@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Jiri Slaby <jirislaby@kernel.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20240304174952.1.I920a314049b345efd1f69d708e7f74d2213d0b49@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I0946e0e50b0433da1d926f5778dbe7b8a651f72b
(cherry picked from commit 3d9319c27ceb35fa3d2c8b15508967f3fc7e5b78)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-24 22:01:08 +05:30
Douglas Anderson
e9c03c47d6 UPSTREAM: serial: qcom-geni: Don't cancel/abort if we can't get the port lock
As of commit d7402513c935 ("arm64: smp: IPI_CPU_STOP and
IPI_CPU_CRASH_STOP should try for NMI"), if we've got pseudo-NMI
enabled then we'll use it to stop CPUs at panic time. This is nice,
but it does mean that there's a pretty good chance that we'll end up
stopping a CPU while it holds the port lock for the console
UART. Specifically, I see a CPU get stopped while holding the port
lock nearly 100% of the time on my sc7180-trogdor based Chromebook by
enabling the "buddy" hardlockup detector and then doing:

  sysctl -w kernel.hardlockup_all_cpu_backtrace=1
  sysctl -w kernel.hardlockup_panic=1
  echo HARDLOCKUP > /sys/kernel/debug/provoke-crash/DIRECT

UART drivers are _supposed_ to handle this case OK and this is why
UART drivers check "oops_in_progress" and only do a "trylock" in that
case. However, before we enabled pseudo-NMI to stop CPUs it wasn't a
very well-tested situation.

Now that we're testing the situation a lot, it can be seen that the
Qualcomm GENI UART driver is pretty broken. Specifically, when I run
my test case and look at the console output I just see a bunch of
garbled output like:

  [  201.069084] NMI backtrace[  201.069084] NM[  201.069087] CPU: 6
  PID: 10296 Comm: dnsproxyd Not tainted 6.7.0-06265-gb13e8c0ede12
  #1 01112b9f14923cbd0b[  201.069090] Hardware name: Google Lazor
  ([  201.069092] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DI[
  201.069095] pc : smp_call_function_man[  201.069099]

That's obviously not so great. This happens because each call to the
console driver exits after the data has been written to the FIFO but
before it's actually been flushed out of the serial port. When we have
multiple calls into the console one after the other then (if we can't
get the lock) each call tells the UART to throw away any data in the
FIFO that hadn't been transferred yet.

I've posted up a patch to change the arm64 core to avoid this
situation most of the time [1] much like x86 seems to do, but even if
that patch lands the GENI driver should still be fixed.

>From testing, it appears that we can just delete the cancel/abort in
the case where we weren't able to get the UART lock and the output
looks good. It makes sense that we'd be able to do this since that
means we'll just call into __qcom_geni_serial_console_write() and
__qcom_geni_serial_console_write() looks much like
qcom_geni_serial_poll_put_char() but with a loop. However, it seems
safest to poll the FIFO and make sure it's empty before our
transfer. This should reliably make sure that we're not
interrupting/clobbering any existing transfers.

As part of this change, we'll also avoid re-setting up a TX at the end
of the console write function if we weren't able to get the lock,
since accessing "port->tx_remaining" without the lock is not
safe. This is only needed to re-start userspace initiated transfers.

[1] https://lore.kernel.org/r/20231207170251.1.Id4817adef610302554b8aa42b090d57270dc119c@changeid

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20240112150307.2.Idb1553d1d22123c377f31eacb4486432f6c9ac8d@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I0d8abd6cb1471f96d8be5c51061dbd830bed236e
(cherry picked from commit 9e957a155005b16af057e86c6bcc1197cd70a6af)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-24 22:00:56 +05:30
Uwe Kleine-König
2c16ff3847 UPSTREAM: serial: qcom_geni: 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/20231110152927.70601-32-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I5d64129414dbd303ae50544ffa9385611dfabda7
(cherry picked from commit dd4d4497be8ff2a72e4345c3c1b6450cadfa75d6)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-24 22:00:34 +05:30
Thomas Gleixner
7161dbc311 UPSTREAM: serial: qcom-geni: Use port lock wrappers
When a serial port is used for kernel console output, then all
modifications to the UART registers which are done from other contexts,
e.g. getty, termios, are interference points for the kernel console.

So far this has been ignored and the printk output is based on the
principle of hope. The rework of the console infrastructure which aims to
support threaded and atomic consoles, requires to mark sections which
modify the UART registers as unsafe. This allows the atomic write function
to make informed decisions and eventually to restore operational state. It
also allows to prevent the regular UART code from modifying UART registers
while printk output is in progress.

All modifications of UART registers are guarded by the UART port lock,
which provides an obvious synchronization point with the console
infrastructure.

To avoid adding this functionality to all UART drivers, wrap the
spin_[un]lock*() invocations for uart_port::lock into helper functions
which just contain the spin_[un]lock*() invocations for now. In a
subsequent step these helpers will gain the console synchronization
mechanisms.

Converted with coccinelle. No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Link: https://lore.kernel.org/r/20230914183831.587273-50-john.ogness@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Id50c4ae6fdb869fda1c55ea491f73c581e8fddec
(cherry picked from commit b8ba915d960d03bd7e24eab80f0820bdd19203ec)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-24 22:00:11 +05:30
Vijaya Krishna Nivarthi
cd5bd514c0 UPSTREAM: tty: serial: qcom-geni-serial: Poll primary sequencer irq status after cancel_tx
TX is handled by primary sequencer. After cancelling primary command, poll
primary sequencer's irq status instead of that of secondary.
While at it, also remove a couple of redundant lines that read from IRQ_EN
register and write back same.

Fixes: 2aaa43c707 ("tty: serial: qcom-geni-serial: add support for serial engine DMA")
Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Link: https://lore.kernel.org/r/1691578393-9891-1-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I3fcbc657ca3bc93ab2a692f16ad760576f190098
(cherry picked from commit 9c8441330b)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-24 21:59:52 +05:30
Johan Hovold
5722a4dd8b UPSTREAM: serial: qcom-geni: clean up clock-rate debug printk
Make the clock-rate debug printk more readable by using an equal sign
instead of a dash as separator between names and values and adding some
spaces:

	qcom_geni_serial 988000.serial: desired_rate = 1843200, clk_rate = 7372800, clk_div = 4

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230714130214.14552-3-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I7d842e9d16bbbc3c0a5bf4481996f76cd60f5847
(cherry picked from commit 18536cc8fa)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-24 06:25:43 +00:00
Johan Hovold
d5e0fbcd4a UPSTREAM: serial: qcom-geni: use icc tag defines
Use the Qualcomm interconnect defines rather than magic numbers for the
icc tags also in the restore() PM callback.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Georgi Djakov <djakov@kernel.org>
Link: https://lore.kernel.org/r/20230711160516.30502-1-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I2517ad217219a4acf92365846c668610248fb96e
(cherry picked from commit 51273792cb)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-24 06:25:43 +00:00
杨辉
5bdef2817a ANDROID: ABI: update gki symbol list
Update the symbol list with new vendor hooks used by xiaomi

2 function symbol(s) added
int __traceiter_android_vh_alloc_flags_cma_adjust(gfp_t gfp_mask,
unsigned int *alloc_flags)
int __traceiter_android_vh_rmqueue_cma_fallback(struct zone *zone,
unsigned int order, struct page **page)

Bug: 374857413
Change-Id: If7ff8cef7d65a4f913afb32d3ff0ef5e56732035
Signed-off-by: 杨辉 <yanghui10@xiaomi.corp-partner.google.com>
2024-10-23 23:11:54 +00:00
zhaoyang.huang
a03d1670d2 ANDROID: Add vendor hook for cma adjusting
ALLOC_CMA is hard binded to GFP_CMA now, introduce a vh for adjusting.

Bug: 291181967
Bug: 374857413
Test: build pass
Change-Id: Idd4c1a2b5971920881b8f42fdc9358918ef2a946
Signed-off-by: zhaoyang.huang <zhaoyang.huang@unisoc.com>
(cherry picked from commit 79353327f1a51082c2308733ed38b4235d5956e0)
2024-10-23 23:11:54 +00:00
Justin Chen
e02772c76d BACKPORT: firmware: arm_scmi: Queue in scmi layer for mailbox implementation
send_message() does not block in the MBOX implementation. This is
because the mailbox layer has its own queue. However, this confuses
the per xfer timeouts as they all start their timeout ticks in
parallel.

Consider a case where the xfer timeout is 30ms and a SCMI transaction
takes 25ms:

  | 0ms: Message #0 is queued in mailbox layer and sent out, then sits
  |      at scmi_wait_for_message_response() with a timeout of 30ms
  | 1ms: Message #1 is queued in mailbox layer but not sent out yet.
  |      Since send_message() doesn't block, it also sits at
  |      scmi_wait_for_message_response() with a timeout of 30ms
  |  ...
  | 25ms: Message #0 is completed, txdone is called and message #1 is sent
  | 31ms: Message #1 times out since the count started at 1ms. Even though
  |       it has only been inflight for 6ms.

Bug: 374939101
Fixes: 5c8a47a5a9 ("firmware: arm_scmi: Make scmi core independent of the transport type")
Change-Id: I0ab132221c28d4594f0bbc161f431ceb49830824
Signed-off-by: Justin Chen <justin.chen@broadcom.com>
Message-Id: <20241014160717.1678953-1-justin.chen@broadcom.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit da1642bc97c4ef67f347edcd493bd0a52f88777b)
Signed-off-by: Danesh Petigara <danesh.petigara@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
2024-10-23 18:19:07 +00:00
Jiri Slaby (SUSE)
4dc2498506 UPSTREAM: tty: serial: simplify qcom_geni_serial_send_chunk_fifo()
* use memcpy() instead of the loop (removes c variable)
* use remaining parameter directly (removes chunk variable)

The code is simpler and easier to follow.

Cc: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: linux-arm-msm@vger.kernel.org
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230420093514.13055-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I297af26a5d1eeac9d1886582a09d917efce6a7bf
(cherry picked from commit 5c7e105cd1)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:33:20 +00:00
Douglas Anderson
719b876f95 UPSTREAM: tty: serial: qcom-geni-serial: Add a poll_init() function
On sc7180 Chromebooks, I did the following:
* Didn't enable earlycon in the kernel command line.
* Didn't enable serial console in the kernel command line.
* Didn't enable an agetty or any other client of "/dev/ttyMSM0".
* Added "kgdboc=ttyMSM0" to the kernel command line.

After I did that, I tried to enter kdb with this command over an ssh
session:
  echo g > /proc/sysrq-trigger

When I did that the system just hung.

Although I thought I'd tested this scenario before, I couldn't go back
and find a time when it was working. Previous testing must have relied
on either the UART acting as the kernel console or an agetty running.

It turns out to be pretty easy to fix: we can just use
qcom_geni_serial_port_setup() as the .poll_init() function. This,
together with the patch ("serial: uart_poll_init() should power on the
UART"), allows the debugger to work even if there are no other users
of the serial port.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230316132027.RESEND.2.Ie678853bb101091afe78cc8c22344bf3ff3aed74@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I9e362aeffbb0a6a4e68f516e5325451288409172
(cherry picked from commit d8851a96ba)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:33:20 +00:00
Johan Hovold
d15f99d2b5 UPSTREAM: serial: qcom-geni: drop bogus uart_write_wakeup()
Drop the bogus uart_write_wakeup() from when setting up a new DMA
transfer, which does not free up any more space in the ring buffer.

Any pending writers will be woken up when the transfer completes.

Cc: stable <stable@kernel.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride
Link: https://lore.kernel.org/r/20230307164405.14218-5-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Ic15a29678c6a6bc3f39af06053e1354de0ba442a
(cherry picked from commit b6a7bac184)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:33:20 +00:00
Johan Hovold
3991e7fcc9 UPSTREAM: serial: qcom-geni: fix mapping of empty DMA buffer
Make sure that there is data in the ring buffer before trying to set up
a zero-length DMA transfer.

This specifically fixes the following warning when unmapping the empty
buffer on the sc8280xp-crd:

   WARNING: CPU: 0 PID: 138 at drivers/iommu/dma-iommu.c:1046 iommu_dma_unmap_page+0xbc/0xd8
   ...
   Call trace:
    iommu_dma_unmap_page+0xbc/0xd8
    dma_unmap_page_attrs+0x30/0x1c8
    geni_se_tx_dma_unprep+0x28/0x38
    qcom_geni_serial_isr+0x358/0x75c

Fixes: 2aaa43c707 ("tty: serial: qcom-geni-serial: add support for serial engine DMA")
Cc: stable <stable@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride
Link: https://lore.kernel.org/r/20230307164405.14218-4-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Idf35c80ec7975d2b5c2968948cecdd9c1e7e4cf5
(cherry picked from commit 97820780b7)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:33:20 +00:00
Johan Hovold
64bccf317e UPSTREAM: serial: qcom-geni: fix DMA mapping leak on shutdown
Fix what appears to be a copy-paste error that can lead to a leaked DMA
mapping on close() and failure to restart TX after the port is reopened.

Note that rx_dma_addr is generally NULL when
qcom_geni_serial_stop_tx_dma() is called as part of shutdown() (but
tx_dma_addr need not be).

Fixes: 2aaa43c707 ("tty: serial: qcom-geni-serial: add support for serial engine DMA")
Cc: stable <stable@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride
Link: https://lore.kernel.org/r/20230307164405.14218-3-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I019a6af70b38cac1b0d89cd522d4e6c692e7baba
(cherry picked from commit 95fcfc0853)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:24:04 +00:00
Johan Hovold
4c3917c600 UPSTREAM: serial: qcom-geni: fix console shutdown hang
A recent commit added back the calls top stop tx and rx to shutdown()
which had previously been removed by commit e83766334f ("tty: serial:
qcom_geni_serial: No need to stop tx/rx on UART shutdown") in order to
be able to use kgdb after stopping the getty.

Not only did this again break kgdb, but it also broke serial consoles
more generally by hanging TX when stopping the getty during reboot.

The underlying problem has been there since the driver was first merged
and fixing it is going to be a bit involved so simply stop calling the
broken stop functions during shutdown for consoles for now.

Fixes: d8aca2f968 ("tty: serial: qcom-geni-serial: stop operations in progress at shutdown")
Cc: stable <stable@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride
Link: https://lore.kernel.org/r/20230307164405.14218-2-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Ib532b26b318d720f74e02543e74fa26775ad4c4a
(cherry picked from commit 9aff74cc4e)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:24:04 +00:00
Ilpo Järvinen
8bbc5694db UPSTREAM: serial: qcom_geni: Fix variable naming
Commit 2aaa43c707 ("tty: serial: qcom-geni-serial: add support for
serial engine DMA") renamed rx_fifo member to rf_buf which caused a
build failure when b8caf69a69 ("tty: serial: qcom-geni-serial: fix
slab-out-of-bounds on RX FIFO buffer") from tty-linus was merged into
tty-next.

Fix the member variable name.

Fixes: 7a6aa989f2 ("Merge 6.2-rc5 into tty-next")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230123173857.40695-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I931e19ef4833321ba23b7c764650c1296c1615a6
(cherry picked from commit a3cf6b946e)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:24:04 +00:00
Bartosz Golaszewski
53be6ca12d BACKPORT: tty: serial: qcom-geni-serial: add support for serial engine DMA
The qcom-geni-serial driver currently only works in SE FIFO mode. This
limits the UART speed to around 180 kB/s. In order to achieve higher
speeds we need to use SE DMA mode.

Keep the console port working in FIFO mode but extend the code to use
DMA
for the high-speed port.

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

Bug: 370629635
Change-Id: I0880354e27e04cb1a49a4759d6df7fe315311574
(cherry picked from commit 2aaa43c707)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:24:04 +00:00
Bartosz Golaszewski
3321cd20f3 BACKPORT: soc: qcom-geni-se: add more symbol definitions
The following symbols will be used when adding support for SE DMA in
the qcom geni serial 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-14-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Id524d6937c9c59634195b3997c318dcac650b738
(cherry picked from commit 7de06d8455)
[ptalari: resolved conflict since file moved qcom-geni-se.h to
linux/soc/qcom/geni-se.h]
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:24:04 +00:00
Bartosz Golaszewski
61df751af7 BACKPORT: tty: serial: qcom-geni-serial: use of_device_id data
Instead of checking the device compatible in probe(), assign the
device-specific data to struct of_device_id. We'll use it later when
providing SE DMA support.

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-13-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I3116f17cf59cefb3d065c402a1dd54fd19686dba
(cherry picked from commit 40ec6d41c8)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:24:04 +00:00
Bartosz Golaszewski
3ebd383e35 BACKPORT: tty: serial: qcom-geni-serial: drop the return value from handle_rx
The return value of the handle_rx() callback is never checked. Drop it.

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-12-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I41a50a0d933243fa03502c5fda997bd53ae14080
(cherry picked from commit 0626afe57b)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:24:04 +00:00
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