Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1715222
| Path | csiph.com!goblin3!goblin2!goblin.stu.neva.ru!news.unit0.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Kishon Vijay Abraham I <kishon@ti.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 08/18] PCI: endpoint: functions/pci-epf-test: Add support to poll early for host commands |
| Date | Fri, 18 Aug 2017 17:00:02 +0200 |
| Message-ID | <ufQUG-58U-29@gated-at.bofh.it> (permalink) |
| References | <ufQUF-58U-3@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1503068326; bh=zBftX7ZvIAf+i70hp3Jw7XcMnCyb8BxxQfhrLkcgMow=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=S8JtawFCimrpGQmUQjmRccPzoVZ/RdquSMQ4zZY+BgMpwsOdMzB2g0cK2h33qaqVF IjToSrMHQGM/hsXvDBhByKHrEEWfraoo6ghRuMvoUU4kErOgRmKM/3ZEN2ClFUQ/vs pjjbDvxrIZE/mkcGwA7jPSnUib8SjH2B4mT9Bk6Y= |
| X-Mailer | git-send-email 2.11.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| X-Exclaimer-Md-Config | e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 73 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Joao Pinto <Joao.Pinto@synopsys.com>, Arnd Bergmann <arnd@arndb.de>, <gregkh@linuxfoundation.org>, <kishon@ti.com>, <nsekhar@ti.com>, <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org> |
| X-Original-Date | Fri, 18 Aug 2017 20:28:00 +0530 |
| X-Original-Message-ID | <20170818145810.17649-9-kishon@ti.com> |
| X-Original-References | <20170818145810.17649-1-kishon@ti.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1715222 |
Show key headers only | View raw
Certain platforms like TI's K2G doesn't support link-up notification. Add
support to poll early (without waiting for the linkup notification)
for commands from the host.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/pci/endpoint/functions/pci-epf-test.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index e378dae9e510..a0aea2500690 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -55,6 +55,7 @@ struct pci_epf_test {
void *reg[6];
struct pci_epf *epf;
enum pci_barno test_reg_bar;
+ bool linkup_notifier;
struct delayed_work cmd_handler;
};
@@ -77,6 +78,7 @@ static struct pci_epf_header test_header = {
struct pci_epf_test_data {
enum pci_barno test_reg_bar;
+ bool linkup_notifier;
};
static int bar_size[] = { 512, 512, 1024, 16384, 131072, 1048576 };
@@ -424,6 +426,7 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf)
static int pci_epf_test_bind(struct pci_epf *epf)
{
int ret;
+ struct pci_epf_test *epf_test = epf_get_drvdata(epf);
struct pci_epf_header *header = epf->header;
struct pci_epc *epc = epf->epc;
struct device *dev = &epf->dev;
@@ -449,6 +452,9 @@ static int pci_epf_test_bind(struct pci_epf *epf)
if (ret)
return ret;
+ if (!epf_test->linkup_notifier)
+ queue_work(kpcitest_workqueue, &epf_test->cmd_handler.work);
+
return 0;
}
@@ -466,11 +472,14 @@ static int pci_epf_test_probe(struct pci_epf *epf)
const struct pci_epf_device_id *match;
struct pci_epf_test_data *data;
enum pci_barno test_reg_bar = BAR_0;
+ bool linkup_notifier = true;
match = pci_epf_match_device(pci_epf_test_ids, epf);
data = (struct pci_epf_test_data *)match->driver_data;
- if (data)
+ if (data) {
test_reg_bar = data->test_reg_bar;
+ linkup_notifier = data->linkup_notifier;
+ }
epf_test = devm_kzalloc(dev, sizeof(*epf_test), GFP_KERNEL);
if (!epf_test)
@@ -479,6 +488,7 @@ static int pci_epf_test_probe(struct pci_epf *epf)
epf->header = &test_header;
epf_test->epf = epf;
epf_test->test_reg_bar = test_reg_bar;
+ epf_test->linkup_notifier = linkup_notifier;
INIT_DELAYED_WORK(&epf_test->cmd_handler, pci_epf_test_cmd_handler);
--
2.11.0
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 08/18] PCI: endpoint: functions/pci-epf-test: Add support to poll early for host commands Kishon Vijay Abraham I <kishon@ti.com> - 2017-08-18 17:00 +0200
csiph-web