netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Felix Manlunas <felix.manlunas@cavium.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	raghu.vatsavayi@cavium.com, derek.chickles@cavium.com,
	satananda.burla@cavium.com
Subject: Re: [PATCH net-next] liquidio: fix bug in soft reset failure detection
Date: Sun, 25 Jun 2017 09:11:37 +0300	[thread overview]
Message-ID: <20170625061137.GP1248@mtr-leonro.local> (raw)
In-Reply-To: <20170624110020.GA1247@felix-thinkpad.cavium.com>

[-- Attachment #1: Type: text/plain, Size: 2137 bytes --]

On Sat, Jun 24, 2017 at 04:00:21AM -0700, Felix Manlunas wrote:
> From: Derek Chickles <derek.chickles@cavium.com>
>
> The code that detects a failed soft reset of Octeon is comparing the wrong
> value against the reset value of the Octeon SLI_SCRATCH_1 register,
> resulting in an inability to detect a soft reset failure.  Fix it by using
> the correct value in the comparison.
>
> Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
> Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
> ---
>  drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 2 +-
>  drivers/net/ethernet/cavium/liquidio/cn66xx_device.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
> index 6081c31..3ab311f 100644
> --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
> +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
> @@ -221,7 +221,7 @@ static int cn23xx_pf_soft_reset(struct octeon_device *oct)
>  	/* Wait for 100ms as Octeon resets. */
>  	mdelay(100);
>
> -	if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1) == 0x1234ULL) {
> +	if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1) != 0x0ULL) {

Zero is always zero, please drop this 0x0ULL and add fixes line to the commit message.

>  		dev_err(&oct->pci_dev->dev, "OCTEON[%d]: Soft reset failed\n",
>  			oct->octeon_id);
>  		return 1;
> diff --git a/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c b/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
> index b28253c..effd7ac 100644
> --- a/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
> +++ b/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
> @@ -44,7 +44,7 @@ int lio_cn6xxx_soft_reset(struct octeon_device *oct)
>  	/* Wait for 10ms as Octeon resets. */
>  	mdelay(100);
>
> -	if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1) == 0x1234ULL) {
> +	if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1) != 0x0ULL) {
>  		dev_err(&oct->pci_dev->dev, "Soft reset failed\n");
>  		return 1;
>  	}

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2017-06-25  6:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-24 11:00 [PATCH net-next] liquidio: fix bug in soft reset failure detection Felix Manlunas
2017-06-25  6:11 ` Leon Romanovsky [this message]

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=20170625061137.GP1248@mtr-leonro.local \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=derek.chickles@cavium.com \
    --cc=felix.manlunas@cavium.com \
    --cc=netdev@vger.kernel.org \
    --cc=raghu.vatsavayi@cavium.com \
    --cc=satananda.burla@cavium.com \
    /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;
as well as URLs for NNTP newsgroup(s).