From: Ricky WU <ricky_wu@realtek.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: "arnd@arndb.de" <arnd@arndb.de>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: RE: [PATCH] misc: rtsx: Fix an error access Page fault
Date: Wed, 11 Oct 2023 03:22:41 +0000 [thread overview]
Message-ID: <39a288879fa34b329356a9e19384f6fe@realtek.com> (raw)
In-Reply-To: <CAAd53p5+ngpAB+J_Hshug61bCCCoec=LveeAUSrtAd_UP6gSoQ@mail.gmail.com>
Hi Kai-Heng,
I finished testing this patch it's working fine, re-plug card many time don't see the issue reproduce
I think this patch can fix the problem
thank you
Tested-by: Ricky Wu <ricky_wu@realtek.com>
> Ricky,
>
> On Tue, Sep 26, 2023 at 11:04 PM Ulf Hansson <ulf.hansson@linaro.org>
> wrote:
> >
> > On Thu, 14 Sept 2023 at 16:47, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> > >
> > > On Wed, 6 Sept 2023 at 10:03, Ricky WU <ricky_wu@realtek.com> wrote:
> > > >
> > > > an error occurs on insert SD7.0 card.
> > > > The pci slot of rtsx_pci will Link Down when the SD7.0 card
> > > > inserted, but the rtsx_pci not exit from runtime_idle at that
> > > > time, then do the power_saving function to access the wrong
> > > > resource
> > > >
> > > > Fixes: 597568e8df04 ("misc: rtsx: Rework runtime power management
> > > > flow")
> > > > Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
> > > > Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
> > >
> > > Applied for fixes, thanks!
> >
> > This was not ready to be applied, my bad! Fortunately, I haven't
> > submitted a pull-request with this yet, so I am simply dropping the
> > patch for now, to make sure we find the proper solution.
>
> Can you please see if the following change helps:
>
> diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
> index ad12515a4a121..89480e31c2266 100644
> --- a/drivers/pci/hotplug/pciehp_pci.c
> +++ b/drivers/pci/hotplug/pciehp_pci.c
> @@ -18,9 +18,18 @@
> #include <linux/kernel.h>
> #include <linux/types.h>
> #include <linux/pci.h>
> +#include <linux/pm_runtime.h>
> #include "../pci.h"
> #include "pciehp.h"
>
> +int pciehp_pm_runtime_barrier(struct pci_dev *pdev, void *unused) {
> + pm_runtime_barrier(&pdev->dev);
> + pci_dev_set_disconnected(pdev, NULL);
> +
> + return 0;
> +}
> +
> /**
> * pciehp_configure_device() - enumerate PCI devices below a hotplug
> bridge
> * @ctrl: PCIe hotplug controller
> @@ -98,7 +107,7 @@ void pciehp_unconfigure_device(struct controller *ctrl,
> bool presence)
> __func__, pci_domain_nr(parent), parent->number);
>
> if (!presence)
> - pci_walk_bus(parent, pci_dev_set_disconnected, NULL);
> + pci_walk_bus(parent, pciehp_pm_runtime_barrier, NULL);
>
> pci_lock_rescan_remove();
>
>
> >
> > [...]
> >
> > Kind regards
> > Uffe
prev parent reply other threads:[~2023-10-11 3:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 8:03 [PATCH] misc: rtsx: Fix an error access Page fault Ricky WU
2023-09-07 1:04 ` Kai-Heng Feng
2023-09-08 6:35 ` Ricky WU
2023-09-18 6:08 ` Kai-Heng Feng
2023-09-18 7:29 ` Ricky WU
2023-09-21 6:07 ` Kai-Heng Feng
2023-09-14 14:47 ` Ulf Hansson
2023-09-26 15:03 ` Ulf Hansson
2023-10-06 5:00 ` Kai-Heng Feng
2023-10-11 3:22 ` Ricky WU [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=39a288879fa34b329356a9e19384f6fe@realtek.com \
--to=ricky_wu@realtek.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=kai.heng.feng@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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