From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932085AbeAQTDI (ORCPT ); Wed, 17 Jan 2018 14:03:08 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:4017 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbeAQTDG (ORCPT ); Wed, 17 Jan 2018 14:03:06 -0500 X-IronPort-AV: E=Sophos;i="5.46,372,1511827200"; d="scan'208";a="703944754" Subject: Re: [PATCH] pci: Do not read INTx PIN and LINE registers for virtual functions To: Alex Williamson , KarimAllah Ahmed CC: , Bjorn Helgaas , , "=?UTF-8?Q?Jan_H_._Sch=c3=b6nherr?=" References: <1516213829-14844-1-git-send-email-karahmed@amazon.de> <20180117114944.4835c296@w520.home> From: KarimAllah Ahmed Message-ID: Date: Wed, 17 Jan 2018 20:02:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180117114944.4835c296@w520.home> Content-Language: en-US X-Originating-IP: [10.43.160.43] X-ClientProxiedBy: EX13D22UWC004.ant.amazon.com (10.43.162.198) To EX13D01EUB001.ant.amazon.com (10.43.166.194) Content-Type: text/plain; charset="utf-8"; format="flowed" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id w0HJ3DtF032038 On 01/17/2018 07:49 PM, Alex Williamson wrote: > On Wed, 17 Jan 2018 19:30:29 +0100 > KarimAllah Ahmed wrote: > >> ... since INTx is not supported by-spec for virtual functions. > But the spec also states that VFs must implement the interrupt pin > register as read-only zero, so either this is redundant or it's a > workaround for VFs that aren't quite compliant? Thanks, The end goal for me is just to NOT do the read across the PCI bus for no good reason. We have devices with thousands of virtual functions and this read is simply not useful in this case and can be optimized as I did. So from a functionality point of view probably the patch does not add any value as you mentioned, but it is really useful as a micro-optimization. > > Alex > >> Cc: Bjorn Helgaas >> Cc: linux-pci@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: KarimAllah Ahmed >> Signed-off-by: Jan H. Schönherr >> --- >> drivers/pci/probe.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c >> index 65099d0..61002fb 100644 >> --- a/drivers/pci/probe.c >> +++ b/drivers/pci/probe.c >> @@ -1232,6 +1232,13 @@ static void pci_read_irq(struct pci_dev *dev) >> { >> unsigned char irq; >> >> + /* Virtual functions do not have INTx support */ >> + if (dev->is_virtfn) { >> + dev->pin = 0; >> + dev->irq = 0; >> + return; >> + } >> + >> pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &irq); >> dev->pin = irq; >> if (irq) > Amazon Development Center Germany GmbH Berlin - Dresden - Aachen main office: Krausenstr. 38, 10117 Berlin Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger Ust-ID: DE289237879 Eingetragen am Amtsgericht Charlottenburg HRB 149173 B