linux/arch/arm
Linus Walleij 2c50a570e9 ARM: 9004/1: debug: Split waituart to CTS and TXRDY
This patch was triggered by a remark from Russell that
introducing a call to the waituart (needed to fix debug prints
on the Qualcomm platforms) was dangerous because in some cases
this will involve waiting for a modem CTS (clear to send)
signal, and debug messages would maybe not work on platforms
with no modem connected to the UART port: they will just
hang waiting for the modem to assert CTS and this might never
happen.

Looking through all UART debug drivers implementing the waituart
macro I discovered that all users except two actually use this
macro to check if the UART is ready for TX, let's call this
TXRDY.

Only two debug UART drivers actually check for CTS:
- arch/arm/include/debug/8250.S
- arch/arm/include/debug/tegra.S

The former is very significant since the 8250 is possibly
the most common UART on the planet.

We have the following problem: the semantics of waituart are
ambiguous making it dangerous to introduce the macro to debug
code fixing debug prints for Qualcomm. To start to pry this
problem apart, this patch does the following:

- Convert all debug UART drivers to define two macros:

  - waituartcts with the clear semantic to wait for CTS
    to be asserted

  - waituarttxrdy with the clear semantic to wait for the TX
    capability of the UART to be ready

- When doing this take care to assign the right function to
  each drivers macro, so they now do exactly the above.

- Update the three sites in the kernel invoking the waituart
  macro to call waituartcts/waituarttxrdy in sequence, so that
  the functional impact on the kernel should be zero.

After this we can start to change the code sites using this
code to do the right thing.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2020-09-15 14:35:27 +01:00
..
boot ARM: 9004/1: debug: Split waituart to CTS and TXRDY 2020-09-15 14:35:27 +01:00
common This tree adds the sched_set_fifo*() encapsulation APIs to remove 2020-08-06 11:55:43 -07:00
configs all arch: remove system call sys_sysctl 2020-08-14 19:56:56 -07:00
crypto crypto: Replace HTTP links with HTTPS ones 2020-07-23 17:34:20 +10:00
include ARM: 9004/1: debug: Split waituart to CTS and TXRDY 2020-09-15 14:35:27 +01:00
kernel ARM: 9004/1: debug: Split waituart to CTS and TXRDY 2020-09-15 14:35:27 +01:00
lib mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
mach-actions ARM: actions: Drop unneeded select of COMMON_CLK 2020-05-15 23:27:37 +02:00
mach-alpine ARM: alpine: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:37 +02:00
mach-artpec
mach-asm9260 ARM: asm9260: Drop unneeded select of GENERIC_CLOCKEVENTS 2020-05-15 23:27:37 +02:00
mach-aspeed ARM: aspeed: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:37 +02:00
mach-at91 ARM: at91: Replace HTTP links with HTTPS ones 2020-07-18 00:59:26 +02:00
mach-axxia
mach-bcm ARM: bcm: Select ARM_TIMER_SP804 for ARCH_BCM_NSP 2020-06-14 15:09:49 -07:00
mach-berlin ARM: berlin: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:37 +02:00
mach-clps711x ARM: clps711x: Drop unneeded select of multi-platform selected options 2020-05-15 23:27:37 +02:00
mach-cns3xxx
mach-davinci ARM: davinci: dm646x-evm: Simplify error handling in 'evm_sw_setup()' 2020-07-22 00:34:21 +05:30
mach-digicolor
mach-dove
mach-ebsa110 mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
mach-efm32
mach-ep93xx treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mach-exynos ARM: SoC driver updates for v5.9 2020-08-03 19:30:59 -07:00
mach-footbridge treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
mach-gemini
mach-highbank
mach-hisi
mach-imx media updates for v5.9-rc1 2020-08-07 13:00:53 -07:00
mach-integrator mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
mach-iop32x mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
mach-ixp4xx mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
mach-keystone mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek ARM: mediatek: Replace <linux/clk-provider.h> by <linux/of_clk.h> 2020-05-15 22:55:06 +02:00
mach-meson
mach-milbeaut
mach-mmp treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mach-moxart
mach-mstar ARM: mstar: Add machine for MStar/Sigmastar Armv7 SoCs 2020-07-28 11:13:49 +02:00
mach-mv78xx0
mach-mvebu ARM: mvebu: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:38 +02:00
mach-mxs
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 media updates for v5.9-rc1 2020-08-07 13:00:53 -07:00
mach-omap2 A set of fixes for lockdep, tracing and RCU: 2020-08-30 11:43:50 -07:00
mach-orion5x treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mach-oxnas ARM: oxnas: make ox820_boot_secondary static 2020-05-12 10:29:33 +02:00
mach-picoxcell
mach-prima2 ARM: prima2: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:38 +02:00
mach-pxa media: mach-pxa: palmz72/pcm990: remove soc_camera dependencies 2020-07-04 12:19:12 +02:00
mach-qcom
mach-rda
mach-realtek
mach-realview VExpress modularization 2020-05-15 23:04:40 +02:00
mach-rockchip
mach-rpc treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mach-s3c24xx ARM: s3c24xx: Replace HTTP links with HTTPS ones 2020-07-20 16:42:28 +02:00
mach-s3c64xx
mach-s5pv210
mach-sa1100 treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
mach-shmobile
mach-socfpga ARM: socfpga: PM: add missing put_device() call in socfpga_setup_ocram_self_refresh() 2020-07-28 13:57:36 -05:00
mach-spear
mach-sti Revert "ARM: sti: Implement dummy L2 cache's write_sec" 2020-06-28 14:46:54 +02:00
mach-stm32
mach-sunxi
mach-tango
mach-tegra treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mach-u300
mach-uniphier
mach-ux500
mach-versatile VExpress modularization 2020-05-15 23:04:40 +02:00
mach-vexpress Revert "ARM: vexpress: Don't select VEXPRESS_CONFIG" 2020-05-28 12:30:33 +02:00
mach-vt8500 ARM: Remove redundant CLKDEV_LOOKUP selects 2020-05-05 12:33:57 -07:00
mach-zx
mach-zynq mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
mm treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
net
nwfpe
oprofile
plat-omap treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
plat-orion ARM: orion/gpio: Make use of for_each_requested_gpio() 2020-07-18 22:49:23 +02:00
plat-pxa
plat-samsung
plat-versatile
probes treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
tools all arch: remove system call sys_sysctl 2020-08-14 19:56:56 -07:00
vdso ARM: vdso: Don't use gcc plugins for building vgettimeofday.c 2020-06-24 07:48:27 -07:00
vfp ARM: 8991/1: use VFP assembler mnemonics if available 2020-07-21 16:33:39 +01:00
xen xen/arm: call dma_to_phys on the dma_addr_t parameter of dma_cache_maint 2020-08-04 07:54:58 +02:00
Kbuild ARM: 8981/1: add arch/arm/Kbuild 2020-07-21 16:33:35 +01:00
Kconfig ARM development for 5.9-rc1: 2020-08-06 10:17:00 -07:00
Kconfig-nommu
Kconfig.assembler ARM: 8991/1: use VFP assembler mnemonics if available 2020-07-21 16:33:39 +01:00
Kconfig.debug treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile ARM development for 5.9-rc1: 2020-08-06 10:17:00 -07:00