[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <F4FA5791-E19A-4D6D-9EE7-705CEC174BA1@vmware.com>
Date: Sat, 22 Jan 2022 19:09:09 +0000
From: Vikash Bansal <bvikas@...are.com>
To: Greg KH <gregkh@...uxfoundation.org>
CC: "bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Srivatsa Bhat <srivatsab@...are.com>,
"srivatsa@...il.mit.edu" <srivatsa@...il.mit.edu>,
Alexey Makhalov <amakhalov@...are.com>,
Srinidhi Rao <srinidhir@...are.com>,
Anish Swaminathan <anishs@...are.com>,
Vasavi Sirnapalli <vsirnapalli@...are.com>,
Ajay Kaher <akaher@...are.com>
Subject: Re: [PATCH] PCI: Speed up device init by parsing capabilities all at
once
In my earlier response, I agreed to few changes suggested by Greg.
I observed some issue while implementing 2 of those changes.
On 20/01/22, 11:01 PM, "Vikash Bansal" <bvikas@...are.com> wrote:
>>> + pci_bus_read_config_word(dev->bus, dev->devfn, pos, &ent);
>>> + id = ent & 0xff;
>>> + if (id == 0xff)
>>> + break;
>>> +
>>> + /* Read first instance of capability */
>>> + if (!(dev->cap_off[id]))
>>> + dev->cap_off[id] = pos;
>>
>>Shouldn't you have checked this before you read the value?
>>
>
>Yes, will move this code
>
Cannot be moved before read, because "id" used in this "if" conditions is
returned by last read.
>>> @@ -1128,6 +1129,7 @@ void pci_sort_breadthfirst(void);
>>>
>>> u8 pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
>>> u8 pci_find_capability(struct pci_dev *dev, int cap);
>>> +void pci_find_all_capabilities(struct pci_dev *dev);
>>
>>Why is this now a global function and not one just local to the pci
>>core? Who else would ever need to call it?
>
>Will make pci_find_all_capabilitie local and move it to probe.c
>
pci_find_all_capabilities function is called only once in probe.c file,
but this function is calling __pci_bus_find_cap_start which is defined in pci.c,
so need to implement this function in pci.c and make it global.
Thanks
Vikash
Powered by blists - more mailing lists