]> git.baikalelectronics.ru Git - kernel.git/commit
IB/hfi1: Add debugfs to control expansion ROM write protect
authorJosh Collier <josh.d.collier@intel.com>
Thu, 11 Apr 2019 14:07:42 +0000 (07:07 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 24 Apr 2019 14:26:41 +0000 (11:26 -0300)
commitb44ef9c91759864e1bd4c77784d6da467bed5723
treedc57bf0dc85444a84bf3120c42787a65a5f37f5f
parent2b8c5edd7492f62a7841cbd1fd62fb608e54101f
IB/hfi1: Add debugfs to control expansion ROM write protect

Some kernels now enable CONFIG_IO_STRICT_DEVMEM which prevents multiple
handles to PCI resource0. In order to continue to support expansion ROM
updates while the driver is loaded, the driver must now provide an
interface to control the expansion ROM write protection.

This patch adds an exprom_wp debugfs interface that allows the hfi1_eprom
user tool to disable the expansion ROM write protection by opening the
file and writing a '1'.  The write protection is released when writing a
'0' or automatically re-enabled when the file handle is closed.  The
current implementation will only allow one handle to be opened at a time
across all hfi1 devices.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Josh Collier <josh.d.collier@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/debugfs.c