From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: lpieralisi@kernel.org, kw@linux.com
Cc: kishon@kernel.org, bhelgaas@google.com,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: [RESEND PATCH v5 3/9] PCI: endpoint: Warn and return if EPC is started/stopped multiple times
Date: Thu, 1 Jun 2023 20:30:57 +0530 [thread overview]
Message-ID: <20230601150103.12755-4-manivannan.sadhasivam@linaro.org> (raw)
In-Reply-To: <20230601150103.12755-1-manivannan.sadhasivam@linaro.org>
When the EPC is started or stopped multiple times from configfs, just emit
a once time warning and return. There is no need to call the EPC start/stop
functions in those cases.
Reviewed-by: Kishon Vijay Abraham I <kishon@kernel.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/endpoint/pci-ep-cfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
index 4b8ac0ac84d5..62c8e09c59f4 100644
--- a/drivers/pci/endpoint/pci-ep-cfs.c
+++ b/drivers/pci/endpoint/pci-ep-cfs.c
@@ -178,6 +178,9 @@ static ssize_t pci_epc_start_store(struct config_item *item, const char *page,
if (kstrtobool(page, &start) < 0)
return -EINVAL;
+ if (WARN_ON_ONCE(start == epc_group->start))
+ return 0;
+
if (!start) {
pci_epc_stop(epc);
epc_group->start = 0;
--
2.25.1
next prev parent reply other threads:[~2023-06-01 15:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-01 15:00 [RESEND PATCH v5 0/9] Add support for MHI Endpoint function driver Manivannan Sadhasivam
2023-06-01 15:00 ` [RESEND PATCH v5 1/9] PCI: endpoint: Add missing documentation about the MSI/MSI-X range Manivannan Sadhasivam
2023-06-01 15:00 ` [RESEND PATCH v5 2/9] PCI: endpoint: Pass EPF device ID to the probe function Manivannan Sadhasivam
2023-06-01 15:00 ` Manivannan Sadhasivam [this message]
2023-06-01 15:00 ` [RESEND PATCH v5 4/9] PCI: endpoint: Add linkdown notifier support Manivannan Sadhasivam
2023-06-01 15:00 ` [RESEND PATCH v5 5/9] PCI: endpoint: Add BME " Manivannan Sadhasivam
2023-06-01 15:01 ` [RESEND PATCH v5 6/9] PCI: qcom-ep: Add support for Link down notification Manivannan Sadhasivam
2023-06-01 15:01 ` [RESEND PATCH v5 7/9] PCI: qcom-ep: Add support for BME notification Manivannan Sadhasivam
2023-06-01 15:01 ` [RESEND PATCH v5 8/9] PCI: endpoint: Add PCI Endpoint function driver for MHI bus Manivannan Sadhasivam
2023-06-01 15:01 ` [RESEND PATCH v5 9/9] MAINTAINERS: Add PCI MHI endpoint function driver under " Manivannan Sadhasivam
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=20230601150103.12755-4-manivannan.sadhasivam@linaro.org \
--to=manivannan.sadhasivam@linaro.org \
--cc=bhelgaas@google.com \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.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;
as well as URLs for NNTP newsgroup(s).