mbox: Harden against BMC daemon errors
mbox: Harden against BMC daemon errors

Bugs present in the BMC daemon mean that skiboot gets presented with
mbox windows of size zero. These windows cannot be valid and skiboot
already detects these conditions.

Currently skiboot warns quite strongly about the occurrence of these
problems. The problem for skiboot is that it doesn't take any action.
Initially I wanting to avoid putting policy like this into skiboot but
since these bugs aren't going away and skiboot barfing is leading to
lockups and ultimately the host going down something needs to be done.

I propose that when we detect the problem we fail the mbox call and punt
the problem back up to Linux. I don't like it but at least it will cause
errors to cascade and won't bring the host down. I'm not sure how Linux
is supposed to detect this or what it can even do but this is better
than a crash.

Diagnosing a failure to boot if skiboot its self fails to read flash may
be marginally more difficult with this patch. This is because skiboot
will now only print one warning about the zero sized window rather than
continuously spitting it out.

Reported-by: Pridhiviraj Paidipeddi <fd8ea14509c256cbd04eaa4ee745a213945e70a1@linux.vnet.ibm.com>
Tested-by: Pridhiviraj Paidipeddi <fd8ea14509c256cbd04eaa4ee745a213945e70a1@linux.vnet.ibm.com>
Signed-off-by: Cyril Bur <6ce38dade8c4b52fd55c193fae70fd1d1275c3c3@au1.ibm.com>
Reviewed-by: Nicholas Piggin <24829078df5003d9dd1dd871ca2aeb0b1cf95ef4@gmail.com>
Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.vnet.ibm.com>

open-power/skiboot,shenki/skiboot,qemu/skiboot,open-power/skiboot,stewart-ibm/skiboot,shenki/skiboot,qemu/skiboot,open-power/skiboot,legoater/skiboot,stewart-ibm/skiboot,legoater/skiboot,legoater/skiboot,qemu/skiboot,open-power/skiboot,shenki/skiboot,open-power/skiboot,qemu/skiboot,qemu/skiboot,shenki/skiboot,stewart-ibm/skiboot,legoater/skiboot,shenki/skiboot,legoater/skiboot