From mboxrd@z Thu Jan 1 00:00:00 1970 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 27B16C4332F for ; Fri, 10 Dec 2021 22:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344898AbhLJWXZ (ORCPT ); Fri, 10 Dec 2021 17:23:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344907AbhLJWXG (ORCPT ); Fri, 10 Dec 2021 17:23:06 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15718C061D76; Fri, 10 Dec 2021 14:19:30 -0800 (PST) Message-ID: <20211210221814.970099984@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639174768; 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=zF6xwEDBnJqDiuzvbqLmsexoc+W+jGd9VwXdVq5BEMI=; b=3uRJBXLzDA2NYHvGXAjPESXwPtY4wndvLVMfkxhow+rp/kDN16U4X0C98PwLB5MMnD4tYn ZOEGSM2ye4hhzzHTXNKc+wG0/ppoUdhswTzSBop3HHGnldcxLhjnLtQjD+xMmCwf22EUFE Q/zKOvjGyNcbqIgKQIsGXYGvefv5FHydeVKH232ubirlNA6T15859yhIKJ3jJ/7StDjYf2 Oo9QLHN7iSJxzUqL6+fXtAzM9h9rqxwBGkEmlO1cFEBEwCIOcIJDJlbaSJFihp8W7eJp79 8OeTtwQoaG0Z1HU6FBoYv5812za0uLavtriysEdHJ3Xheg5DIbiHdaTlV7ZxlQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639174768; 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=zF6xwEDBnJqDiuzvbqLmsexoc+W+jGd9VwXdVq5BEMI=; b=jVULDfzUnOD2T8hCESYAAk+sAcevMjadKqHQJ3kXJ4DqJvj5V3VSRLrJFQ9AuMxcORx3I7 XP2F++Om2JcSHtCg== From: Thomas Gleixner To: LKML Cc: Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , linux-pci@vger.kernel.org, Cedric Le Goater , Greg Kroah-Hartman , Vinod Koul , dmaengine@vger.kernel.org, Juergen Gross , xen-devel@lists.xenproject.org, Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, Bjorn Helgaas , Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Mark Rutland , Will Deacon , Robin Murphy , Joerg Roedel , iommu@lists.linux-foundation.org, Jassi Brar , Peter Ujfalusi , Sinan Kaya Subject: [patch V3 29/35] dmaengine: mv_xor_v2: Get rid of msi_desc abuse References: <20211210221642.869015045@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Fri, 10 Dec 2021 23:19:28 +0100 (CET) Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org From: Thomas Gleixner Storing a pointer to the MSI descriptor just to keep track of the Linux interrupt number is daft. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Vinod Koul Cc: dmaengine@vger.kernel.org --- drivers/dma/mv_xor_v2.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c @@ -149,7 +149,7 @@ struct mv_xor_v2_descriptor { * @desc_size: HW descriptor size * @npendings: number of pending descriptors (for which tx_submit has * @hw_queue_idx: HW queue index - * @msi_desc: local interrupt descriptor information + * @irq: The Linux interrupt number * been called, but not yet issue_pending) */ struct mv_xor_v2_device { @@ -168,7 +168,7 @@ struct mv_xor_v2_device { int desc_size; unsigned int npendings; unsigned int hw_queue_idx; - struct msi_desc *msi_desc; + unsigned int irq; }; /** @@ -718,7 +718,6 @@ static int mv_xor_v2_probe(struct platfo int i, ret = 0; struct dma_device *dma_dev; struct mv_xor_v2_sw_desc *sw_desc; - struct msi_desc *msi_desc; BUILD_BUG_ON(sizeof(struct mv_xor_v2_descriptor) != MV_XOR_V2_EXT_DESC_SIZE); @@ -770,14 +769,9 @@ static int mv_xor_v2_probe(struct platfo if (ret) goto disable_clk; - msi_desc = first_msi_entry(&pdev->dev); - if (!msi_desc) { - ret = -ENODEV; - goto free_msi_irqs; - } - xor_dev->msi_desc = msi_desc; + xor_dev->irq = msi_get_virq(&pdev->dev, 0); - ret = devm_request_irq(&pdev->dev, msi_desc->irq, + ret = devm_request_irq(&pdev->dev, xor_dev->irq, mv_xor_v2_interrupt_handler, 0, dev_name(&pdev->dev), xor_dev); if (ret) @@ -892,7 +886,7 @@ static int mv_xor_v2_remove(struct platf xor_dev->desc_size * MV_XOR_V2_DESC_NUM, xor_dev->hw_desq_virt, xor_dev->hw_desq); - devm_free_irq(&pdev->dev, xor_dev->msi_desc->irq, xor_dev); + devm_free_irq(&pdev->dev, xor_dev->irq, xor_dev); platform_msi_domain_free_irqs(&pdev->dev); From mboxrd@z Thu Jan 1 00:00:00 1970 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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7607C433EF for ; Fri, 10 Dec 2021 22:19:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 714424284C; Fri, 10 Dec 2021 22:19:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HZB-jXknrqff; Fri, 10 Dec 2021 22:19:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5E0E042855; Fri, 10 Dec 2021 22:19:32 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 01DEFC0072; Fri, 10 Dec 2021 22:19:32 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 40F57C0012 for ; Fri, 10 Dec 2021 22:19:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2F5608560B for ; Fri, 10 Dec 2021 22:19:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=linutronix.de header.b="3uRJBXLz"; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=linutronix.de header.b="jVULDfzU" Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Llb87ZjJGr3M for ; Fri, 10 Dec 2021 22:19:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7CBE185535 for ; Fri, 10 Dec 2021 22:19:30 +0000 (UTC) Message-ID: <20211210221814.970099984@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639174768; 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=zF6xwEDBnJqDiuzvbqLmsexoc+W+jGd9VwXdVq5BEMI=; b=3uRJBXLzDA2NYHvGXAjPESXwPtY4wndvLVMfkxhow+rp/kDN16U4X0C98PwLB5MMnD4tYn ZOEGSM2ye4hhzzHTXNKc+wG0/ppoUdhswTzSBop3HHGnldcxLhjnLtQjD+xMmCwf22EUFE Q/zKOvjGyNcbqIgKQIsGXYGvefv5FHydeVKH232ubirlNA6T15859yhIKJ3jJ/7StDjYf2 Oo9QLHN7iSJxzUqL6+fXtAzM9h9rqxwBGkEmlO1cFEBEwCIOcIJDJlbaSJFihp8W7eJp79 8OeTtwQoaG0Z1HU6FBoYv5812za0uLavtriysEdHJ3Xheg5DIbiHdaTlV7ZxlQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639174768; 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=zF6xwEDBnJqDiuzvbqLmsexoc+W+jGd9VwXdVq5BEMI=; b=jVULDfzUnOD2T8hCESYAAk+sAcevMjadKqHQJ3kXJ4DqJvj5V3VSRLrJFQ9AuMxcORx3I7 XP2F++Om2JcSHtCg== From: Thomas Gleixner To: LKML Subject: [patch V3 29/35] dmaengine: mv_xor_v2: Get rid of msi_desc abuse References: <20211210221642.869015045@linutronix.de> MIME-Version: 1.0 Date: Fri, 10 Dec 2021 23:19:28 +0100 (CET) Cc: Nishanth Menon , Mark Rutland , Stuart Yoder , Benjamin Herrenschmidt , Will Deacon , Ashok Raj , Michael Ellerman , Jassi Brar , Sinan Kaya , iommu@lists.linux-foundation.org, Peter Ujfalusi , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Jason Gunthorpe , linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, Kevin Tian , Arnd Bergmann , Robin Murphy , Alex Williamson , Cedric Le Goater , Santosh Shilimkar , Bjorn Helgaas , Megha Dey , Juergen Gross , Tero Kristo , Greg Kroah-Hartman , Vinod Koul , Marc Zygnier , dmaengine@vger.kernel.org, linuxppc-dev@lists.ozlabs.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" From: Thomas Gleixner Storing a pointer to the MSI descriptor just to keep track of the Linux interrupt number is daft. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Vinod Koul Cc: dmaengine@vger.kernel.org --- drivers/dma/mv_xor_v2.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c @@ -149,7 +149,7 @@ struct mv_xor_v2_descriptor { * @desc_size: HW descriptor size * @npendings: number of pending descriptors (for which tx_submit has * @hw_queue_idx: HW queue index - * @msi_desc: local interrupt descriptor information + * @irq: The Linux interrupt number * been called, but not yet issue_pending) */ struct mv_xor_v2_device { @@ -168,7 +168,7 @@ struct mv_xor_v2_device { int desc_size; unsigned int npendings; unsigned int hw_queue_idx; - struct msi_desc *msi_desc; + unsigned int irq; }; /** @@ -718,7 +718,6 @@ static int mv_xor_v2_probe(struct platfo int i, ret = 0; struct dma_device *dma_dev; struct mv_xor_v2_sw_desc *sw_desc; - struct msi_desc *msi_desc; BUILD_BUG_ON(sizeof(struct mv_xor_v2_descriptor) != MV_XOR_V2_EXT_DESC_SIZE); @@ -770,14 +769,9 @@ static int mv_xor_v2_probe(struct platfo if (ret) goto disable_clk; - msi_desc = first_msi_entry(&pdev->dev); - if (!msi_desc) { - ret = -ENODEV; - goto free_msi_irqs; - } - xor_dev->msi_desc = msi_desc; + xor_dev->irq = msi_get_virq(&pdev->dev, 0); - ret = devm_request_irq(&pdev->dev, msi_desc->irq, + ret = devm_request_irq(&pdev->dev, xor_dev->irq, mv_xor_v2_interrupt_handler, 0, dev_name(&pdev->dev), xor_dev); if (ret) @@ -892,7 +886,7 @@ static int mv_xor_v2_remove(struct platf xor_dev->desc_size * MV_XOR_V2_DESC_NUM, xor_dev->hw_desq_virt, xor_dev->hw_desq); - devm_free_irq(&pdev->dev, xor_dev->msi_desc->irq, xor_dev); + devm_free_irq(&pdev->dev, xor_dev->irq, xor_dev); platform_msi_domain_free_irqs(&pdev->dev); _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C92EEC433F5 for ; Fri, 10 Dec 2021 22:37:58 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4J9m512yVRz3gCb for ; Sat, 11 Dec 2021 09:37:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=3uRJBXLz; dkim=fail reason="signature verification failed" header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=jVULDfzU; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linutronix.de (client-ip=2a0a:51c0:0:12e:550::1; helo=galois.linutronix.de; envelope-from=tglx@linutronix.de; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=3uRJBXLz; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=jVULDfzU; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4J9lgl2nYwz3cbD for ; Sat, 11 Dec 2021 09:19:31 +1100 (AEDT) Message-ID: <20211210221814.970099984@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639174768; 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=zF6xwEDBnJqDiuzvbqLmsexoc+W+jGd9VwXdVq5BEMI=; b=3uRJBXLzDA2NYHvGXAjPESXwPtY4wndvLVMfkxhow+rp/kDN16U4X0C98PwLB5MMnD4tYn ZOEGSM2ye4hhzzHTXNKc+wG0/ppoUdhswTzSBop3HHGnldcxLhjnLtQjD+xMmCwf22EUFE Q/zKOvjGyNcbqIgKQIsGXYGvefv5FHydeVKH232ubirlNA6T15859yhIKJ3jJ/7StDjYf2 Oo9QLHN7iSJxzUqL6+fXtAzM9h9rqxwBGkEmlO1cFEBEwCIOcIJDJlbaSJFihp8W7eJp79 8OeTtwQoaG0Z1HU6FBoYv5812za0uLavtriysEdHJ3Xheg5DIbiHdaTlV7ZxlQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639174768; 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=zF6xwEDBnJqDiuzvbqLmsexoc+W+jGd9VwXdVq5BEMI=; b=jVULDfzUnOD2T8hCESYAAk+sAcevMjadKqHQJ3kXJ4DqJvj5V3VSRLrJFQ9AuMxcORx3I7 XP2F++Om2JcSHtCg== From: Thomas Gleixner To: LKML Subject: [patch V3 29/35] dmaengine: mv_xor_v2: Get rid of msi_desc abuse References: <20211210221642.869015045@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Fri, 10 Dec 2021 23:19:28 +0100 (CET) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Mark Rutland , Stuart Yoder , Will Deacon , Ashok Raj , Joerg Roedel , Jassi Brar , Sinan Kaya , iommu@lists.linux-foundation.org, Peter Ujfalusi , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Jason Gunthorpe , linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, Kevin Tian , Arnd Bergmann , Robin Murphy , Alex Williamson , Cedric Le Goater , Santosh Shilimkar , Bjorn Helgaas , Megha Dey , Laurentiu Tudor , Juergen Gross , Tero Kristo , Greg Kroah-Hartman , Vinod Koul , Marc Zygnier , dmaengine@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Thomas Gleixner Storing a pointer to the MSI descriptor just to keep track of the Linux interrupt number is daft. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Vinod Koul Cc: dmaengine@vger.kernel.org --- drivers/dma/mv_xor_v2.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c @@ -149,7 +149,7 @@ struct mv_xor_v2_descriptor { * @desc_size: HW descriptor size * @npendings: number of pending descriptors (for which tx_submit has * @hw_queue_idx: HW queue index - * @msi_desc: local interrupt descriptor information + * @irq: The Linux interrupt number * been called, but not yet issue_pending) */ struct mv_xor_v2_device { @@ -168,7 +168,7 @@ struct mv_xor_v2_device { int desc_size; unsigned int npendings; unsigned int hw_queue_idx; - struct msi_desc *msi_desc; + unsigned int irq; }; /** @@ -718,7 +718,6 @@ static int mv_xor_v2_probe(struct platfo int i, ret = 0; struct dma_device *dma_dev; struct mv_xor_v2_sw_desc *sw_desc; - struct msi_desc *msi_desc; BUILD_BUG_ON(sizeof(struct mv_xor_v2_descriptor) != MV_XOR_V2_EXT_DESC_SIZE); @@ -770,14 +769,9 @@ static int mv_xor_v2_probe(struct platfo if (ret) goto disable_clk; - msi_desc = first_msi_entry(&pdev->dev); - if (!msi_desc) { - ret = -ENODEV; - goto free_msi_irqs; - } - xor_dev->msi_desc = msi_desc; + xor_dev->irq = msi_get_virq(&pdev->dev, 0); - ret = devm_request_irq(&pdev->dev, msi_desc->irq, + ret = devm_request_irq(&pdev->dev, xor_dev->irq, mv_xor_v2_interrupt_handler, 0, dev_name(&pdev->dev), xor_dev); if (ret) @@ -892,7 +886,7 @@ static int mv_xor_v2_remove(struct platf xor_dev->desc_size * MV_XOR_V2_DESC_NUM, xor_dev->hw_desq_virt, xor_dev->hw_desq); - devm_free_irq(&pdev->dev, xor_dev->msi_desc->irq, xor_dev); + devm_free_irq(&pdev->dev, xor_dev->irq, xor_dev); platform_msi_domain_free_irqs(&pdev->dev); From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0106BC433EF for ; Fri, 10 Dec 2021 22:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:MIME-Version:References:Subject:Cc :To:From:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: List-Owner; bh=j09bPKSrqpv7n7MqOh7GVm3r3hKM7sYwN0rbGhTGjgs=; b=bN3poOnAKVWSkr LDs3sX1L1ji0SxBB9B/O/hu8SNMe2MZBg27KzSEhd0tS0YqMi8e+nwFf70JdsTP7hc9Wl1+CDCavk Pf4P9VA7qAI15gpvvT6nahT26/Vb/8Mx8oPwTYWIxQL/JZZhrpJhEk3NKE7z5KpNH6mQlJP+Nj/4V H5an7I20w8WVD6B7Eo93M/qyJvkcvLBvbSwSA1QS4sboU9ISujTphkZSgzbNSZgqu6jZ9Ochovwl2 Jy6mSy0gJoRKR3PIAykGL83wn9vwc2lt0PSfYQjT7Qv7T8wec8pw9mdYjgvrlEH2CWfIJhI5iF88m 93cL9k4UeNJcCpBGpitA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvock-0049Ja-GK; Fri, 10 Dec 2021 22:44:19 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvoEk-003zXC-Af for linux-arm-kernel@lists.infradead.org; Fri, 10 Dec 2021 22:19:32 +0000 Message-ID: <20211210221814.970099984@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639174768; 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=zF6xwEDBnJqDiuzvbqLmsexoc+W+jGd9VwXdVq5BEMI=; b=3uRJBXLzDA2NYHvGXAjPESXwPtY4wndvLVMfkxhow+rp/kDN16U4X0C98PwLB5MMnD4tYn ZOEGSM2ye4hhzzHTXNKc+wG0/ppoUdhswTzSBop3HHGnldcxLhjnLtQjD+xMmCwf22EUFE Q/zKOvjGyNcbqIgKQIsGXYGvefv5FHydeVKH232ubirlNA6T15859yhIKJ3jJ/7StDjYf2 Oo9QLHN7iSJxzUqL6+fXtAzM9h9rqxwBGkEmlO1cFEBEwCIOcIJDJlbaSJFihp8W7eJp79 8OeTtwQoaG0Z1HU6FBoYv5812za0uLavtriysEdHJ3Xheg5DIbiHdaTlV7ZxlQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639174768; 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=zF6xwEDBnJqDiuzvbqLmsexoc+W+jGd9VwXdVq5BEMI=; b=jVULDfzUnOD2T8hCESYAAk+sAcevMjadKqHQJ3kXJ4DqJvj5V3VSRLrJFQ9AuMxcORx3I7 XP2F++Om2JcSHtCg== From: Thomas Gleixner To: LKML Cc: Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , linux-pci@vger.kernel.org, Cedric Le Goater , Greg Kroah-Hartman , Vinod Koul , dmaengine@vger.kernel.org, Juergen Gross , xen-devel@lists.xenproject.org, Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, Bjorn Helgaas , Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Mark Rutland , Will Deacon , Robin Murphy , Joerg Roedel , iommu@lists.linux-foundation.org, Jassi Brar , Peter Ujfalusi , Sinan Kaya Subject: [patch V3 29/35] dmaengine: mv_xor_v2: Get rid of msi_desc abuse References: <20211210221642.869015045@linutronix.de> MIME-Version: 1.0 Date: Fri, 10 Dec 2021 23:19:28 +0100 (CET) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211210_141930_698316_618800EC X-CRM114-Status: GOOD ( 13.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thomas Gleixner Storing a pointer to the MSI descriptor just to keep track of the Linux interrupt number is daft. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Vinod Koul Cc: dmaengine@vger.kernel.org --- drivers/dma/mv_xor_v2.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c @@ -149,7 +149,7 @@ struct mv_xor_v2_descriptor { * @desc_size: HW descriptor size * @npendings: number of pending descriptors (for which tx_submit has * @hw_queue_idx: HW queue index - * @msi_desc: local interrupt descriptor information + * @irq: The Linux interrupt number * been called, but not yet issue_pending) */ struct mv_xor_v2_device { @@ -168,7 +168,7 @@ struct mv_xor_v2_device { int desc_size; unsigned int npendings; unsigned int hw_queue_idx; - struct msi_desc *msi_desc; + unsigned int irq; }; /** @@ -718,7 +718,6 @@ static int mv_xor_v2_probe(struct platfo int i, ret = 0; struct dma_device *dma_dev; struct mv_xor_v2_sw_desc *sw_desc; - struct msi_desc *msi_desc; BUILD_BUG_ON(sizeof(struct mv_xor_v2_descriptor) != MV_XOR_V2_EXT_DESC_SIZE); @@ -770,14 +769,9 @@ static int mv_xor_v2_probe(struct platfo if (ret) goto disable_clk; - msi_desc = first_msi_entry(&pdev->dev); - if (!msi_desc) { - ret = -ENODEV; - goto free_msi_irqs; - } - xor_dev->msi_desc = msi_desc; + xor_dev->irq = msi_get_virq(&pdev->dev, 0); - ret = devm_request_irq(&pdev->dev, msi_desc->irq, + ret = devm_request_irq(&pdev->dev, xor_dev->irq, mv_xor_v2_interrupt_handler, 0, dev_name(&pdev->dev), xor_dev); if (ret) @@ -892,7 +886,7 @@ static int mv_xor_v2_remove(struct platf xor_dev->desc_size * MV_XOR_V2_DESC_NUM, xor_dev->hw_desq_virt, xor_dev->hw_desq); - devm_free_irq(&pdev->dev, xor_dev->msi_desc->irq, xor_dev); + devm_free_irq(&pdev->dev, xor_dev->irq, xor_dev); platform_msi_domain_free_irqs(&pdev->dev); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel