From: "Erhard F." <erhard_f@mailbox.org>
To: "Ahmed S. Darwish" <a.darwish@linutronix.de>
Cc: Jakub Kicinski <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: seqlock lockdep false positives?
Date: Mon, 8 Mar 2021 19:28:49 +0100 [thread overview]
Message-ID: <20210308192849.153454f7@yea> (raw)
In-Reply-To: <YESayEskbtjEWjFd@lx-t490>
On Sun, 7 Mar 2021 10:20:08 +0100
"Ahmed S. Darwish" <a.darwish@linutronix.de> wrote:
> @Erhard, can you please try below patch? Just want to confirm if this
> theory has any validity to it:
>
> diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
> index 1e5a453dea14..c0dbb0418e9d 100644
> --- a/drivers/net/ethernet/realtek/8139too.c
> +++ b/drivers/net/ethernet/realtek/8139too.c
> @@ -715,6 +715,11 @@ static const unsigned int rtl8139_rx_config =
> static const unsigned int rtl8139_tx_config =
> TxIFG96 | (TX_DMA_BURST << TxDMAShift) | (TX_RETRY << TxRetryShift);
>
> +#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
> +static struct lock_class_key rx_stats_key;
> +static struct lock_class_key tx_stats_key;
> +#endif
> +
> static void __rtl8139_cleanup_dev (struct net_device *dev)
> {
> struct rtl8139_private *tp = netdev_priv(dev);
> @@ -794,8 +799,17 @@ static struct net_device *rtl8139_init_board(struct pci_dev *pdev)
>
> pci_set_master (pdev);
>
> - u64_stats_init(&tp->rx_stats.syncp);
> - u64_stats_init(&tp->tx_stats.syncp);
> +#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
> + dev_warn(d, "Manually intializing tx/rx stats sequence counters\n");
> +
> + tp->rx_stats.syncp.seq.sequence = 0;
> + lockdep_set_class_and_name(&tp->rx_stats.syncp.seq,
> + &rx_stats_key, "RX stats");
> +
> + tp->tx_stats.syncp.seq.sequence = 0;
> + lockdep_set_class_and_name(&tp->tx_stats.syncp.seq,
> + &tx_stats_key, "TX stats");
> +#endif
Hi Ahmed!
With your patch on top of 5.12-rc2 the lockdep splat is gone in the kernel dmesg and I only get:
[...]
8139too: 8139too Fast Ethernet driver 0.9.28
8139too 0000:00:0f.0: Manually intializing tx/rx stats sequence counters
8139too 0000:00:0f.0 eth0: RealTek RTL8139 at 0x(ptrval), 00:30:1b:2f:2c:58, IRQ 18
[...]
Trying Peter's patch next.
prev parent reply other threads:[~2021-03-08 18:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 0:40 seqlock lockdep false positives? Jakub Kicinski
2021-03-07 9:20 ` Ahmed S. Darwish
2021-03-08 8:38 ` Peter Zijlstra
2021-03-08 20:42 ` Erhard F.
2021-03-09 7:54 ` Peter Zijlstra
2021-03-09 10:12 ` Eric Dumazet
2021-03-09 14:24 ` Peter Zijlstra
2021-03-08 18:28 ` Erhard F. [this message]
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=20210308192849.153454f7@yea \
--to=erhard_f@mailbox.org \
--cc=a.darwish@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).