Message ID | 1558647944-13816-1-git-send-email-alan.mikhak@sifive.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] PCI: endpoint: Set endpoint controller pointer to null | expand |
+Bjorn Helgaas On Thu, May 23, 2019 at 2:46 PM Alan Mikhak <alan.mikhak@sifive.com> wrote: > > Set endpoint controller pointer to null in pci_epc_remove_epf() > to avoid -EBUSY on subsequent call to pci_epc_add_epf(). > > Requires checking for null endpoint function pointer. > > Signed-off-by: Alan Mikhak <alan.mikhak@sifive.com> > --- > drivers/pci/endpoint/pci-epc-core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c > index e4712a0f249c..2091508c1620 100644 > --- a/drivers/pci/endpoint/pci-epc-core.c > +++ b/drivers/pci/endpoint/pci-epc-core.c > @@ -519,11 +519,12 @@ void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf) > { > unsigned long flags; > > - if (!epc || IS_ERR(epc)) > + if (!epc || IS_ERR(epc) || !epf) > return; > > spin_lock_irqsave(&epc->lock, flags); > list_del(&epf->list); > + epf->epc = NULL; > spin_unlock_irqrestore(&epc->lock, flags); > } > EXPORT_SYMBOL_GPL(pci_epc_remove_epf); > -- > 2.7.4 >
[trimming recipient list] How is this related to arch/riscv?
On 24/05/19 5:27 AM, Alan Mikhak wrote: > +Bjorn Helgaas > > On Thu, May 23, 2019 at 2:46 PM Alan Mikhak <alan.mikhak@sifive.com> wrote: >> >> Set endpoint controller pointer to null in pci_epc_remove_epf() >> to avoid -EBUSY on subsequent call to pci_epc_add_epf(). >> >> Requires checking for null endpoint function pointer. >> >> Signed-off-by: Alan Mikhak <alan.mikhak@sifive.com> Acked-by: Kishon Vijay Abraham I <kishon@ti.com> >> --- >> drivers/pci/endpoint/pci-epc-core.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c >> index e4712a0f249c..2091508c1620 100644 >> --- a/drivers/pci/endpoint/pci-epc-core.c >> +++ b/drivers/pci/endpoint/pci-epc-core.c >> @@ -519,11 +519,12 @@ void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf) >> { >> unsigned long flags; >> >> - if (!epc || IS_ERR(epc)) >> + if (!epc || IS_ERR(epc) || !epf) >> return; >> >> spin_lock_irqsave(&epc->lock, flags); >> list_del(&epf->list); >> + epf->epc = NULL; >> spin_unlock_irqrestore(&epc->lock, flags); >> } >> EXPORT_SYMBOL_GPL(pci_epc_remove_epf); >> -- >> 2.7.4 >>
Chrisoph, These changes were implemented in Linux PCI Endpoint framework to exercise PCIe endpoint mode on RISCV. Alan On Thu, May 23, 2019 at 11:38 PM Christoph Hellwig <hch@infradead.org> wrote: > > [trimming recipient list] > > > How is this related to arch/riscv?
On Thu, 23 May 2019, Christoph Hellwig wrote: > [trimming recipient list] > > > How is this related to arch/riscv? This was my doing: I suggested to Alan that he copy these messages to the linux-riscv mailing list. We're seeing interest from people who want to build PCIe cards based on RISC-V Linux, so I thought it might increase the potential review coverage for these patches. - Paul
The get_maintainers.pl script also suggests linux-riscv mailing list. On Fri, May 24, 2019 at 12:04 PM Paul Walmsley <paul.walmsley@sifive.com> wrote: > > On Thu, 23 May 2019, Christoph Hellwig wrote: > > > [trimming recipient list] > > > > > > How is this related to arch/riscv? > > This was my doing: I suggested to Alan that he copy these messages to the > linux-riscv mailing list. We're seeing interest from people who want to > build PCIe cards based on RISC-V Linux, so I thought it might increase the > potential review coverage for these patches. > > > - Paul
On Fri, May 24, 2019 at 11:23:04AM -0700, Alan Mikhak wrote: > Chrisoph, > > These changes were implemented in Linux PCI Endpoint framework to > exercise PCIe endpoint mode on RISCV. Well, arch/riscv isn't involved in this patch (which having an interest in the PCIe EP stuff I really like). I still don't see how it relates to riscv except that you apparently have been able to use it on a RISCV SOC somehow.
On Fri, May 24, 2019 at 12:05:24PM -0700, Alan Mikhak wrote:
> The get_maintainers.pl script also suggests linux-riscv mailing list.
For drivers/pci/endpoint stuff? That kinda sounds like a bug, can you
paste the output here?
On Sat, May 25, 2019 at 1:24 AM Christoph Hellwig <hch@infradead.org> wrote: > > On Fri, May 24, 2019 at 12:05:24PM -0700, Alan Mikhak wrote: > > The get_maintainers.pl script also suggests linux-riscv mailing list. > > For drivers/pci/endpoint stuff? That kinda sounds like a bug, can you > paste the output here? Please see below output of get_maintainers.pl for all my patches related to PCIe endpoint work. It seems get_maintainers.pl suggests linux-riscv based on @sifive.com email address. $ ./scripts/get_maintainer.pl 0001-Set-endpoint-controller-pointer-to-null.patch Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM) Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM) Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) linux-kernel@vger.kernel.org (open list) linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) $ ./scripts/get_maintainer.pl 0001-Allocate-enough-space-for-fixed-size-BAR.patch Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM,commit_signer:7/8=88%,authored:4/8=50%,added_lines:61/136=45%,removed_lines:39/63=62%) Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM,commit_signer:8/8=100%) Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) Gustavo Pimentel <gustavo.pimentel@synopsys.com> (commit_signer:2/8=25%,authored:2/8=25%,added_lines:68/136=50%,removed_lines:22/63=35%) Kangjie Lu <kjlu@umn.edu> (commit_signer:1/8=12%,authored:1/8=12%) Wen Yang <wen.yang99@zte.com.cn> (commit_signer:1/8=12%,authored:1/8=12%) linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) linux-kernel@vger.kernel.org (open list) linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) $ ./scripts/get_maintainer.pl 0001-Skip-odd-BAR-when-skipping-64bit-BAR.patch Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM,commit_signer:7/8=88%,authored:4/8=50%,added_lines:61/136=45%,removed_lines:39/63=62%) Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM,commit_signer:8/8=100%) Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) Gustavo Pimentel <gustavo.pimentel@synopsys.com> (commit_signer:2/8=25%,authored:2/8=25%,added_lines:68/136=50%,removed_lines:22/63=35%) Kangjie Lu <kjlu@umn.edu> (commit_signer:1/8=12%,authored:1/8=12%) Wen Yang <wen.yang99@zte.com.cn> (commit_signer:1/8=12%,authored:1/8=12%) linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) linux-kernel@vger.kernel.org (open list) linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) $ ./scripts/get_maintainer.pl 0001-Clear-BAR-before-freeing-its-space.patch Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM,commit_signer:7/8=88%,authored:4/8=50%,added_lines:61/136=45%,removed_lines:39/63=62%) Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM,commit_signer:8/8=100%) Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) Gustavo Pimentel <gustavo.pimentel@synopsys.com> (commit_signer:2/8=25%,authored:2/8=25%,added_lines:68/136=50%,removed_lines:22/63=35%) Kangjie Lu <kjlu@umn.edu> (commit_signer:1/8=12%,authored:1/8=12%) Wen Yang <wen.yang99@zte.com.cn> (commit_signer:1/8=12%,authored:1/8=12%) linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) linux-kernel@vger.kernel.org (open list) linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) $ ./scripts/get_maintainer.pl 0001-Add-DMA-to-Linux-PCI-EP-Framework.patch Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM,commit_signer:7/8=88%,authored:4/8=50%,added_lines:61/136=45%,removed_lines:39/63=62%) Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM,commit_signer:8/8=100%) Arnd Bergmann <arnd@arndb.de> (supporter:CHAR and MISC DRIVERS) Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:CHAR and MISC DRIVERS) Jingoo Han <jingoohan1@gmail.com> (maintainer:PCI DRIVER FOR SYNOPSYS DESIGNWARE) Gustavo Pimentel <gustavo.pimentel@synopsys.com> (maintainer:PCI DRIVER FOR SYNOPSYS DESIGNWARE,commit_signer:2/8=25%,authored:2/8=25%,added_lines:68/136=50%,removed_lines:22/63=35%) Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) Wen Yang <wen.yang99@zte.com.cn> (commit_signer:1/8=12%,authored:1/8=12%) Kangjie Lu <kjlu@umn.edu> (commit_signer:1/8=12%,authored:1/8=12%) linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) linux-kernel@vger.kernel.org (open list) linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) $ ./scripts/get_maintainer.pl 0001-Fix-broken-pcitest-compilation.patch Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM) Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM) Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) linux-kernel@vger.kernel.org (open list) linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) $ ./scripts/get_maintainer.pl 0002-Fix-compiler-warning-in-pcitest.patch Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM) Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM) Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) linux-kernel@vger.kernel.org (open list) linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS)
On Tue, 28 May 2019 09:20:35 PDT (-0700), alan.mikhak@sifive.com wrote: > On Sat, May 25, 2019 at 1:24 AM Christoph Hellwig <hch@infradead.org> wrote: >> >> On Fri, May 24, 2019 at 12:05:24PM -0700, Alan Mikhak wrote: >> > The get_maintainers.pl script also suggests linux-riscv mailing list. >> >> For drivers/pci/endpoint stuff? That kinda sounds like a bug, can you >> paste the output here? > > Please see below output of get_maintainers.pl for all my patches > related to PCIe endpoint work. It seems get_maintainers.pl suggests > linux-riscv based on @sifive.com email address. > > $ ./scripts/get_maintainer.pl 0001-Set-endpoint-controller-pointer-to-null.patch > Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM) > Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM) > Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) > Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) > Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) > linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) > linux-kernel@vger.kernel.org (open list) > linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) > > $ ./scripts/get_maintainer.pl > 0001-Allocate-enough-space-for-fixed-size-BAR.patch > Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT > SUBSYSTEM,commit_signer:7/8=88%,authored:4/8=50%,added_lines:61/136=45%,removed_lines:39/63=62%) > Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT > SUBSYSTEM,commit_signer:8/8=100%) > Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) > Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) > Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) > Gustavo Pimentel <gustavo.pimentel@synopsys.com> > (commit_signer:2/8=25%,authored:2/8=25%,added_lines:68/136=50%,removed_lines:22/63=35%) > Kangjie Lu <kjlu@umn.edu> (commit_signer:1/8=12%,authored:1/8=12%) > Wen Yang <wen.yang99@zte.com.cn> (commit_signer:1/8=12%,authored:1/8=12%) > linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) > linux-kernel@vger.kernel.org (open list) > linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) > > $ ./scripts/get_maintainer.pl 0001-Skip-odd-BAR-when-skipping-64bit-BAR.patch > Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT > SUBSYSTEM,commit_signer:7/8=88%,authored:4/8=50%,added_lines:61/136=45%,removed_lines:39/63=62%) > Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT > SUBSYSTEM,commit_signer:8/8=100%) > Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) > Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) > Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) > Gustavo Pimentel <gustavo.pimentel@synopsys.com> > (commit_signer:2/8=25%,authored:2/8=25%,added_lines:68/136=50%,removed_lines:22/63=35%) > Kangjie Lu <kjlu@umn.edu> (commit_signer:1/8=12%,authored:1/8=12%) > Wen Yang <wen.yang99@zte.com.cn> (commit_signer:1/8=12%,authored:1/8=12%) > linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) > linux-kernel@vger.kernel.org (open list) > linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) > > $ ./scripts/get_maintainer.pl 0001-Clear-BAR-before-freeing-its-space.patch > Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT > SUBSYSTEM,commit_signer:7/8=88%,authored:4/8=50%,added_lines:61/136=45%,removed_lines:39/63=62%) > Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT > SUBSYSTEM,commit_signer:8/8=100%) > Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) > Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) > Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) > Gustavo Pimentel <gustavo.pimentel@synopsys.com> > (commit_signer:2/8=25%,authored:2/8=25%,added_lines:68/136=50%,removed_lines:22/63=35%) > Kangjie Lu <kjlu@umn.edu> (commit_signer:1/8=12%,authored:1/8=12%) > Wen Yang <wen.yang99@zte.com.cn> (commit_signer:1/8=12%,authored:1/8=12%) > linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) > linux-kernel@vger.kernel.org (open list) > linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) > > $ ./scripts/get_maintainer.pl 0001-Add-DMA-to-Linux-PCI-EP-Framework.patch > Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT > SUBSYSTEM,commit_signer:7/8=88%,authored:4/8=50%,added_lines:61/136=45%,removed_lines:39/63=62%) > Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT > SUBSYSTEM,commit_signer:8/8=100%) > Arnd Bergmann <arnd@arndb.de> (supporter:CHAR and MISC DRIVERS) > Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:CHAR and > MISC DRIVERS) > Jingoo Han <jingoohan1@gmail.com> (maintainer:PCI DRIVER FOR SYNOPSYS > DESIGNWARE) > Gustavo Pimentel <gustavo.pimentel@synopsys.com> (maintainer:PCI > DRIVER FOR SYNOPSYS > DESIGNWARE,commit_signer:2/8=25%,authored:2/8=25%,added_lines:68/136=50%,removed_lines:22/63=35%) > Bjorn Helgaas <bhelgaas@google.com> (supporter:PCI SUBSYSTEM) > Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) > Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) > Wen Yang <wen.yang99@zte.com.cn> (commit_signer:1/8=12%,authored:1/8=12%) > Kangjie Lu <kjlu@umn.edu> (commit_signer:1/8=12%,authored:1/8=12%) > linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) > linux-kernel@vger.kernel.org (open list) > linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) > > $ ./scripts/get_maintainer.pl 0001-Fix-broken-pcitest-compilation.patch > Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM) > Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM) > Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) > Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) > linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) > linux-kernel@vger.kernel.org (open list) > linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) > > $ ./scripts/get_maintainer.pl 0002-Fix-compiler-warning-in-pcitest.patch > Kishon Vijay Abraham I <kishon@ti.com> (supporter:PCI ENDPOINT SUBSYSTEM) > Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> (supporter:PCI ENDPOINT SUBSYSTEM) > Palmer Dabbelt <palmer@sifive.com> (supporter:SIFIVE DRIVERS) > Paul Walmsley <paul.walmsley@sifive.com> (supporter:SIFIVE DRIVERS) > linux-pci@vger.kernel.org (open list:PCI ENDPOINT SUBSYSTEM) > linux-kernel@vger.kernel.org (open list) > linux-riscv@lists.infradead.org (open list:SIFIVE DRIVERS) I'm guessing it's this SIFIVE DRIVERS M: Palmer Dabbelt <palmer@sifive.com> M: Paul Walmsley <paul.walmsley@sifive.com> L: linux-riscv@lists.infradead.org T: git git://github.com/sifive/riscv-linux.git S: Supported K: sifive N: sifive which, if I understand correctly, will match any "sifive" in the entire patch body. I think the options are to either drop the K line, or to attempt a regex that doesn't match the sifive part. This appears to at least stop the matches for me diff --git a/MAINTAINERS b/MAINTAINERS index 2c2fce72e694..003570e1f8d4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14131,7 +14131,7 @@ M: Paul Walmsley <paul.walmsley@sifive.com> L: linux-riscv@lists.infradead.org T: git git://github.com/sifive/riscv-linux.git S: Supported -K: sifive +K: ^[@]sifive N: sifive SILEAD TOUCHSCREEN DRIVER Anyone have a better idea?
On Thu, May 23, 2019 at 02:45:44PM -0700, Alan Mikhak wrote: > Set endpoint controller pointer to null in pci_epc_remove_epf() > to avoid -EBUSY on subsequent call to pci_epc_add_epf(). > > Requires checking for null endpoint function pointer. > > Signed-off-by: Alan Mikhak <alan.mikhak@sifive.com> > --- > drivers/pci/endpoint/pci-epc-core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied to pci/endpoint for v5.3, thanks. Lorenzo > diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c > index e4712a0f249c..2091508c1620 100644 > --- a/drivers/pci/endpoint/pci-epc-core.c > +++ b/drivers/pci/endpoint/pci-epc-core.c > @@ -519,11 +519,12 @@ void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf) > { > unsigned long flags; > > - if (!epc || IS_ERR(epc)) > + if (!epc || IS_ERR(epc) || !epf) > return; > > spin_lock_irqsave(&epc->lock, flags); > list_del(&epf->list); > + epf->epc = NULL; > spin_unlock_irqrestore(&epc->lock, flags); > } > EXPORT_SYMBOL_GPL(pci_epc_remove_epf); > -- > 2.7.4 >
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index e4712a0f249c..2091508c1620 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -519,11 +519,12 @@ void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf) { unsigned long flags; - if (!epc || IS_ERR(epc)) + if (!epc || IS_ERR(epc) || !epf) return; spin_lock_irqsave(&epc->lock, flags); list_del(&epf->list); + epf->epc = NULL; spin_unlock_irqrestore(&epc->lock, flags); } EXPORT_SYMBOL_GPL(pci_epc_remove_epf);
Set endpoint controller pointer to null in pci_epc_remove_epf() to avoid -EBUSY on subsequent call to pci_epc_add_epf(). Requires checking for null endpoint function pointer. Signed-off-by: Alan Mikhak <alan.mikhak@sifive.com> --- drivers/pci/endpoint/pci-epc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)