From: "Jörg Schummer" <ext-jorg.2.schummer@nokia.com>
To: ext Pierre Ossman <drzeus-mmc@drzeus.cx>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFT] MMC: core/core.c: mmc_rescan detects card change in one run
Date: Tue, 03 Mar 2009 09:24:19 +0200 [thread overview]
Message-ID: <1236065059.5791.34.camel@jorg-desktop> (raw)
In-Reply-To: <20090302210945.04bfa623@mjolnir.ossman.eu>
Hello,
thanks for your reply.
On Mon, 2009-03-02 at 21:09 +0100, ext Pierre Ossman wrote:
> On Thu, 19 Feb 2009 17:26:26 +0200
> Jorg Schummer <ext-jorg.2.schummer@nokia.com> wrote:
>
> > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> > index df6ce4a..cd2e29f 100644
> > --- a/drivers/mmc/core/core.c
> > +++ b/drivers/mmc/core/core.c
> > @@ -740,6 +740,22 @@ void mmc_rescan(struct work_struct *work)
> >
> > mmc_bus_get(host);
> >
> > + /* if there is a card registered */
> > + if (host->bus_ops != NULL) {
> > +
> > + if (host->bus_ops->detect && !host->bus_dead) {
> > +
> > + /* check whether the card is still present */
> > + host->bus_ops->detect(host);
> > +
> > + /* release the bus and update bus status in case
> > + the card was removed */
> > + mmc_bus_put(host);
> > + mmc_bus_get(host);
> > + }
> > + }
> > +
> > + /* if there is no card registered */
> > if (host->bus_ops == NULL) {
> > /*
> > * Only we can add a new handler, so it's safe to
>
> Perhaps it's more clear if you grab the lock for the first section,
> release it after and then regrab it for the second section. A bit less
> efficient, but I don't think that will be a problem in practice.
Yes, you're probably right, I should take read- and maintainability into
account there. Will change that.
>
> > @@ -789,12 +805,8 @@ void mmc_rescan(struct work_struct *work)
> >
> > mmc_release_host(host);
> > mmc_power_off(host);
> > - } else {
> > - if (host->bus_ops->detect && !host->bus_dead)
> > - host->bus_ops->detect(host);
> > -
> > + } else
> > mmc_bus_put(host);
> > - }
> > out:
> > if (host->caps & MMC_CAP_NEEDS_POLL)
> > mmc_schedule_delayed_work(&host->detect, HZ);
>
> The else section got a bit small here with that code removed. Perhaps
> we should instead have:
>
> if (host->bus_ops != NULL) {
> mmc_bus_put(host);
> goto out;
> }
I guess you meant
else {
mmc_bus_put(host);
goto out;
}
since it would be the else clause of
if (host->bus_ops == NULL)
Also: Are you sure "goto out" should be added in the else-branch? (Since
it's not present in the end of the corresponding if-branch either, and
is technically not needed.)
Regards,
Jörg
next prev parent reply other threads:[~2009-03-03 7:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-19 15:26 [PATCH RFT] MMC: core/core.c: mmc_rescan detects card change in one run Jorg Schummer
2009-03-02 20:09 ` Pierre Ossman
2009-03-03 7:24 ` Jörg Schummer [this message]
2009-03-03 8:55 ` Pierre Ossman
2009-03-31 14:51 ` [PATCH 1/1] " Jorg Schummer
2009-04-10 16:39 ` Pierre Ossman
2009-06-03 9:47 ` Jörg Schummer
2009-06-03 10:24 ` Pierre Ossman
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=1236065059.5791.34.camel@jorg-desktop \
--to=ext-jorg.2.schummer@nokia.com \
--cc=drzeus-mmc@drzeus.cx \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox