From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231AbbJNCVk (ORCPT ); Tue, 13 Oct 2015 22:21:40 -0400 Received: from mga03.intel.com ([134.134.136.65]:25994 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751401AbbJNCVh (ORCPT ); Tue, 13 Oct 2015 22:21:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,681,1437462000"; d="scan'208";a="826133157" Subject: Re: [PATCH] genirq/msi: Do not use pci_msi_[un]mask_irq as default methods To: Marc Zyngier , Thomas Gleixner , Bjorn Helgaas References: <1444760085-27857-1-git-send-email-marc.zyngier@arm.com> Cc: linux-kernel@vger.kernel.org From: Jiang Liu Organization: Intel Message-ID: <561DBC1A.5060902@linux.intel.com> Date: Wed, 14 Oct 2015 10:21:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1444760085-27857-1-git-send-email-marc.zyngier@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/10/14 2:14, Marc Zyngier wrote: > When we create a generic MSI domain, that MSI_FLAG_USE_DEF_CHIP_OPS > is set, and that any of .mask or .unmask are NULL in the irq_chip > structure, we set them to pci_msi_[un]mask_irq. > > This is a bad idea for at least two reasons: > - PCI_MSI might not be selected, kernel fails to build (yes, this is > legitimate, at least on arm64!) > - This may not be a PCI/MSI domain at all (platform MSI, for example) > > Either way, this looks wrong. Move the overriding of mask/unmask to > the PCI counterpart, and panic is any of these two methods is not > set in the core code (they really should be present). Hi Marc, Thanks for fixing this, Reviewed-by: Jiang Liu Thanks, Gerry > > Signed-off-by: Marc Zyngier > --- > drivers/pci/msi.c | 4 ++++ > kernel/irq/msi.c | 6 +----- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c > index d449714..4a7da3c 100644 > --- a/drivers/pci/msi.c > +++ b/drivers/pci/msi.c > @@ -1243,6 +1243,10 @@ static void pci_msi_domain_update_chip_ops(struct msi_domain_info *info) > BUG_ON(!chip); > if (!chip->irq_write_msi_msg) > chip->irq_write_msi_msg = pci_msi_domain_write_msg; > + if (!chip->irq_mask) > + chip->irq_mask = pci_msi_mask_irq; > + if (!chip->irq_unmask) > + chip->irq_unmask = pci_msi_unmask_irq; > } > > /** > diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c > index 7e6512b..be9149f 100644 > --- a/kernel/irq/msi.c > +++ b/kernel/irq/msi.c > @@ -228,11 +228,7 @@ static void msi_domain_update_chip_ops(struct msi_domain_info *info) > { > struct irq_chip *chip = info->chip; > > - BUG_ON(!chip); > - if (!chip->irq_mask) > - chip->irq_mask = pci_msi_mask_irq; > - if (!chip->irq_unmask) > - chip->irq_unmask = pci_msi_unmask_irq; > + BUG_ON(!chip || !chip->irq_mask || !chip->irq_unmask); > if (!chip->irq_set_affinity) > chip->irq_set_affinity = msi_domain_set_affinity; > } >