From patchwork Fri Jan 24 09:24:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233072 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3879C2D0DB for ; Fri, 24 Jan 2020 11:03:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91EBB2075D for ; Fri, 24 Jan 2020 11:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579863819; bh=Cb+67RHWaiR8x3D2sAd/KGPR4Zt9gdxQz+rLJHNr7t4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ufnnbawo3JTSu/gmUTVcmeyxurot02GLvw08wQK+GbQgQfnKxl9C/QOlD8y9QASkX Fkuo7+Qv9nr1mx764p45ZKkNUMRzC3A/ZMcEFcllb6SBURawP+31WqIxDxsToXHwAl HGFDG0IBGP0R0PdgEGeNmMJwr7NIQxq3WehuZHgQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388366AbgAXLDi (ORCPT ); Fri, 24 Jan 2020 06:03:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:37460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388348AbgAXLDg (ORCPT ); Fri, 24 Jan 2020 06:03:36 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39DC52071A; Fri, 24 Jan 2020 11:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579863816; bh=Cb+67RHWaiR8x3D2sAd/KGPR4Zt9gdxQz+rLJHNr7t4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uvClaLhNRNs6WQwLPHc/JqoWJOXDo6REOYShG0zXx8JaG39r6/j/qyCAcszM3wxdw lMLvvaWydMlK2zULQuWtaAncrzyO2FsMzStKtg48aiqO/qFsVf2IVTlB1QNwq24hzB 4f8ilRcXlktfQgcsU12uhwsvVSOwUroZLCyzf2Ns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kelvin Cao , Wesley Sheng , Bjorn Helgaas , Logan Gunthorpe , Sasha Levin Subject: [PATCH 4.19 083/639] switchtec: Remove immediate status check after submitting MRPC command Date: Fri, 24 Jan 2020 10:24:13 +0100 Message-Id: <20200124093057.770531375@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kelvin Cao [ Upstream commit 526180408b815aa7b96fd48bd23cdd33ef04e38e ] 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 a 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 a delayed MemRd completion that may cause a Completion Timeout. 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 Signed-off-by: Wesley Sheng Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe Signed-off-by: Sasha Levin --- 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 5aaa4ce04ec3d..ceb7ab3ba3d09 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)); }