Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1990463pxu; Sun, 13 Dec 2020 09:50:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUZP9QFw2JzLVXI83jT3vZ9te2qO6oaNXTjsvNZJzoiG2TlruYKgAshRaaGoWFC3bp10rl X-Received: by 2002:a50:f404:: with SMTP id r4mr8616029edm.62.1607881809072; Sun, 13 Dec 2020 09:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607881809; cv=none; d=google.com; s=arc-20160816; b=P5DBtXJFsGChJwhlbY5/dRFEDlYPbCqGgOImngoY5/xmXSRr9fcFenrW+4hF8QLuEF dRzCa2YNXuRymafBp0mALyVGlSlN7uQJiogSg6CHGdTXlO3J1oLqQAzGTKxd8Bg1TiPT ccqjaK74CXPXo+R2Y7xkzz0LsfMRNfwnBKL7tWrohpEns5JYnNXyGr6p3EVS2bw8X3DY KFlwvAJWmbRvIzyDHxFgoWFDJC7mH2uDY31DxrbOP5TFaliGOp+G5Iia7yndvTvGfjbx ITL6dvQnSgEEqPms5c+0akeoN6Nz0VZwz5GnipRqu4DZvhq5h3sGq2/XxN3v3reibwea HumA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=VaeAUus1rNjDVdpneM1XXAW2srOZQ+w5dltPlY5NNS0=; b=vfdDWjNO5cRewv1GTpkfkAkYbyEwLO8fSWd4Fj2jZpJ438DXJ3CW+aCqo90jyWmT7n UFDzItRN4XaX+YCUJgHWxqfFRjOTyleiXScZorQWGHQnZcmZEN7Jp7NuJoxZhl7jNeJR uJpOmmV4SeCezDkSURdtn+piplcekGhmfoyDa6gOMxQ61QyyxHvUBuQuGdpVrO+bLRCx U7Wmt6BBb7SG1nIZ7wK1FJx2n4eEHO72nl6DXCPBjPmoFXV18y//mxgd0yEc+V2T1fd7 t9hi2GDNpB/6QkhFNW4zc/ea6aaZJ03G5WNNX5bOyANzJVVCkd+meK+vy6/7zXoEwuaW 0bRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TVSR2uV8; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb5si7779717ejc.585.2020.12.13.09.49.46; Sun, 13 Dec 2020 09:50:09 -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=@kernel.org header.s=k20201202 header.b=TVSR2uV8; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbgLMFOn (ORCPT + 99 others); Sun, 13 Dec 2020 00:14:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:34184 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgLMFOn (ORCPT ); Sun, 13 Dec 2020 00:14:43 -0500 Content-Type: text/plain; charset="utf-8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607836443; bh=VaeAUus1rNjDVdpneM1XXAW2srOZQ+w5dltPlY5NNS0=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=TVSR2uV8fXibrDJR0JsFRK2z5DyNUykiQtSg7rHx7t60763vOPg5/eidNeG8tT1zW u9zOoF1TQi0lCyDjSJ3GSUHjq44LtCbqOB34mPkWM+k2NbMWZH3KaqGhbF4o780yQY 6PNWK+rWJ8rCKerWpESwn7BlzoSFe4gv17J2aEVa3OUqvSVfgCLLdWiRu+pK4xkWzg WAmafQpCldA8y/U4XSsZD02KWyOhiXyxGsWMQh5qnbTlKd8kxYpHQ3mmH+bBmc2y/A v0Gfbv3pUnNrlJsqBY9oNZB4BbXCSU2SIt8hICHfLSKvYpYwqnB751wqsXTZxeeJsU 1SSrLT9hUv3Sg== MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20201211164801.7838-2-nsaenzjulienne@suse.de> References: <20201211164801.7838-1-nsaenzjulienne@suse.de> <20201211164801.7838-2-nsaenzjulienne@suse.de> Subject: Re: [PATCH v6 01/11] firmware: raspberrypi: Keep count of all consumers From: Stephen Boyd Cc: linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, wahrenst@gmx.net, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, p.zabel@pengutronix.de, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, bgolaszewski@baylibre.com, andy.shevchenko@gmail.com To: Florian Fainelli , Nicolas Saenz Julienne , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, u.kleine-koenig@pengutronix.de Date: Sat, 12 Dec 2020 21:14:01 -0800 Message-ID: <160783644171.1580929.15619962172135112128@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Nicolas Saenz Julienne (2020-12-11 08:47:50) > 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 introduce rpi_firmware_put() > which will permit automatically decrease the reference count upon > unbinding consumer drivers. >=20 > Suggested-by: Uwe Kleine-K=C3=B6nig > Signed-off-by: Nicolas Saenz Julienne > Reviewed-by: Florian Fainelli >=20 > --- Reviewed-by: Stephen Boyd