From: David Miller <davem@davemloft.net>
To: marex@denx.de
Cc: netdev@vger.kernel.org, andrew@lunn.ch, f.fainelli@gmail.com,
george.mccollister@gmail.com, Tristram.Ha@microchip.com,
woojung.huh@microchip.com
Subject: Re: [PATCH 2/2] net: dsa: microchip: Add shared regmap mutex
Date: Sun, 13 Oct 2019 09:26:28 -0700 (PDT) [thread overview]
Message-ID: <20191013.092628.1408615115437209574.davem@davemloft.net> (raw)
In-Reply-To: <018dad90-f6a4-328c-765e-8e5b66df27d6@denx.de>
From: Marek Vasut <marex@denx.de>
Date: Sun, 13 Oct 2019 12:50:15 +0200
> On 10/13/19 2:21 AM, David Miller wrote:
>> From: David Miller <davem@davemloft.net>
>> Date: Sat, 12 Oct 2019 17:20:55 -0700 (PDT)
>>
>>> From: Marek Vasut <marex@denx.de>
>>> Date: Thu, 10 Oct 2019 20:25:08 +0200
>>>
>>>> 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>
>>>
>>> Applied.
>>
>> Actually, both patches reverted. Please test your changes properly:
>>
>> ERROR: "ksz_regmap_unlock" [drivers/net/dsa/microchip/ksz8795_spi.ko] undefined!
>> ERROR: "ksz_regmap_lock" [drivers/net/dsa/microchip/ksz8795_spi.ko] undefined!
>> ERROR: "ksz_regmap_unlock" [drivers/net/dsa/microchip/ksz9477_spi.ko] undefined!
>> ERROR: "ksz_regmap_lock" [drivers/net/dsa/microchip/ksz9477_spi.ko] undefined!
>> ERROR: "ksz_regmap_unlock" [drivers/net/dsa/microchip/ksz9477_i2c.ko] undefined!
>> ERROR: "ksz_regmap_lock" [drivers/net/dsa/microchip/ksz9477_i2c.ko] undefined!
>
> So the test is to compile it as a module ?
The test is to compile it in all relevant possible configurations.
As a module, statically, and with dependent modules both static and
modular as is relevant.
next prev parent reply other threads:[~2019-10-13 16:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 18:25 [PATCH 1/2] net: dsa: microchip: Do not reinit mutexes on KSZ87xx Marek Vasut
2019-10-10 18:25 ` [PATCH 2/2] net: dsa: microchip: Add shared regmap mutex Marek Vasut
2019-10-13 0:20 ` David Miller
2019-10-13 0:21 ` David Miller
2019-10-13 10:50 ` Marek Vasut
2019-10-13 16:26 ` David Miller [this message]
2019-10-13 0:20 ` [PATCH 1/2] net: dsa: microchip: Do not reinit mutexes on KSZ87xx David Miller
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=20191013.092628.1408615115437209574.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Tristram.Ha@microchip.com \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=george.mccollister@gmail.com \
--cc=marex@denx.de \
--cc=netdev@vger.kernel.org \
--cc=woojung.huh@microchip.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;
as well as URLs for NNTP newsgroup(s).