mwifiex: add recovery code if the firmware becomes wedged.

The firmware can get into a state where it does not respond and the
driver does not attempt a reset.

The symptom in the log messages is:
	mwifiex_sdio mmc1:0001:1: host_to_card, write iomem (1) failed: -1

Add code to issue a reset when the driver gets into this state to aid
recovery. For now this is off by default and can be enabled by writing
a non-zero value into debugfs firmware_recover.

In addition, add test code to simulate the failure. Writing a non-zero
value into debugfs firmware_wedge immediately simulates the firmware
not responding, and if firmware_recover is enabled, this variable is
cleared in reset.

See b/31916833

Change-Id: I8a5a3b9e9438a1af3ee144dc9a4cb0be5c0c978a
2 files changed