]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
IB/hfi: Only read capability registers if the capability exists
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Fri, 22 Dec 2017 16:47:20 +0000 (08:47 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 22 Dec 2017 17:42:08 +0000 (10:42 -0700)
commit4c009af473b2026caaa26107e34d7cc68dad7756
treeb6c2b467dde85a47f5b1bd55656cb7bb99c9a179
parent1f80bd6a6cc8358b81194e1f5fc16449947396ec
IB/hfi: Only read capability registers if the capability exists

During driver init, various registers are saved to allow restoration
after an FLR or gen3 bump.  Some of these registers are not available
in some circumstances (i.e. Virtual machines).

This bug makes the driver unusable when the PCI device is passed into
a VM, it fails during probe.

Delete unnecessary register read/write, and only access register if
the capability exists.

Cc: <stable@vger.kernel.org> # 4.14.x
Fixes: a618b7e40af2 ("IB/hfi1: Move saving PCI values to a separate function")
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/hfi.h
drivers/infiniband/hw/hfi1/pcie.c