diff mbox series

[GIT,PULL] MIPS changes

Message ID 20190921231022.kawfomtmka737arq@pburton-laptop (mailing list archive)
State Not Applicable
Headers show
Series [GIT,PULL] MIPS changes | expand

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git tags/mips_5.4

Commit Message

Paul Burton Sept. 21, 2019, 11:10 p.m. UTC
Hi Linus,

Here are the main MIPS changes for v5.4; please pull.

My apologies that this is arriving at the end of the week; a combination
of travel & discovering a MIPS32 page table handling issue later than
would have been ideal delayed things.

There are a number of minor merge conflicts with current master, my
suggested resolutions are as follows:

+++ b/Documentation/mips/index.rst
@@@ -1,17 -1,11 +1,18 @@@
  .. SPDX-License-Identifier: GPL-2.0
  
 -===========================
 -MIPS-specific Documentation
 -===========================
 +=================
 +MIPS architecture
 +=================
  
  .. toctree::
 -   :maxdepth: 1
 -   :numbered:
 +   :maxdepth: 2
  
 +   au1xxx_ide
+    ingenic-tcu
 +
 +.. only::  subproject and html
 +
 +   Indices
 +   =======
 +
 +   * :ref:`genindex`
+++ b/arch/mips/Kconfig
@@@ -43,8 -44,7 +44,8 @@@ config MIP
        select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
-       select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
+       select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES
 +      select HAVE_ASM_MODVERSIONS
        select HAVE_EBPF_JIT if (!CPU_MICROMIPS)
        select HAVE_CONTEXT_TRACKING
        select HAVE_COPY_THREAD_TLS
+++ b/drivers/video/fbdev/Makefile
@@@ -116,7 -116,7 +116,6 @@@ obj-y                             += om
  obj-$(CONFIG_XEN_FBDEV_FRONTEND)  += xen-fbfront.o
  obj-$(CONFIG_FB_CARMINE)          += carminefb.o
  obj-$(CONFIG_FB_MB862XX)        += mb862xx/
- obj-$(CONFIG_FB_JZ4740)                 += jz4740_fb.o
 -obj-$(CONFIG_FB_NUC900)           += nuc900fb.o
  obj-$(CONFIG_FB_PUV3_UNIGFX)      += fb-puv3.o
  obj-$(CONFIG_FB_HYPERV)                 += hyperv_fb.o
  obj-$(CONFIG_FB_OPENCORES)      += ocfb.o

Thanks,
    Paul


The following changes since commit 5f9e832c137075045d15cd6899ab0505cfb2ca4b:

  Linus 5.3-rc1 (2019-07-21 14:05:38 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git tags/mips_5.4

for you to fetch changes up to 05d013a0366d50f4f0dbebf8c1b22b42020bf49a:

  MIPS: Detect bad _PFN_SHIFT values (2019-09-20 14:55:07 -0700)

----------------------------------------------------------------
Main MIPS changes for v5.4:

- boot_mem_map is removed, providing a nice cleanup made possible by the
  recent removal of bootmem.

- Some fixes to atomics, in general providing compiler barriers for
  smp_mb__{before,after}_atomic plus fixes specific to Loongson CPUs or
  MIPS32 systems using cmpxchg64().

- Conversion to the new generic VDSO infrastructure courtesy of Vincenzo
  Frascino.

- Removal of undefined behavior in set_io_port_base(), fixing the
  behavior of some MIPS kernel configurations when built with recent
  clang versions.

- Initial MIPS32 huge page support, functional on at least Ingenic SoCs.

- pte_special() is now supported for some configurations, allowing among
  other things generic fast GUP to be used.

- Miscellaneous fixes & cleanups.

And platform specific changes:

- Major improvements to Ingenic SoC support from Paul Cercueil, mostly
  enabled by the inclusion of the new TCU (timer-counter unit) drivers
  he's spent a very patient year or so working on. Plus some fixes for
  X1000 SoCs from Zhou Yanjie.

- Netgear R6200 v1 systems are now supported by the bcm47xx platform.

- DT updates for BMIPS, Lantiq & Microsemi Ocelot systems.

----------------------------------------------------------------
Antoine Tenart (2):
      MIPS: dts: mscc: describe the PTP register range
      MIPS: dts: mscc: describe the PTP ready interrupt

Arnd Bergmann (1):
      mips: fix vdso32 build, again

Christoph Hellwig (1):
      mips: remove ioremap_cachable

Christophe JAILLET (1):
      MIPS: Octeon: Fix a typo in #define OCTOEN_SERIAL_LEN

Daniel Silsby (5):
      MIPS: Disallow CPU_SUPPORTS_HUGEPAGES for XPA,EVA
      MIPS: Add partial 32-bit huge page support
      MIPS: Decouple CPU_SUPPORTS_HUGEPAGES from 64BIT
      MIPS: ingenic: Add support for huge pages
      MIPS: Undefine PMD_ORDER for 32-bit builds

Dmitry Korotin (1):
      MIPS: pte_special()/pte_mkspecial() support

Edward Matijević (1):
      MIPS: BCM47XX: Add support for Netgear R6200 V1

Fabian Mewes (1):
      MIPS: Kconfig: remove HAVE_LATENCYTOP_SUPPORT

Firoz Khan (1):
      mips: remove nargs from __SYSCALL

Florian Fainelli (2):
      firmware: bcm47xx_nvram: Correct size_t printf format
      firmware: bcm47xx_nvram: Allow COMPILE_TEST

Hauke Mehrtens (1):
      MIPS: ralink: deactivate PCI support for SOC_MT7621

Jiaxun Yang (9):
      MIPS: OCTEON: Drop boot_mem_map
      MIPS: fw: Record prom memory
      MIPS: malta: Drop prom_free_prom_memory
      MIPS: msp: Record prom memory
      MIPS: ip22: Drop addr_is_ram
      MIPS: xlp: Drop boot_mem_map
      MIPS: mm: Drop boot_mem_map
      MIPS: init: Drop boot_mem_map
      MIPS: Treat Loongson Extensions as ASEs

Jonas Gorski (1):
      MIPS: BMIPS: add clock controller nodes

Martin Blumenstingl (1):
      MIPS: lantiq: update the clock alias' for the mainline PCIe PHY driver

Nathan Chancellor (3):
      MIPS: Don't use bc_false uninitialized in __mm_isBranchInstr
      MIPS/ptrace: Update mips_get_syscall_arg's return type
      MIPS: tlbex: Explicitly cast _PAGE_NO_EXEC to a boolean

Nick Desaulniers (1):
      mips: avoid explicit UB in assignment of mips_io_port_base

Paul Burton (15):
      MIPS: Remove unused R4300 CPU support
      MIPS: Remove unused R5432 CPU support
      MIPS: Remove unused R5432_CP0_INTERRUPT_WAR
      MIPS: Remove unused R8000 CPU support
      MIPS: octeon: Remove cpu_has_saa
      MIPS: octeon: Remove ARCH_HAS_IRQ_PER_CPU
      Merge branch 'ingenic-tcu-v5.4' into mips-next
      MIPS: mm: Fix highmem compile
      MIPS: Fix build with CONFIG_PROC_VMCORE=y
      MIPS: Select R3k-style TLB in Kconfig
      MIPS: tlbex: Simplify r3k check
      MIPS: tlbex: Remove cpu_has_local_ebase
      MIPS: Drop Loongson _CACHE_* definitions
      MIPS: Disable pte_special() for MIPS32 with RiXi
      MIPS: Detect bad _PFN_SHIFT values

Paul Cercueil (27):
      MIPS: Rename JZRISC to XBURST
      MIPS: Decode config3 register on Ingenic SoCs
      MIPS: DTS: jz4740: Add node for the MMC driver
      MIPS: qi_lb60: Move MMC configuration to devicetree
      MIPS: DTS: jz4740: Add missing nodes
      MIPS: qi_lb60: Migrate to devicetree
      MIPS: configs: LB60: update defconfig
      ASoC: jz4740: Drop lb60 board code
      video/fbdev: Drop JZ4740 driver
      dma: Drop JZ4740 driver
      mtd: rawnand: Drop obsolete JZ4740 NAND driver
      power/supply: Drop obsolete JZ4740 driver
      hwmon: Drop obsolete JZ4740 driver
      MIPS: jz4740: Drop dead code
      dt-bindings: ingenic: Add DT bindings for TCU clocks
      doc: Add doc for the Ingenic TCU hardware
      dt-bindings: Add doc for the Ingenic TCU drivers
      mfd/syscon: Add device_node_to_regmap()
      clk: ingenic: Add driver for the TCU clocks
      irqchip: Add irq-ingenic-tcu driver
      clocksource: Add a new timer-ingenic driver
      clk: jz4740: Add TCU clock
      MIPS: jz4740: Add DTS nodes for the TCU drivers
      MIPS: qi_lb60: Reduce system timer and clocksource to 750 kHz
      MIPS: CI20: Reduce system timer and clocksource to 3 MHz
      MIPS: GCW0: Reduce system timer and clocksource to 750 kHz
      MIPS: jz4740: Drop obsolete code

Peter Zijlstra (3):
      mips/atomic: Fix cmpxchg64 barriers
      mips/atomic: Fix loongson_llsc_mb() wreckage
      mips/atomic: Fix smp_mb__{before,after}_atomic()

Stephen Boyd (1):
      MIPS: Remove dev_err() usage after platform_get_irq()

Thomas Bogendoerfer (1):
      MIPS: PCI: refactor ioc3 special handling

Vincenzo Frascino (6):
      mips: Add support for generic vDSO
      mips: Add clock_getres entry point
      mips: Add clock_gettime64 entry point
      mips: vdso: Fix source path
      mips: vdso: Fix flip/flop vdso building bug
      mips: compat: vdso: Use legacy syscalls as fallback

YueHaibing (2):
      irqchip/irq-ingenic-tcu: Fix COMPILE_TEST building
      MIPS: Octeon: remove duplicated include from dma-octeon.c

Zhou Yanjie (3):
      MIPS: X1000: Add X1000 system type.
      MIPS: Ingenic: Fix bugs when detecting X1000's L2 cache.
      MIPS: Ingenic: Disable broken BTB lookup optimization.

 .../devicetree/bindings/pwm/ingenic,jz47xx-pwm.txt |  22 -
 .../devicetree/bindings/timer/ingenic,tcu.txt      | 137 ++++
 .../bindings/watchdog/ingenic,jz4740-wdt.txt       |  17 -
 Documentation/index.rst                            |   1 +
 Documentation/mips/index.rst                       |  11 +
 Documentation/mips/ingenic-tcu.rst                 |  71 +++
 arch/mips/Kconfig                                  |  65 +-
 arch/mips/Makefile                                 |   4 -
 arch/mips/bcm47xx/board.c                          |   1 +
 arch/mips/bcm47xx/buttons.c                        |  10 +
 arch/mips/boot/dts/brcm/bcm3368.dtsi               |  12 +-
 arch/mips/boot/dts/brcm/bcm63268.dtsi              |  12 +-
 arch/mips/boot/dts/brcm/bcm6328.dtsi               |   6 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi               |  12 +-
 arch/mips/boot/dts/brcm/bcm6362.dtsi               |  12 +-
 arch/mips/boot/dts/brcm/bcm6368.dtsi               |  12 +-
 arch/mips/boot/dts/ingenic/ci20.dts                |   7 +
 arch/mips/boot/dts/ingenic/gcw0.dts                |  10 +
 arch/mips/boot/dts/ingenic/jz4740.dtsi             | 127 +++-
 arch/mips/boot/dts/ingenic/jz4770.dtsi             |  21 +
 arch/mips/boot/dts/ingenic/jz4780.dtsi             |  23 +
 arch/mips/boot/dts/ingenic/qi_lb60.dts             | 325 ++++++++++
 arch/mips/boot/dts/mscc/ocelot.dtsi                |   7 +-
 arch/mips/cavium-octeon/dma-octeon.c               |  16 +-
 arch/mips/cavium-octeon/setup.c                    |   3 +-
 arch/mips/configs/qi_lb60_defconfig                |  44 +-
 arch/mips/fw/arc/memory.c                          |  24 +-
 arch/mips/include/asm/addrspace.h                  |   9 -
 arch/mips/include/asm/atomic.h                     |  19 +-
 arch/mips/include/asm/barrier.h                    |  44 +-
 arch/mips/include/asm/bitops.h                     |  47 +-
 arch/mips/include/asm/bootinfo.h                   |  17 +-
 arch/mips/include/asm/cmpxchg.h                    |  18 +-
 arch/mips/include/asm/cpu-features.h               |  19 +-
 arch/mips/include/asm/cpu-type.h                   |  15 +-
 arch/mips/include/asm/cpu.h                        |  19 +-
 arch/mips/include/asm/io.h                         |  21 +-
 arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h |   1 +
 .../asm/mach-cavium-octeon/cpu-feature-overrides.h |   9 -
 arch/mips/include/asm/mach-cavium-octeon/war.h     |   1 -
 .../include/asm/mach-dec/cpu-feature-overrides.h   |   1 -
 arch/mips/include/asm/mach-generic/war.h           |   1 -
 arch/mips/include/asm/mach-ip22/war.h              |   1 -
 arch/mips/include/asm/mach-ip27/war.h              |   1 -
 arch/mips/include/asm/mach-ip28/war.h              |   1 -
 arch/mips/include/asm/mach-ip32/war.h              |   1 -
 arch/mips/include/asm/mach-jz4740/gpio.h           |  15 -
 arch/mips/include/asm/mach-jz4740/jz4740_fb.h      |  58 --
 arch/mips/include/asm/mach-jz4740/jz4740_mmc.h     |  12 -
 arch/mips/include/asm/mach-jz4740/platform.h       |  26 -
 .../asm/mach-loongson64/cpu-feature-overrides.h    |   1 -
 arch/mips/include/asm/mach-malta/war.h             |   1 -
 arch/mips/include/asm/mach-pmcs-msp71xx/war.h      |   1 -
 arch/mips/include/asm/mach-rc32434/war.h           |   1 -
 arch/mips/include/asm/mach-rm/war.h                |   1 -
 arch/mips/include/asm/mach-sibyte/war.h            |   1 -
 arch/mips/include/asm/mach-tx49xx/war.h            |   1 -
 arch/mips/include/asm/mipsregs.h                   |   4 +
 arch/mips/include/asm/module.h                     |   6 -
 arch/mips/include/asm/octeon/octeon.h              |   4 +-
 arch/mips/include/asm/pgtable-32.h                 |  62 +-
 arch/mips/include/asm/pgtable-bits.h               |  34 +-
 arch/mips/include/asm/pgtable.h                    |  20 +-
 arch/mips/include/asm/syscall.h                    |  21 +-
 arch/mips/include/asm/vdso.h                       |  78 +--
 arch/mips/include/asm/vdso/gettimeofday.h          | 222 +++++++
 arch/mips/{ => include/asm}/vdso/vdso.h            |  16 +-
 arch/mips/include/asm/vdso/vsyscall.h              |  43 ++
 arch/mips/include/asm/war.h                        |  13 -
 arch/mips/jz4740/Makefile                          |   7 +-
 arch/mips/jz4740/board-qi_lb60.c                   | 523 ----------------
 arch/mips/jz4740/platform.c                        | 250 --------
 arch/mips/jz4740/prom.c                            |   5 -
 arch/mips/jz4740/setup.c                           |   7 +-
 arch/mips/jz4740/time.c                            | 151 +----
 arch/mips/kernel/branch.c                          |   2 +-
 arch/mips/kernel/cpu-probe.c                       |  53 +-
 arch/mips/kernel/genex.S                           |   3 -
 arch/mips/kernel/idle.c                            |   3 +-
 arch/mips/kernel/proc.c                            |   4 +
 arch/mips/kernel/scall32-o32.S                     |   2 +-
 arch/mips/kernel/scall64-n32.S                     |   2 +-
 arch/mips/kernel/scall64-n64.S                     |   2 +-
 arch/mips/kernel/scall64-o32.S                     |   2 +-
 arch/mips/kernel/setup.c                           | 357 +++--------
 arch/mips/kernel/syscall.c                         |   1 +
 arch/mips/kernel/syscalls/syscalltbl.sh            |   4 +-
 arch/mips/kernel/vdso.c                            |  37 +-
 arch/mips/lantiq/xway/sysctrl.c                    |  16 +-
 arch/mips/mm/Makefile                              |   6 +-
 arch/mips/mm/c-r4k.c                               |   2 -
 arch/mips/mm/init.c                                |  98 ++-
 arch/mips/mm/pgtable-32.c                          |  20 +
 arch/mips/mm/sc-mips.c                             |  27 +-
 arch/mips/mm/tlb-r8k.c                             | 239 -------
 arch/mips/mm/tlbex.c                               |  63 +-
 arch/mips/mti-malta/malta-memory.c                 |  11 -
 arch/mips/netlogic/xlp/setup.c                     |  12 +-
 arch/mips/pci/pci-xtalk-bridge.c                   | 167 ++---
 arch/mips/pmcs-msp71xx/msp_prom.c                  |  22 +-
 arch/mips/ralink/Kconfig                           |   1 -
 arch/mips/ralink/timer.c                           |   4 +-
 arch/mips/sgi-ip22/ip28-berr.c                     |  20 +-
 arch/mips/vdso/Makefile                            |  41 +-
 arch/mips/vdso/config-n32-o32-env.c                |  19 +
 arch/mips/vdso/elf.S                               |   2 +-
 arch/mips/vdso/sigreturn.S                         |   2 +-
 arch/mips/vdso/vdso.lds.S                          |   4 +
 arch/mips/vdso/vgettimeofday.c                     |  58 ++
 drivers/clk/ingenic/Kconfig                        |  10 +-
 drivers/clk/ingenic/Makefile                       |   1 +
 drivers/clk/ingenic/jz4740-cgu.c                   |   6 +
 drivers/clk/ingenic/tcu.c                          | 474 ++++++++++++++
 drivers/clocksource/Kconfig                        |  11 +
 drivers/clocksource/Makefile                       |   1 +
 drivers/clocksource/ingenic-timer.c                | 356 +++++++++++
 drivers/dma/Kconfig                                |   6 -
 drivers/dma/Makefile                               |   1 -
 drivers/dma/dma-jz4740.c                           | 623 -------------------
 drivers/firmware/broadcom/Kconfig                  |   2 +-
 drivers/firmware/broadcom/bcm47xx_nvram.c          |   4 +-
 drivers/hwmon/Kconfig                              |  10 -
 drivers/hwmon/Makefile                             |   1 -
 drivers/hwmon/jz4740-hwmon.c                       | 135 ----
 drivers/irqchip/Kconfig                            |  12 +
 drivers/irqchip/Makefile                           |   1 +
 drivers/irqchip/irq-ingenic-tcu.c                  | 182 ++++++
 drivers/mfd/syscon.c                               |  46 +-
 drivers/mtd/nand/raw/ingenic/Kconfig               |   7 -
 drivers/mtd/nand/raw/ingenic/Makefile              |   1 -
 drivers/mtd/nand/raw/ingenic/jz4740_nand.c         | 536 ----------------
 drivers/power/supply/Kconfig                       |  11 -
 drivers/power/supply/Makefile                      |   1 -
 drivers/power/supply/jz4740-battery.c              | 421 -------------
 drivers/video/fbdev/Kconfig                        |   9 -
 drivers/video/fbdev/Makefile                       |   1 -
 drivers/video/fbdev/jz4740_fb.c                    | 690 ---------------------
 include/dt-bindings/clock/ingenic,tcu.h            |  20 +
 include/dt-bindings/clock/jz4740-cgu.h             |   1 +
 include/linux/mfd/syscon.h                         |   6 +
 sound/soc/jz4740/Kconfig                           |  25 +-
 sound/soc/jz4740/Makefile                          |   5 -
 sound/soc/jz4740/qi_lb60.c                         | 106 ----
 143 files changed, 2921 insertions(+), 4948 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/ingenic,jz47xx-pwm.txt
 create mode 100644 Documentation/devicetree/bindings/timer/ingenic,tcu.txt
 delete mode 100644 Documentation/devicetree/bindings/watchdog/ingenic,jz4740-wdt.txt
 create mode 100644 Documentation/mips/index.rst
 create mode 100644 Documentation/mips/ingenic-tcu.rst
 delete mode 100644 arch/mips/include/asm/mach-jz4740/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-jz4740/jz4740_fb.h
 delete mode 100644 arch/mips/include/asm/mach-jz4740/jz4740_mmc.h
 delete mode 100644 arch/mips/include/asm/mach-jz4740/platform.h
 create mode 100644 arch/mips/include/asm/vdso/gettimeofday.h
 rename arch/mips/{ => include/asm}/vdso/vdso.h (77%)
 create mode 100644 arch/mips/include/asm/vdso/vsyscall.h
 delete mode 100644 arch/mips/jz4740/board-qi_lb60.c
 delete mode 100644 arch/mips/jz4740/platform.c
 delete mode 100644 arch/mips/mm/tlb-r8k.c
 create mode 100644 arch/mips/vdso/config-n32-o32-env.c
 create mode 100644 arch/mips/vdso/vgettimeofday.c
 create mode 100644 drivers/clk/ingenic/tcu.c
 create mode 100644 drivers/clocksource/ingenic-timer.c
 delete mode 100644 drivers/dma/dma-jz4740.c
 delete mode 100644 drivers/hwmon/jz4740-hwmon.c
 create mode 100644 drivers/irqchip/irq-ingenic-tcu.c
 delete mode 100644 drivers/mtd/nand/raw/ingenic/jz4740_nand.c
 delete mode 100644 drivers/power/supply/jz4740-battery.c
 delete mode 100644 drivers/video/fbdev/jz4740_fb.c
 create mode 100644 include/dt-bindings/clock/ingenic,tcu.h
 delete mode 100644 sound/soc/jz4740/qi_lb60.c

Comments

pr-tracker-bot@kernel.org Sept. 22, 2019, 4:45 p.m. UTC | #1
The pull request you sent on Sat, 21 Sep 2019 23:10:24 +0000:

> git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git tags/mips_5.4

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5c6bd5de3c2e5bc8a17451e281ed2613375a7fd5

Thank you!
Linus Torvalds Sept. 22, 2019, 6:35 p.m. UTC | #2
On Sat, Sep 21, 2019 at 4:10 PM Paul Burton <paul.burton@mips.com> wrote:
>
> Here are the main MIPS changes for v5.4; please pull.

Hmm. I pulled and because initial tests didn't show any issues, I
already pushed out.

But some unrelated further testing then shows that this:

> Florian Fainelli (2):
>       firmware: bcm47xx_nvram: Correct size_t printf format
>       firmware: bcm47xx_nvram: Allow COMPILE_TEST

causes problems, and commit feb4eb060c3a ("firmware: bcm47xx_nvram:
Correct size_t printf format") is buggy:

  drivers/firmware/broadcom/bcm47xx_nvram.c: In function ‘nvram_init’:
  drivers/firmware/broadcom/bcm47xx_nvram.c:151: warning: format ‘%zu’
expects argument of type ‘size_t’, but argument 2 has type ‘u32’ {aka
‘unsigned int’} [-Wformat=]

and the change to use %zu was completely wrong.

It prints out 'header.len', which is an u32, not nvram_len which is a size_t.

Tssk tssk.

I've fixed it in my tree, but this should have shown up in linux-next,
or in MIPS testing. The process clearly failed.

                 Linus
Florian Fainelli Sept. 23, 2019, 3:36 p.m. UTC | #3
On 9/22/2019 11:35 AM, Linus Torvalds wrote:
> On Sat, Sep 21, 2019 at 4:10 PM Paul Burton <paul.burton@mips.com> wrote:
>>
>> Here are the main MIPS changes for v5.4; please pull.
> 
> Hmm. I pulled and because initial tests didn't show any issues, I
> already pushed out.
> 
> But some unrelated further testing then shows that this:
> 
>> Florian Fainelli (2):
>>       firmware: bcm47xx_nvram: Correct size_t printf format
>>       firmware: bcm47xx_nvram: Allow COMPILE_TEST
> 
> causes problems, and commit feb4eb060c3a ("firmware: bcm47xx_nvram:
> Correct size_t printf format") is buggy:
> 
>   drivers/firmware/broadcom/bcm47xx_nvram.c: In function ‘nvram_init’:
>   drivers/firmware/broadcom/bcm47xx_nvram.c:151: warning: format ‘%zu’
> expects argument of type ‘size_t’, but argument 2 has type ‘u32’ {aka
> ‘unsigned int’} [-Wformat=]
> 
> and the change to use %zu was completely wrong.
> 
> It prints out 'header.len', which is an u32, not nvram_len which is a size_t.
> 
> Tssk tssk.
> 
> I've fixed it in my tree, but this should have shown up in linux-next,
> or in MIPS testing. The process clearly failed.

Thanks for fixing that. The process worked, there was an email sent by
the kbuild robot but I saw it only now somehow and failed to address it
in time before Paul sent out the pull request.
Paul Burton Sept. 23, 2019, 6:07 p.m. UTC | #4
Hi Linus,

On Sun, Sep 22, 2019 at 11:35:36AM -0700, Linus Torvalds wrote:
> On Sat, Sep 21, 2019 at 4:10 PM Paul Burton <paul.burton@mips.com> wrote:
> >
> > Here are the main MIPS changes for v5.4; please pull.
> 
> Hmm. I pulled and because initial tests didn't show any issues, I
> already pushed out.
> 
> But some unrelated further testing then shows that this:
> 
> > Florian Fainelli (2):
> >       firmware: bcm47xx_nvram: Correct size_t printf format
> >       firmware: bcm47xx_nvram: Allow COMPILE_TEST
> 
> causes problems, and commit feb4eb060c3a ("firmware: bcm47xx_nvram:
> Correct size_t printf format") is buggy:
> 
>   drivers/firmware/broadcom/bcm47xx_nvram.c: In function ‘nvram_init’:
>   drivers/firmware/broadcom/bcm47xx_nvram.c:151: warning: format ‘%zu’
> expects argument of type ‘size_t’, but argument 2 has type ‘u32’ {aka
> ‘unsigned int’} [-Wformat=]
> 
> and the change to use %zu was completely wrong.
> 
> It prints out 'header.len', which is an u32, not nvram_len which is a size_t.
> 
> Tssk tssk.

Oopsie.

> I've fixed it in my tree, but this should have shown up in linux-next,
> or in MIPS testing. The process clearly failed.

Looking back I do see that the kbuild test robot reported an issue here,
so one aspect of the failure is squarely on my not having caught up on
email properly yet.

Another issue is that there are currently 'expected' warnings dotted
through the tree for various defconfigs, so whilst I do perform test
builds before submitting pull requests I generally don't pay too much
attention to warnings... So an improvement I'll look at is fixing up
those warnings & building with -Werror, or at least not ignoring
warnings.

My apologies and thanks for fixing this up,

Paul
Linus Torvalds Sept. 23, 2019, 6:18 p.m. UTC | #5
On Mon, Sep 23, 2019 at 11:07 AM Paul Burton <paul.burton@mips.com> wrote:
>
> Another issue is that there are currently 'expected' warnings dotted
> through the tree for various defconfigs

This is why I refuse to have _any_ warnings at all in my tree during
the merge window.

If you have expected warnings, you will ignore the new and valid ones.
So the only acceptable situation is "no warnings".

In honesty, I actually do have one warning in my tree:

  samples/vfs/test-statx.c:24:15: warning: ‘struct foo’ declared
inside parameter list will not be visible outside of this definition
or declaration
     24 | #define statx foo
        |               ^~~

but because it's in the sample code, it pretty much never gets rebuilt
for me unless I basically do a "git clean" to get rid of everything,
so I don't normally see it for any normal pull.

So I've ignored that one warning, although I've actually been tempted
to just remove the sample because of it.

Adding David and Al to the cc just in case they have some simple fixup
for it that is likely to work across different user headers.

I considered just adding a

     struct foo;

declaration, but the whole thing is incredibly ugly.

                  Linus
David Howells Sept. 24, 2019, 12:40 p.m. UTC | #6
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> In honesty, I actually do have one warning in my tree:
> 
>   samples/vfs/test-statx.c:24:15: warning: ‘struct foo’ declared
> inside parameter list will not be visible outside of this definition
> or declaration
>      24 | #define statx foo
>         |               ^~~

Were there any note lines from the compiler associated with this?  The warning
message can't actually be taking place on this line.

Another thing I'm wondering is why your compiler shows this warning - and mine
does not.  I've seen this before with uninitialised variables too where you
get a warning and I don't.

> but because it's in the sample code, it pretty much never gets rebuilt
> for me unless I basically do a "git clean" to get rid of everything,
> so I don't normally see it for any normal pull.
> 
> So I've ignored that one warning, although I've actually been tempted
> to just remove the sample because of it.
> 
> Adding David and Al to the cc just in case they have some simple fixup
> for it that is likely to work across different user headers.
> 
> I considered just adding a
> 
>      struct foo;
> 
> declaration, but the whole thing is incredibly ugly.

Yeah - I'm not sure the best way to deal with this.  The problem being that
userspace may have a conflicting definition - or no definition at all - and I
need to use the one from the kernel in preference as that may have changes in
it that aren't yet reflected in userspace.

I'd rather not remove the sample if I can avoid it as I use it occasionally,
but maybe I should switch to relying on glibc.

David
Linus Torvalds Sept. 24, 2019, 3:32 p.m. UTC | #7
On Tue, Sep 24, 2019 at 5:40 AM David Howells <dhowells@redhat.com> wrote:
>
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > In honesty, I actually do have one warning in my tree:
> >
> >   samples/vfs/test-statx.c:24:15: warning: ‘struct foo’ declared
> > inside parameter list
>
> Were there any note lines from the compiler associated with this?  The warning
> message can't actually be taking place on this line.

That's the only thing that gcc says. I agree that it's not where the
problem occurs, but the gcc warning system tries to avoid warning
inside system header files, so it seems to have logic tracing it back
to the user.

But I have system header files that look like this:

  /* Fill *BUF with information about PATH in DIRFD.  */
  int statx (int __dirfd, const char *__restrict __path, int __flags,
             unsigned int __mask, struct statx *__restrict __buf)
    __THROW __nonnull ((2, 5));

and I think that's the one that triggers.

You must have hit *something* similar too, since the only reason for that

  #define statx foo
  #define statx_timestamp foo_timestamp
  #include <sys/stat.h>
  #undef statx
  #undef statx_timestamp

is that you're playing games with the kernel 'statx' clashing with
user 'statx' use.

And what I think happens is that you had the <sys/types.h> include
*without* that #define, so the 'struct statx' got declared there, and
then in <sys/stat.h> it gets used, but it gets used as 'struct foo',
so now the compiler complains (properly) that you're using this
undeclared 'struct foo' in the function declaration, and because of
namespace rules it's not the same thing as then a later 'struct foo'
would be.

              Linus

              Linus
diff mbox series

Patch

diff --cc Documentation/mips/index.rst
index fd9023c8a89f,321b4794f3b8..3616fb872af3
--- a/Documentation/mips/index.rst
diff --cc arch/mips/Kconfig
index 904c096fa4da,2f7c050e8cde..cc8e2b1032a5
--- a/arch/mips/Kconfig
diff --cc drivers/video/fbdev/Makefile
index aab7155884ea,49502d6256cb..aa6352798cf4
--- a/drivers/video/fbdev/Makefile