From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F07C219EA for ; Wed, 20 Dec 2023 10:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WG/VJPVz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703068651; x=1734604651; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mwzvb1h3V5fruDOZoYDmhDZh8/drmi6Hc+Wqgrki4lk=; b=WG/VJPVzG5+ZGKCFhOC7CukFtQI+ROqZ0Fk0xmKRQhj+Q29+nHJndBKq JlEhFWvm+8o6iznKeyDw/99mmEQH1xsjQlSAZv5NtU3RlE1lNU/lLua2t LXpREzGs+Y/bI4lU6vY+zHo7sYEZRXzPOMI1jdJ6bC9n0z2M0o6wlpSdk sMQqhtTlYj0iFU5JbZsZSowXQNqhW9ekKC5YOd8gkFbGrsnnkPILWP6/E Lp/P0myckh05CgGim13MwA96/1MNzKuBnitiE1hgOOGGgmcaVYVQVFEJj /F4EJZKtxrP+pQvrLTb8nWseqHzvPjSHBDIGslS3FHg2HpVSvjoZgfy52 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10929"; a="9174383" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="9174383" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2023 02:37:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10929"; a="769544272" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="769544272" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2023 02:37:30 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 509F311FB5E; Wed, 20 Dec 2023 12:37:27 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Hans Verkuil Subject: [PATCH v2 21/29] media: ipu3-cio2: Request IRQ earlier Date: Wed, 20 Dec 2023 12:37:05 +0200 Message-Id: <20231220103713.113386-22-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231220103713.113386-1-sakari.ailus@linux.intel.com> References: <20231220103713.113386-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Call devm_request_irq() before registering the async notifier, as otherwise it would be possible to use the device before the interrupts could be deliveted to the driver. Signed-off-by: Sakari Ailus --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c index da82d09b46ab..3222ec5b8345 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1789,11 +1789,6 @@ static int cio2_pci_probe(struct pci_dev *pci_dev, v4l2_async_nf_init(&cio2->notifier, &cio2->v4l2_dev); - /* Register notifier for subdevices we care */ - r = cio2_parse_firmware(cio2); - if (r) - goto fail_clean_notifier; - r = devm_request_irq(dev, pci_dev->irq, cio2_irq, IRQF_SHARED, CIO2_NAME, cio2); if (r) { @@ -1801,6 +1796,11 @@ static int cio2_pci_probe(struct pci_dev *pci_dev, goto fail_clean_notifier; } + /* Register notifier for subdevices we care */ + r = cio2_parse_firmware(cio2); + if (r) + goto fail_clean_notifier; + pm_runtime_put_noidle(dev); pm_runtime_allow(dev); -- 2.39.2