Re: [PATCH 5/6] MIPS: OCTEON: delete legacy code for PHY access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Sep 01, 2016 at 04:00:35PM -0700, David Daney wrote:
> On 09/01/2016 01:43 PM, Aaro Koskinen wrote:
> >PHY access through the board helper should be impossible with the
> >current drivers, so delete this code and add BUG_ON().
> >
> >Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
> >---
> >  .../cavium-octeon/executive/cvmx-helper-board.c    | 110 +--------------------
> >  1 file changed, 5 insertions(+), 105 deletions(-)
> >
> >diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> >index 5572e39..8d75242 100644
> >--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> >+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> [...]
> >+	BUG_ON(cvmx_helper_board_get_mii_address(ipd_port) != -1);
> >
> 
> Can we do WARN_ON instead?
> 
> No need to crash the kernel for this I think.

I could change it, but I really think it is 100% unreachable case with
the current mainline: If we know the mii address then the in-tree DTB
pruning code would have set up the phy node properly, and this code
never gets called. So reaching the BUG_ON condition really would mean
a fatal bug somewhere.

The only case you can hit the BUG_ON is:

	1) you add new switch case CVMX_BOARD_TYPE_* into
	   cvmx_helper_board_get_mii_address()

	2) you pass your own DTB without proper phy-handle (or fixed-link)

But we should not allow 1) as there is no reason to add new
CVMX_BOARD_TYPE_* types anymore, and the best way to tell people not to
do that is BUG_ON...

A.




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux