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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B85B4C5DF9D for ; Mon, 26 Oct 2020 16:26:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7303F2464E for ; Mon, 26 Oct 2020 16:26:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1773379AbgJZQ0X (ORCPT ); Mon, 26 Oct 2020 12:26:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:47980 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404162AbgJZQ0W (ORCPT ); Mon, 26 Oct 2020 12:26:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EEE67AC48; Mon, 26 Oct 2020 16:26:19 +0000 (UTC) Message-ID: <160f3f542a89e0263d5d375fdae796af6017c33c.camel@suse.de> Subject: Re: [PATCH v2 01/10] firmware: raspberrypi: Introduce rpi_firmware_put() From: Nicolas Saenz Julienne To: Andy Shevchenko Cc: Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , Linux Kernel Mailing List , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list , linux-pwm@vger.kernel.org, linux-arm Mailing List , devicetree , Stefan Wahren , linux-input , Dmitry Torokhov , Greg Kroah-Hartman , "open list:STAGING SUBSYSTEM" , Philipp Zabel , "open list:GPIO SUBSYSTEM" , Linus Walleij , linux-clk , Stephen Boyd , linux-rpi-kernel Date: Mon, 26 Oct 2020 17:26:17 +0100 In-Reply-To: References: <20201022155858.20867-1-nsaenzjulienne@suse.de> <20201022155858.20867-2-nsaenzjulienne@suse.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-+M2bTZi8S7Ge32C0tkNp" User-Agent: Evolution 3.36.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org --=-+M2bTZi8S7Ge32C0tkNp Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2020-10-22 at 21:46 +0300, Andy Shevchenko wrote: > On Thu, Oct 22, 2020 at 9:06 PM Nicolas Saenz Julienne > wrote: > > When unbinding the firmware device we need to make sure it has no > > consumers left. Otherwise we'd leave them with a firmware handle > > pointing at freed memory. > >=20 > > Keep a reference count of all consumers and make sure they all finished > > unbinding before we do. >=20 > Wait, if it's a device, why do we need all these? > get_device() / put_device() along with module_get() / module_put() > should be sufficient, no? Could you expand here a little, I do see how I could use get_device()'s reference count. But it seems to me I'd be digging way too deep into kobj i= n order to get the functionality I need. If you meant to say that it should be automatically taken care by the platf= orm bus, just FYI we're using 'simple-mfd' in DT. Where firmware supplier is th= e parent and all consumers are children. Regards, Nicolas --=-+M2bTZi8S7Ge32C0tkNp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl+W+KkACgkQlfZmHno8 x/6XwQf+N4Vi5LyZRLbYPf2alcEVhV4rJF362cZVbIn76rK576WGug740xSWsiwO gfzWfNuZQ8dHdYtromdKWWMK3JYZ1EYnhWwxzQVC9bhKypTweP7tpIxNgdQLfoi0 qS6Omn19ldcynO+YlLCEp76lrapt5ADWIGR5phjOWOj2yPHYJN0TsaQ80bNsNHZL caC8ddA5LxpEZKe8NEd9tqOdhB9rnvTHmPLG4A7CdjCsNdwcO6TXUTM4os21JNVv IB/eaEzZp7DLTWVAUJxV+HIX0SSdy80TCryzgCsfbcd8q6AuD2RWtWpVQ88Qtrbl fFrXd+Hf3/iVhraCCi5GKegidy4SyA== =30G8 -----END PGP SIGNATURE----- --=-+M2bTZi8S7Ge32C0tkNp--