All of lore.kernel.org
 help / color / mirror / Atom feed
From: richardcochran@gmail.com (Richard Cochran)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/4] net: macb: Add hardware PTP support
Date: Wed, 7 Jun 2017 15:28:17 +0200	[thread overview]
Message-ID: <20170607132817.GA28329@localhost.localdomain> (raw)
In-Reply-To: <BN3PR07MB2516A47C2CFEB58BCFFB2C46C9C80@BN3PR07MB2516.namprd07.prod.outlook.com>

On Wed, Jun 07, 2017 at 11:13:36AM +0000, Rafal Ozieblo wrote:
> Please look at following call-stack:
> 
> 1. macb_interrupt()   // spin_lock(&bp->lock) is taken
> 2. macb_tx_interrupt()
> 3. macb_handle_txtstamp()
> 4. skb_tstamp_tx()
> 5. __skb_tstamp_tx()
> 6. skb_may_tx_timestamp()
> 7. read_lock_bh() // second lock is taken

Well, you can always drop the lock, or postpone the call to
skb_tstamp_tx() until after the spin lock is released...

> I know that those are different locks and different types. But this could lead 
> to deadlocks. This is the reason of warning I could see.

Can you please post the lockdep splat?

Thanks,
Richard

WARNING: multiple messages have this Message-ID (diff)
From: Richard Cochran <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Rafal Ozieblo <rafalo-vna1KIf7WgpBDgjK7y7TUQ@public.gmane.org>
Cc: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	"nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org"
	<nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
	"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"harini.katakam-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org"
	<harini.katakam-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>,
	"andrei.pistirica-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org"
	<andrei.pistirica-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
Subject: Re: [PATCH v2 4/4] net: macb: Add hardware PTP support
Date: Wed, 7 Jun 2017 15:28:17 +0200	[thread overview]
Message-ID: <20170607132817.GA28329@localhost.localdomain> (raw)
In-Reply-To: <BN3PR07MB2516A47C2CFEB58BCFFB2C46C9C80-EldUQEzkDQfxGZiqM5fOI+FPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

On Wed, Jun 07, 2017 at 11:13:36AM +0000, Rafal Ozieblo wrote:
> Please look at following call-stack:
> 
> 1. macb_interrupt()   // spin_lock(&bp->lock) is taken
> 2. macb_tx_interrupt()
> 3. macb_handle_txtstamp()
> 4. skb_tstamp_tx()
> 5. __skb_tstamp_tx()
> 6. skb_may_tx_timestamp()
> 7. read_lock_bh() // second lock is taken

Well, you can always drop the lock, or postpone the call to
skb_tstamp_tx() until after the spin lock is released...

> I know that those are different locks and different types. But this could lead 
> to deadlocks. This is the reason of warning I could see.

Can you please post the lockdep splat?

Thanks,
Richard

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Richard Cochran <richardcochran@gmail.com>
To: Rafal Ozieblo <rafalo@cadence.com>
Cc: David Miller <davem@davemloft.net>,
	"nicolas.ferre@atmel.com" <nicolas.ferre@atmel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"harini.katakam@xilinx.com" <harini.katakam@xilinx.com>,
	"andrei.pistirica@microchip.com" <andrei.pistirica@microchip.com>
Subject: Re: [PATCH v2 4/4] net: macb: Add hardware PTP support
Date: Wed, 7 Jun 2017 15:28:17 +0200	[thread overview]
Message-ID: <20170607132817.GA28329@localhost.localdomain> (raw)
In-Reply-To: <BN3PR07MB2516A47C2CFEB58BCFFB2C46C9C80@BN3PR07MB2516.namprd07.prod.outlook.com>

On Wed, Jun 07, 2017 at 11:13:36AM +0000, Rafal Ozieblo wrote:
> Please look at following call-stack:
> 
> 1. macb_interrupt()   // spin_lock(&bp->lock) is taken
> 2. macb_tx_interrupt()
> 3. macb_handle_txtstamp()
> 4. skb_tstamp_tx()
> 5. __skb_tstamp_tx()
> 6. skb_may_tx_timestamp()
> 7. read_lock_bh() // second lock is taken

Well, you can always drop the lock, or postpone the call to
skb_tstamp_tx() until after the spin lock is released...

> I know that those are different locks and different types. But this could lead 
> to deadlocks. This is the reason of warning I could see.

Can you please post the lockdep splat?

Thanks,
Richard

  reply	other threads:[~2017-06-07 13:28 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 14:23 [PATCH v2 0/4] PTP support for macb driver Rafal Ozieblo
2017-06-02 14:23 ` Rafal Ozieblo
2017-06-02 14:23 ` Rafal Ozieblo
2017-06-02 14:26 ` [PATCH v2 1/4] net: macb: Add support for PTP timestamps in DMA descriptors Rafal Ozieblo
2017-06-02 14:26   ` Rafal Ozieblo
2017-06-02 14:26   ` Rafal Ozieblo
2017-06-02 14:27 ` [PATCH v2 2/4] net: macb: Add tsu_clk to device tree Rafal Ozieblo
2017-06-02 14:27   ` Rafal Ozieblo
2017-06-02 14:27   ` Rafal Ozieblo
     [not found] ` <1496413439-12900-1-git-send-email-rafalo-vna1KIf7WgpBDgjK7y7TUQ@public.gmane.org>
2017-06-02 14:27   ` [PATCH v2 3/4] net: macb: macb.c changed to macb_main.c Rafal Ozieblo
2017-06-02 14:27     ` Rafal Ozieblo
2017-06-02 14:27     ` Rafal Ozieblo
2017-06-06 18:39     ` Richard Cochran
2017-06-06 18:39       ` Richard Cochran
2017-06-06 18:39       ` Richard Cochran
2017-06-06 19:00       ` David Miller
2017-06-06 19:00         ` David Miller
2017-06-06 19:00         ` David Miller
2017-06-06 20:22         ` Richard Cochran
2017-06-06 20:22           ` Richard Cochran
2017-06-06 20:22           ` Richard Cochran
2017-06-02 14:28 ` [PATCH v2 4/4] net: macb: Add hardware PTP support Rafal Ozieblo
2017-06-02 14:28   ` Rafal Ozieblo
2017-06-02 14:28   ` Rafal Ozieblo
2017-06-04 20:55   ` Richard Cochran
2017-06-04 20:55     ` Richard Cochran
2017-06-04 20:55     ` Richard Cochran
2017-06-06  8:54     ` Rafal Ozieblo
2017-06-06  8:54       ` Rafal Ozieblo
2017-06-06 18:36       ` Richard Cochran
2017-06-06 18:36         ` Richard Cochran
2017-06-06 18:36         ` Richard Cochran
2017-06-06 18:33   ` Richard Cochran
2017-06-06 18:33     ` Richard Cochran
2017-06-07 11:13     ` Rafal Ozieblo
2017-06-07 11:13       ` Rafal Ozieblo
2017-06-07 11:13       ` Rafal Ozieblo
2017-06-07 13:28       ` Richard Cochran [this message]
2017-06-07 13:28         ` Richard Cochran
2017-06-07 13:28         ` Richard Cochran
2017-06-08 12:48         ` Rafal Ozieblo
2017-06-08 12:48           ` Rafal Ozieblo

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=20170607132817.GA28329@localhost.localdomain \
    --to=richardcochran@gmail.com \
    --cc=linux-arm-kernel@lists.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 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.