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 0E7D4C678DB for ; Tue, 7 Mar 2023 19:25:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234154AbjCGTZY (ORCPT ); Tue, 7 Mar 2023 14:25:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234211AbjCGTZD (ORCPT ); Tue, 7 Mar 2023 14:25:03 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A79EB3E1F for ; Tue, 7 Mar 2023 11:11:07 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1464A61520 for ; Tue, 7 Mar 2023 19:11:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27028C433D2; Tue, 7 Mar 2023 19:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678216266; bh=DbXAfy0A9EKLvlXiY6yIOUQaG1wsZEK+6OQiWQNUjXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=APXook+xrpRq3hJhSpzG8MgKWPvVdlhNCwn1TJhriLijAE7LO9KbbLZax9bTRnOZA Rf1geI3w9AJehosg5fM42hfu9WsOUByv/kMs8HxPML799o2R7SlUcGaxheFIQ69JYR xl+VtuD4NnY6D2v9wsClDdiMKV4SvWV0Kxxz/kUQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sakari Ailus , Bingbu Cao , Mauro Carvalho Chehab Subject: [PATCH 5.15 528/567] media: ipu3-cio2: Fix PM runtime usage_count in driver unbind Date: Tue, 7 Mar 2023 18:04:24 +0100 Message-Id: <20230307165928.829169364@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307165905.838066027@linuxfoundation.org> References: <20230307165905.838066027@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sakari Ailus commit 909d3096ac99fa2289f9b8945a3eab2269947a0a upstream. Get the PM runtime usage_count and forbid PM runtime at driver unbind. The opposite is being done in probe() already. Fixes: commit c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") Cc: stable@vger.kernel.org # for >= 4.16 Signed-off-by: Sakari Ailus Reviewed-by: Bingbu Cao Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c @@ -1851,6 +1851,9 @@ static void cio2_pci_remove(struct pci_d v4l2_device_unregister(&cio2->v4l2_dev); media_device_cleanup(&cio2->media_dev); mutex_destroy(&cio2->lock); + + pm_runtime_forbid(&pci_dev->dev); + pm_runtime_get_noresume(&pci_dev->dev); } static int __maybe_unused cio2_runtime_suspend(struct device *dev)