Skip to contentSkip to conversation

MCB Update for v4.17

PATCH Superseded Johannes Thumshirn 5 participants 9 messages Feb 27, 2018

Subsystems (5)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover MCB Update for v4.17

Hi Greg,

here's a small mcb update for the 4.17 window. The first patch makes the PCI Vendor ID of Altera generally available in pci_ids.h and removes it from the two private implementations before I would have to add a 3rd one.

The 2nd patch adds the Altera's PCI vendor ID to the mcb pci driver which enables at least one carrier board. This was reported and tested by Ben Turner.

Johannes Thumshirn (2):
PCI: add vendor id for Altera
mcb: add Altera PCI ID to mcb-pci

 drivers/char/xillybus/xillybus_pcie.c | 2 +-
 drivers/fpga/altera-cvp.c             | 3 +--
 drivers/mcb/mcb-pci.c                 | 2 ++
 include/linux/pci_ids.h               | 2 ++
 4 files changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/2 PCI: add vendor id for Altera

Add the Altera PCI Vendor id to pci_ids.h and remove the private definitions from xillybus_pcie.c and altera-cvp.c.

Cc Bjorn Helgaas <[email protected]>
Cc Eli Billauer <[email protected]>
Cc Anatolij Gustschin <[email protected]>
---
 drivers/char/xillybus/xillybus_pcie.c | 2 +-
 drivers/fpga/altera-cvp.c             | 3 +--
 include/linux/pci_ids.h               | 2 ++
 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/char/xillybus/xillybus_pcie.c +1 -1
index dff2d1538164..b888f7c44a09 100644
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/pci-aspm.h>
+#include <linux/pci_ids.h>
 #include <linux/slab.h>
 #include "xillybus.h"
 
@@ -24,7 +25,6 @@ MODULE_LICENSE("GPL v2");
 
 #define PCI_DEVICE_ID_XILLYBUS		0xebeb
 
-#define PCI_VENDOR_ID_ALTERA		0x1172
 #define PCI_VENDOR_ID_ACTEL		0x11aa
 #define PCI_VENDOR_ID_LATTICE		0x1204
 
drivers/fpga/altera-cvp.c +1 -2
index 00e73d28077c..53ee426d425f 100644
@@ -23,6 +23,7 @@
 #include <linux/fpga/fpga-mgr.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/pci_ids.h>
 #include <linux/sizes.h>
 
 #define CVP_BAR		0	/* BAR used for data transfer in memory mode */
@@ -384,8 +385,6 @@ static int altera_cvp_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *dev_id);
 static void altera_cvp_remove(struct pci_dev *pdev);
 
-#define PCI_VENDOR_ID_ALTERA	0x1172
-
 static struct pci_device_id altera_cvp_id_tbl[] = {
 	{ PCI_VDEVICE(ALTERA, PCI_ANY_ID) },
 	{ }
include/linux/pci_ids.h +2 -0
index a6b30667a331..6a96a70fb462 100644
@@ -1561,6 +1561,8 @@
 #define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
 #define PCI_DEVICE_ID_SERVERWORKS_HT1100LD 0x0408
 
+#define PCI_VENDOR_ID_ALTERA		0x1172
+
 #define PCI_VENDOR_ID_SBE		0x1176
 #define PCI_DEVICE_ID_SBE_WANXL100	0x0301
 #define PCI_DEVICE_ID_SBE_WANXL200	0x0302
Signature · 1 line
2.13.6
#2 lore raw

Re: [PATCH 1/2] PCI: add vendor id for Altera

drivers/char/xillybus/xillybus_pcie.c

Quoted 8 lines · Johannes Thumshirn

Add the Altera PCI Vendor id to pci_ids.h and remove the private definitions from xillybus_pcie.c and altera-cvp.c.

#include <linux/pci.h>

drivers/char/xillybus/xillybus_pcie.c +2 -0
+#include <linux/pci_ids.h>
 
 #include <linux/pci.h>
+#include <linux/pci_ids.h>

Isn't pci.h includes pci_ids.h ?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw

Re: [PATCH 1/2] PCI: add vendor id for Altera

Quoted 7 lines · Andy Shevchenko
Quoted 5 lines · Johannes Thumshirn

Add the Altera PCI Vendor id to pci_ids.h and remove the private definitions from xillybus_pcie.c and altera-cvp.c.

Quoted 8 lines
Quoted 6 lines

 #include <linux/pci.h>
+#include <linux/pci_ids.h>

 #include <linux/pci.h>
+#include <linux/pci_ids.h>

Isn't pci.h includes pci_ids.h ?

It indeed is, but it won't do any harm and it's not quite clear what the general policy (regarding pci_ids.h) is, some drivers include it (even in the drivers/pci/) some don't.

Bjorn, any guidance from your side?

Byte,
Johannes

Signature · 10 lines
Johannes Thumshirn                                          Storage
jthumshi
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH,
Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham
Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600
D0D0 0393 969D 2D76 0850
#4 lore raw

Re: [PATCH 1/2] PCI: add vendor id for Altera

Quoted 15 lines · Johannes Thumshirn
Quoted 14 lines · Andy Shevchenko
Quoted 11 lines · Johannes Thumshirn

Add the Altera PCI Vendor id to pci_ids.h and remove the private definitions from xillybus_pcie.c and altera-cvp.c.

 #include <linux/pci.h>
+#include <linux/pci_ids.h>

 #include <linux/pci.h>
+#include <linux/pci_ids.h>

Quoted 7 lines
Quoted 1 line

Isn't pci.h includes pci_ids.h ?

It indeed is, but it won't do any harm and it's not quite clear what the general policy (regarding pci_ids.h) is, some drivers include it (even in the drivers/pci/) some don't.

Bjorn, any guidance from your side?

I don't think it's necessary to add the include.

Please cc: [email protected] in addition, since that feeds the patchwork I work from.

maintainer
#5 lore raw

Re: [PATCH 1/2] PCI: add vendor id for Altera

In reply to Johannes Thumshirn

Hello Johannes,

Thanks for the patch.

I can confirm that xillybus_pcie.c compiles well with and without including pci_ids.h. As a matter of fact, it already used PCI_VENDOR_ID_XILINX, which is defined in pci_ids.h, without including it directly. Hence moving PCI_VENDOR_ID_ALTERA didn't change much in terms of the dependency on pci_ids.h.

This is a matter of convention -- I'm fine either way.

Regards,
Eli

Quoted 28 lines · Johannes Thumshirn
Quoted 7 lines · Andy Shevchenko
Quoted 3 lines · Johannes Thumshirn

Add the Altera PCI Vendor id to pci_ids.h and remove the private definitions from xillybus_pcie.c and altera-cvp.c.

Quoted 9 lines

Review

Quoted 7 lines
  #include<linux/pci.h>
(quoted diff) +2 -0
+#include<linux/pci_ids.h>
 
 
  #include<linux/pci.h>
+#include<linux/pci_ids.h>

Isn't pci.h includes pci_ids.h ?

It indeed is, but it won't do any harm and it's not quite clear what the general policy (regarding pci_ids.h) is, some drivers include it (even in the drivers/pci/) some don't.

Bjorn, any guidance from your side?

Byte,
Johannes

#6 lore raw

PATCH 2/2 mcb: add Altera PCI ID to mcb-pci

In reply to Johannes Thumshirn

Some older PCI attached MEN FPGAs use an Altera PCI Vendor ID instead of the MEN one. Add it to the PCI ID table so the driver automatically attaches to it.

---
 drivers/mcb/mcb-pci.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mcb/mcb-pci.c +2 -0
index af4d2f26f1c6..286b32ca526f 100644
@@ -11,6 +11,7 @@
 
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/pci_ids.h>
 #include <linux/mcb.h>
 
 #include "mcb-internal.h"
@@ -117,6 +118,7 @@ static void mcb_pci_remove(struct pci_dev *pdev)
 
 static const struct pci_device_id mcb_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_MEN, PCI_DEVICE_ID_MEN_CHAMELEON) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ALTERA, PCI_DEVICE_ID_MEN_CHAMELEON) },
 	{ 0 },
 };
 MODULE_DEVICE_TABLE(pci, mcb_pci_tbl);
Signature · 1 line
2.13.6
Reviewed-by on v1 2/2
#7 lore raw

Re: [PATCH 2/2] mcb: add Altera PCI ID to mcb-pci

Looks good.

Quoted 36 lines · Johannes Thumshirn

Some older PCI attached MEN FPGAs use an Altera PCI Vendor ID instead of the MEN one. Add it to the PCI ID table so the driver automatically attaches to it.

---
 drivers/mcb/mcb-pci.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mcb/mcb-pci.c +2 -0
index af4d2f26f1c6..286b32ca526f 100644
@@ -11,6 +11,7 @@
 
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/pci_ids.h>
 #include <linux/mcb.h>
 
 #include "mcb-internal.h"
@@ -117,6 +118,7 @@ static void mcb_pci_remove(struct pci_dev *pdev)
 
 static const struct pci_device_id mcb_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_MEN, PCI_DEVICE_ID_MEN_CHAMELEON) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ALTERA, PCI_DEVICE_ID_MEN_CHAMELEON) },
 	{ 0 },
 };
 MODULE_DEVICE_TABLE(pci, mcb_pci_tbl);
Signature · 1 line
2.13.6
Signature · 1 line
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
#8 lore raw

Re: [PATCH 2/2] mcb: add Altera PCI ID to mcb-pci

Quoted 1 line · Michael Moese

Looks good.

Do we need redundant header inclusions?

Quoted 9 lines
Quoted 6 lines · Johannes Thumshirn

Some older PCI attached MEN FPGAs use an Altera PCI Vendor ID instead of the MEN one. Add it to the PCI ID table so the driver automatically attaches to it.

#include <linux/pci.h>
+#include <linux/pci_ids.h>

Same question.

Signature · 2 lines
With Best Regards,
Andy Shevchenko