OpenCloudOS-Kernel/drivers/net
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
..
appletalk
arcnet
bonding bonding: fix error checking in bond_debug_reregister() 2023-02-03 19:22:20 -08:00
caif
can can: mcp251xfd: mcp251xfd_ring_set_ringparam(): assign missing tx_obj_num_coalesce_irq 2023-02-02 10:33:27 +01:00
dsa net: dsa: mt7530: don't change PVC_EG_TAG when CPU port becomes VLAN-aware 2023-02-07 11:42:04 +01:00
ethernet igb: conditionalize I2C bit banging on external thermal sensor support 2023-02-15 21:20:40 -08:00
fddi net: defxx: Fix missing err handling in dfx_init() 2022-12-09 10:44:27 +00:00
fjes
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-13 09:49:29 +01:00
hippi
hyperv hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC 2023-02-07 20:39:26 -08:00
ieee802154 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-08 18:19:59 -08:00
ipa net: ipa: disable ipa interrupt during suspend 2023-01-17 19:04:13 -08:00
ipvlan Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
mctp mctp: serial: Fix starting value for frame check sequence 2022-12-19 12:38:45 +00:00
mdio net: mdio-mux-meson-g12a: force internal PHY off on mux switch 2023-01-25 22:46:51 -08:00
netdevsim xfrm: allow state packet offload mode 2022-12-05 10:32:44 +01:00
pcs net: pcs: altera-tse: remove unnecessary register definitions 2022-11-29 20:29:55 -08:00
phy net: phy: meson-gxl: use MMD access dummy stubs for GXL, internal PHY 2023-02-03 19:55:36 -08:00
plip net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() 2022-12-07 20:10:47 -08:00
ppp Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
pse-pd
slip
team Revert "net: team: use IFF_NO_ADDRCONF flag to prevent ipv6 addrconf" 2023-01-18 20:32:44 -08:00
usb net/usb: kalmia: Don't pass act_len in usb_bulk_msg error path 2023-02-13 09:41:14 +00:00
vmxnet3 vmxnet3: move rss code block under eop descriptor 2023-02-09 22:50:46 -08:00
vxlan vxlan: Fix memory leaks in error path 2023-01-02 13:37:33 +00:00
wan net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs 2023-01-13 21:34:31 -08:00
wireguard wireguard: timers: cast enum limits members to int in prints 2022-12-13 19:30:45 -08:00
wireless wifi: mt76: dma: fix a regression in adding rx buffers 2023-01-16 17:27:17 +02:00
wwan net: wwan: t7xx: Fix Runtime PM initialization 2023-01-28 13:20:21 +00:00
xen-netback xen: branch for v6.2-rc4 2023-01-12 17:02:20 -06:00
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
loopback.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
macsec.c net: macsec: fix net device access prior to holding a lock 2022-12-13 18:58:08 -08:00
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c netconsole: avoid CON_ENABLED misuse to track registration 2022-12-02 11:25:02 +01:00
nlmon.c
ntb_netdev.c ntb_netdev: Use dev_kfree_skb_any() in interrupt context 2022-12-12 12:56:37 -08:00
rionet.c
sb1000.c
sungem_phy.c
tap.c driver/net/tun: Added features for USO. 2022-12-12 09:29:56 +00:00
thunderbolt.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-08 18:19:59 -08:00
tun.c driver/net/tun: Added features for USO. 2022-12-12 09:29:56 +00:00
veth.c veth: Fix race with AF_XDP exposing old or uninitialized descriptors 2022-12-22 15:06:10 +01:00
virtio_net.c virtio-net: Keep stop() to follow mirror sequence of open() 2023-02-02 10:10:53 -08:00
vrf.c net: vrf: determine the dst using the original ifindex for multicast 2022-12-21 17:47:37 -08:00
vsockmon.c
xen-netfront.c xen: branch for v6.2-rc4 2023-01-12 17:02:20 -06:00