All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org, Rajat Jain <rajatja@google.com>
Subject: Re: [PATCH 09/12] iwlwifi: pcie: remove non-responsive device
Date: Thu, 26 Apr 2018 10:46:25 +0300	[thread overview]
Message-ID: <c3cc162f1980fa56838a78e2b171e8165afc6321.camel@coelho.fi> (raw)
In-Reply-To: <87efj3af5t.fsf@kamboji.qca.qualcomm.com>

On Wed, 2018-04-25 at 11:01 +0300, Kalle Valo wrote:
> Luca Coelho <luca@coelho.fi> writes:
> 
> > On Tue, 2018-04-24 at 12:44 +0300, Kalle Valo wrote:
> > > Luca Coelho <luca@coelho.fi> writes:
> > > 
> > > > From: Luca Coelho <luciano.coelho@intel.com>
> > > > 
> > > > If we fail to to grab NIC access because the device is not
> > > > responding
> > > > (i.e. CSR_GP_CNTRL returns 0xFFFFFFFF), remove the device from
> > > > the
> > > > PCI
> > > > bus, to avoid any further damage, and to let the user space
> > > > rescan.
> > > > 
> > > > Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> > > > Signed-off-by: Rajat Jain <rajatja@google.com>
> > > 
> > > The commit log doesn't mention anything about the module
> > > parameter
> > > nor
> > > about the kobject uevent.
> > 
> > Good point.  The uevent and the module parameter were added in
> > later
> > patches and I squashed them all into this one, but forgot to update
> > the
> > commit message.  I'll fix it.
> 
> Good, thanks.
> 
> > > > +static void iwl_trans_pcie_removal_wk(struct work_struct *wk)
> > > > +{
> > > > +	struct iwl_trans_pcie_removal *removal =
> > > > +		container_of(wk, struct
> > > > iwl_trans_pcie_removal,
> > > > work);
> > > > +	struct pci_dev *pdev = removal->pdev;
> > > > +	char *prop[] = {"EVENT=INACCESSIBLE", NULL};
> > > > +
> > > > +	dev_err(&pdev->dev, "Device gone - attempting
> > > > removal\n");
> > > > +	kobject_uevent_env(&pdev->dev.kobj, KOBJ_CHANGE,
> > > > prop);
> > > > +	pci_lock_rescan_remove();
> > > > +	pci_dev_put(pdev);
> > > > +	pci_stop_and_remove_bus_device(pdev);
> > > > +	pci_unlock_rescan_remove();
> > > > +
> > > > +	kfree(removal);
> > > > +	module_put(THIS_MODULE);
> > > > +}
> > > 
> > > So is the uevent some standard thing or what? At least grepping
> > > INACCESSIBLE for didn't tell me anything.
> > 
> > No, this is not standard.  We didn't find any appropriate standard
> > message for this case, so we created a new one.  Also, we didn't
> > want
> > to interfere with components that may react to standard messages.
> > 
> > This is disabled by default and the idea is to change this in the
> > future to allow the driver to remove and rescan the device
> > automatically.  So we will have 3 options in the module parameter:
> > do
> > nothing; auto-rescan or; send uevent.
> 
> Ok, I assume you will explain this in the commit log.

Yes, I'll improve the commit message.


> In my opinion the driver should not be sending custom events like
> this
> and instead pci_stop_and_remove_bus_device() should do it, but maybe
> that's just me?

pci_stop_and_remove_bus_device() will already trigger some events, like
"REMOVED" or something like that.  But the semantics is a little bit
different.  If the device was removed, you don't usually want to rescan
the bus, because the device will not be there anymore.  In our case,
the device *is* there, but got stuck and we want to rescan to get it
back.

--
Cheers,
Luca.

  reply	other threads:[~2018-04-26  7:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-22  8:27 [PATCH 00/12] iwlwifi: updates intended for v4.18 2018-04-22 Luca Coelho
2018-04-22  8:27 ` [PATCH 01/12] iwlwifi: allow different csr flags for different device families Luca Coelho
2018-05-27 12:08   ` iwlwifi: regression due to: " Alexander Wetzel
2018-05-31  6:30     ` Luca Coelho
2018-05-31  8:44       ` Kalle Valo
2018-05-31  9:17         ` Luca Coelho
2018-04-22  8:27 ` [PATCH 02/12] iwlwifi: introduce Image Loader (IML) - new firmware image Luca Coelho
2018-04-22  8:27 ` [PATCH 03/12] iwlwifi: cfg: remove unnecessary cfg data in non-dvm devices Luca Coelho
2018-04-22  8:27 ` [PATCH 04/12] iwlwifi: pcie: allow sending pre-built A-MSDUs Luca Coelho
2018-04-22  8:27 ` [PATCH 05/12] iwlwifi: support new csr addresses for hw address Luca Coelho
2018-04-22  8:27 ` [PATCH 06/12] iwlwifi: mvm: move skb padding reservation earlier Luca Coelho
2018-04-22  8:27 ` [PATCH 07/12] iwlwifi: fw: harden page loading code Luca Coelho
2018-04-22  8:27 ` [PATCH 08/12] iwlwifi: fw: combine loading of last page block into main copy loop Luca Coelho
2018-04-22  8:27 ` [PATCH 09/12] iwlwifi: pcie: remove non-responsive device Luca Coelho
2018-04-24  9:44   ` Kalle Valo
2018-04-24 10:56     ` Luca Coelho
2018-04-25  8:01       ` Kalle Valo
2018-04-26  7:46         ` Luca Coelho [this message]
2018-04-26  7:53   ` [PATCH v2 12/12] " Luca Coelho
2018-04-26  7:55     ` Luciano Coelho
2018-04-22  8:27 ` [PATCH 10/12] iwlwifi: make bitfield a u32 instead of u16 Luca Coelho
2018-04-22  8:27 ` [PATCH 11/12] iwlwifi: mvm: remove check for non low latency TIDs Luca Coelho
2018-04-22  8:27 ` [PATCH 12/12] iwlwifi: mvm: set wakeup filters for wowlan "any" configuration Luca Coelho
2018-04-24  9:45   ` Kalle Valo
2018-04-24 10:56     ` Luca Coelho
2018-04-26  7:52   ` [PATCH v2 " Luca Coelho

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=c3cc162f1980fa56838a78e2b171e8165afc6321.camel@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rajatja@google.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.