Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Alessio Igor Bogani <alessio.bogani@elettra.eu>,
	<intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH] igb: Unconditionally deallocate workqueues as allocation already does
Date: Wed, 19 Jul 2023 14:18:00 -0700	[thread overview]
Message-ID: <26d9aed2-6eba-9f19-3948-8d6fb8c9768b@intel.com> (raw)
In-Reply-To: <20230718134517.8247-1-alessio.bogani@elettra.eu>

On 7/18/2023 6:45 AM, Alessio Igor Bogani wrote:
> The workqueues ptp_tx_work and ptp_overflow_work are unconditionally allocated
> by igb_ptp_init() but, at the moment, are deallocated only if the flag
> IGB_PTP_ENABLED is on which isn't the case if there are errors or
> if CONFIG_PTP is disabled.
> 
> Otherwise, when we unbind the igb driver with vfio-pci we receive a stack trace:
> BUG: unable to handle page fault for address: ffffc9000440b6f8
> [...]
> Workqueue: events igb_ptp_overflow_check
> RIP: 0010:igb_rd32+0x1f/0x60
> [...]
> Call Trace:
>   igb_ptp_read_82580+0x20/0x50
>   timecounter_read+0x15/0x60
>   igb_ptp_overflow_check+0x1a/0x50
>   process_one_work+0x1cb/0x3c0
>   worker_thread+0x53/0x3f0
>   ? rescuer_thread+0x370/0x370
>   kthread+0x142/0x160
>   ? kthread_associate_blkcg+0xc0/0xc0
>   ret_from_fork+0x1f/0x30

Process-wise. If you can please specify the tree you are targeting and, 
as this is a fix, you should add a Fixes: tag.

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq

This is also missing your sign-off

> ---
>   drivers/net/ethernet/intel/igb/igb_ptp.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
> index 6f471b91f562..56839bf65c13 100644
> --- a/drivers/net/ethernet/intel/igb/igb_ptp.c
> +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
> @@ -1440,9 +1440,6 @@ void igb_ptp_sdp_init(struct igb_adapter *adapter)
>    */
>   void igb_ptp_suspend(struct igb_adapter *adapter)
>   {
> -	if (!(adapter->ptp_flags & IGB_PTP_ENABLED))
> -		return;
> -

There are cases where the workqueues are not setup (and IGB_PTP_ENABLED 
not set); this safeguards against those situations. I think the better 
fix would be to not have the workqueues if PTP is not enabled.

>   	if (adapter->ptp_flags & IGB_PTP_OVERFLOW_CHECK)
>   		cancel_delayed_work_sync(&adapter->ptp_overflow_work);
>   
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2023-07-19 21:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 13:45 [Intel-wired-lan] [PATCH] igb: Unconditionally deallocate workqueues as allocation already does Alessio Igor Bogani
2023-07-19 21:18 ` Tony Nguyen [this message]
2023-07-20 14:50   ` [Intel-wired-lan] [PATCH] igb: Avoid starting unnecessary workqueues Alessio Igor Bogani
2023-07-21 17:15     ` Tony Nguyen
2023-08-21  5:47     ` Arland, ArpanaX

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=26d9aed2-6eba-9f19-3948-8d6fb8c9768b@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=alessio.bogani@elettra.eu \
    --cc=intel-wired-lan@lists.osuosl.org \
    /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