mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	rdh@east.sun.com, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH] pci/pcie: Avoid unnecessary PCIe link retrains
Date: Fri, 6 Nov 2009 14:00:28 -0800	[thread overview]
Message-ID: <20091106140028.6242cb94@jbarnes-piketon> (raw)
In-Reply-To: <4AF240E7.8050200@jp.fujitsu.com>

On Thu, 05 Nov 2009 12:05:11 +0900
Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> wrote:
> 
> There are a lot of codes that searches PCI express capability offset
> in the PCI configuration space using pci_find_capability(). Caching it
> in the struct pci_dev will reduce unncecessary search. This patch adds
> an additional 'pcie_cap' fields into struct pci_dev, which is
> initialized at pci device scan time (in set_pcie_port_type()).
> 
> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
> 
> ---
>  drivers/pci/probe.c |    1 +
>  include/linux/pci.h |    1 +
>  2 files changed, 2 insertions(+)
> 
> Index: 20090825/drivers/pci/probe.c
> ===================================================================
> --- 20090825.orig/drivers/pci/probe.c
> +++ 20090825/drivers/pci/probe.c
> @@ -693,6 +693,7 @@ static void set_pcie_port_type(struct pc
>  	if (!pos)
>  		return;
>  	pdev->is_pcie = 1;
> +	pdev->pcie_cap = pos;
>  	pci_read_config_word(pdev, pos + PCI_EXP_FLAGS, &reg16);
>  	pdev->pcie_type = (reg16 & PCI_EXP_FLAGS_TYPE) >> 4;
>  }
> Index: 20090825/include/linux/pci.h
> ===================================================================
> --- 20090825.orig/include/linux/pci.h
> +++ 20090825/include/linux/pci.h
> @@ -218,6 +218,7 @@ struct pci_dev {
>  	unsigned int	class;		/* 3 bytes:
> (base,sub,prog-if) */ u8		revision;	/* PCI
> revision, low byte of class word */ u8
> hdr_type;	/* PCI header type (`multi' flag masked out) */
> +	u8		pcie_cap;	/* PCI-E capability
> offset */ u8		pcie_type;	/* PCI-E device/port
> type */ u8		rom_base_reg;	/* which config
> register controls the ROM */ u8		pin;
> 		/* which interrupt pin this device uses */
> 
> 

Applied this one to linux-next, thanks Kenji-san.

-- 
Jesse Barnes, Intel Open Source Technology Center

  parent reply	other threads:[~2009-11-06 22:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-03 21:38 RDH
2009-11-04 19:03 ` Jesse Barnes
2009-11-04 23:28   ` Bjorn Helgaas
2009-11-05  3:05     ` Kenji Kaneshige
2009-11-05 18:59       ` Bjorn Helgaas
2009-11-05 19:07         ` Matthew Wilcox
2009-11-05 20:29           ` Bjorn Helgaas
2009-11-06  1:15             ` Kenji Kaneshige
2009-11-05 19:11       ` Matthew Wilcox
2009-11-06  2:48         ` Kenji Kaneshige
2009-11-06 22:00       ` Jesse Barnes [this message]
2009-11-05  1:38   ` Kenji Kaneshige

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=20091106140028.6242cb94@jbarnes-piketon \
    --to=jbarnes@virtuousgeek.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rdh@east.sun.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

all inboxes | Powered by JetHome®