From: Florian Fainelli <f.fainelli@gmail.com>
To: "Csókás Bence" <csokas.bence@prolan.hu>, netdev@vger.kernel.org
Cc: Richard Cochran <richardcochran@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Francesco Dolcini <francesco.dolcini@toradex.com>,
Andrew Lunn <andrew@lunn.ch>,
kernel@pengutronix.de, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: Re: [PATCH v2] net: fec: Use a spinlock to guard `fep->ptp_clk_on`
Date: Fri, 2 Sep 2022 08:47:34 -0700 [thread overview]
Message-ID: <d4667ada-bee0-e7c8-4456-b27e30cfffd0@gmail.com> (raw)
In-Reply-To: <6703a552-8d23-6136-c0b8-c68845d00aa8@prolan.hu>
On 9/2/2022 12:35 AM, Csókás Bence wrote:
>
> On 2022. 09. 01. 18:26, Florian Fainelli wrote:
>>
>>> schedule_delayed_work(&fep->time_keep, HZ);
>>> }
>>> @@ -599,8 +593,6 @@ void fec_ptp_init(struct platform_device *pdev,
>>> int irq_idx)
>>> }
>>> fep->ptp_inc = NSEC_PER_SEC / fep->cycle_speed;
>>> - spin_lock_init(&fep->tmreg_lock);
>>
>> This change needs to be kept as there is no other code in the driver
>> that would initialize the tmreg_lock otherwise. Try building a kernel
>> with spinlock debugging enabled and you should see it barf with an
>> incorrect spinlock bad magic.
>
> `fec_ptp_init()` is called from `fec_probe()`, which init's the spinlock:
>
> > @@ -3907,7 +3908,7 @@ fec_probe(struct platform_device *pdev)
> > }
> >
> > fep->ptp_clk_on = false;
> > - mutex_init(&fep->ptp_clk_mutex);
> > + spin_lock_init(&fep->tmreg_lock);
Ah indeed, I missed that, thanks!
--
Florian
next prev parent reply other threads:[~2022-09-02 15:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 14:04 [PATCH v2] net: fec: Use a spinlock to guard `fep->ptp_clk_on` Csókás Bence
2022-09-01 15:04 ` Francesco Dolcini
2022-09-02 7:18 ` Csókás Bence
2022-09-01 16:26 ` Florian Fainelli
2022-09-02 7:35 ` Csókás Bence
2022-09-02 15:47 ` Florian Fainelli [this message]
2022-09-02 17:04 ` Francesco Dolcini
2022-09-03 4:30 ` patchwork-bot+netdevbpf
2022-09-05 7:38 ` Marc Kleine-Budde
2022-09-07 14:39 ` Marc Kleine-Budde
2022-09-09 13:56 ` Francesco Dolcini
2022-09-10 17:08 ` Csókás Bence
2022-09-14 14:53 ` [REGRESSION] " Guenter Roeck
2022-09-18 18:59 ` [REGRESSION] Re: [PATCH v2] net: fec: Use a spinlock to guard `fep->ptp_clk_on` #forregzbot Thorsten Leemhuis
2022-09-22 10:58 ` Thorsten Leemhuis
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=d4667ada-bee0-e7c8-4456-b27e30cfffd0@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=csokas.bence@prolan.hu \
--cc=davem@davemloft.net \
--cc=francesco.dolcini@toradex.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
/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).