]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI/IDE: Initialize an ID for all IDE streams
authorDan Williams <dan.j.williams@intel.com>
Thu, 13 Nov 2025 02:14:43 +0000 (18:14 -0800)
committerDan Williams <dan.j.williams@intel.com>
Fri, 14 Nov 2025 23:06:57 +0000 (15:06 -0800)
commit079115370d00c78ef69b31dd15def90adf2aa579
treee1e4858d3ede2d62add04710f764eb9985e0df76
parentf86e51399c2a911a5b01d441de513f17bf773856
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>
drivers/pci/ide.c
drivers/pci/pci.h
drivers/pci/remove.c
include/linux/pci-ide.h
include/linux/pci.h