From: Axe Yang <axe.yang@mediatek.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Chaotian Jing <chaotian.jing@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
Satya Tangirala <satyat@google.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Lucas Stach <dev@lynxeye.de>, Eric Biggers <ebiggers@google.com>,
Andrew Jeffery <andrew@aj.id.au>,
Stephen Boyd <swboyd@chromium.org>,
Kiwoong Kim <kwmad.kim@samsung.com>, Yue Hu <huyue2@yulong.com>,
Tian Tao <tiantao6@hisilicon.com>,
<angelogioacchino.delregno@collabora.com>,
<linux-mmc@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
Yong Mao <yong.mao@mediatek.com>
Subject: Re: [RESEND v3 3/3] mmc: mediatek: add support for SDIO eint IRQ
Date: Wed, 19 Jan 2022 18:11:43 +0800 [thread overview]
Message-ID: <068c965a0243486f0e1cabbafb8904a6a8ddcc9f.camel@mediatek.com> (raw)
In-Reply-To: <CAHp75VdkKYujGZOdGkLK-tzC9q+RjkX59fFZe5cHajGOnDdL2w@mail.gmail.com>
On Tue, 2022-01-18 at 11:18 +0200, Andy Shevchenko wrote:
> On Mon, Jan 17, 2022 at 7:33 PM Axe Yang <axe.yang@mediatek.com>
> wrote:
> >
> > Add support for eint IRQ when MSDC is used as an SDIO host. This
> > feature requires SDIO device support async IRQ function. With this
> > feature, SDIO host can be awakened by SDIO card in suspend state,
> > without additional pin.
> >
> > MSDC driver will time-share the SDIO DAT1 pin. During suspend, MSDC
> > turn off clock and switch SDIO DAT1 pin to GPIO mode. And during
> > resume, switch GPIO function back to DAT1 mode then turn on clock.
> >
> > Some device tree property should be added or modified in MSDC node
> > to support SDIO eint IRQ. Pinctrls named state_dat1 and state_eint
> > are mandatory. And cap-sdio-async-irq flag is necessary since this
> > feature depends on asynchronous interrupt:
> > &mmcX {
> > ...
> > pinctrl-names = "default", "state_uhs",
> > "state_eint",
> > "state_dat1";
> > ...
> > pinctrl-2 = <&mmc2_pins_eint>;
> > pinctrl-3 = <&mmc2_pins_dat1>;
> > ...
> > cap-sdio-async-irq;
> > ...
> > };
>
> ...
>
> > +static irqreturn_t msdc_sdio_eint_irq(int irq, void *dev_id)
> > +{
> > + struct msdc_host *host = dev_id;
> > + struct mmc_host *mmc = mmc_from_priv(host);
> > + unsigned long flags;
>
> Same Q as per v2. Why do you need this?
>
> Yes, you did the first step to the answer, but I want you to go
> deeper
> and tell me why you need the spin_lock_irqsave() variant.
You are right, no need to save/restore flags in irq handler.
Will fix it in new version.
Thanks.
>
> > + spin_lock_irqsave(&host->lock, flags);
> > + if (likely(host->sdio_irq_cnt > 0)) {
> > + disable_irq_nosync(host->eint_irq);
> > + disable_irq_wake(host->eint_irq);
> > + host->sdio_irq_cnt--;
> > + }
> > + spin_unlock_irqrestore(&host->lock, flags);
> > +
> > + sdio_signal_irq(mmc);
> > +
> > + return IRQ_HANDLED;
> > +}
>
>
prev parent reply other threads:[~2022-01-19 10:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-17 8:25 [RESEND v3 0/3] " Axe Yang
2022-01-17 8:25 ` [RESEND v3 1/3] dt-bindings: mmc: add cap-sdio-async-irq flag Axe Yang
2022-01-17 8:25 ` [RESEND v3 2/3] mmc: core: Add support for SDIO async interrupt Axe Yang
2022-01-17 8:25 ` [RESEND v3 3/3] mmc: mediatek: add support for SDIO eint IRQ Axe Yang
2022-01-18 9:18 ` Andy Shevchenko
2022-01-19 10:11 ` Axe Yang [this message]
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=068c965a0243486f0e1cabbafb8904a6a8ddcc9f.camel@mediatek.com \
--to=axe.yang@mediatek.com \
--cc=adrian.hunter@intel.com \
--cc=andrew@aj.id.au \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chaotian.jing@mediatek.com \
--cc=dev@lynxeye.de \
--cc=devicetree@vger.kernel.org \
--cc=ebiggers@google.com \
--cc=huyue2@yulong.com \
--cc=kwmad.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=satyat@google.com \
--cc=swboyd@chromium.org \
--cc=tiantao6@hisilicon.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=yong.mao@mediatek.com \
--cc=yoshihiro.shimoda.uh@renesas.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
all inboxes | Powered by JetHome®