[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1387578320-26525-1-git-send-email-khoroshilov@ispras.ru>
Date: Sat, 21 Dec 2013 02:25:20 +0400
From: Alexey Khoroshilov <khoroshilov@...ras.ru>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc: Alexey Khoroshilov <khoroshilov@...ras.ru>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Bruce Allan <bruce.w.allan@...el.com>,
Carolyn Wyborny <carolyn.wyborny@...el.com>,
Don Skidmore <donald.c.skidmore@...el.com>,
Greg Rose <gregory.v.rose@...el.com>,
Alex Duyck <alexander.h.duyck@...el.com>,
John Ronciak <john.ronciak@...el.com>,
e1000-devel@...ts.sourceforge.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, ldv-project@...uxtesting.org
Subject: [PATCH] e1000: avoid potential deadlock in e1000_do_[read|write]_eeprom()
If eeprom->word_size is zero, e1000_do_[read|write]_eeprom() invoke
e1000_init_eeprom_params() to reinit eeprom params.
That is not a good idea since e1000_init_eeprom_params() calls
e1000_read_eeprom() if eeprom->type is e1000_eeprom_spi.
That means a deadlock on e1000_eeprom_lock.
At the same time it is unclear if the reinit is needed at all.
e1000_init_eeprom_params() is called from probe, so
it should succeed before any activities of the module start.
The patch suggests to remove the try to reinit eeprom params.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>
---
drivers/net/ethernet/intel/e1000/e1000_hw.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000/e1000_hw.c b/drivers/net/ethernet/intel/e1000/e1000_hw.c
index 2879b9631e15..a0317348ebde 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_hw.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_hw.c
@@ -3982,10 +3982,6 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
return E1000_SUCCESS;
}
- /* If eeprom is not yet detected, do so now */
- if (eeprom->word_size == 0)
- e1000_init_eeprom_params(hw);
-
/* A check for invalid values: offset too large, too many words, and
* not enough words.
*/
@@ -4162,10 +4158,6 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
return E1000_SUCCESS;
}
- /* If eeprom is not yet detected, do so now */
- if (eeprom->word_size == 0)
- e1000_init_eeprom_params(hw);
-
/* A check for invalid values: offset too large, too many words, and
* not enough words.
*/
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists