mirror of
https://github.com/AuxXxilium/synology-igc.git
synced 2024-11-23 15:01:06 +07:00
igc: Reinstate IGC_REMOVED logic and implement it properly
backport from 7c1ddcee53
Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
parent
e52503cd8f
commit
58a6b64178
@ -4900,6 +4900,9 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)
|
||||
u8 __iomem *hw_addr = READ_ONCE(hw->hw_addr);
|
||||
u32 value = 0;
|
||||
|
||||
if (IGC_REMOVED(hw_addr))
|
||||
return ~value;
|
||||
|
||||
value = readl(&hw_addr[reg]);
|
||||
|
||||
/* reads should not return all F's */
|
||||
|
@ -253,7 +253,8 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg);
|
||||
#define wr32(reg, val) \
|
||||
do { \
|
||||
u8 __iomem *hw_addr = READ_ONCE((hw)->hw_addr); \
|
||||
writel((val), &hw_addr[(reg)]); \
|
||||
if (!IGC_REMOVED(hw_addr)) \
|
||||
writel((val), &hw_addr[(reg)]); \
|
||||
} while (0)
|
||||
|
||||
#define rd32(reg) (igc_rd32(hw, reg))
|
||||
@ -265,4 +266,6 @@ do { \
|
||||
|
||||
#define array_rd32(reg, offset) (igc_rd32(hw, (reg) + ((offset) << 2)))
|
||||
|
||||
#define IGC_REMOVED(h) unlikely(!(h))
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user