Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp201066pxu; Thu, 22 Oct 2020 20:39:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfcGBLGXZ9bEuQkcOtEpzk6ZJw8zIqOR7SzJWfM9+6nZJrFB42Z8XDAB/TLd9luCO13B5/ X-Received: by 2002:a50:e79d:: with SMTP id b29mr354001edn.57.1603424367868; Thu, 22 Oct 2020 20:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603424367; cv=none; d=google.com; s=arc-20160816; b=nW1S/dcSVm3nlCPWFA5jH2mAyGAPyhKhgwtGo/N2gkOBraPSPhKuwnW8ixqVUiEOw7 yMb94iDDS6TokIio3x9loImwdG4gFj6X/XnvXna1eoSYQzK28n/0x7rKJLRL6z0sW2Ng qtP07k19IU1ojiE6a5yX9unBuT5exRbDoqOvtXqNN54hCYIUYbJUQ6nTA9aBsLrSLZXu l0m4/FpxON92nEEk6aeCWWA+mhxGSfa5IPZx1mP8G9PnEPLQy+Dme8mdDkVh5I5ZzPQf 7H+YEQJ66OuellFf1MlArFbNnfLwI1u7XfsyroSxek0uT4n5r1IDKu8RXKGczISmB0Ol VH7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PJ+uKLoDbt4Kdg8ImByLjA8Njsk3WlOLgUgCbpkC9zk=; b=BFYA2j9riK356l6xXq8vPXmStHau/EC7PjtFx2FIAuktRuoUBLEjD55lHsSiaEwD18 JEWiLXUpnp8Sv2s3dQ6nfdgi9JeaoVH9Kz7mjbbMB2vWdkt1MWxj6j8xpmui+vGLmDPl lu9DbVadxRGGaZ0eBIsl95BH/InK0pji1lx0Phe9IpPmwRx9ckNkfelP6ZjxVW2AI2P8 /IK6xb+lOVa0wWPkJDvH/Ykr85EomYLwI0fiOMsaVGDt1b6hMuJ3G9SnEkkTYuK6oA05 50+OwcIE1XPYwv8Iql5Kl6MVZf1Z0uFeYnz6RE9UI1YcQD4519Ti+yz4bYa/Yeyz+jPZ XFaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A8jUhEN6; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt10si51015ejb.461.2020.10.22.20.39.05; Thu, 22 Oct 2020 20:39:27 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A8jUhEN6; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S369526AbgJVSpz (ORCPT + 99 others); Thu, 22 Oct 2020 14:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S368830AbgJVSpy (ORCPT ); Thu, 22 Oct 2020 14:45:54 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 661EEC0613CE; Thu, 22 Oct 2020 11:45:53 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id y14so1696170pfp.13; Thu, 22 Oct 2020 11:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PJ+uKLoDbt4Kdg8ImByLjA8Njsk3WlOLgUgCbpkC9zk=; b=A8jUhEN65PHD6v/QKxHHZH30h3Bes875e+6+YJN1oRjC7MZxpv05pacosmi/+65EBk Dx8XXnOnRTnBVHVQ5JmYEycve17jrdZVst0f6IsgoRtTyydrVVoQEhhVNi4cbk+tod5A MNLeNR+TUQSkY5iFpk/xW8fcCvmfbFIEIsWzj8l/+MZ2GaZLFfk/oasxZ10SVZDdetqd m7cKjO1GDgNygAgXbqYg3qwViz8gUMo2l9iN/xTV7hcM7OzUJgHiVxn2xn1Ix11Xn3Mj w5xyxZzMqJdXhyvSL/CCT5pFyt+G/Ry3aTxphw+1BfRgwJ6o1PZGhL3mLbVF7NEE1HQo stlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PJ+uKLoDbt4Kdg8ImByLjA8Njsk3WlOLgUgCbpkC9zk=; b=Lffidh1m26Tpvc0fK79Div1yEN/p+2gdVsvah6YqlDfyZhZRXsi+QpY1G+HVpOOppz H56NwCbB/viPVmrdC+9JqCmF4mTzVdpdMz1y0eS5PNMAASEkejo4dhvnM7EDePCxjRfQ Fx0moZo2qkGjTfSFuo25ZpPE2w8xzTBHLNEDmVqJhIlIRWzdJ7JO4OIqXxdDd8h4e0oL 2cXwch18dfnTSWK+ZIDklGy5wc1slWQm1Mw4SKPA82RMQFiawtLtL51IzCzqbDAdqm4h SzW9FEN6fbyYSRIjq2xCZS9WoARgqGLKj1zbsZBO9HZRHL4O43E73SsHkWpjd8alueqQ oRMw== X-Gm-Message-State: AOAM530yFVlBowcW0UkuuWa4lhLNX3dM35yizMP29Ui2FnMfAuN7HRy8 Opi1yF75+HS780vfSL2EOJbcKHuaiiQ/HFVN39Q= X-Received: by 2002:a05:6a00:22c2:b029:156:543:7c1d with SMTP id f2-20020a056a0022c2b029015605437c1dmr3749000pfj.40.1603392352903; Thu, 22 Oct 2020 11:45:52 -0700 (PDT) MIME-Version: 1.0 References: <20201022155858.20867-1-nsaenzjulienne@suse.de> <20201022155858.20867-2-nsaenzjulienne@suse.de> In-Reply-To: <20201022155858.20867-2-nsaenzjulienne@suse.de> From: Andy Shevchenko Date: Thu, 22 Oct 2020 21:46:41 +0300 Message-ID: Subject: Re: [PATCH v2 01/10] firmware: raspberrypi: Introduce rpi_firmware_put() To: Nicolas Saenz Julienne Cc: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Keep a reference count of all consumers and make sure they all finished > unbinding before we do. 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? -- With Best Regards, Andy Shevchenko