OpenCloudOS-Kernel/drivers/net/ethernet
Corinna Vinschen 5d54cb1767 igb: conditionalize I2C bit banging on external thermal sensor support
Commit a97f8783a9 ("igb: unbreak I2C bit-banging on i350") introduced
code to change I2C settings to bit banging unconditionally.

However, this patch introduced a regression:  On an Intel S2600CWR
Server Board with three NICs:

- 1x dual-port copper
  Intel I350 Gigabit Network Connection [8086:1521] (rev 01)
  fw 1.63, 0x80000dda

- 2x quad-port SFP+ with copper SFP Avago ABCU-5700RZ
  Intel I350 Gigabit Fiber Network Connection [8086:1522] (rev 01)
  fw 1.52.0

the SFP NICs no longer get link at all.  Reverting commit a97f8783a9
or switching to the Intel out-of-tree driver both fix the problem.

Per the igb out-of-tree driver, I2C bit banging on i350 depends on
support for an external thermal sensor (ETS).  However, commit
a97f8783a9 added bit banging unconditionally.  Additionally, the
out-of-tree driver always calls init_thermal_sensor_thresh on probe,
while our driver only calls init_thermal_sensor_thresh only in
igb_reset(), and only if an ETS is present, ignoring the internal
thermal sensor.  The affected SFPs don't provide an ETS.  Per Intel,
the behaviour is a result of i350 firmware requirements.

This patch fixes the problem by aligning the behaviour to the
out-of-tree driver:

- split igb_init_i2c() into two functions:
  - igb_init_i2c() only performs the basic I2C initialization.
  - igb_set_i2c_bb() makes sure that E1000_CTRL_I2C_ENA is set
    and enables bit-banging.

- igb_probe() only calls igb_set_i2c_bb() if an ETS is present.

- igb_probe() calls init_thermal_sensor_thresh() unconditionally.

- igb_reset() aligns its behaviour to igb_probe(), i. e., call
  igb_set_i2c_bb() if an ETS is present and call
  init_thermal_sensor_thresh() unconditionally.

Fixes: a97f8783a9 ("igb: unbreak I2C bit-banging on i350")
Tested-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Co-developed-by: Jamie Bainbridge <jbainbri@redhat.com>
Signed-off-by: Jamie Bainbridge <jbainbri@redhat.com>
Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://lore.kernel.org/r/20230214185549.1306522-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-02-15 21:20:40 -08:00
..
3com net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
8390 ethernet: 8390: remove unnecessary check of mem 2022-09-29 11:05:23 +02:00
actions net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
adaptec net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
adi net: ethernet: adi: adin1110: Fix multicast offloading 2023-01-23 21:41:33 -08:00
aeroflex ethernet: aeroflex: fix potential skb leak in greth_init_rings() 2022-12-07 11:45:52 +01:00
agere net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
alacritech net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
allwinner net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
alteon net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
altera Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
amazon net: ena: Update NUMA TPH hint register upon NUMA node update 2022-12-30 07:43:44 +00:00
amd amd-xgbe: Delay AN timeout during KR training 2023-01-12 21:50:37 -08:00
apm drivers: net: xgene: disable napi when register irq failed in xgene_enet_open() 2022-11-08 15:15:55 +01:00
apple net: apple: bmac: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-12 09:53:10 +00:00
aquantia Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
arc net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
asix net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
atheros Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-17 18:30:39 -08:00
broadcom bnxt_en: Fix mqprio and XDP ring checking logic 2023-02-13 09:57:59 +00:00
brocade bna: Avoid clashing function prototypes 2022-11-21 08:17:59 +00:00
cadence net: macb: Perform zynqmp dynamic configuration only for SGMII interface 2023-02-03 19:34:55 -08:00
calxeda net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
cavium liquidio: use strscpy() to instead of strncpy() 2022-12-12 10:00:55 +00:00
chelsio Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
cirrus net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
cisco enic: define constants for legacy interrupts offset 2022-10-18 19:34:28 -07:00
cortina net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
davicom net: dm9051: Fix missing dev_kfree_skb() in dm9051_loop_rx() 2022-11-23 12:43:14 +00:00
dec net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
dlink sundance: remove unused variable cnt 2022-11-17 13:18:30 +01:00
emulex net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
engleder tsnep: Fix TX queue stop/wake for multiple queues 2023-01-25 22:41:50 -08:00
ezchip
faraday net: ftmac100: allow increasing MTU to make most use of single-segment buffers 2022-10-31 20:02:57 -07:00
freescale net: fman: memac: free mdio device if lynx_pcs_create() fails 2023-01-31 21:05:09 -08:00
fujitsu net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
fungible net: devlink: clean-up empty devlink_ops::info_get() 2022-11-30 21:49:39 -08:00
google gve: Handle alternate miss completions 2022-11-21 10:52:14 +00:00
hisilicon net: hns3: fix wrong use of rss size during VF rss config 2023-01-11 20:20:59 -08:00
huawei Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-17 18:30:39 -08:00
i825xx
ibm ibmvnic: Update XPS assignments during affinity binding 2022-11-14 10:47:07 +00:00
intel igb: conditionalize I2C bit banging on external thermal sensor support 2023-02-15 21:20:40 -08:00
litex net: ethernet: litex: Fix return type of liteeth_start_xmit 2022-09-19 18:23:39 -07:00
marvell octeontx2-af: Fix devlink unregister 2023-02-01 21:22:41 -08:00
mediatek net: ethernet: mtk_eth_soc: fix DSA TX tag hwaccel for switch port 0 2023-02-08 09:11:31 +00:00
mellanox net/mlx5: Serialize module cleanup with reload and remove 2023-02-07 19:01:07 -08:00
micrel net: ksz884x: fix missing pci_disable_device() on error in pcidev_init() 2022-10-25 19:46:35 -07:00
microchip net: microchip: sparx5: fix PTP init/deinit not checking all ports 2023-02-06 09:26:04 +00:00
microsoft net: mana: Fix accessing freed irq affinity_hint 2023-02-07 21:30:22 -08:00
moxa net: moxa: fix endianness-related issues from 'sparse' 2022-09-06 10:24:42 +02:00
mscc net: mscc: ocelot: fix all IPv6 getting trapped to CPU when PTP timestamping is used 2023-02-09 10:52:44 +01:00
myricom myri10ge: Fix an error handling path in myri10ge_probe() 2022-12-19 12:30:32 +00:00
natsemi net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
neterion ethernet: s2io: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-12 09:38:24 +00:00
netronome nfp: fix schedule in atomic context when offloading sa 2023-02-09 22:28:06 -08:00
ni net: ethernet: nixge: fix NULL dereference 2022-11-28 11:09:51 +00:00
nvidia net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
nxp net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
oki-semi net: pch_gbe: fix pci device refcount leak while module exiting 2022-11-18 19:40:14 -08:00
packetengines net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
pasemi net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
pensando ionic: missed doorbell workaround 2023-02-03 19:58:53 -08:00
qlogic qede: execute xdp_do_flush() before napi_complete_done() 2023-01-27 22:27:59 -08:00
qualcomm net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
rdc r6040: Fix kmemleak in probe and remove 2022-12-15 12:48:34 +01:00
realtek Revert "r8169: disable detection of chip version 36" 2023-01-09 20:40:28 -08:00
renesas net: ravb: Fix possible hang if RIS2_QFF1 happen 2023-01-25 13:00:27 +00:00
rocker rocker: Explicitly mark learned FDB entries as offloaded 2022-11-02 20:45:23 -07:00
samsung net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
seeq
sfc sfc: correctly advertise tunneled IPv6 segmentation 2023-01-28 00:19:48 -08:00
sgi net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
silan
sis net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
smsc net: remove smc911x driver 2022-10-18 19:33:51 -07:00
socionext net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
stmicro net: stmmac: Restrict warning on disabling DMA store and fwd mode 2023-02-14 09:10:47 +01:00
sun treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
sunplus eth: sp7021: drop free_netdev() from spl2sw_init_netdev() 2022-11-10 16:27:33 -08:00
synopsys net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
tehuti net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
ti net: ethernet: ti: am65-cpsw: Add RX DMA Channel Teardown Quirk 2023-02-10 19:22:32 -08:00
toshiba net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
tundra ethernet: tundra: free irq when alloc ring failed in tsi108_open() 2022-11-10 15:39:08 +01:00
vertexcom net: vertexcom: mse102x: Silence no spi_device_id warnings 2022-09-26 12:46:16 -07:00
via net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
wangxun net: libwx: Fix dead code for duplicate check 2022-11-18 10:53:13 +00:00
wiznet net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
xilinx Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-13 09:49:29 +01:00
xircom net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
xscale ptp_ixp46x: convert .adjfreq to .adjfine 2022-11-11 10:58:39 +00:00
Kconfig eth: fealnx: delete the driver for Myson MTD-800 2022-10-27 13:32:08 +02:00
Makefile eth: fealnx: delete the driver for Myson MTD-800 2022-10-27 13:32:08 +02:00
dnet.c net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-12 09:56:17 +00:00
dnet.h
ec_bhf.c
ethoc.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
jme.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
jme.h
korina.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
lantiq_etop.c net: lantiq_etop: don't free skb when returning NETDEV_TX_BUSY 2022-10-24 13:02:18 +01:00
lantiq_xrx200.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00