[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <39a288879fa34b329356a9e19384f6fe@realtek.com>
Date: Wed, 11 Oct 2023 03:22:41 +0000
From: Ricky WU <ricky_wu@...ltek.com>
To: Kai-Heng Feng <kai.heng.feng@...onical.com>,
Ulf Hansson <ulf.hansson@...aro.org>
CC: "arnd@...db.de" <arnd@...db.de>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>
Subject: RE: [PATCH] misc: rtsx: Fix an error access Page fault
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@...ltek.com>
> Ricky,
>
> On Tue, Sep 26, 2023 at 11:04 PM Ulf Hansson <ulf.hansson@...aro.org>
> wrote:
> >
> > On Thu, 14 Sept 2023 at 16:47, Ulf Hansson <ulf.hansson@...aro.org> wrote:
> > >
> > > On Wed, 6 Sept 2023 at 10:03, Ricky WU <ricky_wu@...ltek.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@...onical.com>
> > > > Signed-off-by: Ricky Wu <ricky_wu@...ltek.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
Powered by blists - more mailing lists