linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wesley Sheng <wesley.sheng@microchip.com>
To: <kurt.schwemmer@microsemi.com>, <logang@deltatee.com>,
	<bhelgaas@google.com>, <linux-pci@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <wesleyshenggit@sina.com>, <wesley.sheng@microchip.com>
Subject: [PATCH 1/5] switchtec: Remove immediate status check after submit a MRPC command
Date: Thu, 15 Nov 2018 17:44:00 +0800	[thread overview]
Message-ID: <1542275044-10970-2-git-send-email-wesley.sheng@microchip.com> (raw)
In-Reply-To: <1542275044-10970-1-git-send-email-wesley.sheng@microchip.com>

From: Kelvin Cao <kelvin.cao@microchip.com>

After submitting a Firmware Download MRPC command, Switchtec firmware will
delay Management EP BAR MemRd TLP responses by more than 10ms. This is a
firmware limitation. Delayed MemRd completions are problem for systems with
a low Completion Timeout (CTO).

The current driver checks the MRPC status immediately after submitting an
MRPC command, which results in the MemRd TLP that's affected by the above
limitation.

Remove the immediate status check and rely on the check after receiving an
interrupt or timing out.

This is only a software workaround to the READ issue and a proper fix of
this should be done in firmware.

Fixes: 080b47def5e5 ("MicroSemi Switchtec management interface driver")
Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com>
Signed-off-by: Wesley Sheng <wesley.sheng@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 54a8b30..d2bca2d 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -134,10 +134,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


  parent reply	other threads:[~2018-11-15  3:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-15  9:43 [PATCH 0/5] Switchtec MRPC DMA mode support Wesley Sheng
2018-11-15  6:03 ` Logan Gunthorpe
2018-11-15  9:44 ` Wesley Sheng [this message]
2018-11-15  9:44 ` [PATCH 2/5] switchtec: Set DMA coherent mask in Switchtec driver Wesley Sheng
2018-11-15  9:44 ` [PATCH 3/5] switchtec: A temporary variable should be used for the flags of switchtec_ioctl_event_ctl Wesley Sheng
2018-11-15  9:44 ` [PATCH 4/5] switchtec: Improve MRPC efficiency by leveraging write combining Wesley Sheng
2018-11-15  9:44 ` [PATCH 5/5] switchtec: MRPC DMA mode implementation Wesley Sheng
2018-12-10  9:12 [PATCH 0/5] Switchtec MRPC DMA mode support Wesley Sheng
2018-12-10  9:12 ` [PATCH 1/5] switchtec: Remove immediate status check after submit a MRPC command Wesley Sheng

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=1542275044-10970-2-git-send-email-wesley.sheng@microchip.com \
    --to=wesley.sheng@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 \
    --cc=wesleyshenggit@sina.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).