[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bdb26ba3-7276-359a-7784-6ec3e35c64de@huawei.com>
Date: Tue, 13 Dec 2022 09:30:32 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: Mark Brown <broonie@...nel.org>, Max Filippov <jcmvbkbc@...il.com>
CC: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
<linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
<linux-xtensa@...ux-xtensa.org>, <linux-spi@...r.kernel.org>,
<yangyingliang@...wei.com>
Subject: Re: [PATCH v1] spi: xtensa-xtfpga: Fix a double put() in
xtfpga_spi_remove()
On 2022/12/12 23:36, Mark Brown wrote:
> On Sat, Dec 10, 2022 at 06:48:02AM -0800, Max Filippov wrote:
>> Hi Christophe,
>>
>> On Sat, Dec 10, 2022 at 3:52 AM Christophe JAILLET
>> <christophe.jaillet@...adoo.fr> wrote:
>>> 'master' is allocated with devm_spi_alloc_master(), there is no need to
>>> put it explicitly in the remove function.
>>> spi_bitbang_stop(&xspi->bitbang);
>>> - spi_master_put(master);
>> This put is matching the get in the spi_bitbang_start.
>> It was discussed here:
>> https://lore.kernel.org/linux-spi/CAMo8BfJaD7pG_iutY8jordysjChyzhTpVSqpxXh3QoZsj2QmaQ@mail.gmail.com/
> Probably worth a comment though since it is a bit of a gotcha. Ideally
> we'd improve this in the bitbang code but that's harder.
Ideally, spi_bitbang_stop() should undo spi_bitbang_start(). shall we
move spi_master_put() in spi_bitbang_stop() instead of
calling it separately in drivers?
Thanks,
Yang
Powered by blists - more mailing lists