Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Aaro Koskinen <aaro.koskinen@iki.fi>
To: David Daney <ddaney@caviumnetworks.com>
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: [PATCH 5/6] MIPS: OCTEON: delete legacy code for PHY access
Date: Fri, 2 Sep 2016 02:45:15 +0300	[thread overview]
Message-ID: <20160901234515.GL14316@raspberrypi.musicnaut.iki.fi> (raw)
In-Reply-To: <57C8B313.6030206@caviumnetworks.com>

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@iki.fi>
> >---
> >  .../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.

  parent reply	other threads:[~2016-09-01 23:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01 20:43 [PATCH 0/6] MIPS: OCTEON: clean up platform phy code Aaro Koskinen
2016-09-01 20:43 ` [PATCH 1/6] MIPS: OCTEON: delete legacy hack for broken bootloaders Aaro Koskinen
2016-09-01 20:43 ` [PATCH 2/6] MIPS: OCTEON: don't try to maintain link state in early init Aaro Koskinen
2016-09-01 20:43 ` [PATCH 3/6] MIPS: OCTEON: delete cvmx_override_board_link_get Aaro Koskinen
2016-09-01 20:43 ` [PATCH 4/6] MIPS: OCTEON: delete cvmx_helper_board_link_set_phy Aaro Koskinen
2016-09-01 20:43 ` [PATCH 5/6] MIPS: OCTEON: delete legacy code for PHY access Aaro Koskinen
2016-09-01 23:00   ` David Daney
2016-09-01 23:00     ` David Daney
2016-09-01 23:45     ` Aaro Koskinen [this message]
2016-09-02 17:59       ` Aaro Koskinen
2016-09-01 20:44 ` [PATCH 6/6] MIPS: OCTEON: delete unused cvmx-mdio.h Aaro Koskinen
2016-09-01 23:02   ` David Daney
2016-09-01 23:02     ` David Daney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160901234515.GL14316@raspberrypi.musicnaut.iki.fi \
    --to=aaro.koskinen@iki.fi \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox