From patchwork Mon Nov 21 14:36:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 23793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1626415wrr; Mon, 21 Nov 2022 06:37:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lSPFyDDmo1FdmAPte5oTb6NO1IbTF6IolHVWEGm7AqOwTRD7JXqd/8CAmaqFoXDKojgyS X-Received: by 2002:a17:902:7686:b0:177:faf5:58c5 with SMTP id m6-20020a170902768600b00177faf558c5mr108757pll.166.1669041458030; Mon, 21 Nov 2022 06:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669041458; cv=none; d=google.com; s=arc-20160816; b=XIUiU9W+v37ftv2d9cSorscbRAzVlv1wn/Bv47c42c9+GFV/LbBEu3Whf5cg5ZBV9K 32bAc2u6JD0Ao8JvAK6v2/QII+YeKlT0MoOMe44uAmoO8l9fYXaSUnRZY/TM6ROKi1la Qk6xWpi+FHx3wOKkVGXRzCger6wP48axh+JpJgjdaHViwH3XWNpfUXTQ/1Rh7lLf9E6R 03+axm8309cCM+2C6z3WEXJeS7WPjSNjlqcu3/h3hI3fSZUo4xvjj8IXkXZ+W6F56g7p Qh4O1KFPFYk+HARHs10Tzei8LQMTlpdgfs4AFY2ssr/pQGBx+f7CW2LSVUkwYLis6wgi 2+Eg== 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=fX3YyaTkrRIM3kSpqK/PVSD3oj0zimiyOCtXLtrgK+M=; b=pTc67H1Eg0ul1R/Gy0UntM/cx/Dyhf5hEs901CA9NSEXaR12F5dJCkGtV1PondvvuE nQkbGAkjXIZvVhPN6GbIgxIpJBGSsm1om5nX1coG4qD8K1WcDdoq3tE1gSS+mlKKAPnz bxBo6Q+rg7hSwtVf6tvY28mrJIphaGz81eel80fKiw+4yWgVCVnv08rGMuEGZZJFFlP6 poRxbe7VQXJEkAoP3Z1lKxp5D5AiwY53aJSAUcQRAEQ4LxiUqCD/fD6lE+KvIVr0ZSrL vLVzM6r33fE0aXDUE0baGKIcl7CGepTKVqIjGErZy/p3juIzyIBzc9B4ew5C3JGuK1nS iyUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=07AUa4ie; 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 n1-20020a634d41000000b0046b2bef339csi11350415pgl.257.2022.11.21.06.37.22; Mon, 21 Nov 2022 06:37:38 -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=07AUa4ie; 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 S231363AbiKUOhD (ORCPT + 99 others); Mon, 21 Nov 2022 09:37:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230413AbiKUOgj (ORCPT ); Mon, 21 Nov 2022 09:36:39 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7643C8440; Mon, 21 Nov 2022 06:36:24 -0800 (PST) Message-ID: <20221121083325.741538017@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041383; 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=fX3YyaTkrRIM3kSpqK/PVSD3oj0zimiyOCtXLtrgK+M=; b=07AUa4iet7fSYqd60LLyVgrQcBpD/0U3skBP8nPL3Wpkw+0D/vqRQp/xYMTAAr4PQVv05e ThkWMW0Kaf2JuMzIapqBFhqPq+xztn2dgSZbP48V+3Qvz3KuL7TyBSijTq3L7/6r78Pn4t t7qadKTQtawlyO1HQbp3yT7eN3fn1fAk+Va24K3MfYggSo3RX7cL00ZBeix30pecrYH4Nh h+Zq7Kt9Qc0OTcv+i2QouEuRmYrHUfypKzoXaAk6DHv/JCFw6Z97faXC0jZZ/yzkBkl1PE K9bSvBgazsA9ORZiK/O7WxFbOJDwyVD4sMIt9PR4ItmH5qVS9Wb+ND2vxHmkVA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041383; 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=fX3YyaTkrRIM3kSpqK/PVSD3oj0zimiyOCtXLtrgK+M=; b=jUUGa1+CU4hAamt7oCsjQtnY1L/HCzsi+lv3jUC0kT1+6UQuyIuTKFYPm0R5J8ud/LxxSs veZXWz6oc8f+/bDA== 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 , Jason Gunthorpe Subject: [patch V2 04/21] genirq/msi: Create msi_api.h References: <20221121083210.309161925@linutronix.de> MIME-Version: 1.0 Date: Mon, 21 Nov 2022 15:36:23 +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?1750116815551305157?= X-GMAIL-MSGID: =?utf-8?q?1750116815551305157?= Create a API header for MSI specific functions which are relevant to device drivers. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Acked-by: Marc Zyngier --- include/linux/msi.h | 6 ++++-- include/linux/msi_api.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -13,11 +13,14 @@ * * Regular device drivers have no business with any of these functions and * especially storing MSI descriptor pointers in random code is considered - * abuse. The only function which is relevant for drivers is msi_get_virq(). + * abuse. + * + * Device driver relevant functions are available in */ #include #include +#include #include #include #include @@ -188,7 +191,6 @@ struct msi_device_data { int msi_setup_device_data(struct device *dev); -unsigned int msi_get_virq(struct device *dev, unsigned int index); void msi_lock_descs(struct device *dev); void msi_unlock_descs(struct device *dev); --- /dev/null +++ b/include/linux/msi_api.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef LINUX_MSI_API_H +#define LINUX_MSI_API_H + +/* + * APIs which are relevant for device driver code for allocating and + * freeing MSI interrupts and querying the associations between + * hardware/software MSI indices and the Linux interrupt number. + */ + +struct device; + +unsigned int msi_get_virq(struct device *dev, unsigned int index); + +#endif