Background: Turris Omnia (Armada 385); eth2 (mvneta) connected to SFP bus;
SFP module is present, but no fiber connected, so definitely no carrier.
After booting, eth2 is down, but netdev LED trigger surprisingly reports
link active. Then, after "ip link set eth2 up", the link indicator goes
away - as I would have expected it from the beginning.
It turns out, that the default carrier state after netdev creation is
"carrier ok". Some ethernet drivers explicitly call netif_carrier_off
during probing, others (like mvneta) don't - which explains the current
behaviour: only when the device is brought up, phylink_start calls
netif_carrier_off.
Fix this for all drivers using phylink, by calling netif_carrier_off in
phylink_create.
Fixes: 089381b27abe ("leds: initial support for Turris Omnia LEDs")
Cc: stable(a)vger.kernel.org
Suggested-by: Andrew Lunn <andrew(a)lunn.ch>
Signed-off-by: Klaus Kudielka <klaus.kudielka(a)gmail.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew(a)lunn.ch>
---
v2: clarified fixed drivers; added fixes tag & cc stable
drivers/net/phy/phylink.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 6712883498..a28da80bde 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1616,6 +1616,7 @@ struct phylink *phylink_create(struct phylink_config *config,
pl->config = config;
if (config->type == PHYLINK_NETDEV) {
pl->netdev = to_net_dev(config->dev);
+ netif_carrier_off(pl->netdev);
} else if (config->type == PHYLINK_DEV) {
pl->dev = config->dev;
} else {
--
2.42.0
The rtnl lock also needs to be held before rndis_filter_device_add()
which advertises nvsp_2_vsc_capability / sriov bit, and triggers
VF NIC offering and registering. If VF NIC finished register_netdev()
earlier it may cause name based config failure.
To fix this issue, move the call to rtnl_lock() before
rndis_filter_device_add(), so VF will be registered later than netvsc
/ synthetic NIC, and gets a name numbered (ethX) after netvsc.
Cc: stable(a)vger.kernel.org
Fixes: e04e7a7bbd4b ("hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()")
Signed-off-by: Haiyang Zhang <haiyangz(a)microsoft.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek(a)intel.com>
---
v3:
Divide it into two patches, suggested by Jakub Kicinski.
v2:
Fix rtnl_unlock() in error handling as found by Wojciech Drewek.
---
drivers/net/hyperv/netvsc_drv.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 3ba3c8fb28a5..5e528a76f5f5 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -2531,15 +2531,6 @@ static int netvsc_probe(struct hv_device *dev,
goto devinfo_failed;
}
- nvdev = rndis_filter_device_add(dev, device_info);
- if (IS_ERR(nvdev)) {
- ret = PTR_ERR(nvdev);
- netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
- goto rndis_failed;
- }
-
- eth_hw_addr_set(net, device_info->mac_adr);
-
/* We must get rtnl lock before scheduling nvdev->subchan_work,
* otherwise netvsc_subchan_work() can get rtnl lock first and wait
* all subchannels to show up, but that may not happen because
@@ -2547,9 +2538,23 @@ static int netvsc_probe(struct hv_device *dev,
* -> ... -> device_add() -> ... -> __device_attach() can't get
* the device lock, so all the subchannels can't be processed --
* finally netvsc_subchan_work() hangs forever.
+ *
+ * The rtnl lock also needs to be held before rndis_filter_device_add()
+ * which advertises nvsp_2_vsc_capability / sriov bit, and triggers
+ * VF NIC offering and registering. If VF NIC finished register_netdev()
+ * earlier it may cause name based config failure.
*/
rtnl_lock();
+ nvdev = rndis_filter_device_add(dev, device_info);
+ if (IS_ERR(nvdev)) {
+ ret = PTR_ERR(nvdev);
+ netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
+ goto rndis_failed;
+ }
+
+ eth_hw_addr_set(net, device_info->mac_adr);
+
if (nvdev->num_chn > 1)
schedule_work(&nvdev->subchan_work);
@@ -2586,9 +2591,9 @@ static int netvsc_probe(struct hv_device *dev,
return 0;
register_failed:
- rtnl_unlock();
rndis_filter_device_remove(dev, nvdev);
rndis_failed:
+ rtnl_unlock();
netvsc_devinfo_put(device_info);
devinfo_failed:
free_percpu(net_device_ctx->vf_stats);
--
2.25.1
This is the start of the stable review cycle for the 5.10.200 release.
There are 95 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 08 Nov 2023 13:02:46 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.200-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.10.200-rc1
Mark Hasemeyer <markhas(a)chromium.org>
ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
Cameron Williams <cang1(a)live.co.uk>
tty: 8250: Add support for Intashield IS-100
Cameron Williams <cang1(a)live.co.uk>
tty: 8250: Add support for Brainboxes UP cards
Cameron Williams <cang1(a)live.co.uk>
tty: 8250: Add support for additional Brainboxes UC cards
Cameron Williams <cang1(a)live.co.uk>
tty: 8250: Remove UC-257 and UC-431
Andrey Konovalov <andreyknvl(a)gmail.com>
usb: raw-gadget: properly handle interrupted requests
LihaSika <lihasika(a)gmail.com>
usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility
Vicki Pfau <vi(a)endrift.com>
PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device
Lukas Magel <lukas.magel(a)posteo.net>
can: isotp: isotp_sendmsg(): fix TX state detection and wait behavior
Oliver Hartkopp <socketcan(a)hartkopp.net>
can: isotp: isotp_bind(): do not validate unused address information
Oliver Hartkopp <socketcan(a)hartkopp.net>
can: isotp: add local echo tx processing and tx without FC
Oliver Hartkopp <socketcan(a)hartkopp.net>
can: isotp: handle wait_event_interruptible() return values
Oliver Hartkopp <socketcan(a)hartkopp.net>
can: isotp: check CAN address family in isotp_bind()
Oliver Hartkopp <socketcan(a)hartkopp.net>
can: isotp: isotp_bind(): return -EINVAL on incorrect CAN ID formatting
Oliver Hartkopp <socketcan(a)hartkopp.net>
can: isotp: set max PDU size to 64 kByte
Patrick Menschel <menschel.p(a)posteo.de>
can: isotp: Add error message if txqueuelen is too small
Patrick Menschel <menschel.p(a)posteo.de>
can: isotp: add symbolic error message to isotp_module_init()
Patrick Menschel <menschel.p(a)posteo.de>
can: isotp: change error format from decimal to symbolic error names
Ian Rogers <irogers(a)google.com>
perf evlist: Avoid frequency mode for the dummy event
Namhyung Kim <namhyung(a)kernel.org>
perf tools: Get rid of evlist__add_on_all_cpus()
Adrian Hunter <adrian.hunter(a)intel.com>
perf evlist: Add evlist__add_dummy_on_all_cpus()
Michael Ellerman <mpe(a)ellerman.id.au>
powerpc/mm: Fix boot crash with FLATMEM
Su Hui <suhui(a)nfschina.com>
net: chelsio: cxgb4: add an error code check in t4_load_phy_fw
Liming Sun <limings(a)nvidia.com>
platform/mellanox: mlxbf-tmfifo: Fix a warning message
Tomas Henzl <thenzl(a)redhat.com>
scsi: mpt3sas: Fix in error path
Jorge Maidana <jorgem.linux(a)gmail.com>
fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit()
Shuming Fan <shumingf(a)realtek.com>
ASoC: rt5650: fix the wrong result of key button
Florian Westphal <fw(a)strlen.de>
netfilter: nfnetlink_log: silence bogus compiler warning
William A. Kennington III <william(a)wkennington.com>
spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0
Arnd Bergmann <arnd(a)arndb.de>
fbdev: atyfb: only use ioremap_uc() on i386 and ia64
Dmitry Torokhov <dmitry.torokhov(a)gmail.com>
Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport
Zhang Shurong <zhang_shurong(a)foxmail.com>
dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
Ben Wolsieffer <ben.wolsieffer(a)hefring.com>
irqchip/stm32-exti: add missing DT IRQ flag translation
Anup Patel <apatel(a)ventanamicro.com>
irqchip/riscv-intc: Mark all INTC nodes as initialized
Gustavo A. R. Silva <gustavoars(a)kernel.org>
net: sched: cls_u32: Fix allocation size in u32_init()
Juergen Gross <jgross(a)suse.com>
x86: Fix .brk attribute in linker script
Hangyu Hua <hbh25y(a)gmail.com>
rpmsg: Fix possible refcount leak in rpmsg_register_device_override()
Bjorn Andersson <quic_bjorande(a)quicinc.com>
rpmsg: glink: Release driver_override
Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
rpmsg: Fix calling device_lock() on non-initialized device
Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
rpmsg: Fix kfree() of static memory on setting driver_override
Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
rpmsg: Constify local variable in field store macro
Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
driver: platform: Add helper for safer setting of driver_override
John Sperbeck <jsperbeck(a)google.com>
objtool/x86: add missing embedded_insn check
Baokun Li <libaokun1(a)huawei.com>
ext4: avoid overlapping preallocations due to overflow
Baokun Li <libaokun1(a)huawei.com>
ext4: fix BUG in ext4_mb_new_inode_pa() due to overflow
Baokun Li <libaokun1(a)huawei.com>
ext4: add two helper functions extent_logical_end() and pa_logical_end()
Josh Poimboeuf <jpoimboe(a)kernel.org>
x86/mm: Fix RESERVE_BRK() for older binutils
Josh Poimboeuf <jpoimboe(a)redhat.com>
x86/mm: Simplify RESERVE_BRK()
Chao Yu <chao(a)kernel.org>
f2fs: fix to do sanity check on inode type during garbage collection
Steve French <stfrench(a)microsoft.com>
smbdirect: missing rc checks while waiting for rdma events
Wang Hai <wanghai38(a)huawei.com>
kobject: Fix slab-out-of-bounds in fill_kobj_path()
Thomas Gleixner <tglx(a)linutronix.de>
x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility
Robert Hancock <robert.hancock(a)calian.com>
iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds
Bartosz Golaszewski <bgolaszewski(a)baylibre.com>
iio: adc: xilinx: use more devres helpers and remove remove()
Bartosz Golaszewski <bgolaszewski(a)baylibre.com>
iio: adc: xilinx: use devm_krealloc() instead of kfree() + kcalloc()
Bartosz Golaszewski <bgolaszewski(a)baylibre.com>
iio: adc: xilinx: use helper variable for &pdev->dev
Alessandro Carminati <alessandro.carminati(a)gmail.com>
clk: Sanitize possible_parent_show to Handle Return Value of of_clk_get_parent_name
Al Viro <viro(a)zeniv.linux.org.uk>
sparc32: fix a braino in fault handling in csum_and_copy_..._user()
Peter Zijlstra <peterz(a)infradead.org>
perf/core: Fix potential NULL deref
Peng Fan <peng.fan(a)nxp.com>
nvmem: imx: correct nregs for i.MX6UL
Peng Fan <peng.fan(a)nxp.com>
nvmem: imx: correct nregs for i.MX6SLL
Peng Fan <peng.fan(a)nxp.com>
nvmem: imx: correct nregs for i.MX6ULL
Ekansh Gupta <quic_ekangupt(a)quicinc.com>
misc: fastrpc: Clean buffers on remote invocation failures
Yujie Liu <yujie.liu(a)intel.com>
tracing/kprobes: Fix the description of variable length arguments
Jian Zhang <zhangjian.3032(a)bytedance.com>
i2c: aspeed: Fix i2c bus hang in slave read
Alain Volmat <alain.volmat(a)foss.st.com>
i2c: stm32f7: Fix PEC handling in case of SMBUS transfers
Herve Codina <herve.codina(a)bootlin.com>
i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node()
Herve Codina <herve.codina(a)bootlin.com>
i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node()
Herve Codina <herve.codina(a)bootlin.com>
i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node()
Marek Szyprowski <m.szyprowski(a)samsung.com>
iio: exynos-adc: request second interupt only when touchscreen mode is used
Haibo Li <haibo.li(a)mediatek.com>
kasan: print the original fault addr when access invalid shadow
Ivan Vecera <ivecera(a)redhat.com>
i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR
Pablo Neira Ayuso <pablo(a)netfilter.org>
gtp: fix fragmentation needed check with gso
Pablo Neira Ayuso <pablo(a)netfilter.org>
gtp: uapi: fix GTPA_MAX
Fred Chen <fred.chenchen03(a)gmail.com>
tcp: fix wrong RTO timeout when received SACK reneging
Douglas Anderson <dianders(a)chromium.org>
r8152: Release firmware if we have an error in probe
Douglas Anderson <dianders(a)chromium.org>
r8152: Cancel hw_phy_work if we have an error in probe
Douglas Anderson <dianders(a)chromium.org>
r8152: Run the unload routine if we have errors during probe
Douglas Anderson <dianders(a)chromium.org>
r8152: Increase USB control msg timeout to 5000ms as per spec
Shigeru Yoshida <syoshida(a)redhat.com>
net: usb: smsc95xx: Fix uninit-value access in smsc95xx_read_reg
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show()
Sasha Neftin <sasha.neftin(a)intel.com>
igc: Fix ambiguity in the ethtool advertising
Eric Dumazet <edumazet(a)google.com>
neighbour: fix various data-races
Mateusz Palczewski <mateusz.palczewski(a)intel.com>
igb: Fix potential memory leak in igb_add_ethtool_nfc_entry
Kunwu Chan <chentao(a)kylinos.cn>
treewide: Spelling fix in comment
Mirsad Goran Todorovac <mirsad.todorovac(a)alu.unizg.hr>
r8169: fix the KCSAN reported data race in rtl_rx while reading desc->opts1
Mirsad Goran Todorovac <mirsad.todorovac(a)alu.unizg.hr>
r8169: fix the KCSAN reported data-race in rtl_tx while reading TxDescArray[entry].opts1
Lukasz Majczak <lma(a)semihalf.com>
drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper()
Wolfram Sang <wsa+renesas(a)sang-engineering.com>
mmc: renesas_sdhi: use custom mask for TMIO_MASK_ALL
Kemeng Shi <shikemeng(a)huaweicloud.com>
mm/page_alloc: correct start page when guard page debug is enabled
Maximilian Heyne <mheyne(a)amazon.de>
virtio-mmio: fix memory leak of vm_dev
Gavin Shan <gshan(a)redhat.com>
virtio_balloon: Fix endless deflation and inflation on arm64
Rodríguez Barbarin, José Javier <JoseJavier.Rodriguez(a)duagon.com>
mcb-lpc: Reallocate memory region to avoid memory overlapping
Rodríguez Barbarin, José Javier <JoseJavier.Rodriguez(a)duagon.com>
mcb: Return actual parsed size when reading chameleon table
Francis Laniel <flaniel(a)linux.microsoft.com>
selftests/ftrace: Add new test case which checks non unique symbol
-------------
Diffstat:
Makefile | 4 +-
arch/powerpc/kernel/setup-common.c | 2 +
arch/powerpc/mm/mem.c | 1 -
arch/sparc/lib/checksum_32.S | 2 +-
arch/x86/include/asm/i8259.h | 2 +
arch/x86/include/asm/setup.h | 46 +--
arch/x86/kernel/acpi/boot.c | 3 +
arch/x86/kernel/i8259.c | 38 +-
arch/x86/kernel/setup.c | 5 -
arch/x86/kernel/vmlinux.lds.S | 2 +-
drivers/base/driver.c | 69 ++++
drivers/base/platform.c | 28 +-
drivers/clk/clk.c | 21 +-
drivers/dma/ste_dma40.c | 1 +
drivers/gpu/drm/drm_dp_mst_topology.c | 6 +-
drivers/i2c/busses/i2c-aspeed.c | 3 +-
drivers/i2c/busses/i2c-stm32f7.c | 9 +-
drivers/i2c/muxes/i2c-demux-pinctrl.c | 2 +-
drivers/i2c/muxes/i2c-mux-gpmux.c | 2 +-
drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 +-
drivers/iio/adc/exynos_adc.c | 24 +-
drivers/iio/adc/xilinx-xadc-core.c | 179 ++++-----
drivers/input/mouse/synaptics.c | 1 +
drivers/input/rmi4/rmi_smbus.c | 50 ++-
drivers/irqchip/irq-riscv-intc.c | 10 +-
drivers/irqchip/irq-stm32-exti.c | 1 +
drivers/mcb/mcb-lpc.c | 35 +-
drivers/mcb/mcb-parse.c | 15 +-
drivers/misc/fastrpc.c | 10 +-
drivers/mmc/host/renesas_sdhi_core.c | 3 +-
drivers/mmc/host/tmio_mmc.h | 2 +-
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 +
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +-
drivers/net/ethernet/intel/igb/igb_ethtool.c | 6 +-
drivers/net/ethernet/intel/igc/igc_ethtool.c | 35 +-
drivers/net/ethernet/realtek/r8169_main.c | 4 +-
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 +-
drivers/net/gtp.c | 5 +-
drivers/net/ieee802154/adf7242.c | 5 +-
drivers/net/usb/r8152.c | 11 +-
drivers/net/usb/smsc95xx.c | 4 +-
drivers/nvmem/imx-ocotp.c | 6 +-
drivers/pci/quirks.c | 8 +-
drivers/platform/mellanox/mlxbf-tmfifo.c | 21 +-
drivers/rpmsg/qcom_glink_native.c | 2 +
drivers/rpmsg/rpmsg_core.c | 37 +-
drivers/rpmsg/rpmsg_internal.h | 5 +-
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +-
drivers/spi/spi-npcm-fiu.c | 5 +-
drivers/tty/serial/8250/8250_pci.c | 122 +++++-
drivers/usb/gadget/legacy/raw_gadget.c | 26 +-
drivers/usb/storage/unusual_cypress.h | 2 +-
drivers/video/fbdev/aty/atyfb_base.c | 4 +
drivers/video/fbdev/uvesafb.c | 2 +-
drivers/virtio/virtio_balloon.c | 6 +-
drivers/virtio/virtio_mmio.c | 19 +-
fs/cifs/smbdirect.c | 14 +-
fs/ext4/mballoc.c | 51 +--
fs/ext4/mballoc.h | 14 +
fs/f2fs/gc.c | 3 +-
include/linux/device/driver.h | 2 +
include/linux/kasan.h | 6 +-
include/linux/pci_ids.h | 1 +
include/linux/platform_device.h | 6 +-
include/linux/rpmsg.h | 14 +-
include/uapi/linux/can/isotp.h | 25 +-
include/uapi/linux/gtp.h | 2 +-
kernel/events/core.c | 3 +-
kernel/trace/trace_kprobe.c | 4 +-
lib/kobject.c | 12 +-
mm/kasan/report.c | 4 +-
mm/page_alloc.c | 2 +-
net/can/isotp.c | 446 +++++++++++++--------
net/core/neighbour.c | 67 ++--
net/ipv4/tcp_input.c | 9 +-
net/netfilter/nfnetlink_log.c | 2 +-
net/sched/cls_u32.c | 2 +-
sound/hda/intel-dsp-config.c | 6 +
sound/soc/codecs/rt5645.c | 2 +
tools/objtool/check.c | 2 +-
tools/perf/util/evlist.c | 21 +
tools/perf/util/evlist.h | 5 +
.../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 13 +
83 files changed, 1088 insertions(+), 573 deletions(-)