From: Frank Li <Frank.li@nxp.com>
To: Zijun Hu <zijun_hu@icloud.com>
Cc: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Joao Pinto" <jpinto@synopsys.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Wei Yongjun" <weiyongjun1@huawei.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
"Zijun Hu" <quic_zijuhu@quicinc.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v3 3/3] PCI: endpoint: Fix API pci_epf_add_vepf() returning -EBUSY error
Date: Thu, 12 Dec 2024 13:03:05 -0500 [thread overview]
Message-ID: <Z1slWQ2xkP80HscH@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20241210-pci-epc-core_fix-v3-3-4d86dd573e4b@quicinc.com>
On Tue, Dec 10, 2024 at 10:00:20PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
>
> pci_epf_add_vepf() will suffer -EBUSY error by steps below:
>
> pci_epf_add_vepf(@epf_pf, @epf_vf) // add
> pci_epf_remove_vepf(@epf_pf, @epf_vf) // remove
> pci_epf_add_vepf(@epf_pf, @epf_vf) // add again, -EBUSY error.
nit: can you align comments to the same column?
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> Fix by clearing @epf_vf->epf_pf in pci_epf_remove_vepf().
>
> Fixes: 1cf362e907f3 ("PCI: endpoint: Add support to add virtual function in endpoint core")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
> drivers/pci/endpoint/pci-epf-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c
> index 8fa2797d4169a9f21136bbf73daa818da6c4ac49..50bc2892a36c54aa82c819ac5a9c99e9155d92c1 100644
> --- a/drivers/pci/endpoint/pci-epf-core.c
> +++ b/drivers/pci/endpoint/pci-epf-core.c
> @@ -202,6 +202,7 @@ void pci_epf_remove_vepf(struct pci_epf *epf_pf, struct pci_epf *epf_vf)
>
> mutex_lock(&epf_pf->lock);
> clear_bit(epf_vf->vfunc_no, &epf_pf->vfunction_num_map);
> + epf_vf->epf_pf = NULL;
> list_del(&epf_vf->list);
> mutex_unlock(&epf_pf->lock);
> }
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2024-12-12 18:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 14:00 [PATCH v3 0/3] PCI: endpoint: fix bug for 2 APIs and simplify 1 API Zijun Hu
2024-12-10 14:00 ` [PATCH v3 1/3] PCI: endpoint: Fix that API devm_pci_epc_destroy() fails to destroy the EPC device Zijun Hu
2024-12-10 14:00 ` [PATCH v3 2/3] PCI: endpoint: Simplify API pci_epc_get() implementation Zijun Hu
2024-12-12 18:00 ` Frank Li
2024-12-10 14:00 ` [PATCH v3 3/3] PCI: endpoint: Fix API pci_epf_add_vepf() returning -EBUSY error Zijun Hu
2024-12-12 18:03 ` Frank Li [this message]
2024-12-12 9:35 ` [PATCH v3 0/3] PCI: endpoint: fix bug for 2 APIs and simplify 1 API Dan Carpenter
2024-12-12 11:56 ` Zijun Hu
2024-12-12 19:12 ` Bjorn Helgaas
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=Z1slWQ2xkP80HscH@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=bhelgaas@google.com \
--cc=jpinto@synopsys.com \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=quic_zijuhu@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=weiyongjun1@huawei.com \
--cc=zijun_hu@icloud.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
all inboxes | Powered by JetHome®