From patchwork Thu Feb 4 22:44:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 8229341 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 92D889F6DA for ; Thu, 4 Feb 2016 23:13:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E38FC20397 for ; Thu, 4 Feb 2016 23:13:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1123620392 for ; Thu, 4 Feb 2016 23:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752199AbcBDXNG (ORCPT ); Thu, 4 Feb 2016 18:13:06 -0500 Received: from mail.kernel.org ([198.145.29.136]:57690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755811AbcBDWo7 (ORCPT ); Thu, 4 Feb 2016 17:44:59 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92014200C1; Thu, 4 Feb 2016 22:44:58 +0000 (UTC) Received: from localhost (unknown [69.71.1.1]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68AB5202BE; Thu, 4 Feb 2016 22:44:57 +0000 (UTC) Date: Thu, 4 Feb 2016 16:44:56 -0600 From: Bjorn Helgaas To: Manish Jaggi Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Tirumalesh Chalamarla , "Richter, Robert" Subject: Re: [PATCH] PCI: Add cavium acs pci quirk Message-ID: <20160204224456.GF7031@localhost> References: <56ABC5AE.1050209@caviumnetworks.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <56ABC5AE.1050209@caviumnetworks.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-7.4 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 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 On Sat, Jan 30, 2016 at 01:33:58AM +0530, Manish Jaggi wrote: > > 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 Applied as follows to pci/virtualization for v4.6, thanks, Manish! Note that this quirk applies to *all* Cavium devices. I assume that's what you want; I only mention it because your comment says "Cavium devices matching this quirk ...", which is all of them because the code says PCI_ANY_ID. Bjorn commit b404bcfbf035413dcce539c8ba2c9986d220d8ed Author: Manish Jaggi Date: Sat Jan 30 01:33:58 2016 +0530 PCI: Add ACS quirk for all Cavium devices 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. Signed-off-by: Manish Jaggi Signed-off-by: Bjorn Helgaas Acked-by: Tirumalesh Chalamarla --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 0575a1e..85fa6a2a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3832,6 +3832,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 @@ -3984,6 +3997,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 } };