Skip to content

Commit 9597893

Browse files
Su Huikuba-moo
Su Hui
authored andcommitted
eth: fbnic: Revert "eth: fbnic: Add hardware monitoring support via HWMON interface"
There is a garbage value problem in fbnic_mac_get_sensor_asic(). 'fw_cmpl' is uninitialized which makes 'sensor' and '*val' to be stored garbage value. Revert commit d85ebad ("eth: fbnic: Add hardware monitoring support via HWMON interface") to avoid this problem. Fixes: d85ebad ("eth: fbnic: Add hardware monitoring support via HWMON interface") Signed-off-by: Su Hui <[email protected]> Suggested-by: Jakub Kicinski <[email protected]> Suggested-by: Michal Swiatkowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fd48f07 commit 9597893

File tree

7 files changed

+0
-126
lines changed

7 files changed

+0
-126
lines changed

drivers/net/ethernet/meta/fbnic/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ fbnic-y := fbnic_csr.o \
1313
fbnic_ethtool.o \
1414
fbnic_fw.o \
1515
fbnic_hw_stats.o \
16-
fbnic_hwmon.o \
1716
fbnic_irq.o \
1817
fbnic_mac.o \
1918
fbnic_netdev.o \

drivers/net/ethernet/meta/fbnic/fbnic.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ struct fbnic_dev {
2020
struct device *dev;
2121
struct net_device *netdev;
2222
struct dentry *dbg_fbd;
23-
struct device *hwmon;
2423

2524
u32 __iomem *uc_addr0;
2625
u32 __iomem *uc_addr4;
@@ -33,7 +32,6 @@ struct fbnic_dev {
3332

3433
struct fbnic_fw_mbx mbx[FBNIC_IPC_MBX_INDICES];
3534
struct fbnic_fw_cap fw_cap;
36-
struct fbnic_fw_completion *cmpl_data;
3735
/* Lock protecting Tx Mailbox queue to prevent possible races */
3836
spinlock_t fw_tx_lock;
3937

@@ -142,9 +140,6 @@ void fbnic_devlink_unregister(struct fbnic_dev *fbd);
142140
int fbnic_fw_enable_mbx(struct fbnic_dev *fbd);
143141
void fbnic_fw_disable_mbx(struct fbnic_dev *fbd);
144142

145-
void fbnic_hwmon_register(struct fbnic_dev *fbd);
146-
void fbnic_hwmon_unregister(struct fbnic_dev *fbd);
147-
148143
int fbnic_pcs_irq_enable(struct fbnic_dev *fbd);
149144
void fbnic_pcs_irq_disable(struct fbnic_dev *fbd);
150145

drivers/net/ethernet/meta/fbnic/fbnic_fw.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ struct fbnic_fw_cap {
4444
u8 link_fec;
4545
};
4646

47-
struct fbnic_fw_completion {
48-
struct {
49-
s32 millivolts;
50-
s32 millidegrees;
51-
} tsene;
52-
};
53-
5447
void fbnic_mbx_init(struct fbnic_dev *fbd);
5548
void fbnic_mbx_clean(struct fbnic_dev *fbd);
5649
void fbnic_mbx_poll(struct fbnic_dev *fbd);

drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c

Lines changed: 0 additions & 81 deletions
This file was deleted.

drivers/net/ethernet/meta/fbnic/fbnic_mac.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -686,27 +686,6 @@ fbnic_mac_get_eth_mac_stats(struct fbnic_dev *fbd, bool reset,
686686
MAC_STAT_TX_BROADCAST);
687687
}
688688

689-
static int fbnic_mac_get_sensor_asic(struct fbnic_dev *fbd, int id, long *val)
690-
{
691-
struct fbnic_fw_completion fw_cmpl;
692-
s32 *sensor;
693-
694-
switch (id) {
695-
case FBNIC_SENSOR_TEMP:
696-
sensor = &fw_cmpl.tsene.millidegrees;
697-
break;
698-
case FBNIC_SENSOR_VOLTAGE:
699-
sensor = &fw_cmpl.tsene.millivolts;
700-
break;
701-
default:
702-
return -EINVAL;
703-
}
704-
705-
*val = *sensor;
706-
707-
return 0;
708-
}
709-
710689
static const struct fbnic_mac fbnic_mac_asic = {
711690
.init_regs = fbnic_mac_init_regs,
712691
.pcs_enable = fbnic_pcs_enable_asic,
@@ -716,7 +695,6 @@ static const struct fbnic_mac fbnic_mac_asic = {
716695
.get_eth_mac_stats = fbnic_mac_get_eth_mac_stats,
717696
.link_down = fbnic_mac_link_down_asic,
718697
.link_up = fbnic_mac_link_up_asic,
719-
.get_sensor = fbnic_mac_get_sensor_asic,
720698
};
721699

722700
/**

drivers/net/ethernet/meta/fbnic/fbnic_mac.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ enum {
4747
#define FBNIC_LINK_MODE_PAM4 (FBNIC_LINK_50R1)
4848
#define FBNIC_LINK_MODE_MASK (FBNIC_LINK_AUTO - 1)
4949

50-
enum fbnic_sensor_id {
51-
FBNIC_SENSOR_TEMP, /* Temp in millidegrees Centigrade */
52-
FBNIC_SENSOR_VOLTAGE, /* Voltage in millivolts */
53-
};
54-
5550
/* This structure defines the interface hooks for the MAC. The MAC hooks
5651
* will be configured as a const struct provided with a set of function
5752
* pointers.
@@ -88,8 +83,6 @@ struct fbnic_mac {
8883

8984
void (*link_down)(struct fbnic_dev *fbd);
9085
void (*link_up)(struct fbnic_dev *fbd, bool tx_pause, bool rx_pause);
91-
92-
int (*get_sensor)(struct fbnic_dev *fbd, int id, long *val);
9386
};
9487

9588
int fbnic_mac_init(struct fbnic_dev *fbd);

drivers/net/ethernet/meta/fbnic/fbnic_pci.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ static int fbnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
296296
/* Capture snapshot of hardware stats so netdev can calculate delta */
297297
fbnic_reset_hw_stats(fbd);
298298

299-
fbnic_hwmon_register(fbd);
300-
301299
if (!fbd->dsn) {
302300
dev_warn(&pdev->dev, "Reading serial number failed\n");
303301
goto init_failure_mode;
@@ -360,7 +358,6 @@ static void fbnic_remove(struct pci_dev *pdev)
360358
fbnic_netdev_free(fbd);
361359
}
362360

363-
fbnic_hwmon_unregister(fbd);
364361
fbnic_dbg_fbd_exit(fbd);
365362
fbnic_devlink_unregister(fbd);
366363
fbnic_fw_disable_mbx(fbd);

0 commit comments

Comments
 (0)