kernel-hacking-2024-linux-s.../drivers
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
..
accel
accessibility
acpi - Start checking for -mindirect-branch-cs-prefix clang support too now that LLVM 2023-01-29 11:17:34 -08:00
amba
android
ata ata: libata: Fix sata_down_spd_limit() when no link speed is reported 2023-02-02 20:26:45 +09:00
atm
auxdisplay
base
bcma
block block-6.2-2023-02-03 2023-02-03 11:35:42 -08:00
bluetooth
bus
cdrom
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl cxl/pmem: Fix nvdimm unregistration when cxl_pmem driver is absent 2023-01-25 15:35:26 -08:00
dax
dca
devfreq
dio
dma
dma-buf dma-buf: actually set signaling bit for private stub fences 2023-01-27 14:16:18 +01:00
edac EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info 2023-01-20 19:47:34 +01:00
eisa
extcon
firewire
firmware Batch #3 of EFI fixes for v6.2 2023-02-03 10:25:41 -08:00
fpga
fsi
gnss
gpio gpio: ep93xx: remove unused variable 2023-01-27 14:05:38 +01:00
gpu drm fixes for 6.2-rc7 2023-02-03 10:09:55 -08:00
greybus
hid for-linus-2023020901 2023-02-09 09:09:13 -08:00
hsi
hte
hv HV: hv_balloon: fix memory leak with using debugfs_lookup() 2023-02-03 07:45:18 +01:00
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio iio: imu: fxos8700: fix MAGN sensor scale and unit 2023-01-21 18:15:19 +00:00
infiniband
input Input updates for v6.2-rc5 2023-01-29 11:06:47 -08:00
interconnect
iommu
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md hardening fixes for v6.2-rc6 2023-01-27 16:09:12 -08:00
media media: videobuf2: set q->streaming later 2023-01-24 16:34:06 +01:00
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net igb: conditionalize I2C bit banging on external thermal sensor support 2023-02-15 21:20:40 -08:00
nfc
ntb
nubus
nvdimm
nvme block-6.2-2023-02-03 2023-02-03 11:35:42 -08:00
nvmem nvmem: qcom-spmi-sdam: fix module autoloading 2023-01-28 14:39:31 +01:00
of Devicetree fixes for v6.2, part 2: 2023-02-07 14:17:12 -08:00
opp
parisc
parport
pci
pcmcia
peci
perf Partially revert "perf/arm-cmn: Optimise DTC counter accesses" 2023-01-26 13:55:38 +00:00
phy
pinctrl
platform platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match 2023-02-02 11:34:38 +01:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc rtc: sunplus: fix format string for printing resource 2023-01-23 23:33:47 +01:00
s390
sbus
scsi SCSI fixes on 20230131 2023-01-31 11:39:08 -08:00
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal thermal: intel: int340x: Add locking to int340x_thermal_get_trip_type() 2023-01-25 15:37:21 +01:00
thunderbolt
tty vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF 2023-01-31 15:51:52 +01:00
ufs
uio
usb usb: typec: ucsi: Don't attempt to resume the ports before they exist 2023-02-02 11:27:28 +01:00
vdpa vdpa: ifcvf: Do proper cleanup if IFCVF init fails 2023-01-27 06:18:41 -05:00
vfio
vhost vhost-scsi: unbreak any layout for response 2023-01-27 06:18:41 -05:00
video fbdev updates for kernel 6.2-rc7: 2023-02-05 11:43:00 -08:00
virt
virtio
vlynq
w1
watchdog watchdog: diag288_wdt: fix __diag288() inline assembly 2023-01-30 14:40:50 +01:00
xen
zorro
Kconfig
Makefile