Re: Traceback with CONFIG_REGMAP_KUNIT=y+CONFIG_DEBUG_ATOMIC_SLEEP=y

From: Mark Brown
Date: Thu Jul 20 2023 - 10:32:03 EST


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@xxxxxxxxxxxx/
> 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.

Attachment: signature.asc
Description: PGP signature