Re: [PATCH v4 01/12] IB/hfi1: Check if pcie_capability_read_*() reads ~0

2020-08-03 Thread Ian Kumlien
On Fri, Jul 31, 2020 at 3:55 PM Bjorn Helgaas wrote: > > [+cc Michael, Ashutosh, Ian, Puranjay] > > On Fri, Jul 31, 2020 at 01:02:29PM +0200, Saheed O. Bolarinwa wrote: > > On failure pcie_capability_read_dword() sets it's last parameter, > > val to 0. In this case dn and up will be 0, so

Re: [PATCH v4 01/12] IB/hfi1: Check if pcie_capability_read_*() reads ~0

2020-07-31 Thread Bjorn Helgaas
[+cc Michael, Ashutosh, Ian, Puranjay] On Fri, Jul 31, 2020 at 01:02:29PM +0200, Saheed O. Bolarinwa wrote: > On failure pcie_capability_read_dword() sets it's last parameter, > val to 0. In this case dn and up will be 0, so aspm_hw_l1_supported() > will return false. > However, with Patch 12/12,

[PATCH v4 01/12] IB/hfi1: Check if pcie_capability_read_*() reads ~0

2020-07-31 Thread Saheed O. Bolarinwa
On failure pcie_capability_read_dword() sets it's last parameter, val to 0. In this case dn and up will be 0, so aspm_hw_l1_supported() will return false. However, with Patch 12/12, it is possible that val is set to ~0 on failure. This would introduce a bug because (x & x) == (~0 & x). So with dn