Netdev List
 help / color / mirror / Atom feed
From: "Kumar, M Chetan" <m.chetan.kumar@linux.intel.com>
To: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	David Miller <davem@davemloft.net>,
	Johannes Berg <johannes@sipsolutions.net>,
	Loic Poulain <loic.poulain@linaro.org>,
	"Sudi, Krishna C" <krishna.c.sudi@intel.com>,
	Intel Corporation <linuxwwan@intel.com>,
	Haijun Liu <haijun.liu@mediatek.com>,
	Madhusmita Sahu <madhusmita.sahu@intel.com>,
	Ricardo Martinez <ricardo.martinez@linux.intel.com>,
	Devegowda Chandrashekar <chandrashekar.devegowda@intel.com>
Subject: Re: [PATCH net-next 3/5] net: wwan: t7xx: PCIe reset rescan
Date: Fri, 9 Sep 2022 17:50:46 +0530	[thread overview]
Message-ID: <bb6ad043-a581-1157-8836-6277ebc69cd1@linux.intel.com> (raw)
In-Reply-To: <CAHNKnsT7zC4fTmc_+17Vy05aP-=vfZhwjOhbYJLOd=OZNMVD0w@mail.gmail.com>

On 9/7/2022 3:49 AM, Sergey Ryazanov wrote:
> On Fri, Sep 2, 2022 at 7:50 AM Kumar, M Chetan
> <m.chetan.kumar@linux.intel.com> wrote:
>> On 8/30/2022 7:32 AM, Sergey Ryazanov wrote:
>>> On Tue, Aug 16, 2022 at 7:12 AM <m.chetan.kumar@intel.com> wrote:
>>>> From: Haijun Liu <haijun.liu@mediatek.com>
>>>>
>>>> PCI rescan module implements "rescan work queue". In firmware flashing
>>>> or coredump collection procedure WWAN device is programmed to boot in
>>>> fastboot mode and a work item is scheduled for removal & detection.
>>>> The WWAN device is reset using APCI call as part driver removal flow.
>>>> Work queue rescans pci bus at fixed interval for device detection,
>>>> later when device is detect work queue exits.
>>>
>>> [skipped]
>>>
>>>> diff --git a/drivers/net/wwan/t7xx/t7xx_pci_rescan.c b/drivers/net/wwan/t7xx/t7xx_pci_rescan.c
>>>> new file mode 100644
>>>> index 000000000000..045777d8a843
>>>> --- /dev/null
>>>> +++ b/drivers/net/wwan/t7xx/t7xx_pci_rescan.c
>>>
>>> [skipped]
>>>
>>>> +static void t7xx_remove_rescan(struct work_struct *work)
>>>> +{
>>>> +       struct pci_dev *pdev;
>>>> +       int num_retries = RESCAN_RETRIES;
>>>> +       unsigned long flags;
>>>> +
>>>> +       spin_lock_irqsave(&g_mtk_rescan_context.dev_lock, flags);
>>>> +       g_mtk_rescan_context.rescan_done = 0;
>>>> +       pdev = g_mtk_rescan_context.dev;
>>>> +       spin_unlock_irqrestore(&g_mtk_rescan_context.dev_lock, flags);
>>>> +
>>>> +       if (pdev) {
>>>> +               pci_stop_and_remove_bus_device_locked(pdev);
>>>
>>> What is the purpose of removing the device then trying to find it by
>>> rescanning the bus? Would not it be easier to save a PCI device
>>> configuration, reset the device, and then restore the configuration?
>>
>> If hotplug is disabled, the device is not removed on reset. So in this
>> case driver need to handle the device removal and rescan.
> 
> I still can not understand this part and need a clue. Why should the
> driver disable the hotplug?

This is a platform configuration, it could be set to enable/disable.
We can find this option in BIOS settings.

> And is there a more gentle way to reset the firmware without the
> device object removing?

Device reset causes WWAN device to fall off the BUS. If device had not 
fallen off the bus then we could have reused.

Without these changes, we need to manually execute device remove & 
rescan commands.

Could you please suggest how can we proceed here ?

-- 
Chetan

      reply	other threads:[~2022-09-09 12:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16  4:23 [PATCH net-next 3/5] net: wwan: t7xx: PCIe reset rescan m.chetan.kumar
2022-08-18 14:58 ` Ilpo Järvinen
2022-08-30  2:02 ` Sergey Ryazanov
2022-09-02  4:50   ` Kumar, M Chetan
2022-09-06 22:19     ` Sergey Ryazanov
2022-09-09 12:20       ` Kumar, M Chetan [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=bb6ad043-a581-1157-8836-6277ebc69cd1@linux.intel.com \
    --to=m.chetan.kumar@linux.intel.com \
    --cc=chandrashekar.devegowda@intel.com \
    --cc=davem@davemloft.net \
    --cc=haijun.liu@mediatek.com \
    --cc=johannes@sipsolutions.net \
    --cc=krishna.c.sudi@intel.com \
    --cc=kuba@kernel.org \
    --cc=linuxwwan@intel.com \
    --cc=loic.poulain@linaro.org \
    --cc=madhusmita.sahu@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=ricardo.martinez@linux.intel.com \
    --cc=ryazanov.s.a@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox