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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47600C31E46 for ; Wed, 12 Jun 2019 05:16:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C9D82086A for ; Wed, 12 Jun 2019 05:16:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730549AbfFLFQ0 (ORCPT ); Wed, 12 Jun 2019 01:16:26 -0400 Received: from gate.crashing.org ([63.228.1.57]:51103 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfFLFQ0 (ORCPT ); Wed, 12 Jun 2019 01:16:26 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x5C5G5tU001179; Wed, 12 Jun 2019 00:16:07 -0500 Message-ID: Subject: [PATCH+DISCUSSION] irqchip: armada-370-xp: Remove redundant ops assignment From: Benjamin Herrenschmidt To: Thomas Petazzoni Cc: Gregory CLEMENT , Marc Zyngier , linux-arm-kernel@lists.infradead.org, "linux-kernel@vger.kernel.org" Date: Wed, 12 Jun 2019 15:16:05 +1000 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pci_msi_create_irq_domain -> pci_msi_domain_update_chip_ops will set those two already since the driver sets MSI_FLAG_USE_DEF_CHIP_OPS Signed-off-by: Benjamin Herrenschmidt --- [UNTESTED] Just something I noticed while browsing through those drivers in search of ways to factor some of the code. That leads to a question here: Some MSI drivers such as this one (or any using the defaults mask/unmask provided by drivers/pci/msi.c) only call the PCI MSI mask/unmask functions. Some other drivers call those PCI function but *also* call the parent mask/unmask (giv-v2m for example) which generally is the inner domain which just itself forwards to its own parent. Is there any preference for doing it one way or the other ? I can see that in cases where the device doesn't support MSI masking, calling the parent could be useful but we don't know that at the moment in the corresponding code. It feels like something we should consolidate (and remove code from drivers). For example, the defaults in drivers/pci/msi.c could always call the parent if it exists and has a mask/unmask callback. Opinions ? I'm happy to produce patches once we agree... diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index c9bdc5221b82..911230f28e2d 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -197,8 +197,6 @@ static void armada_370_xp_irq_unmask(struct irq_data *d) static struct irq_chip armada_370_xp_msi_irq_chip = { .name = "MPIC MSI", - .irq_mask = pci_msi_mask_irq, - .irq_unmask = pci_msi_unmask_irq, }; static struct msi_domain_info armada_370_xp_msi_domain_info = { 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 X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1761EC31E48 for ; Wed, 12 Jun 2019 05:16:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E1121208C2 for ; Wed, 12 Jun 2019 05:16:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ivTzpYWd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1121208C2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:Date:To:From:Subject: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4U8qEweRlphx7FkYAheEYu+XdiVVLhFTQgM7YI/7y7I=; b=ivTzpYWd4kIqj6 /rBAarihV2XoDLhVW1tt26ErMeyZ9ko9LIjbnbspuqpFFQ1ks9qOqrwmBUAyAyPakMYCmefy2kDZW hAskyZOevrYj//P3babSD4gQQhYvOj2DliUjdD8y8ppiR3pS4KZpqHoIfIFBGVy5N5+xACTjCR6wk kCl68erFvVDYplYzut3gmTrQRcmNR83gweBKDhuBd+KxpHr244Zehkw/NiqvAVjiUCZ9xINSiouiL hm0pkkldv9T4NXnCSe0+sm1yUHgsTG9wpRPkZBcyw6QZ468zytz9UFpkGzP9yvLxtyJVylZYknyjB gD4bMUaj+zRn2XhkQiGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1havcW-0006Lf-DM; Wed, 12 Jun 2019 05:16:24 +0000 Received: from gate.crashing.org ([63.228.1.57]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1havcR-0006L2-Qm for linux-arm-kernel@lists.infradead.org; Wed, 12 Jun 2019 05:16:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x5C5G5tU001179; Wed, 12 Jun 2019 00:16:07 -0500 Message-ID: Subject: [PATCH+DISCUSSION] irqchip: armada-370-xp: Remove redundant ops assignment From: Benjamin Herrenschmidt To: Thomas Petazzoni Date: Wed, 12 Jun 2019 15:16:05 +1000 X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_221621_866733_EF23A127 X-CRM114-Status: GOOD ( 10.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gregory CLEMENT , Marc Zyngier , "linux-kernel@vger.kernel.org" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org pci_msi_create_irq_domain -> pci_msi_domain_update_chip_ops will set those two already since the driver sets MSI_FLAG_USE_DEF_CHIP_OPS Signed-off-by: Benjamin Herrenschmidt --- [UNTESTED] Just something I noticed while browsing through those drivers in search of ways to factor some of the code. That leads to a question here: Some MSI drivers such as this one (or any using the defaults mask/unmask provided by drivers/pci/msi.c) only call the PCI MSI mask/unmask functions. Some other drivers call those PCI function but *also* call the parent mask/unmask (giv-v2m for example) which generally is the inner domain which just itself forwards to its own parent. Is there any preference for doing it one way or the other ? I can see that in cases where the device doesn't support MSI masking, calling the parent could be useful but we don't know that at the moment in the corresponding code. It feels like something we should consolidate (and remove code from drivers). For example, the defaults in drivers/pci/msi.c could always call the parent if it exists and has a mask/unmask callback. Opinions ? I'm happy to produce patches once we agree... diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index c9bdc5221b82..911230f28e2d 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -197,8 +197,6 @@ static void armada_370_xp_irq_unmask(struct irq_data *d) static struct irq_chip armada_370_xp_msi_irq_chip = { .name = "MPIC MSI", - .irq_mask = pci_msi_mask_irq, - .irq_unmask = pci_msi_unmask_irq, }; static struct msi_domain_info armada_370_xp_msi_domain_info = { _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel