Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp466789pxx; Mon, 26 Oct 2020 12:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz22CUtU3sfx+GopS8q/2v26/gxwS84QitBgdivpzHGNKDsm1boLZ3fqzHh+iiFObY0iz9 X-Received: by 2002:aa7:c746:: with SMTP id c6mr17241399eds.221.1603740975839; Mon, 26 Oct 2020 12:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603740975; cv=none; d=google.com; s=arc-20160816; b=B5MpMjHud6FYHSy81UIOYdSZKzzf+nnAsMRGblfmtT8KPX/oaIBG8w2VeOfq+1sutD 3yBWJ8nwvs9L6y7F185pV4nAFuLoEj9d9CxP+rCQVc0YhJWbzCJf6xGEvtcas8RgzdA5 TYmgVx7wyyvHz2uWdPpt/s7SW/1QkAzpqCKhyEJ32XSBFRJVjMhSTJaI+f1CxE5xwGKZ aqufDOfqBE0UdbxlfB1/FLUq8QKOUKr/AVN+8f3YASs25NA4RYkIBuuPaZGPORs5DNr5 b06AhlAtyugxzcxEOQGR5TyFcoAy9zYTxQnkL6i8oF+VYiHK6VBRFNvKxmpb6R1W2Ysg ymwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :date:cc:to:from:subject:message-id; bh=2BbBDdNfr4NmhYOEHkW5klRozynJ6sThKwcYg5IWG/4=; b=Y6SaiV73Hs1W7K5bdVSezeFKnQzl254IVO95yTuttLRK0t0zp0v7VRAn4wTESxLrqE jMxsEnOcnVk86WKUysrciclKJ3+3Togq0g3zTypOiUf6vl0D2OeKUhF8jvDnHHUGsM+t T9La1KDj71RgnclTczPlq4t/gvjhrROPbX8ihomxyivYzJmWJmNG5a5hSLqEiFJgIEbU pcRvPY9y8qTOrnlQTNkUfwRMYZ1aslOnXrJyBvoYB89gocZ7Nj1OEv1xdBTiZMqvAtPe n/WGGlnIQN+v/ZcOp3pRsv82Y0L8dBRAKM8b5OMU0xxbFIjtsR/VRP1rM4idPcCKZFOT OuDA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y22si7446005edr.151.2020.10.26.12.35.54; Mon, 26 Oct 2020 12:36:15 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1785918AbgJZQ0X (ORCPT + 99 others); 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-kernel@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--