[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0ee7ab71-5d01-58e2-baf7-4dd41455b377@rock-chips.com>
Date: Wed, 16 Feb 2022 09:23:58 +0800
From: Jon Lin <jon.lin@...k-chips.com>
To: Mark Brown <broonie@...nel.org>
Cc: heiko@...ech.de, linux-spi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] spi: rockchip: Preset cs-high and clk polarity in
setup progress
在 2022/2/15 20:36, Mark Brown 写道:
> On Tue, Feb 15, 2022 at 11:00:54AM +0800, Jon Lin wrote:
>> 在 2022/2/14 20:49, Mark Brown 写道:
>
>>> As covered in the documentation setup() for one device may run while
>>> another is active, therefore if multiple devices are configured in the
>>> same register you should use a lock to ensure there can't be multiple
>>> writes. Note that the above appears to not just be setting the mode but
>>> also the chip select so if you've got two SPI_CS_HIGH devices then
>>> they'll both be going in and separately setting cr0.
>
>> Is the io_mutex in function spi_setup is good enough?
>
> It's not supposed to be for that but looking at the code quickly I
> *think* setup() is never called with io_mutex held so it might well be
> fine - you should double check though. If not you'd need to add another
> lock in your driver data.
》setup() is never called with io_mutex held
I think so. and I think the io_mutex is enough for me.
Powered by blists - more mailing lists