mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Tony Huang 黃懷厚" <tony.huang@sunplus.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Tony Huang" <tonyhuang.sunplus@gmail.com>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"lhjeff911@gmail.com" <lhjeff911@gmail.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	DTML <devicetree@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Wells Lu 呂芳騰" <wells.lu@sunplus.com>,
	"Lh Kuo 郭力豪" <lh.Kuo@sunplus.com>
Subject: RE: [PATCH v5 2/2] mmc: Add mmc driver for Sunplus SP7021
Date: Fri, 1 Apr 2022 00:53:01 +0000	[thread overview]
Message-ID: <b93772c707074f14ae3f2eeaf5e348ab@sphcmbx02.sunplus.com.tw> (raw)
In-Reply-To: <CAK8P3a3edkGMyypwchiJjHDvO4ro6RsOvrhUbEDmP1Obs94mXw@mail.gmail.com>

Dear Arnd:

> <tony.huang@sunplus.com> wrote:
> > > > +static void spmmc_request(struct mmc_host *mmc, struct
> > > > +mmc_request
> > > > +*mrq) {
> > > > +       struct spmmc_host *host = mmc_priv(mmc);
> > > > +       struct mmc_data *data;
> > > > +       struct mmc_command *cmd;
> > > > +       int ret;
> > > > +
> > > > +       ret = mutex_lock_interruptible(&host->mrq_lock);
> > > > +       if (ret)
> > > > +               return;
> > >
> > > I don't think it's valid to just return here when you get a signal.
> > > If nothing can handle the signal, doesn't it just hang?
> > >
> > > It also appears that you don't release the mutex until the tasklet
> > > runs, but it is not valid to release a mutex from a different context.
> > >
> > > You should get a warning about this when running a kernel with
> > > lockdep enabled at compile time. Please rework the locking to make this
> work.
> > >
> >         Reomve code:
> >     ret = mutex_lock_interruptible(&host->mrq_lock);
> >     if (ret)
> >          return;
> >
> >         Below is my modification:
> > .    mutex_lock(&host->mrq_lock);
> 
> That addresses the problem with the signal handling, but not the lock
> imbalance. Please fix that as well.

Ok, I will modify lock imbalance issue.

> > >
> > > It's better to use SYSTEM_SLEEP_PM_OPS/RUNTIME_PM_OPS instead of
> the
> > > SET_ version, then you can remove all the #ifdef checks.
> > >
> >
> >         I use SYSTEM_SLEEP_PM_OPS/RUNTIME_PM_OPS.
> >         Compile shows error. Error: implicit declaration of function ? ?
> SYSTEM_SLEEP_PM_OPS? ? Did you mean ? ? SET_SYSTEM_SLEEP_PM_OPS? ?
> [-Werror=implicit-function-declaration]
> 
> Maybe you are on an old kernel release?
> 

OK,I will use new kernel release to compiler.

> >         I reference other mmc driver.
> >         Below is my modification:
> >     Compiler is pass.
> >
> >         #ifdef CONFIG_PM_SLEEP
> >         static int spmmc_pm_suspend(struct device *dev)
> >         {
> >                 pm_runtime_force_suspend(dev);
> >
> >                 return 0;
> >         }
> 
> We should fix the other drivers as well. For the moment, just do it the right
> way now instead of copying the #ifdefs.
> 
OK, I will follow right way to remove #ifdef.




      reply	other threads:[~2022-04-01  0:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 14:42 [PATCH v5 0/2] Add mmc driver for Sunplus SP7021 SOC Tony Huang
2022-03-29 14:42 ` [PATCH v5 1/2] dt-binding: mmc: Add mmc yaml file for Sunplus SP7021 Tony Huang
2022-03-29 16:50   ` Krzysztof Kozlowski
2022-03-31  9:35     ` Tony Huang 黃懷厚
2022-03-29 14:42 ` [PATCH v5 2/2] mmc: Add mmc driver " Tony Huang
2022-03-29 15:10   ` Arnd Bergmann
2022-03-31  9:27     ` Tony Huang 黃懷厚
2022-03-31 10:17       ` Arnd Bergmann
2022-04-01  0:53         ` Tony Huang 黃懷厚 [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=b93772c707074f14ae3f2eeaf5e348ab@sphcmbx02.sunplus.com.tw \
    --to=tony.huang@sunplus.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=lh.Kuo@sunplus.com \
    --cc=lhjeff911@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=tonyhuang.sunplus@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wells.lu@sunplus.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®