mwifiex: process pcie io memory read failure case
authorXinming Hu <huxm@marvell.com>
Wed, 3 Feb 2016 06:05:03 +0000 (22:05 -0800)
committerKalle Valo <kvalo@codeaurora.org>
Sun, 7 Feb 2016 07:15:35 +0000 (09:15 +0200)
It is observed that ioread32 may fail to read pcie register
in certain scenarios, this patch handles these cases.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/pcie.c

index 918e04954afec14c10e161f524dd0f7fcf151e4f..b9fe1813cc4febeb446b0a543e3ef52f9706d714 100644 (file)
@@ -323,6 +323,8 @@ static int mwifiex_read_reg(struct mwifiex_adapter *adapter, int reg, u32 *data)
        struct pcie_service_card *card = adapter->card;
 
        *data = ioread32(card->pci_mmap1 + reg);
+       if (*data == 0xffffffff)
+               return 0xffffffff;
 
        return 0;
 }