[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YbhOQx60Qz/tLUKU@infradead.org>
Date: Mon, 13 Dec 2021 23:56:51 -0800
From: Christoph Hellwig <hch@...radead.org>
To: "David E. Box" <david.e.box@...ux.intel.com>
Cc: nirmal.patel@...ux.intel.com, jonathan.derrick@...ux.dev,
lorenzo.pieralisi@....com, robh@...nel.org, kw@...ux.com,
bhelgaas@...gle.com, michael.a.bottini@...ux.intel.com,
rafael@...nel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, Adhitya Mohan <me@...ityamohan.in>
Subject: Re: [PATCH V3 2/2] PCI: vmd: Override ASPM on TGL/ADL VMD devices
On Thu, Dec 09, 2021 at 12:12:35PM -0800, David E. Box wrote:
> +static int vmd_enable_aspm(struct pci_dev *pdev, void *userdata)
> +{
> + int features = *(int *)userdata;
> +
> + if (features & VMD_FEAT_QUIRK_OVERRIDE_ASPM &&
> + pdev->class == PCI_CLASS_STORAGE_EXPRESS) {
> + int pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_LTR);
> +
> + if (pos) {
> + pci_write_config_word(pdev, pos + PCI_LTR_MAX_SNOOP_LAT, 0x1003);
> + pci_write_config_word(pdev, pos + PCI_LTR_MAX_NOSNOOP_LAT, 0x1003);
> + if (pcie_aspm_policy_override(pdev))
> + pci_info(pdev, "Unable of override ASPM policy\n");
> + }
This is completely unredable due to the long lines. Just return early on
the two conditionals and it will all be fine.
Powered by blists - more mailing lists