All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, kernel test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 5.15 062/110] net: stmmac: dwmac-visconti: No change to ETHER_CLOCK_SEL for unexpected speed request.
Date: Mon,  7 Feb 2022 12:06:35 +0100	[thread overview]
Message-ID: <20220207103804.384237281@linuxfoundation.org> (raw)
In-Reply-To: <20220207103802.280120990@linuxfoundation.org>

From: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>

commit 928d6fe996f69330ded6b887baf4534c5fac7988 upstream.

Variable clk_sel_val is not initialized in the default case of the first switch statement.
In that case, the function should return immediately without any changes to the hardware.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: b38dd98ff8d0 ("net: stmmac: Add Toshiba Visconti SoCs glue driver")
Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
@@ -49,13 +49,15 @@ struct visconti_eth {
 	void __iomem *reg;
 	u32 phy_intf_sel;
 	struct clk *phy_ref_clk;
+	struct device *dev;
 	spinlock_t lock; /* lock to protect register update */
 };
 
 static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed)
 {
 	struct visconti_eth *dwmac = priv;
-	unsigned int val, clk_sel_val;
+	struct net_device *netdev = dev_get_drvdata(dwmac->dev);
+	unsigned int val, clk_sel_val = 0;
 	unsigned long flags;
 
 	spin_lock_irqsave(&dwmac->lock, flags);
@@ -85,7 +87,9 @@ static void visconti_eth_fix_mac_speed(v
 		break;
 	default:
 		/* No bit control */
-		break;
+		netdev_err(netdev, "Unsupported speed request (%d)", speed);
+		spin_unlock_irqrestore(&dwmac->lock, flags);
+		return;
 	}
 
 	writel(val, dwmac->reg + MAC_CTRL_REG);
@@ -230,6 +234,7 @@ static int visconti_eth_dwmac_probe(stru
 
 	spin_lock_init(&dwmac->lock);
 	dwmac->reg = stmmac_res.addr;
+	dwmac->dev = &pdev->dev;
 	plat_dat->bsp_priv = dwmac;
 	plat_dat->fix_mac_speed = visconti_eth_fix_mac_speed;
 



  parent reply	other threads:[~2022-02-07 11:55 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 11:05 [PATCH 5.15 000/110] 5.15.22-rc1 review Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 001/110] drm/i915: Disable DSB usage for now Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 002/110] selinux: fix double free of cond_list on error paths Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 003/110] audit: improve audit queue handling when "audit=1" on cmdline Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 004/110] ipc/sem: do not sleep with a spin lock held Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 005/110] spi: stm32-qspi: Update spi registering Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 006/110] ASoC: hdmi-codec: Fix OOB memory accesses Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 007/110] ASoC: ops: Reject out of bounds values in snd_soc_put_volsw() Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 008/110] ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx() Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 009/110] ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx() Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 010/110] ALSA: usb-audio: Correct quirk for VF0770 Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 011/110] ALSA: hda: Fix UAF of leds class devs at unbinding Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 012/110] ALSA: hda: realtek: Fix race at concurrent COEF updates Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 013/110] ALSA: hda/realtek: Add quirk for ASUS GU603 Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 014/110] ALSA: hda/realtek: Add missing fixup-model entry for Gigabyte X570 ALC1220 quirks Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 015/110] ALSA: hda/realtek: Fix silent output on Gigabyte X570S Aorus Master (newer chipset) Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 016/110] ALSA: hda/realtek: Fix silent output on Gigabyte X570 Aorus Xtreme after reboot from Windows Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 017/110] btrfs: dont start transaction for scrub if the fs is mounted read-only Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 018/110] btrfs: fix deadlock between quota disable and qgroup rescan worker Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 019/110] btrfs: fix use-after-free after failure to create a snapshot Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 020/110] Revert "fs/9p: search open fids first" Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 021/110] drm/nouveau: fix off by one in BIOS boundary checking Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 022/110] drm/i915/adlp: Fix TypeC PHY-ready status readout Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 023/110] drm/amd/pm: correct the MGpuFanBoost support for Beige Goby Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 024/110] drm/amd/display: watermark latencies is not enough on DCN31 Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 025/110] drm/amd/display: Force link_rate as LINK_RATE_RBR2 for 2018 15" Apple Retina panels Greg Kroah-Hartman
2022-02-07 11:05 ` [PATCH 5.15 026/110] nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts() Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 027/110] mm/debug_vm_pgtable: remove pte entry from the page table Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 028/110] mm/pgtable: define pte_index so that preprocessor could recognize it Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 029/110] mm/kmemleak: avoid scanning potential huge holes Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 030/110] block: bio-integrity: Advance seed correctly for larger interval sizes Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 031/110] dma-buf: heaps: Fix potential spectre v1 gadget Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 032/110] IB/hfi1: Fix AIP early init panic Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 033/110] Revert "fbcon: Disable accelerated scrolling" Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 034/110] fbcon: Add option to enable legacy hardware acceleration Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 035/110] mptcp: fix msk traversal in mptcp_nl_cmd_set_flags() Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 036/110] Revert "ASoC: mediatek: Check for error clk pointer" Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 037/110] KVM: arm64: Avoid consuming a stale esr value when SError occur Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 038/110] KVM: arm64: Stop handle_exit() from handling HVC twice when an SError occurs Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 039/110] RDMA/cma: Use correct address when leaving multicast group Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 040/110] RDMA/ucma: Protect mc during concurrent multicast leaves Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 041/110] RDMA/siw: Fix refcounting leak in siw_create_qp() Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 042/110] IB/rdmavt: Validate remote_addr during loopback atomic tests Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 043/110] RDMA/siw: Fix broken RDMA Read Fence/Resume logic Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 044/110] RDMA/mlx4: Dont continue event handler after memory allocation failure Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 045/110] ALSA: usb-audio: initialize variables that could ignore errors Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 046/110] ALSA: hda: Fix signedness of sscanf() arguments Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 047/110] ALSA: hda: Skip codec shutdown in case the codec is not registered Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 048/110] iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping() Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 049/110] iommu/amd: Fix loop timeout issue in iommu_ga_log_enable() Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 050/110] spi: bcm-qspi: check for valid cs before applying chip select Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 051/110] spi: mediatek: Avoid NULL pointer crash in interrupt Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 052/110] spi: meson-spicc: add IRQ check in meson_spicc_probe Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 053/110] spi: uniphier: fix reference count leak in uniphier_spi_probe() Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 054/110] IB/hfi1: Fix tstats alloc and dealloc Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 055/110] IB/cm: Release previously acquired reference counter in the cm_id_priv Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 056/110] net: ieee802154: hwsim: Ensure proper channel selection at probe time Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 057/110] net: ieee802154: mcr20a: Fix lifs/sifs periods Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 058/110] net: ieee802154: ca8210: Stop leaking skbs Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 059/110] netfilter: nft_reject_bridge: Fix for missing reply from prerouting Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 060/110] net: ieee802154: Return meaningful error codes from the netlink helpers Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 061/110] net/smc: Forward wakeup to smc socket waitqueue after fallback Greg Kroah-Hartman
2022-02-07 11:06 ` Greg Kroah-Hartman [this message]
2022-02-07 11:06 ` [PATCH 5.15 063/110] net: stmmac: properly handle with runtime pm in stmmac_dvr_remove() Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 064/110] net: macsec: Fix offload support for NETDEV_UNREGISTER event Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 065/110] net: macsec: Verify that send_sci is on when setting Tx sci explicitly Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 066/110] net: stmmac: dump gmac4 DMA registers correctly Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 067/110] net: stmmac: ensure PTP time register reads are consistent Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 068/110] drm/kmb: Fix for build errors with Warray-bounds Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 069/110] drm/i915/overlay: Prevent divide by zero bugs in scaling Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 070/110] drm/amd: avoid suspend on dGPUs w/ s2idle support when runtime PM enabled Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 071/110] ASoC: fsl: Add missing error handling in pcm030_fabric_probe Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 072/110] ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytes Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 073/110] ASoC: simple-card: fix probe failure on platform component Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 074/110] ASoC: cpcap: Check for NULL pointer after calling of_get_child_by_name Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 075/110] ASoC: max9759: fix underflow in speaker_gain_control_put() Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 076/110] ASoC: codecs: wcd938x: fix incorrect used of portid Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 077/110] ASoC: codecs: lpass-rx-macro: fix sidetone register offsets Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 078/110] ASoC: codecs: wcd938x: fix return value of mixer put function Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 079/110] pinctrl: sunxi: Fix H616 I2S3 pin data Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 080/110] pinctrl: intel: Fix a glitch when updating IRQ flags on a preconfigured line Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 081/110] pinctrl: intel: fix unexpected interrupt Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 082/110] pinctrl: bcm2835: Fix a few error paths Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 083/110] scsi: bnx2fc: Make bnx2fc_recv_frame() mp safe Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 084/110] nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 085/110] gve: fix the wrong AdminQ buffer queue index check Greg Kroah-Hartman
2022-02-07 11:06 ` [PATCH 5.15 086/110] bpf: Use VM_MAP instead of VM_ALLOC for ringbuf Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 087/110] selftests/exec: Remove pipe from TEST_GEN_FILES Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 088/110] selftests: futex: Use variable MAKE instead of make Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 089/110] tools/resolve_btfids: Do not print any commands when building silently Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 090/110] e1000e: Separate ADP board type from TGP Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 091/110] rtc: cmos: Evaluate century appropriate Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 092/110] kvm/arm64: rework guest entry logic Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 093/110] perf: Copy perf_event_attr::sig_data on modification Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 094/110] perf stat: Fix display of grouped aliased events Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 095/110] perf/x86/intel/pt: Fix crash with stop filters in single-range mode Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 096/110] x86/perf: Default set FREEZE_ON_SMI for all Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 097/110] EDAC/altera: Fix deferred probing Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 098/110] EDAC/xgene: " Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 099/110] ext4: prevent used blocks from being allocated during fast commit replay Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 100/110] ext4: modify the logic of ext4_mb_new_blocks_simple Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 101/110] ext4: fix error handling in ext4_restore_inline_data() Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 102/110] ext4: fix error handling in ext4_fc_record_modified_inode() Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 103/110] ext4: fix incorrect type issue during replay_del_range Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 104/110] net: dsa: mt7530: make NET_DSA_MT7530 select MEDIATEK_GE_PHY Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 105/110] cgroup/cpuset: Fix "suspicious RCU usage" lockdep warning Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 106/110] tools include UAPI: Sync sound/asound.h copy with the kernel sources Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 107/110] gpio: idt3243x: Fix an ignored error return from platform_get_irq() Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 108/110] gpio: mpc8xxx: " Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 109/110] selftests: nft_concat_range: add test for reload with no element add/del Greg Kroah-Hartman
2022-02-07 11:07 ` [PATCH 5.15 110/110] selftests: netfilter: check stateless nat udp checksum fixup Greg Kroah-Hartman
2022-02-07 12:29 ` [PATCH 5.15 000/110] 5.15.22-rc1 review Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220207103804.384237281@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=stable@vger.kernel.org \
    --cc=yuji2.ishikawa@toshiba.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.