Re: [PATCH v2] Add support for PCIe SSD status LED management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 01, 2021 at 04:38:20PM -0400, Stuart Hayes wrote:
> --- /dev/null
> +++ b/drivers/pci/pcie-ssd-leds.c

Since this is a PCIe-specific feature, it should probably live in the
pcie/ subdirectory.  Or in drivers/nvme/.


> +static bool pdev_has_dsm(struct pci_dev *pdev)
> +{
> +	acpi_handle handle;
> +
> +	handle = ACPI_HANDLE(&pdev->dev);
> +	if (!handle)
> +		return false;
> +
> +	return acpi_check_dsm(handle, &pcie_ssdleds_dsm_guid, 0x1,
> +			      1 << GET_SUPPORTED_STATES_DSM ||
> +			      1 << GET_STATE_DSM ||
> +			      1 << SET_STATE_DSM);
> +}

Would it be possible to bail out early if pdev->class !=
PCI_CLASS_STORAGE_EXPRESS (or something like that), thus avoiding
the overhead of an ACPI namespace search for *every* PCI device?

Thanks,

Lukas



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux