Re: [PATCH 1/1] Fix ARI enabling for a NVME devices

From: Christoph Hellwig
Date: Tue Sep 03 2019 - 09:14:19 EST


On Tue, Sep 03, 2019 at 12:53:15PM +0000, Andrei Leonvikov wrote:
> + if ((dev->driver != NULL) && (strncmp(dev->driver->name, "nvme", 4) == 0)) {
> + // for NVME device this field always zero, but ARI can be enabled
> + pcie_capability_read_dword(bridge, PCI_EXP_DEVCAP2, &cap);
> + if (!(cap & PCI_EXP_DEVCAP2_ARI))
> + return;
> + }

Besides the missing patch description, all the obvious style issues, and
the fact that you can't just check a driver name a here:

There are plenty NVMe drives that support the ARI capability, and I
don't know of any standard saying nvme device should be treated special.