archive mirror
 help / color / mirror / Atom feed
From: Kunihiko Hayashi <>
To: Kishon Vijay Abraham I <>,
	Lorenzo Pieralisi <>
	Kunihiko Hayashi <>
Subject: [PATCH v2] PCI: endpoint: Fix clearing start entry in configfs
Date: Wed, 26 Feb 2020 14:52:23 +0900	[thread overview]
Message-ID: <> (raw)

After endpoint has started using configfs, if 0 is written to the entry
'start', the controller stops but the entry value remains 1.

At this time, unlinking the function from the controller, WARN_ON_ONCE()
in pci_epc_epf_unlink() will be triggered despite right behavior.

This fixes the issue by clearing the entry when stopping the controller.

Fixes: d74679911610 ("PCI: endpoint: Introduce configfs entry for configuring EP functions")
Cc: Kishon Vijay Abraham I <>
Signed-off-by: Kunihiko Hayashi <>
Acked-by: Kishon Vijay Abraham I <>
 drivers/pci/endpoint/pci-ep-cfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
index d1288a0..4fead88 100644
--- a/drivers/pci/endpoint/pci-ep-cfs.c
+++ b/drivers/pci/endpoint/pci-ep-cfs.c
@@ -58,6 +58,7 @@ static ssize_t pci_epc_start_store(struct config_item *item, const char *page,
 	if (!start) {
+		epc_group->start = 0;
 		return len;

             reply	other threads:[~2020-02-26  5:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  5:52 Kunihiko Hayashi [this message]
2020-03-11 11:18 ` [PATCH v2] PCI: endpoint: Fix clearing start entry in configfs Lorenzo Pieralisi

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).