@@ -285,8 +285,6 @@ static void pci_msi_set_enable(struct pci_dev *dev, int enable)
285
285
static int msi_setup_msi_desc (struct pci_dev * dev , int nvec ,
286
286
struct irq_affinity_desc * masks )
287
287
{
288
- const struct irq_domain * d = dev_get_msi_domain (& dev -> dev );
289
- const struct msi_domain_info * info = d -> host_data ;
290
288
struct msi_desc desc ;
291
289
u16 control ;
292
290
@@ -297,7 +295,7 @@ static int msi_setup_msi_desc(struct pci_dev *dev, int nvec,
297
295
/* Lies, damned lies, and MSIs */
298
296
if (dev -> dev_flags & PCI_DEV_FLAGS_HAS_MSI_MASKING )
299
297
control |= PCI_MSI_FLAGS_MASKBIT ;
300
- if (info -> flags & MSI_FLAG_NO_MASK )
298
+ if (pci_msi_domain_supports ( dev , MSI_FLAG_NO_MASK , DENY_LEGACY ) )
301
299
control &= ~PCI_MSI_FLAGS_MASKBIT ;
302
300
303
301
desc .nvec_used = nvec ;
@@ -604,20 +602,18 @@ static void __iomem *msix_map_region(struct pci_dev *dev,
604
602
*/
605
603
void msix_prepare_msi_desc (struct pci_dev * dev , struct msi_desc * desc )
606
604
{
607
- const struct irq_domain * d = dev_get_msi_domain (& dev -> dev );
608
- const struct msi_domain_info * info = d -> host_data ;
609
-
610
605
desc -> nvec_used = 1 ;
611
606
desc -> pci .msi_attrib .is_msix = 1 ;
612
607
desc -> pci .msi_attrib .is_64 = 1 ;
613
608
desc -> pci .msi_attrib .default_irq = dev -> irq ;
614
609
desc -> pci .mask_base = dev -> msix_base ;
615
- desc -> pci .msi_attrib .can_mask = !(info -> flags & MSI_FLAG_NO_MASK ) &&
616
- !desc -> pci .msi_attrib .is_virtual ;
617
610
618
- if (desc -> pci .msi_attrib .can_mask ) {
611
+
612
+ if (!pci_msi_domain_supports (dev , MSI_FLAG_NO_MASK , DENY_LEGACY ) &&
613
+ !desc -> pci .msi_attrib .is_virtual ) {
619
614
void __iomem * addr = pci_msix_desc_addr (desc );
620
615
616
+ desc -> pci .msi_attrib .can_mask = 1 ;
621
617
desc -> pci .msix_ctrl = readl (addr + PCI_MSIX_ENTRY_VECTOR_CTRL );
622
618
}
623
619
}
@@ -715,8 +711,6 @@ static int msix_setup_interrupts(struct pci_dev *dev, struct msix_entry *entries
715
711
static int msix_capability_init (struct pci_dev * dev , struct msix_entry * entries ,
716
712
int nvec , struct irq_affinity * affd )
717
713
{
718
- const struct irq_domain * d = dev_get_msi_domain (& dev -> dev );
719
- const struct msi_domain_info * info = d -> host_data ;
720
714
int ret , tsize ;
721
715
u16 control ;
722
716
@@ -747,7 +741,7 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
747
741
/* Disable INTX */
748
742
pci_intx_for_msi (dev , 0 );
749
743
750
- if (!( info -> flags & MSI_FLAG_NO_MASK )) {
744
+ if (!pci_msi_domain_supports ( dev , MSI_FLAG_NO_MASK , DENY_LEGACY )) {
751
745
/*
752
746
* Ensure that all table entries are masked to prevent
753
747
* stale entries from firing in a crash kernel.
0 commit comments