All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: broonie@kernel.org, gregkh@linuxfoundation.org,
	rafael@kernel.org, andy.shevchenko@gmail.com,
	mazziesaccount@gmail.com, linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <krzk@kernel.org>,
	'Linux Samsung SOC' <linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH v2 11/12] regmap-irq: Add get_irq_reg() callback
Date: Sun, 03 Jul 2022 12:06:58 +0100	[thread overview]
Message-ID: <J6lhcwtTNjo9XCDWYcEz3QEWJBaJ34Qk@localhost> (raw)
In-Reply-To: <acaaf77f-3282-8544-dd3c-7915fc1a6a4f@samsung.com>


Marek Szyprowski <m.szyprowski@samsung.com> writes:

> Hi All,
>
> On 23.06.2022 23:14, Aidan MacDonald wrote:
>> Replace the internal sub_irq_reg() function with a public callback
>> that drivers can use when they have more complex register layouts.
>> The default implementation is regmap_irq_get_irq_reg_linear(), used
>> if the chip doesn't provide its own callback.
>>
>> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
>> ---
>
> This patch landed in today's linux next-20220701 as commit bdf9b86cd3ad 
> ("regmap-irq: Add get_irq_reg() callback"). I've noticed that it causes 
> a regression on my test systems: the RTC alarm stopped working on all 
> boards with Samsung PMICs (drivers/mfd/sec*.c). There are no 
> warnings/oopses/etc. Waitng for the RTC alarm lasts forever, so it looks 
> that something is broken with interrupts. Reverting it on top of 
> linux-next fixes the issue.
>
> Unfortunately I'm going for a holidays for the whole next week and I'm 
> not able to analyze this issue further today. Krzysztof: maybe You will 
> be able to provide some more hints which regmap irq variant is broken?

Fortunately it's nothing complicated -- just a typo. Thanks for testing.

>>   drivers/base/regmap/regmap-irq.c | 126 ++++++++++++++++++++-----------
>>   include/linux/regmap.h           |  15 +++-
>>   2 files changed, 93 insertions(+), 48 deletions(-)
>> [..]
>> +unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
>> +					   unsigned int base, int index)
>> +{
>> +	const struct regmap_irq_chip *chip = data->chip;
>> +	struct regmap *map = data->map;
>> +
>> +	/*
>> +	 * FIXME: This is for backward compatibility and should be removed
>> +	 * when not_fixed_stride is dropped (it's only used by qcom-pm8008).
>> +	 */
>> +	if (chip->not_fixed_stride && chip->sub_reg_offsets) {
>> +		struct regmap_irq_sub_irq_map *subreg;
>> +
>> +		subreg = &chip->sub_reg_offsets[0];
>> +		return base + subreg->offset[0];
>> +	}
>> +
>> +	return base + index * map->reg_stride * chip->irq_reg_stride;

chip->irq_reg_stride is usually 0. This should be data->irq_reg_stride,
which will be corrected to the default value of 1.

>> +}
>> +EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear);
>> +
>>   /**
>>    * regmap_irq_set_type_config_simple() - Simple IRQ type configuration callback.
>>    * @buf: Buffer containing configuration register values, this is a 2D array of
>> @@ -862,6 +891,11 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
>
> Best regards

  reply	other threads:[~2022-07-03 11:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 21:14 [PATCH v2 00/12] regmap-irq cleanups and refactoring Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 01/12] regmap-irq: Convert bool bitfields to unsigned int Aidan MacDonald
2022-06-23 21:26   ` Andy Shevchenko
2022-06-24 12:11     ` Mark Brown
2022-06-24 12:46       ` Joe Perches
2022-06-24 12:56         ` Mark Brown
2022-06-24 13:05         ` Aidan MacDonald
2022-06-24 13:45           ` Joe Perches
2022-06-24 14:28             ` David Laight
2022-06-24 14:31             ` Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 02/12] regmap-irq: Remove unused type_reg_stride field Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 03/12] regmap-irq: Cleanup sizeof(...) use in memory allocation Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 04/12] regmap-irq: Remove an unnecessary restriction on type_in_mask Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 05/12] regmap-irq: Remove inappropriate uses of regmap_irq_update_bits() Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 06/12] regmap-irq: Remove mask_writeonly and regmap_irq_update_bits() Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 07/12] regmap-irq: Refactor checks for status bulk read support Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 08/12] regmap-irq: Introduce config registers for irq types Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 09/12] regmap-irq: Deprecate type registers and virtual registers Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 10/12] regmap-irq: Fix inverted handling of unmask registers Aidan MacDonald
2022-06-23 21:14 ` [PATCH v2 11/12] regmap-irq: Add get_irq_reg() callback Aidan MacDonald
2022-07-01 16:33   ` Marek Szyprowski
2022-07-03 11:06     ` Aidan MacDonald [this message]
2022-06-23 21:14 ` [PATCH v2 12/12] regmap-irq: Deprecate the not_fixed_stride flag Aidan MacDonald
2022-06-30 17:27 ` [PATCH v2 00/12] regmap-irq cleanups and refactoring Mark Brown

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=J6lhcwtTNjo9XCDWYcEz3QEWJBaJ34Qk@localhost \
    --to=aidanmacdonald.0x0@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mazziesaccount@gmail.com \
    --cc=rafael@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.