public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brett Creeley <bcreeley@amd.com>
To: Jakub Kicinski <kuba@kernel.org>, Brett Creeley <brett.creeley@amd.com>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	shannon.nelson@amd.com
Subject: Re: [PATCH net] pds_core: Fix pdsc_check_pci_health function to print warning
Date: Tue, 2 Apr 2024 10:02:57 -0700	[thread overview]
Message-ID: <29bc2adb-07d5-416d-b357-4cf084b45ed8@amd.com> (raw)
In-Reply-To: <20240322180251.69167fd1@kernel.org>

On 3/22/2024 6:02 PM, Jakub Kicinski wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> On Wed, 20 Mar 2024 23:39:54 -0700 Brett Creeley wrote:
>> When the driver notices fw_status == 0xff it tries to perform a PCI
>> reset on itself via pci_reset_function() in the context of the driver's
>> health thread. However, pdsc_reset_prepare calls
>> pdsc_stop_health_thread(), which attempts to stop/flush the health
>> thread. This results in a deadlock because the stop/flush will never
>> complete since the driver called pci_reset_function() from the health
>> thread context. Fix this by changing the pdsc_check_pci_health_function()
>> to print a dev_warn() once every fw_down/fw_up cycle and requiring the
>> user to perform a reset on the device via sysfs's reset interface,
>> reloading the driver, rebinding the device, etc.
> 
> Dunno, to call PCI reset you don't need much device context.
> Perhaps you could allocate a work entry, throw it onto a per-driver
> workqueue, and return. Basically some minimal viable way to
> "asynchronously" call pci_reset_function()?
> You can take a ref on the device so it doesn't disappear.
> And flush that queue on module unload.

Hi Jakub,

Yeah, this is better than my proposed solution. Now that I'm back from 
vacation I will work on a v2.

Thanks for the review,

Brett

      reply	other threads:[~2024-04-02 17:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21  6:39 [PATCH net] pds_core: Fix pdsc_check_pci_health function to print warning Brett Creeley
2024-03-22 11:09 ` Simon Horman
2024-03-23  1:02 ` Jakub Kicinski
2024-04-02 17:02   ` Brett Creeley [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=29bc2adb-07d5-416d-b357-4cf084b45ed8@amd.com \
    --to=bcreeley@amd.com \
    --cc=brett.creeley@amd.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shannon.nelson@amd.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