Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5550762pxb; Wed, 19 Jan 2022 22:46:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhTfy0M1U6pY5teVQ1HwEbCfmq3jHXLo+8UveR7OYrV+LEjp/SW2N/FzO9K3tlwpLJ6GR1 X-Received: by 2002:a17:902:b612:b0:14a:9c3c:134d with SMTP id b18-20020a170902b61200b0014a9c3c134dmr25632403pls.45.1642661176794; Wed, 19 Jan 2022 22:46:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642661176; cv=none; d=google.com; s=arc-20160816; b=DDTR77VHhSjh3kSKTBvGY4lQ7f5uABom/wS8F+buwN8mTqY+MYPrb8YBUgoNc6qSLL snTXfQNT5LrxmLtRe9991WY5yqcX3RiS0owhN+ekrdRYlo4saKXUHTKj1oEZQcFcpNZ4 DB6Aupt3kDIw3LVEHmYXlrz6ri2kfZ1hdbUQl4pLXvDEuGlPHx2JP5d4Y4lUx6m5FkKO M2nEe2VvuCB2+IyhudBTBL1RNpRwu6uhAbcSs0GpIZ2qhEAQNp4pdXUk/gdZlSVzdWAr Uhgm2WCW1FRswkrSvSdUeea1wfXZfPM3j7d1n6eVVFvYCc//iYF63p+2ZrreBDjHZVK4 6Xew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=8tSOi6hFO4mBG1V3W8bMA0J9PppE7RMIf5SisFC//CI=; b=lyg9SKuBTMAnnix6b2hS5ByaOEWps6/Eu//z/uyMzDqF6YOi2zfLeiLQnWbsy0CCuM yIoD4uaSo+K2dnRNyHdYCyVVuJRlN9tIsYj/fa7lDrTJfnOREClD6ZK+e0RIJrrCWE7x FQHC792CmsV0JcHHweP1hOudgy0iZp7/bWuOVMMQwR8Enw9Jm3sDag0QslyySbVTET24 YFdign7y0Y9xdJcNFIK/wabjFZjJzZnqsuHcpU54IjL3HJ6Jy+GlVkxoDkbdtLNTqN/I IF9tcstEteb5NMR0WZuTU67oMA4bn2z61OZJ0NW1rAi7XAzn4baSZ7RFFHoCi0xXMHpZ w6lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=2rCtH5QP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si2120310pls.57.2022.01.19.22.46.03; Wed, 19 Jan 2022 22:46:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=2rCtH5QP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237988AbiARKon (ORCPT + 99 others); Tue, 18 Jan 2022 05:44:43 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:39418 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237931AbiARKom (ORCPT ); Tue, 18 Jan 2022 05:44:42 -0500 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20I97GDu009658; Tue, 18 Jan 2022 11:44:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=8tSOi6hFO4mBG1V3W8bMA0J9PppE7RMIf5SisFC//CI=; b=2rCtH5QP/v8r3GgsSoY6Pq3pXO6qXE4aw1ZZ0RrQW4IAynpj+Bo85F9ip/XsEgq/flNg 7hQpCHpIon9MYzLQPpP+P6T+E38l6qM5l/FUo3QkYtb+icyvkRCNbxt5B0E6Fm/SEH9Q 2rjVHQtzvmutThtVNwrmSlrR04YnfdBlodDAruT3tulCjOhgWAHUiaHcnDLlmw212XU2 YvrOSGIVKRAMMk/rHzakdmqojXD+vkH5g7rIXRaFzkuk1V5RgWk0wanLgftTH0JOzbFO uqDFNidLjygE9+RCaKVZPIM4rNSNdYFZFP2hCr7G9ZIlMMquIw2J9ZFBieJ2orP+W+E4 tA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3dnkesjnu8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jan 2022 11:44:33 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7D5BA10002A; Tue, 18 Jan 2022 11:44:32 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node1.st.com [10.75.127.4]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 6A797211F15; Tue, 18 Jan 2022 11:44:32 +0100 (CET) Received: from lmecxl0889.lme.st.com (10.75.127.50) by SFHDAG2NODE1.st.com (10.75.127.4) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Tue, 18 Jan 2022 11:44:31 +0100 Subject: Re: [PATCH v8 03/13] rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl To: Bjorn Andersson CC: Mathieu Poirier , , , , References: <20211207080843.21222-1-arnaud.pouliquen@foss.st.com> <20211207080843.21222-4-arnaud.pouliquen@foss.st.com> From: Arnaud POULIQUEN Message-ID: Date: Tue, 18 Jan 2022 11:44:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SFHDAG2NODE1.st.com (10.75.127.4) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-18_03,2022-01-18_01,2021-12-02_01 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Bjorn, On 1/17/22 11:55 PM, Bjorn Andersson wrote: > On Tue 07 Dec 02:08 CST 2021, Arnaud Pouliquen wrote: >> diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c > [..] >> -static void rpmsg_ctrldev_release_device(struct device *dev) >> -{ >> - struct rpmsg_ctrldev *ctrldev = dev_to_ctrldev(dev); >> - >> - ida_simple_remove(&rpmsg_ctrl_ida, dev->id); >> - ida_simple_remove(&rpmsg_minor_ida, MINOR(dev->devt)); >> - cdev_del(&ctrldev->cdev); >> - kfree(ctrldev); >> -} >> - >> -static int rpmsg_chrdev_probe(struct rpmsg_device *rpdev) >> -{ >> - struct rpmsg_ctrldev *ctrldev; >> - struct device *dev; >> - int ret; >> - >> - ctrldev = kzalloc(sizeof(*ctrldev), GFP_KERNEL); >> - if (!ctrldev) >> - return -ENOMEM; >> - >> - ctrldev->rpdev = rpdev; >> - >> - dev = &ctrldev->dev; >> - device_initialize(dev); >> - dev->parent = &rpdev->dev; >> - dev->class = rpmsg_class; >> - >> - cdev_init(&ctrldev->cdev, &rpmsg_ctrldev_fops); >> - ctrldev->cdev.owner = THIS_MODULE; >> - >> - ret = ida_simple_get(&rpmsg_minor_ida, 0, RPMSG_DEV_MAX, GFP_KERNEL); >> - if (ret < 0) >> - goto free_ctrldev; >> - dev->devt = MKDEV(MAJOR(rpmsg_major), ret); >> - >> - ret = ida_simple_get(&rpmsg_ctrl_ida, 0, 0, GFP_KERNEL); >> - if (ret < 0) >> - goto free_minor_ida; >> - dev->id = ret; >> - dev_set_name(&ctrldev->dev, "rpmsg_ctrl%d", ret); >> - >> - ret = cdev_add(&ctrldev->cdev, dev->devt, 1); > > This turns out to be incomplete and the cdev_del above is in the wrong > place. This, and the same for eptdev, is being corrected in: > > https://lore.kernel.org/linux-remoteproc/164245960510.1698571.4998090450663669237.b4-ty@linaro.org/T/#t I will rebase on next branch including this patchset Thanks, Arnaud > > Regards, > Bjorn >