public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Yuval Mintz <yuvalm@mellanox.com>
To: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, Ariel.Elior@cavium.com
Subject: Re: [PATCH net-next 1/4] qed: Populate nvm image attribute shadow.
Date: Tue, 27 Mar 2018 16:01:13 +0300	[thread overview]
Message-ID: <20180327130113.GA28037@dev-r-vrt-155.mtr.labs.mlnx> (raw)
In-Reply-To: <20180326101348.21075-2-sudarsana.kalluru@cavium.com>

On Mon, Mar 26, 2018 at 03:13:45AM -0700, Sudarsana Reddy Kalluru wrote:
> This patch add support for populating the flash image attributes.
s/add/adds/

[...]

> -int qed_mcp_bist_nvm_test_get_image_att(struct qed_hwfn *p_hwfn,
> -					struct qed_ptt *p_ptt,
> -					struct bist_nvm_image_att *p_image_att,
> +int qed_mcp_bist_nvm_get_image_att(struct qed_hwfn *p_hwfn,
> +				   struct qed_ptt *p_ptt,
> +				   struct bist_nvm_image_att *p_image_att,
>  					u32 image_index)

Indentation seems broken.

>  
> +int qed_mcp_nvm_info_populate(struct qed_hwfn *p_hwfn)
> +{
> +	struct qed_nvm_image_info *nvm_info = &p_hwfn->nvm_info;
> +	struct qed_ptt *p_ptt;
> +	int rc;
> +	u32 i;
> +
> +	p_ptt = qed_ptt_acquire(p_hwfn);
> +	if (!p_ptt) {
> +		DP_ERR(p_hwfn, "failed to acquire ptt\n");
> +		return -EBUSY;
> +	}
> +
> +	/* Acquire from MFW the amount of available images */
> +	nvm_info->num_images = 0;
> +	rc = qed_mcp_bist_nvm_get_num_images(p_hwfn,
> +					     p_ptt, &nvm_info->num_images);
> +	if (rc == -EOPNOTSUPP) {
> +		DP_INFO(p_hwfn, "DRV_MSG_CODE_BIST_TEST is not supported\n");
> +		goto out;
> +	} else if ((rc != 0) || (nvm_info->num_images == 0)) {

rc || !nvm_info->num_images

> +		DP_ERR(p_hwfn, "Failed getting number of images\n");
> +		goto err0;
> +	}
> +
> +	nvm_info->image_att =
> +	    kmalloc(nvm_info->num_images * sizeof(struct bist_nvm_image_att),
> +		    GFP_KERNEL);

Indentation can be better than this.

[...]

> --- a/drivers/net/ethernet/qlogic/qed/qed_selftest.c
> +++ b/drivers/net/ethernet/qlogic/qed/qed_selftest.c
> @@ -125,10 +125,11 @@ int qed_selftest_nvram(struct qed_dev *cdev)
>  	}
>  
>  	/* Acquire from MFW the amount of available images */
> -	rc = qed_mcp_bist_nvm_test_get_num_images(p_hwfn, p_ptt, &num_images);
> +	rc = qed_mcp_bist_nvm_get_num_images(p_hwfn, p_ptt, &num_images);
>  	if (rc || !num_images) {
>  		DP_ERR(p_hwfn, "Failed getting number of images\n");
> -		return -EINVAL;
> +		rc = -EINVAL;
> +		goto err0;

Well, this one is a bug fix [Failure flow currently leaks a PTT entry].
If you don't want to treat it as one that's fine, but I think it
deserves its own patch in the series.

>  	}
>  
>  	/* Iterate over images and validate CRC */
> @@ -136,8 +137,8 @@ int qed_selftest_nvram(struct qed_dev *cdev)
>  		/* This mailbox returns information about the image required for
>  		 * reading it.
>  		 */
> -		rc = qed_mcp_bist_nvm_test_get_image_att(p_hwfn, p_ptt,
> -							 &image_att, i);
> +		rc = qed_mcp_bist_nvm_get_image_att(p_hwfn, p_ptt,
> +						    &image_att, i);
>  		if (rc) {
>  			DP_ERR(p_hwfn,
>  			       "Failed getting image index %d attributes\n",
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2018-03-27 13:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 10:13 [PATCH net-next 0/4] qed*: Flash upgrade support Sudarsana Reddy Kalluru
2018-03-26 10:13 ` [PATCH net-next 1/4] qed: Populate nvm image attribute shadow Sudarsana Reddy Kalluru
2018-03-27 13:01   ` Yuval Mintz [this message]
2018-03-26 10:13 ` [PATCH net-next 2/4] qed: Add APIs for flash access Sudarsana Reddy Kalluru
2018-03-26 10:13 ` [PATCH net-next 3/4] qed: Adapter flash update support Sudarsana Reddy Kalluru
2018-03-27 13:36   ` Yuval Mintz
2018-03-28  6:56     ` Kalluru, Sudarsana
2018-03-26 10:13 ` [PATCH net-next 4/4] qede: Ethtool " Sudarsana Reddy Kalluru

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=20180327130113.GA28037@dev-r-vrt-155.mtr.labs.mlnx \
    --to=yuvalm@mellanox.com \
    --cc=Ariel.Elior@cavium.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sudarsana.kalluru@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