All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Xiaolei Li <xiaolei.li@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Maxim Levitsky <maximlevitsky@gmail.com>
Subject: Re: [RFC PATCH 0/5] mtd: rawnand: Simplify the locking
Date: Tue, 15 Jan 2019 17:54:02 +0100	[thread overview]
Message-ID: <20190115175402.6b4d990c@xps13> (raw)
In-Reply-To: <20181120105720.23081-1-boris.brezillon@bootlin.com>

Hi Boris,

Boris Brezillon <boris.brezillon@bootlin.com> wrote on Tue, 20 Nov 2018
11:57:15 +0100:

> Hello,
> 
> The nand_get_device()/nand_release_device() logic looks complex for no
> obvious reasons. I might be wrong, but I think the spinlock+waitqueue
> approach can be replaced by regular mutexes: one to serialize accesses
> to the NAND chip (and protect the suspended field), another one to
> serialize accesses to the controller.
> 
> We also get rid of the ->state field which was not really useful except
> for detecting when the NAND chip is suspended (some drivers were using
> it to determine the timeout value, but always taking the max timeout
> sounds like a good solution too, since it's a timeout, not a delay).
> This ->state field is replaced by a ->suspended field which is
> protected by the chip lock. So no state machine anymore, just 3 states:
> 
> 1/ NAND is idle
> 2/ NAND is being accessed (we don't care about the access type)
> 3/ NAND is suspended
> 
> Patches 1 to 4 are preparing things for the chip->state, controller->wq
> and controller->lock removal by patching all drivers that were
> accessing those fields directly.
> 
> Patch 5 is doing the actual locking changes.
> 
> Note that even if we don't rework the locking, I think patches 1 to 4
> are worth applying.
> 
> Regards,
> 
> Boris

Looks good to me, applied on nand/next.


Thanks,
Miquèl

      parent reply	other threads:[~2019-01-15 16:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 10:57 [RFC PATCH 0/5] mtd: rawnand: Simplify the locking Boris Brezillon
2018-11-20 10:57 ` [RFC PATCH 1/5] mtd: rawnand: mtk: Use nand_controller_init() instead of open-coding it Boris Brezillon
2018-11-20 10:57 ` [RFC PATCH 2/5] mtd: rawnand: tmio: Do not abuse nand_controller->wq Boris Brezillon
2018-11-20 10:57 ` [RFC PATCH 3/5] mtd: rawnand: omap2: Use nand_controller_init() Boris Brezillon
2018-11-20 10:57 ` [RFC PATCH 4/5] mtd: rawnand: Stop using chip->state in drivers Boris Brezillon
2018-11-20 10:57 ` [RFC PATCH 5/5] mtd: rawnand: Simplify the locking Boris Brezillon
2019-01-15 16:54 ` Miquel Raynal [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=20190115175402.6b4d990c@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=maximlevitsky@gmail.com \
    --cc=richard@nod.at \
    --cc=xiaolei.li@mediatek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.