linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Wesley.Sheng@microchip.com>
To: <kurt.schwemmer@microsemi.com>, <Kurt.Schwemmer@microchip.com>,
	<logang@deltatee.com>, <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] switchtec: Remove immediate status check after submit a MRPC command
Date: Thu, 13 Sep 2018 06:43:21 +0000	[thread overview]
Message-ID: <DM2PR11MB0105EC547AFBB2DFA9D05A17951A0@DM2PR11MB0105.namprd11.prod.outlook.com> (raw)

From: Wesley Sheng <Wesley.Sheng@microchip.com>

After submit a Firmware Download (Download sub-command)
MRPC command, switchtec firmware refuses to response
any management EP's BAR access until current flash
programming finished.

During this time, a READ TLP to the gas area in the BAR of
the management EP will complete with significant delay like
more than 10ms.

It's a switchtec firmware limitation that READ requests
cannot get prompt service during firmware download.

The delayed completion of READ TLP would be a problem on
some system which is sensitive to READ timeout.

Current driver check status immediately after submit a
MRPC command, which triggers READ TLP to the gas area in
the BAR of the management EP. Also, other processes or
functions, like NTB, would also trigger READ TLP by accessing
the GAS.

To avoid this, the immediate check of status is removed
in this patch, and driver delays the status check to the
occurrence of MSIx or MRPC timeout. In the meanwhile, user
must not initiate any gas access during a firmware download.

Also, any process that issues MRPC command will be affected
by the delay in this patch.

However, this is only a software workaround to the READ
issue in firmware download. A complete fix of this should
happen in firmware.

Note: For NTB function, the memory window access is handled
by switchtec hardware. So it's not affected by this firmware
limitation. But the GAS accesses, like for doorbell registers,
in the NTB function are affected by this firmware limitation.

Signed-off-by: Kelvin Cao <Kelvin.Cao@microchip.com>
---
 drivers/pci/switch/switchtec.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 4591f15..b759228 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -142,10 +142,6 @@ static void mrpc_cmd_submit(struct switchtec_dev *stdev)
 		    stuser->data, stuser->data_len);
 	iowrite32(stuser->cmd, &stdev->mmio_mrpc->cmd);
 
-	stuser->status = ioread32(&stdev->mmio_mrpc->status);
-	if (stuser->status != SWITCHTEC_MRPC_STATUS_INPROGRESS)
-		mrpc_complete_cmd(stdev);
-
 	schedule_delayed_work(&stdev->mrpc_timeout,
 			      msecs_to_jiffies(500));
 }
-- 
2.7.4

             reply	other threads:[~2018-09-13  6:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13  6:43 Wesley.Sheng [this message]
2018-09-13 16:00 ` [PATCH] switchtec: Remove immediate status check after submit a MRPC command Logan Gunthorpe

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=DM2PR11MB0105EC547AFBB2DFA9D05A17951A0@DM2PR11MB0105.namprd11.prod.outlook.com \
    --to=wesley.sheng@microchip.com \
    --cc=Kurt.Schwemmer@microchip.com \
    --cc=bhelgaas@google.com \
    --cc=kurt.schwemmer@microsemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=logang@deltatee.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;
as well as URLs for NNTP newsgroup(s).