From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00A62C4332F for ; Mon, 21 Nov 2022 15:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232184AbiKUPZZ (ORCPT ); Mon, 21 Nov 2022 10:25:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232155AbiKUPZB (ORCPT ); Mon, 21 Nov 2022 10:25:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E694E0BD; Mon, 21 Nov 2022 07:25:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 07A5CB810A4; Mon, 21 Nov 2022 15:24:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 248D0C433C1; Mon, 21 Nov 2022 15:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669044297; bh=plmemg8ck/2JJiYk6N9WCm94qIUIDl5laChJjW2g7Cw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZD6NmPJsSKDjUcrRAnF9Oet4XPiBretpsjQgkgD6mqMH3wdi5doXmLHgKS/0N/itH LSsIClTFQx7/80hwc10c8A9IP6RDa1UckhdZKYdBJincU1vvaQMOSfejT9GGgaBnp8 gY1Arvm3qsWYdLaTuHgTDHXiBkj+Q5nc6Z9xY53Y= Date: Mon, 21 Nov 2022 16:24:54 +0100 From: Greg Kroah-Hartman To: Elliot Berman Cc: Bjorn Andersson , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Arnd Bergmann , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Catalin Marinas , Will Deacon , Jassi Brar , Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v7 10/20] gunyah: rsc_mgr: Add resource manager RPC core Message-ID: References: <20221121140009.2353512-1-quic_eberman@quicinc.com> <20221121140009.2353512-11-quic_eberman@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221121140009.2353512-11-quic_eberman@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Mon, Nov 21, 2022 at 05:59:59AM -0800, Elliot Berman wrote: > +struct gh_rm_rpc { > + struct device *dev; > + struct gunyah_resource tx_ghrsc, rx_ghrsc; > + struct gh_msgq msgq; > + struct mbox_client msgq_client; > + struct gh_rm_connection *active_rx_connection; > + int last_tx_ret; > + > + struct idr call_idr; > + struct mutex call_idr_lock; > + > + struct mutex send_lock; > + > + struct work_struct recv_work; > +}; What handles the reference counting for this object? Shouldn't this be a real 'struct device' and just have a pointer to the parent? Otherwise how do you know when to free this? thanks, greg k-h