Skip to content

Fix PROM call regression.

David Miller sparclinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9sparc64: Delete prom_puts() unused.arch/sparc/prom/console_64.c+0 -160 replies
2/9sparc: Remove prom_pathtoinode()arch/sparc/include/asm/oplib_32.h arch/sparc/include/asm/oplib_64.h arch/sparc/prom/tree_32.c +1 more+0 -360 replies
3/9sparc: Kill prom devops_{32,64}.carch/sparc/include/asm/oplib_32.h arch/sparc/include/asm/oplib_64.h arch/sparc/prom/Makefile +2 more+0 -1950 replies
4/9sparc64: Unexport prom_service_exists().arch/sparc/include/asm/oplib_64.h arch/sparc/prom/misc_64.c+1 -20 replies
5/9sparc64: Delete prom_setcallback().arch/sparc/include/asm/oplib_64.h arch/sparc/prom/misc_64.c+0 -220 replies
6/9sparc: Do not export prom_nb{get,put}char().arch/sparc/include/asm/oplib_32.h arch/sparc/include/asm/oplib_64.h arch/sparc/prom/console_32.c +1 more+4 -200 replies
7/9sparc: Pass buffer pointer all the way down toarch/sparc/include/asm/openprom.h arch/sparc/include/asm/oplib_32.h arch/sparc/include/asm/oplib_64.h +3 more+55 -540 replies
8/9sparc: Delete prom_*getchar().arch/sparc/include/asm/oplib_32.h arch/sparc/include/asm/oplib_64.h arch/sparc/prom/console_32.c +1 more+0 -830 replies
9/9sparc: Write to prom console using indirect buffer.arch/sparc/include/asm/oplib_32.h arch/sparc/include/asm/oplib_64.h arch/sparc/prom/console_32.c +2 more+52 -290 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] Fix PROM call regression.

The commit to fix huge PROM device node property fetching 25edd6946a1d74e5e77813c2324a0908c68bcf9e ("sparc64: Get rid of indirect p1275 PROM call buffer.") added a regresion for console I/O via the PROM.

The issue is that the firmware is not %100 64-bit clean for buffer addresses, and the code to do firmware console output/input uses an on-stack buffer which can be above 4GB.

We can't just use a static variable to solve this issue otherwise two threads can race and corrupt the static variable by trying to use it at the same time.

So the following set of patches do the following:

1) Eliminate all unused PROM interfaces which pass buffers by address to the firmware.

This way we have less things to "fix" and audit, and it's a waste of time to try and adjust the buffer handling of routines when we don't have any idea how they'll even be used.

2) Unexport and mark as static routines which are only used internally by other PROM routines.

3) Consolidate all the console output paths into a final routine which takes a multi-character buffer to output, and it's length.

4) On sparc64 have an indirect buffer, and a protecting spinlock, which is used to make sure that the console output call uses a buffer in the low 4GB of the virtual address space.

The costs of #3 are OK because the PROM console output is only used as our early boot console.