From patchwork Tue Oct 17 12:47:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Lomovtsev X-Patchwork-Id: 10011907 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 24985600CC for ; Tue, 17 Oct 2017 12:48:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15FEB2889E for ; Tue, 17 Oct 2017 12:48:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A83F288A0; Tue, 17 Oct 2017 12:48:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C5992889E for ; Tue, 17 Oct 2017 12:48:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761983AbdJQMs1 (ORCPT ); Tue, 17 Oct 2017 08:48:27 -0400 Received: from mail-by2nam01on0074.outbound.protection.outlook.com ([104.47.34.74]:53536 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1761970AbdJQMsY (ORCPT ); Tue, 17 Oct 2017 08:48:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=njXVpcxZHrtWr8wlz6WRMPP5ffuRfW4Qo19xWp3NeFk=; b=le9Dclu2THoNlfA1EX7UR1aBThStmu8wC1Srwn1vjEzWKku/S3TTiUG3syqJGUbmNPqq59FnUwFA4I46s1taiJN3dX5i2MNlhT5Al2W7HhA0WOLVuo6eXbG3uCxQhubSQv0tndxZlq4Ahw5R48dtPEvc/M2FsTNpCcT2foIZT98= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Vadim.Lomovtsev@cavium.com; Received: from localhost.localdomain.com (50.233.148.156) by BN6PR07MB2993.namprd07.prod.outlook.com (10.172.106.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 17 Oct 2017 12:48:21 +0000 From: Vadim Lomovtsev To: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, alex.williamson@redhat.com Cc: Wilson.Snyder@cavium.com, robert.richter@cavium.com, david.daney@cavium.com, mjaggi@caviumnetworks.com, Vadim Lomovtsev Subject: [PATCH v7 1/2] PCI: quirks: Set Cavium ACS capability quirk flags to assert RR/CR/SV/UF. Date: Tue, 17 Oct 2017 05:47:38 -0700 Message-Id: <1508244459-2615-2-git-send-email-Vadim.Lomovtsev@caviumnetworks.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1508244459-2615-1-git-send-email-Vadim.Lomovtsev@caviumnetworks.com> References: <1506536439-29318-1-git-send-email-Vadim.Lomovtsev@caviumnetworks.com> <1508244459-2615-1-git-send-email-Vadim.Lomovtsev@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: MWHPR15CA0050.namprd15.prod.outlook.com (10.174.254.12) To BN6PR07MB2993.namprd07.prod.outlook.com (10.172.106.11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38a29d98-7081-4185-3f30-08d5155d5a07 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB2993; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB2993; 3:Vdd4ARUj1xOnWKWhIRzWzxen+7fCwsk9vffVprOHWqp6xjMw0Ygqyu12tIOFSx+zZpuW6YbyW2Y7rnFWbs8zhgq6c9PRFibr36nuQhX2+1/jlo8Owtzo1a68bLEOSo9EJpCY/pLpxuZBb/KXBsfVbClJtgzzyTzFP8VUHuFrD7EyvKkEy7XyNtGu/gu+WaX+5zRoezwHG3LqwdxUFsIns8lxDYJBpryDuSdTSfmAAUbHYMeKEqBnJiMDz0+chu6N; 25:dKnoDR07TPdyZdgkCplGilSqH6FDKF/Cww0t92ukr1bBLJGmjPNTlJXa7gSOCK8/DfyYFSg87Oxk92Tw21xbJGTsSy8q2XkEL79WCIG3SNt5c8PFVQjewhzXN/yGTHU37GQMgW7Uo7EYa97g1NNDDtZxlGMybJwvy1wnvhdHzmxIDc4GImvAjzoOVHzZzZy2QnW0Bs1+pFuTGODVkhg8aspZ57CEQnG/rliqDg/XVL0Nne6OTY1o4u1/Vm+iVDtYEODiMumujcJfwv2F6ZnhaBTzmslBwGROfBMRK2a+b2p6F50Y4dj1Nanb+ek7Dj82Qpw5RdcLVpR0h3e8vmTXhw==; 31:ApTvi/lXXuqs0R55nmivX/ZxRu1hNP9MlXrfNNX5t+V+2T5ssfiF0tVWZ4FyyYSsf1474nuxtrOsUe9acD0wI4PZtn6nenjk7TcVD7FmiKUtqYGpMsmJvPQkA8ZhdC/w/eUVbeeLNKssULbWAb/FxiQHtPD9ppdPjH1GjFAyhp0A8M65oUVtOE04V6NJs30NwDXzACtsztovnPbEJ+e6gL3mx70XZeNcWK59JQSW5N8= X-MS-TrafficTypeDiagnostic: BN6PR07MB2993: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB2993; 20:YoKqIuUvlFnzhyjsfkM2IHoja23cZ92yMdmL9cKuw6kHiRdtXCtOJSCBjQX/iC3lHY4APj7xFzP8VO4wMXd40diTebFPMA9PPmQWgAyjOfgZQ36hTU5dhWELwgh0viPtI64DQurjmrwPgOlNYzKWTTV5xfq8AvbXKmVKP0H+OGPSoe7jCm67jjVCoe/Ko7W8IRIS+1LL5Yr1sHSFiKh/f62e+cMkUT+n8+6zkcpIozTGNvFWfVeDbTtiA1OWfkK1bzvkmOq+ihXsasywGHl8H/gkP8uxDefajFop8jIpjZBJKSb9+ssqo17BG1jhfYX/IpSJC8FYYyI4HoaqbIdjBqHMo2TCY7euNeznxwjY6Jr8cLgXTZeIpZKLqcIfVRsrUgXyFjBteo8XXSX/sBXccbNubxCtcqs3Yzrf6YMyT3FIR1C2cv3RqZHzzxG1+x2mViZ/8kwpgWbyIixTjHJyZIEuhCNHlHfV3GU1DglC7moU2ofRWnxrVENJ29heGztulQKfw2PddJpnVaUKpevfp8i/Wn4mkVSYj15xbR1IaGRg6GYlvYFzJSF4HBgBJ2CqGIVKQGUfcWlXMMuk3KCkP65cCJTPOazOoWxVyWHuCV4=; 4:vPNyNIRMm4VVGi+3R7VNFMQgflI8IYZBBiUCLuJKDKnCyGxCZgd0nnYEQuYSe0r2Es7rLLN+XSpE0qUhIT5vY8ArJIEXFP/oybtpHWYI7z4Ypi/2w6Jx+7qFw2axDNEQMkBnix81XFMbDWZkVlTvjR19tzGsINX0YMKWZVdn4/f/3SMWZV+DvU8WxWALKKbye4qzzrreqFQOKxCfWwfJL+tn0pO8QfyYkuHK39GgHB2odcFXop6Y88P/Ads4opTD X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(6041248)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB2993; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB2993; X-Forefront-PRVS: 04631F8F77 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(346002)(376002)(199003)(189002)(50226002)(3846002)(305945005)(4326008)(50466002)(575784001)(105586002)(5003940100001)(53416004)(69596002)(16586007)(72206003)(25786009)(16526018)(53936002)(478600001)(36756003)(97736004)(48376002)(6116002)(6512007)(5660300001)(2906002)(101416001)(2950100002)(68736007)(8676002)(42882006)(6486002)(8936002)(316002)(81166006)(50986999)(47776003)(76176999)(7736002)(106356001)(6506006)(189998001)(107886003)(66066001)(81156014)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB2993; H:localhost.localdomain.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB2993; 23:NRJc55lTsKEZQ1Ux365AbIqhlGo4ZCgMWeVWZCLXz?= =?us-ascii?Q?0FCb3HSoZs7QbTNMJngreWaQhe6VCLmvUJeM+RALfwAvk+v2lFupohVqFuvk?= =?us-ascii?Q?J6DNuqp0idN6KEDl1Vk4EZky2ywquiBYN2dz7LQxm/ih9hZ6gsoZCAqnFNWW?= =?us-ascii?Q?oVHwssDh2/GfDxL/YE9pmk+udpPVTRLgNLrAI2VIj9SMw2mSJDbZqfi/s3rn?= =?us-ascii?Q?t8inEQh4iYyFqZlgMdPI+fXq8jwP6UgiuGWlm/qLQJ1Hmg+NajJfP16MDzU8?= =?us-ascii?Q?mjA6lV1gjCaOphIDkRiXr2/HpmONibpoXfqjhJXbMIDAtwebfplSqLFFqVHi?= =?us-ascii?Q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kg1hu8jFve7WoSAnA68W6Ed6L7Jmy9FeqmkEFy5Cmn5rsnDse2TSfllpPznlaj+mvRoesX3vIWQw4XbvXXAo2ZJfQXroWwOsuKE2+r3ci+bYi73CSesyRZjW05kUV3UUCnGEaYEH1KqdcPYCOo8mrE2o3kA560YPzd4nNzLBRWhrsaalqTmo+Xs2Y/yyse9g7e+I0DQpAG4MgP9bU/A035gZ8AfAD6gSN2C6aki7K7CBBNrk4qgEFkNjPVZuwNoc5f0dtkECeBItNXuHZFDrbousaTI6drM/hPUpK59QVVQ==; 5:6FvoOp8U2BMV6dabJoFjJz5r0ZNuDtROdYSp9685f1QYbc1dH4n7tXEC5n6/DaKxVhTffPklnJvytDnZ5jIyRL7GF9mvYKpCvvZFQLLAK8QtLcP4EpNni18Jl+qz5NM0yHhY/q4+TXum3k7uKpn2BA==; 24:ol4TSjbZuteIgZLKPb41NpZCck2Mj/Z3LNrX25NOLJyiX8skQ/GhgRhvISulfoyg9yAdXYluTftBkIWNg6Y+crs3cv9h4MPnLqU86JjwSa8=; 7:rQe+/ivGTT2r+DNtd9lM5kl16sPE3eekTGCw9uq3Lu+weEmjxtV9sRxoVmNfhlJO4NEwQW9XAEXmC1BEbkGKa2UHrqIlzrZHltC4p1wT0YzVkN4IcZX7byx+qK5vsD+XWO73KVqbWX4uLEioyoqNM3+QKXQJmrvf8VX69x/Z9ZiQOT4iqkk6ElQykWiLlH2lo4L1k8XRhsqBsidE7ZD+kAJypgvg7aOHG1EY1YPwmrE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2017 12:48:21.8265 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB2993 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vadim Lomovtsev The Cavium ThunderX (CN8XXX) family PCIe Root Ports has limited PCI capabilities in terms of no ACS support advertisement. However, the RTL internally implements similar protection as if ACS had completion/request redirection, upstream forwarding and validation features enabled. This commit changes Cavium ACS capabilities quirk flags accordingly. Signed-off-by: Vadim Lomovtsev --- drivers/pci/quirks.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a4d33619a7bb..5e0e83304fda 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -4214,12 +4214,13 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags) { /* - * Cavium devices matching this quirk do not perform peer-to-peer - * with other functions, allowing masking out these bits as if they - * were unimplemented in the ACS capability. + * The Cavium downstream ports doesn't advertise their ACS capability + * registers. However, the RTL internally implements similar protection + * as if ACS had completion redirection, forwarding and validation + * features enabled. So by this flags we're asserting that the hardware + * implements and enables equivalent ACS functionality for these flags. */ - acs_flags &= ~(PCI_ACS_SV | PCI_ACS_TB | PCI_ACS_RR | - PCI_ACS_CR | PCI_ACS_UF | PCI_ACS_DT); + acs_flags &= ~(PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_SV | PCI_ACS_UF); if (!((dev->device >= 0xa000) && (dev->device <= 0xa0ff))) return -ENOTTY;