devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Frank Li <frank.li@nxp.com>
Cc: "tglx@linutronix.de" <tglx@linutronix.de>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"krzysztof.kozlowski+dt@linaro.org" 
	<krzysztof.kozlowski+dt@linaro.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kw@linux.com" <kw@linux.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"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>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Peng Fan <peng.fan@nxp.com>, Aisheng Dong <aisheng.dong@nxp.com>,
	"jdmason@kudzu.us" <jdmason@kudzu.us>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>, "kishon@ti.com" <kishon@ti.com>,
	"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
	"ntb@lists.linux.dev" <ntb@lists.linux.dev>,
	"lznuaa@gmail.com" <lznuaa@gmail.com>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"manivannan.sadhasivam@linaro.org"
	<manivannan.sadhasivam@linaro.org>
Subject: Re: [EXT] Re: [PATCH v9 2/4] irqchip: Add IMX MU MSI controller driver
Date: Fri, 09 Sep 2022 13:07:55 +0100	[thread overview]
Message-ID: <87edwkrbs4.wl-maz@kernel.org> (raw)
In-Reply-To: <AM9PR04MB8793CE5AAAB281CE628845AC88409@AM9PR04MB8793.eurprd04.prod.outlook.com>

On Thu, 08 Sep 2022 16:35:20 +0100,
Frank Li <frank.li@nxp.com> wrote:

> > > > > +struct imx_mu_msi {
> > > > > +     spinlock_t                      lock;
> > > > > +     raw_spinlock_t                  reglock;
> > > >
> > > > Why two locks? Isn't one enough to protect both MSI allocation (which
> > > > happens once in a blue moon) and register access?
> > >
> > > [Frank Li] Previously your comment, ask me to use raw_spinlock for
> > > read\write register access.  I don't think raw_spinlock is good for
> > > MSI allocation.
> > 
> > Why wouldn't it be good enough? I'd really like to know.[Frank Li] '
> 
> [Frank Li] According to my understand, raw_spinlock skip some lockdep
> /debug feature to get better performance, which should be used when
> Frequently call, such as irq handle\polling thread.

I'm afraid you are terribly misguided. They both have the same debug
features because they are both using the same core implementation, and
the only difference is whether this is preemptible for RT purposes or
not.

> Spinlock have DEBUG feature to check wrong use lock.  Allocate MSI generally
> only is call once when driver probe.

Again, you should really read the code and the documentation and stop
making things up.

> 
> The basic principle,  lock should be used only when necessary.  Access reg and
> Allocate msi is totally independence events.

Independent events that do not occur simultaneously. So no harm in
sharing the same lock.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2022-09-09 12:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07  3:48 [PATCH v9 0/4] PCI EP driver support MSI doorbell from host Frank Li
2022-09-07  3:48 ` [PATCH v9 1/4] irqchip: allow pass down .pm field at IRQCHIP_PLATFORM_DRIVER_END Frank Li
2022-09-07  3:48 ` [PATCH v9 2/4] irqchip: Add IMX MU MSI controller driver Frank Li
2022-09-08  0:03   ` kernel test robot
2022-09-08  7:02     ` Marc Zyngier
2022-09-08 14:26       ` [EXT] " Frank Li
2022-09-08 14:35         ` Marc Zyngier
2022-09-08  7:39   ` Marc Zyngier
2022-09-08 14:23     ` [EXT] " Frank Li
2022-09-08 14:51       ` Marc Zyngier
2022-09-08 15:35         ` Frank Li
2022-09-09 12:07           ` Marc Zyngier [this message]
2022-09-09 14:59             ` Frank Li
2022-09-10 14:35               ` Marc Zyngier
2022-09-12 15:53         ` Frank Li
2022-09-13 17:44           ` Marc Zyngier
2022-09-09 14:52     ` Frank Li
2022-09-10 14:40       ` Marc Zyngier
2022-09-12 16:17     ` Frank Li
2022-09-07  3:48 ` [PATCH v9 3/4] dt-bindings: irqchip: imx mu work as msi controller Frank Li
2022-09-09  1:43   ` Rob Herring
2022-09-07  3:48 ` [PATCH v9 4/4] PCI: endpoint: Add vNTB MSI support Frank Li
2022-09-07 20:43   ` kernel test robot
2022-09-13 17:24   ` Manivannan Sadhasivam

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=87edwkrbs4.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=aisheng.dong@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=jdmason@kudzu.us \
    --cc=kernel@pengutronix.de \
    --cc=kishon@ti.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lznuaa@gmail.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=ntb@lists.linux.dev \
    --cc=peng.fan@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    /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).