From: Jerome Brunet <jbrunet@baylibre.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
Stephen Boyd <sboyd@kernel.org>,
Jan Dakinevich <jan.dakinevich@salutedevices.com>,
linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org,
linux-clk@vger.kernel.org
Subject: Re: [PATCH v2 1/9] reset: amlogic: convert driver to regmap
Date: Thu, 18 Jul 2024 19:19:04 +0200 [thread overview]
Message-ID: <1jr0bqmxdj.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <2f094b21-aa55-4a81-b9af-ff06c34c5a67@linaro.org> (Neil Armstrong's message of "Thu, 18 Jul 2024 14:45:35 +0200")
On Thu 18 Jul 2024 at 14:45, Neil Armstrong <neil.armstrong@linaro.org> wrote:
>> +
>> static int meson_reset_reset(struct reset_controller_dev *rcdev,
>> - unsigned long id)
>> + unsigned long id)
>> {
>> struct meson_reset *data =
>> container_of(rcdev, struct meson_reset, rcdev);
>> - unsigned int bank = id / BITS_PER_REG;
>> - unsigned int offset = id % BITS_PER_REG;
>> - void __iomem *reg_addr = data->reg_base + (bank << 2);
>> + unsigned int offset, bit;
>> - writel(BIT(offset), reg_addr);
>> + meson_reset_offset_and_bit(data, id, &offset, &bit);
>> - return 0;
>> + return regmap_update_bits(data->map, offset,
>> + BIT(bit), BIT(bit));
>
> Here, you're converting a:
> writel(BIT())
> to a:
> reg = readl()
> reg |= BIT()
> writel(reg)
>
> so indeed you should use regmap_write(data->map, offset, BIT(bit))
>
Ok the trouble is this particular register which is write only, not
some writel vs regmap problem. The read value is probably undefined.
I should not have changed which the migration anyway.
Thanks for pointing it out, I'll fix that in v3
--
Jerome
next prev parent reply other threads:[~2024-07-18 17:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 9:57 [PATCH v2 0/9] reset: amlogic: move audio reset drivers out of CCF Jerome Brunet
2024-07-18 9:57 ` [PATCH v2 1/9] reset: amlogic: convert driver to regmap Jerome Brunet
2024-07-18 12:45 ` Neil Armstrong
2024-07-18 17:19 ` Jerome Brunet [this message]
2024-07-18 9:57 ` [PATCH v2 2/9] reset: amlogic: use generic data matching function Jerome Brunet
2024-07-18 9:57 ` [PATCH v2 3/9] reset: amlogic: make parameters unsigned Jerome Brunet
2024-07-18 9:57 ` [PATCH v2 4/9] reset: amlogic: add driver parameters Jerome Brunet
2024-07-18 9:57 ` [PATCH v2 5/9] reset: amlogic: use reset number instead of register count Jerome Brunet
2024-07-18 9:57 ` [PATCH v2 6/9] reset: amlogic: add reset status support Jerome Brunet
2024-07-18 9:57 ` [PATCH v2 7/9] reset: amlogic: move drivers to a dedicated directory Jerome Brunet
2024-07-18 9:57 ` [PATCH v2 8/9] reset: amlogic: split the device core and platform probe Jerome Brunet
2024-07-18 9:57 ` [PATCH v2 9/9] reset: amlogic: add auxiliary reset driver support Jerome Brunet
2024-07-24 1:18 ` Jan Dakinevich
2024-07-18 14:20 ` [PATCH v2 0/9] reset: amlogic: move audio reset drivers out of CCF Jan Dakinevich
2024-07-18 17:20 ` Jerome Brunet
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=1jr0bqmxdj.fsf@starbuckisacylon.baylibre.com \
--to=jbrunet@baylibre.com \
--cc=jan.dakinevich@salutedevices.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=sboyd@kernel.org \
/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