mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Matthew Wilcox <matthew@wil.cx>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: [PATCH 0/2] PCI 2.1 VPD support
Date: Fri, 13 Jun 2008 22:27:44 +0100	[thread overview]
Message-ID: <20080613212743.GZ11300@solarflare.com> (raw)

PCI 2.1 specifies a way to provide VPD in the expansion ROM.  This patch
series exposes that in the same way as PCI 2.2 VPD.

I do not have any production devices with VPD in ROM so I reflashed a NIC
with an image including it.  This code should be tested against some
production ROMs since I may have misinterpreted the specification both
when reading and writing!

There are two remaining aspects of this that I'm not quite happy about:

1. I understand that the expansion ROM may share a decoder with BAR 0,
which makes expansion ROM access dangerous when a driver is loaded.  The
sysfs "rom" attribute must be specifically read-enabled by writing to it,
which I assume is intended to protect against this.  Perhaps
pci_vpd_pci21_read() should test pdev->rom_attr_enabled?

2. PCI resource allocation may fail during pci_scan_device() and
therefore I could not insert the call to pci_vpd_pci21_init() there.
Instead I added it to pci_create_sysfs_dev_files() - but I don't really
think this function should be probing.  Is there a better place to add
the call?

Ben.

Ben Hutchings (2):
  PCI: ROM access changes to support PCI 2.1 VPD
  PCI: Expose PCI 2.1 VPD through sysfs

 drivers/pci/pci-sysfs.c |    2 +-
 drivers/pci/pci.h       |    1 +
 drivers/pci/rom.c       |  245 +++++++++++++++++++++++++++++++++++++++--------
 3 files changed, 206 insertions(+), 42 deletions(-)

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

             reply	other threads:[~2008-06-13 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-13 21:27 Ben Hutchings [this message]
2008-06-16 23:13 ` Jesse Barnes

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=20080613212743.GZ11300@solarflare.com \
    --to=bhutchings@solarflare.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matthew@wil.cx \
    /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®