From patchwork Mon Nov 21 14:36:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 23808 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1627250wrr; Mon, 21 Nov 2022 06:39:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf6NtABKFf+/tEwCMvJT/c448Q8/IUSv0490PFwG/vrq5KCX8yk4P4bzn3ZEJ8TVS+rEHglR X-Received: by 2002:a17:902:ca04:b0:188:f993:724a with SMTP id w4-20020a170902ca0400b00188f993724amr769209pld.77.1669041549121; Mon, 21 Nov 2022 06:39:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669041549; cv=none; d=google.com; s=arc-20160816; b=AGJAP/MRzCg+VwEP1GKNYQSraS1drqW3JeUPhlkSxsfHc8b9D210LO9JJ745aT2BPX T5NVKqiLSvJeq6rqKPSGeFb2SUvEiUITirKdjgqG6jaAPfiA27GH6IpRXcllO2D2awtl +YkPho28G/BybU//ZFPo2VwWq0kgXkrHdaw2RXuhJ/s11HpWov4wIv1/crw1HaAoZIZr 8z8BWJ1Dr5ewzofzMQhmmRzXQ+Td1Vw79KuS9R9FyXGDKcF2hZlMrfuWOIbNOS1up0EK o0haOApzAi7cW65IVI8PdWZsqPnG0guI2qQ+WP+PnbZb5Txt3pADQ4LYU1UuVfpcGVZy bqRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=Dc0ZFlk2JAPmF0v24u3+k7yycgC6/ipKg9qXDEwD/vU=; b=UeRnMBbYlTxEZv098PpHudQHfbzjCJ7/VLDpR3+fSvZkgEIGy5wu0v2McFjXWvdPnd LyJ/K/cZ+l7Vz3N3ug4sFRUFLCqEsUtcbBFDzoVAhc3UtCHzjl4wnDnUcI7Iahmovj18 12gNQRKhhSszdXE04fUZUZQh4BOf5goekA4mhFoCoFANKgK5H9S0or10ZOdPT81P1Hiz mvrwX+KoFemylDMyTrZYUC74tb3FIkygqkw2rtlmyM3u0CDRXCBKgK5YBDq4A/o+ZIML fX83s1jz4DUIDaB56/RHpWs5GAPT3mNanLInlHVHpjnjNR8pFEYU5A5nOnM1r5QO/mrE HYXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=VaFlFjBD; dkim=neutral (no key) header.i=@linutronix.de header.b=Su3d0lcf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a170902dac100b0018914bd1b66si6190316plx.105.2022.11.21.06.38.54; Mon, 21 Nov 2022 06:39:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=VaFlFjBD; dkim=neutral (no key) header.i=@linutronix.de header.b=Su3d0lcf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbiKUOiQ (ORCPT + 99 others); Mon, 21 Nov 2022 09:38:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230357AbiKUOgq (ORCPT ); Mon, 21 Nov 2022 09:36:46 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0683C76A6; Mon, 21 Nov 2022 06:36:43 -0800 (PST) Message-ID: <20221121083326.562323643@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=Dc0ZFlk2JAPmF0v24u3+k7yycgC6/ipKg9qXDEwD/vU=; b=VaFlFjBDVa6HJIaY2cjyzQLRAvezi2uSZ+cBOuDTxCVMmoHTN6adMFOUrGJEzxSBjOHzTD IQsDEqMDdQUp0SRI6nlodNzN4jeE/jgE5dtLQjCtdYJTu8F7QCsgySYaIWicqhP3/m6Uk8 77ZO4ZPdMaLayxnyk5eSvKarJsPpctkv7/3X4hVm2zu2Bc04CRpLD9P0LWKIAnlxj+HAO7 vA2OrMMx5OFxcMzgBieRWfqeAM2eoKUjEm5UMkY7rYpQDyzdpD9Xv+wDzxkhfL7iF0Pdkn zmwEMwBAwPyE8nWUDMxL3Mj6LWG3F4G9fsTvpDYOMKx6IwsFBPjk8wtS/fIHOw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=Dc0ZFlk2JAPmF0v24u3+k7yycgC6/ipKg9qXDEwD/vU=; b=Su3d0lcfmOFRa+bdpPmWSdcHlphAcY6+INF+dRNd/JtIJhIX4d+Lv6AK1iO2DYU/fVzQkR 99rdhYMi5TtbEcBQ== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe Subject: [patch V2 19/21] bus: fsl-mc-msi: Switch to domain id aware interfaces References: <20221121083210.309161925@linutronix.de> MIME-Version: 1.0 Date: Mon, 21 Nov 2022 15:36:42 +0100 (CET) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750116911478496815?= X-GMAIL-MSGID: =?utf-8?q?1750116911478496815?= Switch to the new domain id aware interfaces to phase out the previous ones. Get rid of the MSI descriptor and domain checks as the core code detects these issues anyway. No functional change. Signed-off-by: Thomas Gleixner --- drivers/bus/fsl-mc/fsl-mc-msi.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) --- a/drivers/bus/fsl-mc/fsl-mc-msi.c +++ b/drivers/bus/fsl-mc/fsl-mc-msi.c @@ -213,21 +213,8 @@ struct irq_domain *fsl_mc_find_msi_domai int fsl_mc_msi_domain_alloc_irqs(struct device *dev, unsigned int irq_count) { - struct irq_domain *msi_domain; - int error; + int error = msi_setup_device_data(dev); - msi_domain = dev_get_msi_domain(dev); - if (!msi_domain) - return -EINVAL; - - error = msi_setup_device_data(dev); - if (error) - return error; - - msi_lock_descs(dev); - if (msi_first_desc(dev, MSI_DESC_ALL)) - error = -EINVAL; - msi_unlock_descs(dev); if (error) return error; @@ -235,7 +222,7 @@ int fsl_mc_msi_domain_alloc_irqs(struct * NOTE: Calling this function will trigger the invocation of the * its_fsl_mc_msi_prepare() callback */ - error = msi_domain_alloc_irqs(msi_domain, dev, irq_count); + error = msi_domain_alloc_irqs_range(dev, MSI_DEFAULT_DOMAIN, 0, irq_count - 1); if (error) dev_err(dev, "Failed to allocate IRQs\n"); @@ -244,11 +231,5 @@ int fsl_mc_msi_domain_alloc_irqs(struct void fsl_mc_msi_domain_free_irqs(struct device *dev) { - struct irq_domain *msi_domain; - - msi_domain = dev_get_msi_domain(dev); - if (!msi_domain) - return; - - msi_domain_free_irqs(msi_domain, dev); + msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN); }