lkml.org 
[lkml]   [2017]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x) systems
From
Date
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.

\
 
 \ /
  Last update: 2017-07-07 17:23    [W:0.083 / U:1.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site