odroid-linux/drivers/s390
Steffen Maier 9cfe5af116 zfcp: status read buffers on first adapter open with link down
commit 9edf7d75ee upstream.

Commit 64deb6efdc
"[SCSI] zfcp: Use status_read_buf_num provided by FCP channel"
started using a value returned by the channel but only evaluated the value
if the fabric link is up.
Commit 8d88cf3f3b
"[SCSI] zfcp: Update status read mempool"
introduced mempool resizings based on the above value.
On setting an FCP device online for the very first time since boot, a new
zeroed adapter object is allocated. If the link is down, the number of
status read requests remains zero. Since just the config data exchange is
incomplete, we proceed with adapter open recovery. However, we
unconditionally call mempool_resize with adapter->stat_read_buf_num == 0 in
this case.

This causes a kernel message "kernel BUG at mm/mempool.c:131!" in process
"zfcperp<FCP-device-bus-ID>" with last function mempool_resize in Krnl PSW
and zfcp_erp_thread in the Call Trace.

Don't evaluate channel values which are invalid on link down. The number of
status read requests is always valid, evaluated, and set to a positive
minimum greater than zero. The adapter open recovery can proceed and the
channel has status read buffers to inform us on a future link up event.
While we are not aware of any other code path that could result in mempool
resize attempts of size zero, we still also initialize the number of status
read buffers to be posted to a static minimum number on adapter object
allocation.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
[sm: Backported to 3.0:
 - Copyright notice changed slightly
 - Don't use zfcp_fsf_convert_portspeed()]
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-28 16:18:51 -07:00
..
block compat: fix compile breakage on s390 2012-03-12 10:32:38 -07:00
char s390/memory hotplug: prevent offline of active memory increments 2013-05-07 19:57:22 -07:00
cio s390/cio: fix pgid reserved check 2013-01-17 08:43:53 -08:00
crypto [S390] ap: skip device registration on type probe failure 2011-05-23 10:24:29 +02:00
kvm KVM: s390: Handle hosts not supporting s390-virtio. 2013-02-28 06:32:24 -08:00
net net: fix NULL dereferences in check_peer_redir() 2012-02-13 11:06:13 -08:00
scsi zfcp: status read buffers on first adapter open with link down 2013-07-28 16:18:51 -07:00
Makefile [S390] split/move machine check handler code 2009-03-26 15:24:10 +01:00