From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Shahed Shaikh <shahed.shaikh@qlogic.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org, Dept-HSGLinuxNICDev@qlogic.com,
Sony Chacko <sony.chacko@qlogic.com>
Subject: Re: [PATCH net 5/5] qlcnic: reset firmware API lock during driver load
Date: Fri, 21 Feb 2014 18:36:29 +0400 [thread overview]
Message-ID: <5307646D.4050801@cogentembedded.com> (raw)
In-Reply-To: <1392963788-18341-6-git-send-email-shahed.shaikh@qlogic.com>
Hello.
On 21-02-2014 10:23, Shahed Shaikh wrote:
> From: Sony Chacko <sony.chacko@qlogic.com>
> Firmware is not resetting API lock at initialization,
> reset the lock at driver load time.
> Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
> ---
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> index 1222865..61f8893 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> @@ -2305,6 +2305,18 @@ void qlcnic_set_drv_version(struct qlcnic_adapter *adapter)
> qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd);
> }
>
> +static void qlcnic_reset_api_lock(struct qlcnic_adapter *adapter)
> +{
> + /* Check lock availability*/
> + if (qlcnic_api_lock(adapter)) {
> + /* Lock not available, force release the lock */
> + qlcnic_api_unlock(adapter);
> + } else {
> + /* Lock available, release it before proceeding */
> + qlcnic_api_unlock(adapter);
> + }
Isn't it simpler to just do:
qlcnic_api_lock(adapter);
qlcnic_api_unlock(adapter);
> +}
> +
> static int
> qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> {
WBR, Sergei
next prev parent reply other threads:[~2014-02-21 14:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-21 6:23 [PATCH net 0/5] qlcnic: Bug fixes Shahed Shaikh
2014-02-21 6:23 ` [PATCH net 1/5] qlcnic: Fix function return error check Shahed Shaikh
2014-02-21 6:23 ` [PATCH net 2/5] qlcnic: Fix usage of use_msi and use_msi_x module parameters Shahed Shaikh
2014-02-21 6:23 ` [PATCH net 3/5] qlcnic: Allow any VLAN to be configured from VF Shahed Shaikh
2014-02-21 6:23 ` [PATCH net 4/5] qlcnic: Fix number of rings when we fall back from msix to legacy Shahed Shaikh
2014-02-21 6:23 ` [PATCH net 5/5] qlcnic: reset firmware API lock during driver load Shahed Shaikh
2014-02-21 14:36 ` Sergei Shtylyov [this message]
2014-02-21 19:20 ` Sony Chacko
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=5307646D.4050801@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=Dept-HSGLinuxNICDev@qlogic.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=shahed.shaikh@qlogic.com \
--cc=sony.chacko@qlogic.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).