linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/MSI: Set device flag indicating only 32-bit MSI support
@ 2020-11-17 14:57 Vidya Sagar
  2020-11-20 21:30 ` Bjorn Helgaas
  2020-11-24 10:50 ` [PATCH V2] " Vidya Sagar
  0 siblings, 2 replies; 9+ messages in thread
From: Vidya Sagar @ 2020-11-17 14:57 UTC (permalink / raw)
  To: bhelgaas, lorenzo.pieralisi, thierry.reding, jonathanh
  Cc: linux-pci, linux-kernel, kthota, mmaddireddy, vidyas, sagar.tv

There are devices (Ex:- Marvell SATA controller) that don't support
64-bit MSIs and the same is advertised through their MSI capability
register. Set no_64bit_msi flag explicitly for such devices in the
MSI setup code so that the msi_verify_entries() API would catch
if the MSI arch code tries to use 64-bit MSI.

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
---
 drivers/pci/msi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d52d118979a6..af49da28854e 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -581,10 +581,12 @@ msi_setup_entry(struct pci_dev *dev, int nvec, struct irq_affinity *affd)
 	entry->msi_attrib.multi_cap	= (control & PCI_MSI_FLAGS_QMASK) >> 1;
 	entry->msi_attrib.multiple	= ilog2(__roundup_pow_of_two(nvec));
 
-	if (control & PCI_MSI_FLAGS_64BIT)
+	if (control & PCI_MSI_FLAGS_64BIT) {
 		entry->mask_pos = dev->msi_cap + PCI_MSI_MASK_64;
-	else
+	} else {
 		entry->mask_pos = dev->msi_cap + PCI_MSI_MASK_32;
+		dev->no_64bit_msi = 1;
+	}
 
 	/* Save the initial mask status */
 	if (entry->msi_attrib.maskbit)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-12-04  2:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 14:57 [PATCH] PCI/MSI: Set device flag indicating only 32-bit MSI support Vidya Sagar
2020-11-20 21:30 ` Bjorn Helgaas
2020-11-24  3:57   ` Vidya Sagar
2020-11-24 10:50 ` [PATCH V2] " Vidya Sagar
2020-12-03  5:00   ` Vidya Sagar
2020-12-03 18:24   ` Bjorn Helgaas
2020-12-03 19:03     ` Vidya Sagar
2020-12-03 19:54       ` Bjorn Helgaas
2020-12-04  2:28         ` Vidya Sagar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).