1
0
Fork 0
remarkable-linux/drivers/scsi/cxlflash
Matthew R. Ochs a5ed99bc6f scsi: cxlflash: Avoid clobbering context control register value
[ Upstream commit 465891fe92 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-03 07:50:41 +02:00
..
Kconfig scsi: cxlflash: Select IRQ_POLL 2017-05-08 22:09:21 -04:00
Makefile cxlflash: Virtual LUN support 2015-08-26 18:05:39 -07:00
common.h scsi: cxlflash: Remove zeroing of private command data 2017-06-26 15:01:13 -04:00
lunmgt.c scsi: cxlflash: Remove port configuration assumptions 2017-04-13 22:55:41 -04:00
main.c scsi: cxlflash: Avoid clobbering context control register value 2018-08-03 07:50:41 +02:00
main.h scsi: cxlflash: Support AFU debug 2017-06-26 15:01:12 -04:00
sislite.h scsi: cxlflash: Avoid clobbering context control register value 2018-08-03 07:50:41 +02:00
superpipe.c scsi: cxlflash: Avoid double mutex unlock 2017-08-25 18:23:34 -04:00
superpipe.h scsi: cxlflash: Fix warnings/errors 2017-04-13 22:55:41 -04:00
vlun.c scsi: cxlflash: Fix vlun resize failure in the shrink path 2017-08-25 18:24:04 -04:00
vlun.h scsi: cxlflash: Fix warnings/errors 2017-04-13 22:55:41 -04:00