From: Andrew Lunn <andrew@lunn•ch>
To: Marek Vasut <marex@denx•de>
Cc: netdev@vger•kernel.org, "David S . Miller" <davem@davemloft•net>,
Florian Fainelli <f.fainelli@gmail•com>,
George McCollister <george.mccollister@gmail•com>,
Tristram Ha <Tristram.Ha@microchip•com>,
Woojung Huh <woojung.huh@microchip•com>
Subject: Re: [PATCH V2 2/2] net: dsa: microchip: Add shared regmap mutex
Date: Wed, 16 Oct 2019 14:03:45 +0200 [thread overview]
Message-ID: <20191016120345.GC4780@lunn.ch> (raw)
In-Reply-To: <20191013193238.1638-2-marex@denx.de>
On Sun, Oct 13, 2019 at 09:32:38PM +0200, Marek Vasut wrote:
> The KSZ driver uses one regmap per register width (8/16/32), each with
> it's own lock, but accessing the same set of registers. In theory, it
> is possible to create a race condition between these regmaps, although
> the underlying bus (SPI or I2C) locking should assure nothing bad will
> really happen and the accesses would be correct.
>
> To make the driver do the right thing, add one single shared mutex for
> all the regmaps used by the driver instead. This assures that even if
> some future hardware is on a bus which does not serialize the accesses
> the same way SPI or I2C does, nothing bad will happen.
>
> Note that the status_mutex was unused and only initied, hence it was
> renamed and repurposed as the regmap mutex.
>
> Signed-off-by: Marek Vasut <marex@denx•de>
Apart from the reverse Christmas tree:
Reviewed-by: Andrew Lunn <andrew@lunn•ch>
Andrew
next prev parent reply other threads:[~2019-10-16 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-13 19:32 [PATCH V2 1/2] net: dsa: microchip: Do not reinit mutexes on KSZ87xx Marek Vasut
2019-10-13 19:32 ` [PATCH V2 2/2] net: dsa: microchip: Add shared regmap mutex Marek Vasut
2019-10-16 0:37 ` David Miller
2019-10-16 12:03 ` Andrew Lunn [this message]
2019-10-16 11:59 ` [PATCH V2 1/2] net: dsa: microchip: Do not reinit mutexes on KSZ87xx Andrew Lunn
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=20191016120345.GC4780@lunn.ch \
--to=andrew@lunn$(echo .)ch \
--cc=Tristram.Ha@microchip$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=f.fainelli@gmail$(echo .)com \
--cc=george.mccollister@gmail$(echo .)com \
--cc=marex@denx$(echo .)de \
--cc=netdev@vger$(echo .)kernel.org \
--cc=woojung.huh@microchip$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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