linux/drivers/net/ethernet/ibm/ehea
Michael Ellerman 3051f39253 ehea: Fix memory hook reference counting crashes
The recent commit to only register the EHEA memory hotplug hooks on
adapter probe has a few problems.

Firstly the reference counting is wrong for multiple adapters, in that
the hooks are registered multiple times. Secondly the check in the tear
down path is backward. Finally the error path doesn't decrement the
count.

The multiple registration of the hooks is the biggest problem, as it
leads to oopses when the system is rebooted, and/or errors during memory
hotplug, eg:

  $ ./mem-on-off-test.sh -r 2
  ...
  ehea: memory is going offline
  ehea: LPAR memory changed - re-initializing driver
  ehea: re-initializing driver complete
  ehea: memory is going offline
  ehea: LPAR memory changed - re-initializing driver
  ehea: opcode=26c ret=fffffffffffffffc arg1=8000000003000003 arg2=0 arg3=700000060000d600 arg4=3fded0000 arg5=200 arg6=0 arg7=0
  ehea: register_rpage_mr failed
  ehea: registering mr failed
  ehea: register MR failed - driver inoperable!
  ehea: memory is going offline

Fixes: aa18332331 ("ehea: Register memory hotplug, reboot and crash hooks on adapter probe")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-25 14:33:04 -04:00
..
ehea_ethtool.c net: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate 2014-06-06 16:24:07 -07:00
ehea_hw.h
ehea_main.c ehea: Fix memory hook reference counting crashes 2015-04-25 14:33:04 -04:00
ehea_phyp.c ehea: Remove uses of virt_to_abs() and abs_to_virt() 2012-09-05 15:18:46 +10:00
ehea_phyp.h powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function 2012-11-15 15:08:07 +11:00
ehea_qmr.c net: ethernet: ibm: ehea: ehea_qmr.c: Fix for possible null pointer dereference 2014-05-18 21:26:02 -04:00
ehea_qmr.h
ehea.h ehea: Remove uses of virt_to_abs() and abs_to_virt() 2012-09-05 15:18:46 +10:00
Makefile net: ethernet: ibm: ehea: Remove duplicate object from Makefile 2014-08-14 14:38:54 -07:00