diff options
| author | Dan Williams <dan.j.williams@intel.com> | 2025-11-12 18:14:43 -0800 |
|---|---|---|
| committer | Dan Williams <dan.j.williams@intel.com> | 2025-11-14 15:06:57 -0800 |
| commit | 079115370d00c78ef69b31dd15def90adf2aa579 (patch) | |
| tree | e1e4858d3ede2d62add04710f764eb9985e0df76 /drivers/pci/pci.h | |
| parent | f86e51399c2a911a5b01d441de513f17bf773856 (diff) | |
PCI/IDE: Initialize an ID for all IDE streams
The PCIe spec defines two types of streams - selective and link. Each
stream has an ID from the same bucket so a stream ID does not tell the
type. The spec defines an "enable" bit for every stream and required
stream IDs to be unique among all enabled stream but there is no such
requirement for disabled streams.
However, when IDE_KM is programming keys, an IDE-capable device needs
to know the type of stream being programmed to write it directly to
the hardware as keys are relatively large, possibly many of them and
devices often struggle with keeping around rather big data not being
used.
Walk through all streams on a device and initialise the IDs to some
unique number, both link and selective.
The weakest part of this proposal is the host bridge ide_stream_ids_ida.
Technically, a Stream ID only needs to be unique within a given partner
pair. However, with "anonymous" / unassigned streams there is no convenient
place to track the available ids. Proceed with an ida in the host bridge
for now, but consider moving this tracking to be an ide_stream_ids_ida per
device.
Co-developed-by: Alexey Kardashevskiy <aik@amd.com>
Signed-off-by: Alexey Kardashevskiy <aik@amd.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20251113021446.436830-6-dan.j.williams@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/pci/pci.h')
| -rw-r--r-- | drivers/pci/pci.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index f6ffe5ee4717..641c0b53c4e3 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -616,10 +616,12 @@ static inline void pci_doe_sysfs_teardown(struct pci_dev *pdev) { } #ifdef CONFIG_PCI_IDE void pci_ide_init(struct pci_dev *dev); void pci_ide_init_host_bridge(struct pci_host_bridge *hb); +void pci_ide_destroy(struct pci_dev *dev); extern const struct attribute_group pci_ide_attr_group; #else static inline void pci_ide_init(struct pci_dev *dev) { } static inline void pci_ide_init_host_bridge(struct pci_host_bridge *hb) { } +static inline void pci_ide_destroy(struct pci_dev *dev) { } #endif #ifdef CONFIG_PCI_TSM |
