mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Mark Brown <broonie@kernel.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: Traceback with CONFIG_REGMAP_KUNIT=y+CONFIG_DEBUG_ATOMIC_SLEEP=y
Date: Thu, 20 Jul 2023 08:03:13 -0700	[thread overview]
Message-ID: <d29552c2-f20c-cf68-76ae-e03a2cc7e0ba@roeck-us.net> (raw)
In-Reply-To: <055f2564-551d-4b5f-a6e3-d54ae104d5c9@sirena.org.uk>

On 7/20/23 07:31, Mark Brown wrote:
> On Thu, Jul 20, 2023 at 07:26:54AM -0700, Guenter Roeck wrote:
>> On 7/20/23 01:50, Dan Carpenter wrote:
> 
>>> +++ b/drivers/base/regmap/regcache-rbtree.c
>>> @@ -187,7 +187,7 @@ static int regcache_rbtree_init(struct regmap *map)
>>>    	int i;
>>>    	int ret;
>>> -	map->cache = kmalloc(sizeof *rbtree_ctx, GFP_KERNEL);
>>> +	map->cache = kmalloc(sizeof *rbtree_ctx, map->alloc_flags);
> 
>> Yes, that might work as well (and after looking more deeply into the code
>> I wondered why it wasn't used in the first place).
> 
>> Based on Mark's feedback I submitted
>> https://lore.kernel.org/lkml/20230720032848.1306349-1-linux@roeck-us.net/
>> Sorry, I forgot to copy you on that one.
> 
>> Mark, please let me know what you prefer.
> 
> They're both independently fine, but I wouldn't expect anything that's
> running in atomic context to be actually using dynamic allocations.

Which one do you prefer ? As I mentioned in my second patch, there are
two drivers which use fast_io together with REGCACHE_RBTREE and thus
are likely affected by this problem. Dan's solution would cover that,
while my current RFC patch would likely cause those drivers to fail.
Plus, of course, they could get stuck if they actually end up trying to
sleep while allocating memory.

Thanks,
Guenter


  reply	other threads:[~2023-07-20 15:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 22:37 Guenter Roeck
2023-07-19 23:05 ` Mark Brown
2023-07-20  8:50 ` Dan Carpenter
2023-07-20 14:26   ` Guenter Roeck
2023-07-20 14:31     ` Mark Brown
2023-07-20 15:03       ` Guenter Roeck [this message]
2023-07-20 15:07         ` Mark Brown
2023-07-20 16:25           ` Guenter Roeck
2023-07-20 16:36             ` Mark Brown
2023-07-20 16:41             ` Guenter Roeck
2023-07-20 16:48               ` Mark Brown
2023-07-20 17:22                 ` Guenter Roeck

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=d29552c2-f20c-cf68-76ae-e03a2cc7e0ba@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=broonie@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®