Bjorn Helgaas wrote: > On Fri, Mar 22, 2024 at 02:30:03PM -0700, Dan Williams wrote: > > Bjorn Helgaas wrote: > > > On Tue, Mar 12, 2024 at 10:08:16AM +0100, Mariusz Tkaczyk wrote: > > > > On Mon, 11 Mar 2024 17:30:06 -0500 > > > > Stuart Hayes <stuart.w.hayes@xxxxxxxxx> wrote: > > > > > > > > > > > No, Linux doesn't support _DSM. It was proposed in previous > > > > > > > iterations by Stuart but I dropped it. We decided that it need to be > > > > > > > strongly rebuild because "pci/pcie" is not right place for ACPI code > > > > > > > so we cannot register _DSM driver instead of NPEM as it was proposed > > > > > > > and I don't have _DSM capable hardware to test it. > > > > > > > > > > I'm not sure I understand why pci/pcie isn't the right place for ACPI code-- > > > > > there are other _DSMs used in PCI code already, and this _DSM is defined > > > > > in a PCI ECN. > > > > > > > > I looked into internal review history and I found out that I dropped it after > > > > discussion with Dan Williams: > > > > > > > > > After review and discussion with Dan _DSM extension is dropped. > > > > > > > > Unfortunately, I don't remember what exactly he suggested, I just remembered > > > > conclusion that it needs to be reworked and I decided to drop it. > > > > Maybe, I didn't understand him correctly. > > > > > > > > Dan, could you take a look? Do you remember something? > > > > > > Straw man proposal: > > > > > > - Update this patch so we use NPEM if the device advertises it. > > > > > > - If/when Linux support for the _DSM is added, we use the _DSM when > > > present. If a device advertises NPEM but no _DSM applies to it, > > > we use native NPEM for it. > > > > The current patch matches my last recollection of the discussion, at a > > minimum do not use the NPEM interface when the _DSM is present. That was > > the compromise to meet the spirit of the _DSM definition and leave it to > > folks that care about the _DSM and have hardware to implement and test > > that support. > > In the case of an OS that supports native NPEM but not _DSM, I think > it would be unreasonable for NPEM to stop working just because a new > firmware release added the _DSM. That is also a reasonable stance. > > However, I think the strawman is workable if only because base NPEM > > already has a problem of ambiguity of which NPEM instance in a topology > > should be used. > > > > For example an NVME or CXL endpoint could have an NPEM implementation > > that is superseded by an NPEM instance in its parent downstream port, or > > another ancestor downstream port / root port. > > > > The fact that the native NPEM may not be the right interface to use in > > the presence of the _DSM has no specified way to resolve conflicts is at > > least matched by downstream-port vs endpoint conflict resolution not > > being specified. > > > > So the spec left a bit of a mess and it is reasonable for Linux to say > > "just turn on all the NPEMs and hope that userspace knows what it is > > supposed to do". > > If a device and its parent both advertise NPEM, I dunno how to figure > out which to use. Maybe that's a benefit that could come with the > _DSM. The _DSM is at least an affirmative indicator of platform-vendor intent (for that one device), but still leaves open the question of whether a downstream port _DSM supersedes another downstream port or endpoint. So, yes, enough ambiguity that I retract my suggestion to skip native NPEM in the presence the _DSM.