Re: [PATCH] PCI: Add ACS quirk for Intel 300 series chipset

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

 



On Thu, Aug 16, 2018 at 09:13:03AM -0600, Alex Williamson wrote:
>  static int pci_quirk_enable_intel_spt_pch_acs(struct pci_dev *dev)
>  {
>  	int pos;
> +	u16 std_ctrl;
>  	u32 cap, ctrl;
>  
>  	if (!pci_quirk_intel_spt_pch_acs_match(dev))
> @@ -4621,6 +4628,18 @@ static int pci_quirk_enable_intel_spt_pch_acs(struct pci_dev *dev)
>  	if (!pos)
>  		return -ENOTTY;
>  
> +	/* If the std control word has bits set or is writable, do not quirk */
> +	pci_read_config_word(dev, pos + PCI_ACS_CTRL, &std_ctrl);
> +	if (std_ctrl)
> +		return -ENOTTY;
> +
> +	pci_write_config_word(dev, pos + PCI_ACS_CTRL, 0xff);

I don't know ACS well but could the above have some unwanted
side-effects, even if we write back zeroes below?

> +	pci_read_config_word(dev, pos + PCI_ACS_CTRL, &std_ctrl);
> +	if (std_ctrl) {
> +		pci_write_config_word(dev, pos + PCI_ACS_CTRL, 0);
> +		return -ENOTTY;
> +	}
> +
>  	pci_read_config_dword(dev, pos + PCI_ACS_CAP, &cap);
>  	pci_read_config_dword(dev, pos + INTEL_SPT_ACS_CTRL, &ctrl);
>  



[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