From: Larry Finger <Larry.Finger@lwfinger.net>
To: Lars-Peter Clausen <lars@metafoo.de>, Kalle Valo <kvalo@codeaurora.org>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
"Chaoming Li" <chaoming_li@realsil.com.cn>,
linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org
Subject: [PATCH 2/2] rtlwifi: Remove unnecessary synchronize_irq() before free_irq()
Date: Mon, 8 Feb 2016 15:44:51 -0600 [thread overview]
Message-ID: <56B90C53.3070204@lwfinger.net> (raw)
In-Reply-To: <1454964073-25108-2-git-send-email-lars@metafoo.de>
On 02/08/2016 02:41 PM, Lars-Peter Clausen wrote:
> Calling synchronize_irq() right before free_irq() is quite useless. On one
> hand the IRQ can easily fire again before free_irq() is entered, on the
> other hand free_irq() itself calls synchronize_irq() internally (in a race
> condition free way), before any state associated with the IRQ is freed.
>
> Patch was generated using the following semantic patch:
> // <smpl>
> @@
> expression irq;
> @@
> -synchronize_irq(irq);
> free_irq(irq, ...);
> // </smpl>
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> drivers/net/wireless/realtek/rtlwifi/pci.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
> index 7f471bf..140d254 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -2392,7 +2392,6 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
> rtlpriv->cfg->ops->deinit_sw_vars(hw);
>
> if (rtlpci->irq_alloc) {
> - synchronize_irq(rtlpci->pdev->irq);
> free_irq(rtlpci->pdev->irq, hw);
> rtlpci->irq_alloc = 0;
> }
>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Makes sense to me.
Thanks,
Larry
WARNING: multiple messages have this Message-ID (diff)
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Lars-Peter Clausen <lars@metafoo.de>, Kalle Valo <kvalo@codeaurora.org>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
"Chaoming Li" <chaoming_li@realsil.com.cn>,
linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org
Subject: Re: [PATCH 2/2] rtlwifi: Remove unnecessary synchronize_irq() before free_irq()
Date: Mon, 8 Feb 2016 15:44:51 -0600 [thread overview]
Message-ID: <56B90C53.3070204@lwfinger.net> (raw)
In-Reply-To: <1454964073-25108-2-git-send-email-lars@metafoo.de>
On 02/08/2016 02:41 PM, Lars-Peter Clausen wrote:
> Calling synchronize_irq() right before free_irq() is quite useless. On one
> hand the IRQ can easily fire again before free_irq() is entered, on the
> other hand free_irq() itself calls synchronize_irq() internally (in a race
> condition free way), before any state associated with the IRQ is freed.
>
> Patch was generated using the following semantic patch:
> // <smpl>
> @@
> expression irq;
> @@
> -synchronize_irq(irq);
> free_irq(irq, ...);
> // </smpl>
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> drivers/net/wireless/realtek/rtlwifi/pci.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
> index 7f471bf..140d254 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -2392,7 +2392,6 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
> rtlpriv->cfg->ops->deinit_sw_vars(hw);
>
> if (rtlpci->irq_alloc) {
> - synchronize_irq(rtlpci->pdev->irq);
> free_irq(rtlpci->pdev->irq, hw);
> rtlpci->irq_alloc = 0;
> }
>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Makes sense to me.
Thanks,
Larry
next prev parent reply other threads:[~2016-02-08 21:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 20:41 [PATCH 1/2] b43: Remove unnecessary synchronize_irq() before free_irq() Lars-Peter Clausen
2016-02-08 20:41 ` [PATCH 2/2] rtlwifi: " Lars-Peter Clausen
2016-02-08 21:44 ` Larry Finger [this message]
2016-02-08 21:44 ` Larry Finger
2016-02-08 22:22 ` [PATCH 1/2] b43: " Michael Büsch
2016-02-08 22:22 ` Michael Büsch
2016-02-25 10:00 ` [1/2] " Kalle Valo
2016-02-25 10:00 ` Kalle Valo
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=56B90C53.3070204@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=b43-dev@lists.infradead.org \
--cc=chaoming_li@realsil.com.cn \
--cc=kvalo@codeaurora.org \
--cc=lars@metafoo.de \
--cc=linux-wireless@vger.kernel.org \
--cc=zajec5@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.