[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1265038824.3785.5.camel@maxim-laptop>
Date: Mon, 01 Feb 2010 17:40:24 +0200
From: Maxim Levitsky <maximlevitsky@...il.com>
To: Ricard Wanderlof <ricard.wanderlof@...s.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
linux-mtd <linux-mtd@...ts.infradead.org>
Subject: Re: [PATCH 03/17] blktrans: track open and close calls.
On Mon, 2010-02-01 at 08:46 +0100, Ricard Wanderlof wrote:
> On Sat, 30 Jan 2010, Maxim Levitsky wrote:
>
> > This patch adds tracking for open and close calls.
> > Now trans ->open and ->release are never called twise in a row
> > ->release is also called once before mtd device disappers
> > ...
>
> > --- a/drivers/mtd/mtd_blkdevs.c
> > +++ b/drivers/mtd/mtd_blkdevs.c
> > @@ -128,6 +128,9 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
> > if (!get_mtd_device(NULL, dev->mtd->index))
> > goto out;
> >
> > + if (dev->open++)
> > + goto out;
> > +
> > if (!try_module_get(tr->owner))
> > goto out_tr;
> >
> > @@ -153,6 +156,10 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode)
> > struct mtd_blktrans_ops *tr = dev->tr;
> > int ret = 0;
> >
> > + dev->open--;
> > + if (dev->open)
> > + return 0;
> > +
>
> Just a very minor quibble: if you use if (dev->open++) in one function,
> why not use if (--dev->open) in the other? Or separate the
> increment/decrement from the test, depending on you style preferences.
No problem, this just got lost in all the noise.
I tried all kinds of approaches to make hotplug reliable, before finally
making it be so. (It is really stable here, I didn't have any hotplug
related issues for very long time)
In fact I feel that my xd card is more stable that sd one...
(I recently found a bug in sdhci driver....)
I would be very happy to receive a full review of the patches, and get
it in the kernel.
Best regards,
Maxim Levitsky
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists