Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1939543rdb; Tue, 3 Oct 2023 06:01:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQIA2Mqy0sHZToQXioRzLGpIS8od9A14aEA6F98/qSZwngg6SOAKJ2ZbIcJl8Xkym5eawv X-Received: by 2002:a17:903:32c3:b0:1c4:c92:2320 with SMTP id i3-20020a17090332c300b001c40c922320mr14966923plr.31.1696338075491; Tue, 03 Oct 2023 06:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696338075; cv=none; d=google.com; s=arc-20160816; b=wB8DwViDxrhJirK/MB9nzJWOufXJG0h88Fyz7dPT0eVg8aaQTD9s1Gppm9aMZ6cmxS vdhb3f31KmlAE6OvRmq8FSv7E9QvdvWKLkPN5mfyit895vDBFQ95CnbQLaJcpdrz3bmg BUnFOSLM6vdoj6bBXajcKww5QZOPbX1SKTOolbhvt+IyyMEumIeavwByaIkCrwfeHFfa JOn+OIxKFHuGBxs+JzMppV6hGwc6xyNgZUD3sfc+NWBGtI9hLYaEGcc9ObrA5dolwEI6 q/UBI7ye8sVnq/nVHwGexxRFanTzSzbU7WhGE9D5YL25bPLqcD6pNlHTvjtRE4WcDlNK 20sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=4C22PM3HJK10OqHMzx44aC5P355Dwh1C/CGK8X5vEZc=; fh=E4iZh4h9q5Qm4U0Ctltv6tK+zRPHel90AxCkNoLAKh8=; b=i1JDumg38X+dJ8vRwVL2Z0QJI73XtxyueqvOMuAgYFfD2HfoF74e/jCPMrFFWz1NKT f6BgMS0k3ey31BX9CE+0EwWnvOpT9Au/mkNbTOEacUTMsJ7OUWkMRQAaowA2aBL14ztY XfynPh/SeEQmg07GlFhOGSbNlDwGoH1Jf7y/5OWPiuux7sTAqVTUIZWQ+mglVPMRvzER UPxKFuuYbo2MwFDPjKPhAumSxzEPkdy9qvhOSp4FxtdncSoXmjpwkVquocavoYwahGXf 44Rld77p7L7I59CwczTUKBNNNzcxu7r4ZHH4V4xieAJMavRhN7GbcJW9w4hnK6cEqZx8 /dVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id p3-20020a170902e74300b001c7345bc007si1434390plf.486.2023.10.03.06.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 06:01:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 446E1818ABEE; Tue, 3 Oct 2023 06:01:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232056AbjJCNBN (ORCPT + 99 others); Tue, 3 Oct 2023 09:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjJCNBM (ORCPT ); Tue, 3 Oct 2023 09:01:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 64DCA93 for ; Tue, 3 Oct 2023 06:01:09 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ABB561FB; Tue, 3 Oct 2023 06:01:47 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B6FE73F59C; Tue, 3 Oct 2023 06:01:08 -0700 (PDT) Date: Tue, 3 Oct 2023 14:01:06 +0100 From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] firmware: arm_ffa: Assign the missing IDR allocation ID to the FFA device Message-ID: <20231003130106.ahzajd46kqyevyex@bogus> References: <20231003085932.3553985-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003085932.3553985-1-sudeep.holla@arm.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 06:01:14 -0700 (PDT) On Tue, Oct 03, 2023 at 09:59:32AM +0100, Sudeep Holla wrote: > Commit 19b8766459c4 ("firmware: arm_ffa: Fix FFA device names for logical > partitions") added an ID to the FFA device using ida_alloc() and append > the same to "arm-ffa" to make up a unique device name. However it missed > to stash the id value in ffa_dev to help freeing the ID later when the > device is destroyed. > > Due to the missing/unassigned ID in FFA device, we get the following > warning when the FF-A device is unregistered. Fix the same by actually > assigning the ID in the FFA device this time for real. > Missed the below warning: | ida_free called for id=0 which is not allocated. | WARNING: CPU: 7 PID: 1 at lib/idr.c:525 ida_free+0x114/0x164 | CPU: 7 PID: 1 Comm: swapper/0 Not tainted 6.6.0-rc4 #209 | pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) | pc : ida_free+0x114/0x164 | lr : ida_free+0x114/0x164 | Call trace: | ida_free+0x114/0x164 | ffa_release_device+0x24/0x3c | device_release+0x34/0x8c | kobject_put+0x94/0xf8 | put_device+0x18/0x24 | klist_devices_put+0x14/0x20 | klist_next+0xc8/0x114 | bus_for_each_dev+0xd8/0x144 | arm_ffa_bus_exit+0x30/0x54 | ffa_init+0x68/0x330 | do_one_initcall+0xdc/0x250 | do_initcall_level+0x8c/0xac | do_initcalls+0x54/0x94 | do_basic_setup+0x1c/0x28 | kernel_init_freeable+0x104/0x170 | kernel_init+0x20/0x1a0 | ret_from_fork+0x10/0x20 > Fixes: 19b8766459c4 ("firmware: arm_ffa: Fix FFA device names for logical partitions") > Signed-off-by: Sudeep Holla > --- > drivers/firmware/arm_ffa/bus.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c > index 2b8bfcd010f5..7865438b3696 100644 > --- a/drivers/firmware/arm_ffa/bus.c > +++ b/drivers/firmware/arm_ffa/bus.c > @@ -193,6 +193,7 @@ struct ffa_device *ffa_device_register(const uuid_t *uuid, int vm_id, > dev->release = ffa_release_device; > dev_set_name(&ffa_dev->dev, "arm-ffa-%d", id); > > + ffa_dev->id = id; > ffa_dev->vm_id = vm_id; > ffa_dev->ops = ops; > uuid_copy(&ffa_dev->uuid, uuid); > -- > 2.42.0 > -- Regards, Sudeep