From patchwork Fri Nov 11 13:57:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 18815 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp758244wru; Fri, 11 Nov 2022 06:05:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf46snnTVzUAMS2xnDUfiQ5qnhum/54lnnGHQ0TLCuKUqHfyWzEvu5bFNhYmuubjCDbPLs+R X-Received: by 2002:a63:ba04:0:b0:46f:b2a5:76e8 with SMTP id k4-20020a63ba04000000b0046fb2a576e8mr1848572pgf.235.1668175546848; Fri, 11 Nov 2022 06:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175546; cv=none; d=google.com; s=arc-20160816; b=hOStIiqeGzAhlwqxfChoyhVL+r70/l2M0qW4fGvSO8YMO35QkELUJ9Tmpgf3ZyeVG8 ACU5d03MgMJDKfi59AP2joC11kgbELWWhuEqL7eKpa3a9HXASeuulc/8x1eLwR8CCA6F LGwU0idlsph6W+TVGl2n5yKCHfH72FtxPh6mP9BRakFznST/uhuxReYBzYOM+GOJZtfn BUrXFgKrmreM1d973zWle24hdw+iChPzWzLIaM68x8QELgzeMSxlqRkRDB5Mrnlu+emQ jiUxk/QYv/agd1C2ln/+o3JUVar7a1I7d0hULxhgPZI/gtqAP+YEkx7J13A59FviyGrN 631w== 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=Z24GO4MnTab288mFIzZQd9PzhPWRMuxD4tIDuzZ+d4sWUzG7CvQLueG059nCaL6UsI k4nGi2iex5iKpD4VethsDTESlNKg2EpF3dSM7UIIcXtnP5qILpJwPMRNiPqWdxQzVnLE TiX3J+/QfqMpCaaxJlPLhcL1Z32SXTZUansxwyydPOlPbUmU+woWyI6bpeKjHp5+Wjn6 NKMqKG1+ZsB7H6tPsZrim59Tq6m1PZH7FcYUQ9QTPyD4l2jDVE6aa3HIUP4IHPQ/R4Je qI56JePJVPAx72OnA4mCSF2VlSZfCRepA0ewXbqml4nC9PzjdjwEHfb9L+/Oaug1BhSJ v5Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=b2qWOR5r; dkim=neutral (no key) header.i=@linutronix.de; 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 i3-20020aa78b43000000b00536fa6bbb11si2132096pfd.344.2022.11.11.06.05.30; Fri, 11 Nov 2022 06:05:46 -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=b2qWOR5r; dkim=neutral (no key) header.i=@linutronix.de; 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 S234313AbiKKODW (ORCPT + 99 others); Fri, 11 Nov 2022 09:03:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234440AbiKKOCO (ORCPT ); Fri, 11 Nov 2022 09:02:14 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7508F89639; Fri, 11 Nov 2022 05:57:26 -0800 (PST) Message-ID: <20221111132707.060879997@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668175026; 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=b2qWOR5rNY5l6QrwV6LOsW8z1NZcuuv0BlXBZwQiTd2ku+0bUb+htoJlY82AP7ueKMnTFh mRrrvZVXzCf/H0WXVARBTsFzszjAWVWufbREofX13hvwsueXQDy7RA0nRAXr40RYK7K8LW epyChfCzDuIFMBqaN4t9mmEUeP1lNF+5SikOV0yvv2n+D43TQ2sveI7y/jgo2jw8W3b39R WA6gqwi28G8sjaoJtA7hQ2hoe5zAcHxK0E5GxBcnm7gALFr8r3kGOsv2yPLgJA5UOPMqlW 67atN9UkO2yPH6BHxWWvWp40wP3toNsME0HJbjSZBJtpiDWpWyp5jEB7yycSmw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668175026; 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=bzCbLBwMp9PgBIKr8pHnkMh9R/cMZQMZPxHvt/cZq6d8HW8BhFofScW9NdUFgmteXW2y6e 0AvvhHSeFhGyk+BA== 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 , "Ahmed S. Darwish" , Reinette Chatre Subject: [patch 18/20] bus: fsl-mc-msi: Switch to domain id aware interfaces References: <20221111131813.914374272@linutronix.de> MIME-Version: 1.0 Date: Fri, 11 Nov 2022 14:57:06 +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?1749208841721759158?= X-GMAIL-MSGID: =?utf-8?q?1749208841721759158?= 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); }