Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1683249

Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x) systems

From Sinan Kaya <okaya@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x) systems
Date 2017-07-07 17:30 +0200
Message-ID <u0DmG-5Qq-3@gated-at.bofh.it> (permalink)
References <u0CTE-5qc-13@gated-at.bofh.it> <u0D3j-5J4-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 7/7/2017 11:07 AM, Sinan Kaya wrote:
> On 7/7/2017 10:53 AM, Sinan Kaya wrote:
>> +	ret = pcie_capability_read_word(dev, PCI_EXP_FLAGS, &flags);
>> +	if (ret || ((flags & PCI_EXP_FLAGS_VERS) < 2))
>> +		return 0;
>>  
> 
> Never mind, there is a problem here. I shouldn't have added it here.
> I'll remove these and post again.
> 

I guess I'll wait until Bjorn gets a chance to review it. There is a decision
that needs to be made here. 

Under normal circumstances, extended tags capability is a reserved field on
v1 that's expected to be 0.

Code is checking for extended tags capability being non-zero next
before setting/clearing the bit.

It should be safe to rely on capability being 0 on v1. However, we can go
paranoid and add the check above to not even look at the capability like I
did it. 

That's why, I thought this is redundant. 

I'll wait until Bjorn chimes in. It is OK to keep the code as it is. It is
just doing too much validation in my opinion. Somebody can always say
play safe.

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x) systems Sinan Kaya <okaya@codeaurora.org> - 2017-07-07 17:00 +0200
  Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x)  systems Sinan Kaya <okaya@codeaurora.org> - 2017-07-07 17:10 +0200
    Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x)  systems Sinan Kaya <okaya@codeaurora.org> - 2017-07-07 17:30 +0200
  Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x)  systems Sinan Kaya <okaya@codeaurora.org> - 2017-07-07 17:10 +0200
    Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x)  systems Wim ten Have <wim.ten.have@oracle.com> - 2017-07-07 18:20 +0200
  Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x)  systems Bjorn Helgaas <helgaas@kernel.org> - 2017-07-11 01:10 +0200
    Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x)  systems Sinan Kaya <okaya@codeaurora.org> - 2017-07-11 02:30 +0200
      Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x)  systems Sinan Kaya <okaya@codeaurora.org> - 2017-07-11 03:50 +0200

csiph-web