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 0373FC433EF for ; Thu, 16 Dec 2021 21:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242602AbhLPVnj (ORCPT ); Thu, 16 Dec 2021 16:43:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242017AbhLPVlc (ORCPT ); Thu, 16 Dec 2021 16:41:32 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7A9EC061748; Thu, 16 Dec 2021 13:41:07 -0800 (PST) Date: Thu, 16 Dec 2021 21:41:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639690866; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZCSBXu3Jia0hJUFtJPFQFmjltA8/rUEgupzwZ+KS/OY=; b=NPPy4PgCuGRsma0j2mMptrhAPkwnYdqCmcTHRm5jZNyv7vRnQL0BOkgLLZ4S3YY8CmHsRU xhlR2TkOZkVroFmvo0alzOqD90it0WUOim6B/YPaTwahGajULt9kFWHbQSxKCJ3eeD00j4 eGNPSksVTII7kPuUxs6e2E8WrSEEUHzkHA0+vv2YVVoX6iXBr4IJfkAHniN5CLAPGJu9MM AKkZ+CsNn1HNmS5FHarasU9RsIpDOXFJFXp18MZKLjuIxcLAZEbWNI09s1VgItfxng6+l+ ds4YnFvpwSV5kW/muwWgh++7YQ5McEtcCjfoCi7SwquFwvzg5Q+2A5GL90mvzw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639690866; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZCSBXu3Jia0hJUFtJPFQFmjltA8/rUEgupzwZ+KS/OY=; b=y88Ex+j/3eo2oGIN4fpy7fNSUsduTOPbjaPnMOTTyA+HTN52mJypiw+3sOFzSDjPUpq7um BIGX9cVcsZvoT4Cw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/msi] bus: fsl-mc-msi: Allocate MSI device data on first use Cc: Thomas Gleixner , "Greg Kroah-Hartman" , Jason Gunthorpe , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20211210221813.867985931@linutronix.de> References: <20211210221813.867985931@linutronix.de> MIME-Version: 1.0 Message-ID: <163969086554.23020.546762594767707973.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/msi branch of tip: Commit-ID: 86ca622628d3941835138f2f89e69ed63f7f50fe Gitweb: https://git.kernel.org/tip/86ca622628d3941835138f2f89e69ed63f7f50fe Author: Thomas Gleixner AuthorDate: Fri, 10 Dec 2021 23:19:00 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 16 Dec 2021 22:16:38 +01:00 bus: fsl-mc-msi: Allocate MSI device data on first use Allocate the MSI device data on first invocation of the allocation function. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.867985931@linutronix.de --- drivers/bus/fsl-mc/fsl-mc-msi.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-msi.c b/drivers/bus/fsl-mc/fsl-mc-msi.c index cf97487..c6215b7 100644 --- a/drivers/bus/fsl-mc/fsl-mc-msi.c +++ b/drivers/bus/fsl-mc/fsl-mc-msi.c @@ -253,6 +253,14 @@ int fsl_mc_msi_domain_alloc_irqs(struct device *dev, struct irq_domain *msi_domain; int error; + msi_domain = dev_get_msi_domain(dev); + if (!msi_domain) + return -EINVAL; + + error = msi_setup_device_data(dev); + if (error) + return error; + if (!list_empty(dev_to_msi_list(dev))) return -EINVAL; @@ -260,12 +268,6 @@ int fsl_mc_msi_domain_alloc_irqs(struct device *dev, if (error < 0) return error; - msi_domain = dev_get_msi_domain(dev); - if (!msi_domain) { - error = -EINVAL; - goto cleanup_msi_descs; - } - /* * NOTE: Calling this function will trigger the invocation of the * its_fsl_mc_msi_prepare() callback