]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: cxlflash: Avoid clobbering context control register value
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Mon, 26 Mar 2018 16:30:22 +0000 (11:30 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 18 Apr 2018 23:32:47 +0000 (19:32 -0400)
commit0ed6f64d45004849d673ae7685847a4199243931
tree042d237bc668e607643d373756cb815d5f5208e6
parent3d44a2295e84e0602d8df1bbf4fdd89c33d5e3d2
scsi: cxlflash: Avoid clobbering context control register value

The SISLite specification originally defined the context control register with
a single field of bits to represent the LISN and also stipulated that the
register reset value be 0. The cxlflash driver took advantage of this when
programming the LISN for the master contexts via an unconditional write - no
other bits were preserved.

When unmap support was added, SISLite was updated to define bit 0 of the
context control register as a way for the AFU to notify the context owner that
unmap operations were supported. Thus the assumptions under which the register
is setup changed and the existing unconditional write is clobbering the unmap
state for master contexts. This is presently not an issue due to the order in
which the context control register is programmed in relation to the unmap bit
being queried but should be addressed to avoid a future regression in the
event this code is moved elsewhere.

To remedy this issue, preserve the bits when programming the LISN field in the
context control register. Since the LISN will now be programmed using a read
value, assert that the initial state of the LISN field is as described in
SISLite (0).

Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxlflash/main.c
drivers/scsi/cxlflash/sislite.h