The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Vikash Bansal <bvikas@vmware.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "bhelgaas@google.com" <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Srivatsa Bhat <srivatsab@vmware.com>,
	"srivatsa@csail.mit.edu" <srivatsa@csail.mit.edu>,
	Alexey Makhalov <amakhalov@vmware.com>,
	Srinidhi Rao <srinidhir@vmware.com>,
	Anish Swaminathan <anishs@vmware.com>,
	Vasavi Sirnapalli <vsirnapalli@vmware.com>,
	Ajay Kaher <akaher@vmware.com>
Subject: Re: [PATCH] PCI: Speed up device init by parsing capabilities all at once
Date: Sat, 22 Jan 2022 19:09:09 +0000	[thread overview]
Message-ID: <F4FA5791-E19A-4D6D-9EE7-705CEC174BA1@vmware.com> (raw)
In-Reply-To: <195F50E8-2E4D-416B-A24A-4602321FABB7@vmware.com>

        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@vmware.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
        





  reply	other threads:[~2022-01-22 19:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1642526161-22499-1-git-send-email-bvikas@vmware.com>
2022-01-20  6:26 ` [PATCH] PCI: Speed up device init by parsing capabilities all at once Greg KH
2022-01-20 17:31   ` Vikash Bansal
2022-01-22 19:09     ` Vikash Bansal [this message]
2022-01-21 17:26   ` Vikash Bansal
2022-01-21 19:42     ` Bjorn Helgaas
2022-01-22  2:12       ` Srivatsa S. Bhat
2022-01-22 18:51         ` Vikash Bansal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F4FA5791-E19A-4D6D-9EE7-705CEC174BA1@vmware.com \
    --to=bvikas@vmware.com \
    --cc=akaher@vmware.com \
    --cc=amakhalov@vmware.com \
    --cc=anishs@vmware.com \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=srinidhir@vmware.com \
    --cc=srivatsa@csail.mit.edu \
    --cc=srivatsab@vmware.com \
    --cc=vsirnapalli@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox