All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Íñigo Huguet" <ihuguet@redhat.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Miroslav Lichvar <mlichvar@redhat.com>,
	netdev@vger.kernel.org, yangbo.lu@nxp.com,
	gerhard@engleder-embedded.com, habetsm.xilinx@gmail.com,
	ecree.xilinx@gmail.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, alex.maftei@amd.com,
	Jacob Keller <jacob.e.keller@intel.com>
Subject: Re: PTP vclock: BUG: scheduling while atomic
Date: Fri, 3 Feb 2023 17:04:53 +0100	[thread overview]
Message-ID: <CACT4oudV-rA0ViZy5tWkvTufYji3bZzUyXcU0tTB67GjsvcvFw@mail.gmail.com> (raw)
In-Reply-To: <Y9xQ8ikvkWjjuw2p@hoboy.vegasvil.org>

On Fri, Feb 3, 2023 at 1:10 AM Richard Cochran <richardcochran@gmail.com> wrote:
>
> On Thu, Feb 02, 2023 at 05:33:15PM +0100, Miroslav Lichvar wrote:
> > On Thu, Feb 02, 2023 at 05:02:07PM +0100, Íñigo Huguet wrote:
> > > Our QA team was testing PTP vclocks, and they've found this error with sfc NIC/driver:
> > >   BUG: scheduling while atomic: ptp5/25223/0x00000002
> > >
> > > The reason seems to be that vclocks disable interrupts with `spin_lock_irqsave` in
> > > `ptp_vclock_gettime`, and then read the timecounter, which in turns ends calling to
> > > the driver's `gettime64` callback.
> >
> > The same issue was observed with the ice driver:
> > https://lists.osuosl.org/pipermail/intel-wired-lan/Week-of-Mon-20221107/030633.html
> >
> > I tried to fix it generally in the vclock support, but was not
> > successful. There was a hint it would be fixed in the driver. I'm not
> > sure what is the best approach here.
>
> Can ptp_vclock_gettime use a mutex instead?

I don't see any place where these vclock functions are called in
atomic context, so it might be possible, but there are many callback
indirections and I'm not sure if I might have missed any.

>
> Thanks,
> Richard
>


-- 
Íñigo Huguet


  reply	other threads:[~2023-02-03 16:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 16:02 PTP vclock: BUG: scheduling while atomic Íñigo Huguet
2023-02-02 16:33 ` Miroslav Lichvar
2023-02-02 20:52   ` Jacob Keller
2023-02-03  0:10   ` Richard Cochran
2023-02-03 16:04     ` Íñigo Huguet [this message]
2023-02-03  9:09 ` Martin Habets

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=CACT4oudV-rA0ViZy5tWkvTufYji3bZzUyXcU0tTB67GjsvcvFw@mail.gmail.com \
    --to=ihuguet@redhat.com \
    --cc=alex.maftei@amd.com \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=gerhard@engleder-embedded.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=yangbo.lu@nxp.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 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.