[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d4667ada-bee0-e7c8-4456-b27e30cfffd0@gmail.com>
Date: Fri, 2 Sep 2022 08:47:34 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Csókás Bence <csokas.bence@...lan.hu>,
netdev@...r.kernel.org
Cc: Richard Cochran <richardcochran@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Francesco Dolcini <francesco.dolcini@...adex.com>,
Andrew Lunn <andrew@...n.ch>, kernel@...gutronix.de,
Marc Kleine-Budde <mkl@...gutronix.de>
Subject: Re: [PATCH v2] net: fec: Use a spinlock to guard `fep->ptp_clk_on`
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
Powered by blists - more mailing lists