All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

  • Hannes Reinecke's avatar
    PCI: Determine actual VPD size on first access · 104daa71
    Hannes Reinecke authored
    PCI-2.2 VPD entries have a maximum size of 32k, but might actually be
    smaller than that.  To figure out the actual size one has to read the VPD
    area until the 'end marker' is reached.
    Per spec, reading outside of the VPD space is "not allowed."  In practice,
    it may cause simple read errors or even crash the card.  To make matters
    worse not every PCI card implements this properly, leaving us with no 'end'
    marker or even completely invalid data.
    Try to determine the size of the VPD data when it's first accessed.  If no
    valid data can be read an I/O error will be returned when reading or
    writing the sysfs attribute.
    As the amount of VPD data is unknown initially the size of the sysfs
    attribute will always be set to '0'.
    [bhelgaas: changelog, use 0/1 (not false/true) for bitfield, tweak
    pci_vpd_pci22_read() error checking]
    Tested-by: default avatarShane Seymour <>
    Tested-by: default avatarBabu Moger <>
    Signed-off-by: default avatarHannes Reinecke <>
    Signed-off-by: default avatarBjorn Helgaas <>
    Cc: Alexander Duyck <>
access.c 19.9 KB