scsi: libsas: shut down the PHY if events reached the threshold
authorJason Yan <yanaijie@huawei.com>
Fri, 8 Dec 2017 09:42:05 +0000 (17:42 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 9 Jan 2018 02:59:28 +0000 (21:59 -0500)
commitf12486e06ae87453530f00a6cb49b60ae3fe4551
tree831a4dd957ced9acdff2349e03ae84fcaacad88e
parent1c393b970e0f4070e4376d45f89a2d19a5c895d0
scsi: libsas: shut down the PHY if events reached the threshold

If the PHY burst too many events, we will alloc a lot of events for the
worker. This may leads to memory exhaustion.

Dan Williams suggested to shut down the PHY if the events reached the
threshold, because in this case the PHY may have gone into some
erroneous state. Users can re-enable the PHY by sysfs if they want.

We cannot use the fixed memory pool because if we run out of events, the
shut down event and loss of signal event will lost too. The events still
need to be allocated and processed in this case.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
CC: John Garry <john.garry@huawei.com>
CC: Johannes Thumshirn <jthumshirn@suse.de>
CC: Ewan Milne <emilne@redhat.com>
CC: Christoph Hellwig <hch@lst.de>
CC: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libsas/sas_init.c
drivers/scsi/libsas/sas_phy.c
include/scsi/libsas.h