mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qiheng Lin <linqiheng@huawei.com>
To: Pavan Chebbi <pavan.chebbi@broadcom.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <lars.povlsen@microchip.com>,
	<Steen.Hegelund@microchip.com>, <daniel.machon@microchip.com>,
	<UNGLinuxDriver@microchip.com>, <netdev@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue
Date: Fri, 2 Dec 2022 18:34:58 +0800	[thread overview]
Message-ID: <52a15a3f-a288-7a7f-e9b3-1096d108e4a3@huawei.com> (raw)
In-Reply-To: <CALs4sv3w4Gjs2JGr-hHh_XEXoVWJm3t27O=ezy6HEzRXuk2TwA@mail.gmail.com>

在 2022/12/2 18:02, Pavan Chebbi 写道:
> On Fri, Dec 2, 2022 at 1:36 PM Pavan Chebbi <pavan.chebbi@broadcom.com> wrote:
>>
>> On Thu, Dec 1, 2022 at 6:57 PM Qiheng Lin <linqiheng@huawei.com> wrote:
>>>
>>> The mchp_sparx5_probe() won't destroy workqueue created by
>>> create_singlethread_workqueue() in sparx5_start() when later
>>> inits failed. Add destroy_workqueue in the cleanup_ports case,
>>> also add it in mchp_sparx5_remove()
>>>
>>> Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
>>> ---
>>>   drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
>>> index eeac04b84638..b6bbb3c9bd7a 100644
>>> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
>>> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
>>> @@ -887,6 +887,8 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
>>>
>>>   cleanup_ports:
>>>          sparx5_cleanup_ports(sparx5);
>>> +       if (sparx5->mact_queue)
>>> +               destroy_workqueue(sparx5->mact_queue);
>>
>> Would be better if you destroy inside sparx5_start() before returning failure.
>>
> 
> Alternatively you could add the destroy inside sparx5_cleanup_ports()
> that will cover all error exits?

That works functionally, I have considered this modification as well. 
Since I'm not quite sure on the naming, destroying the mact_queue 
belongs to sparx5_cleanup_ports, which they don't contain now.

> 
>>>   cleanup_config:
>>>          kfree(configs);
>>>   cleanup_pnode:
>>> @@ -911,6 +913,7 @@ static int mchp_sparx5_remove(struct platform_device *pdev)
>>>          sparx5_cleanup_ports(sparx5);
>>>          /* Unregister netdevs */
>>>          sparx5_unregister_notifier_blocks(sparx5);
>>> +       destroy_workqueue(sparx5->mact_queue);
>>>
>>>          return 0;
>>>   }
>>> --
>>> 2.32.0
>>>


  reply	other threads:[~2022-12-02 10:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 13:47 Qiheng Lin
2022-12-02  8:06 ` Pavan Chebbi
2022-12-02 10:02   ` Pavan Chebbi
2022-12-02 10:34     ` Qiheng Lin [this message]
2022-12-03  4:59 ` Jakub Kicinski

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=52a15a3f-a288-7a7f-e9b3-1096d108e4a3@huawei.com \
    --to=linqiheng@huawei.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.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

all inboxes | Powered by JetHome®