netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Michal Schmidt <mschmidt@redhat.com>
Cc: Shinas Rasheed <srasheed@marvell.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	hgani@marvell.com, vimleshk@marvell.com, egallen@redhat.com,
	pabeni@redhat.com, horms@kernel.org, kuba@kernel.org,
	davem@davemloft.net, wizhao@redhat.com, konguyen@redhat.com,
	Veerasenareddy Burru <vburru@marvell.com>,
	Sathesh Edara <sedara@marvell.com>,
	Eric Dumazet <edumazet@google.com>,
	Abhijit Ayarekar <aayarekar@marvell.com>,
	Satananda Burla <sburla@marvell.com>
Subject: Re: [PATCH net v2] octeon_ep: explicitly test for firmware ready value
Date: Thu, 7 Dec 2023 11:55:32 +0100	[thread overview]
Message-ID: <ZXGkpGuJSCds5idf@nanopsycho> (raw)
In-Reply-To: <CADEbmW1qF7UvGr0rZ0NUMiP0Lybgz3CHLB3JVBn_Na-8md-tgQ@mail.gmail.com>

Thu, Dec 07, 2023 at 09:45:15AM CET, mschmidt@redhat.com wrote:
>On Thu, Dec 7, 2023 at 8:50 AM Shinas Rasheed <srasheed@marvell.com> wrote:
>>
>> The firmware ready value is 1, and get firmware ready status
>> function should explicitly test for that value. The firmware
>> ready value read will be 2 after driver load, and on unbind
>> till firmware rewrites the firmware ready back to 0, the value
>> seen by driver will be 2, which should be regarded as not ready.
>>
>> Fixes: 10c073e40469 ("octeon_ep: defer probe if firmware not ready")
>> Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
>> ---
>> V2:
>>   - Fixed redundant logic
>>
>> V1: https://lore.kernel.org/all/20231206063549.2590305-1-srasheed@marvell.com/
>>
>>  drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
>> index 552970c7dec0..b8ae269f6f97 100644
>> --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
>> +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
>> @@ -1258,7 +1258,8 @@ static bool get_fw_ready_status(struct pci_dev *pdev)
>>
>>                 pci_read_config_byte(pdev, (pos + 8), &status);
>>                 dev_info(&pdev->dev, "Firmware ready status = %u\n", status);
>> -               return status;
>> +#define FW_STATUS_READY 1ULL
>> +               return (status == FW_STATUS_READY);
>
>The parentheses are not necessary, but if you find it better readable
>this way, so be it.

Well, since return is not a function, parentheses should not be here.
Please drop them.


>
>Reviewed-by: Michal Schmidt <mschmidt@redhat.com>
>
>>         }
>>         return false;
>>  }
>> --
>> 2.25.1
>>
>
>

      reply	other threads:[~2023-12-07 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  7:49 [PATCH net v2] octeon_ep: explicitly test for firmware ready value Shinas Rasheed
2023-12-07  8:45 ` Michal Schmidt
2023-12-07 10:55   ` Jiri Pirko [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=ZXGkpGuJSCds5idf@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=aayarekar@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=egallen@redhat.com \
    --cc=hgani@marvell.com \
    --cc=horms@kernel.org \
    --cc=konguyen@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mschmidt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sburla@marvell.com \
    --cc=sedara@marvell.com \
    --cc=srasheed@marvell.com \
    --cc=vburru@marvell.com \
    --cc=vimleshk@marvell.com \
    --cc=wizhao@redhat.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).