From patchwork Fri Jan 29 20:03:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Jaggi X-Patchwork-Id: 8167641 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AF9559FBE9 for ; Fri, 29 Jan 2016 21:38:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF80F20390 for ; Fri, 29 Jan 2016 21:38:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 99B8B20211 for ; Fri, 29 Jan 2016 21:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756697AbcA2ViD (ORCPT ); Fri, 29 Jan 2016 16:38:03 -0500 Received: from mail-bn1on0080.outbound.protection.outlook.com ([157.56.110.80]:42696 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753102AbcA2ViB (ORCPT ); Fri, 29 Jan 2016 16:38:01 -0500 Authentication-Results: caviumnetworks.com; dkim=none (message not signed) header.d=none;caviumnetworks.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from [10.19.103.25] (64.2.3.194) by BY1PR0701MB1594.namprd07.prod.outlook.com (10.162.110.148) with Microsoft SMTP Server (TLS) id 15.1.390.13; Fri, 29 Jan 2016 20:04:06 +0000 To: , CC: Tirumalesh Chalamarla , "Richter, Robert" From: Manish Jaggi Subject: [PATCH] PCI: Add cavium acs pci quirk Message-ID: <56ABC5AE.1050209@caviumnetworks.com> Date: Sat, 30 Jan 2016 01:33:58 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: BY1PR0201CA0022.namprd02.prod.outlook.com (25.160.191.160) To BY1PR0701MB1594.namprd07.prod.outlook.com (25.162.110.148) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1594; 2:k5aGYnb4eckNcUXNDJDJotGhIF/imQosRqFb7oaD6VVDC/D9BgjoBWrQ7D4MiYSE0r/llVPQaECsLV1drM829Ma5tZcGMqDeNz3rahe2vax0Xfl/SzK3coCSaXFxxQhm3yqnbMzs5Xwn2q+ND7BA3w==; 3:CZBI9Dx9SK4U+Yv32VtTKYENnOnXzxP0xStQao9E9edOXv7PCyDozkK9A+dxlZoNcVmYYduE/PrkVyL0sYuiB0EvJHavD4R6e7J3GhrnWzEiUQq5e8vpYi4+JofMl8vc; 25:xhhz/1peXSfOSMgHMbo6fLWejJjHR9Z+2XVCphxD6W5fy22WGF7ctG8Eq4xrwXcGC+VTluw24SBfu+qm6aR1dg3RtqWTu2IKmyggQoGd3HQjnd51qyCnJAXPib+PJkaoaDKyK/aZaQ2MyqClTbOWDlIi0WQgh73YAaZcgfIp8rTCnOQ4/UcEXKxU0XPFoWEisETyO7t1+tRp5LIgIRgnML+IZtmV3VZfJWGGb5XAnUonVx7vrOHc+56p5BZjbdUV X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1594; X-MS-Office365-Filtering-Correlation-Id: 054dc010-5186-48e3-92de-08d328e758ab X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1594; 20:DRG/YtL0mW1he5T2KLvQPsfeSDnGwranUz6aMSc7xwD73XR1hiZwZotTsQ42KboOt1HyyM0e58tZ1iDx3+tRgnR338Tg3CVg6Bv/g9oX9dA0P0+kJTSyhQ502gI6gIakhgp1ORKyXrjTs2wTWccpaExV5x0ua61HUZyPmskNJd6JXQoUU0Tc5/ZTzTiLFSWGrTE8BqD3D9EXvjtuJRfLfA44OAOMD5IK/tdOl8XoePMqs+dv08jRfIkzGD1AUlmVBe+zVJtbK4txACp7z6ncV099GvK+s45EbfCPAVzTjn8FEUfHkuDOeiSLYo0huIo8Pti3g116O78l2l6zpMeYMrqhURgwRs5cAsw+rfrbxwvJylBu3eQt+k8yDfSJ1rO4nhiqT0MIjUGUQVFMWxmYGEALMy2PPDiBws6qpkg6iqfGPHAfhD6tLYgwkrYYaNp/ZEnDtRekz1G6jwmO3z7E0BRcOgKTi2Vz/QFKrY6bX0nzSQynCcGCHHbQY5ESpLJEiGNDJMENx6gVwJzkgUOncyC2AciIhesShSVrkjtmVCk/aZrE/FcWuuUEaE/tbj+o1yzA3eRih8alWCmKMzDSP50EUJTPPk+O1+1oa0SXlek= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:BY1PR0701MB1594; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1594; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1594; 4:+Hab1B+qhdgefSpwFzYYwF94G238U/fvzxorZGbvq/abJio6oVC8QN9uRMntD6IOWfBT7ripHM0FH604bsRQl1L/RhuAOLVT4LFJ/doO26ysDfjRVxj61pl8c7jCyhxYJzXQKWl9/mfqo2P1bqCVPbZ8pUyYTAxAoklfGkXscvHt7Lll9DFWuP/r54zJoQaxD7xeH72oMV4/aRvXXwfSTik3a+OYu0NtRPpdUssujKzDgPWC7ftDof0K0r+niPLgmRxmuMpNL8LzdbwEm6DmJ/wVZjN5i9nmy/nEnvGpe/F09lbXsscQ1I1HRfzovvpJaNXBFvyD6lUcFX564GlV11DzIwSTLCNhDLGwmSZBdx2Dj59VUjJ+OL9gBg/Kacpe X-Forefront-PRVS: 083691450C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(4001350100001)(47776003)(107886002)(36756003)(87266999)(65816999)(50466002)(54356999)(19580395003)(19580405001)(87976001)(59896002)(83506001)(5001960100002)(5001770100001)(4001430100002)(50986999)(77096005)(65806001)(5004730100002)(230700001)(229853001)(189998001)(65956001)(23676002)(5008740100001)(64126003)(66066001)(33656002)(122386002)(92566002)(2906002)(40100003)(4326007)(42186005)(1096002)(3846002)(3470700001)(586003)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1594; H:[10.19.103.25]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjA3MDFNQjE1OTQ7MjM6Qm4ydllFVlEybVF4QWF4MVdQM2Q3YkFj?= =?utf-8?B?WXkzSXVqVVNjVzBSTzJLbGV5T2R1bGM5ZVR1T2U0RXVJV2ZIbDkzN1hYSG0w?= =?utf-8?B?cVpHZEhVRXh3WmcwSnhMK2xYTDhOd1dTL2RBbGJZd21vYmM4MzlDZG1iYWFz?= =?utf-8?B?NVdCVUZxTmFVT1Rla0RPUUg5UGdmN3I0Zk9iQURnKzlHUURyc1JsTmtSZFRR?= =?utf-8?B?NlNYdVlDbDEwbHJ5VEo4SUpYcmxsczhwNXpCTFFMdG1WN2FiSFJ3em15REpX?= =?utf-8?B?eGRNUlY3S3dXSjVaaklTK1prTDd4RDYrL2s0NkIySWkyTUNybG5qUVJndVNU?= =?utf-8?B?ZmF2ZFFhVzc1b3ZXOXpQVVZVL0ZoNW5WeXNEOTJjaWk5SlFnUnlhamoxak1j?= =?utf-8?B?M2dYajcxSm53bkhMZkZxMmhtVU56ZjB2QlB1blk5WThReDNZTXdWOFRJNDg0?= =?utf-8?B?UkVjU1ZRa2trNnAzcnQxWnl2L2Q1aWFXeTVPMGJuM2dKT0JvdDI2bzRFQXVr?= =?utf-8?B?R3FiQjF5ZEtzc0djRlZMQzBuclUwNkdvZC9wOUpwcDBJNmh4WFZUcWpOWU1J?= =?utf-8?B?a2Z5UkFtSy8v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puR3FKN0dIR0lLY3BVb09OWFV2bS9zM2JlVDNucW0r?= =?utf-8?Q?uqF?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1594; 5:qeAB8auG67C966f/qEdrh96VwObGb4b9Z+Og4vnTyGyIYS9PNv7FawHmfE8vxOhA+KMCRzoWlWSk7adKrqYoEL73/N8aW4sCYaKxvsLQJ1jGbhLqmGKNhNOk8RFqoSEEqsV1+4oFumUTQJqVJdIb1w==; 24:x4ychLxvD2iiNgTE7HGOwhDUQBFOqa+K9pvOWfdqnrA+uf/JHkCZ+0NhMzKRJvAYUXf0WP5ApansH/0tOzQ7VPjn4cUBGlraWLRR6NQHzME= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2016 20:04:06.0192 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1594 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Acked-by: Tirumalesh Chalamarla Signed-off-by: Manish Jaggi --- drivers/pci/quirks.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 7e32730..a300fa6 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3814,6 +3814,19 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) #endif } +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. + */ + acs_flags &= ~(PCI_ACS_SV | PCI_ACS_TB | PCI_ACS_RR | + PCI_ACS_CR | PCI_ACS_UF | PCI_ACS_DT); + + return acs_flags ? 0 : 1; +} + /* * Many Intel PCH root ports do provide ACS-like features to disable peer * transactions and validate bus numbers in requests, but do not provide an @@ -3966,6 +3979,8 @@ static const struct pci_dev_acs_enabled { { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs }, { 0x19a2, 0x710, pci_quirk_mf_endpoint_acs }, /* Emulex BE3-R */ { 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */ + /* Cavium ThunderX */ + { PCI_VENDOR_ID_CAVIUM, PCI_ANY_ID, pci_quirk_cavium_acs }, { 0 } };