Skip to content

Commit

Permalink
staging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC
Browse files Browse the repository at this point in the history
When building for a non-Cavium MIPS system with COMPILE_TEST=y, the
Octeon ethernet driver hits a number of issues due to use of macros
provided only for CONFIG_CAVIUM_OCTEON_SOC=y configurations. For
example:

  drivers/staging/octeon/ethernet-rx.c:190:6: error:
    'CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE' undeclared (first use in this function)
  drivers/staging/octeon/ethernet-rx.c:472:25: error:
    'OCTEON_IRQ_WORKQ0' undeclared (first use in this function)

These come from various asm/ headers that a non-Octeon build will be
using a non-Octeon version of.

Fix this by using the octeon-stubs.h header for non-Cavium MIPS builds,
and only using the real asm/octeon/ headers when building a Cavium
Octeon kernel configuration.

This requires that octeon-stubs.h doesn't redefine XKPHYS_TO_PHYS, which
is defined for MIPS by asm/addrspace.h which is pulled in by many other
common asm/ headers.

Signed-off-by: Paul Burton <[email protected]>
Reported-by: Geert Uytterhoeven <[email protected]>
URL: https://lore.kernel.org/linux-mips/CAMuHMdXvu+BppwzsU9imNWVKea_hoLcRt9N+a29Q-QsjW=ip2g@mail.gmail.com/
Fixes: 171a9ba ("staging/octeon: Allow test build on !MIPS")
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: David S. Miller <[email protected]>

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
paulburton authored and gregkh committed Oct 8, 2019
1 parent a30b30f commit 17a29fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/octeon/octeon-ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <linux/of.h>
#include <linux/phy.h>

#ifdef CONFIG_MIPS
#ifdef CONFIG_CAVIUM_OCTEON_SOC

#include <asm/octeon/octeon.h>

Expand Down
5 changes: 4 additions & 1 deletion drivers/staging/octeon/octeon-stubs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#define CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE 512
#define XKPHYS_TO_PHYS(p) (p)

#ifndef XKPHYS_TO_PHYS
# define XKPHYS_TO_PHYS(p) (p)
#endif

#define OCTEON_IRQ_WORKQ0 0
#define OCTEON_IRQ_RML 0
Expand Down

0 comments on commit 17a29fe

Please sign in to comment.