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(-)
--
2.13.6
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.
Signed-off-by: Johannes Thumshirn <[email protected]>
Reported-by: Ben Turner <[email protected]>
Tested-by: Ben Turner <[email protected]>
Cc: Andreas Geißler <[email protected]>
Cc: Michael Moese <[email protected]>
---
drivers/mcb/mcb-pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c
index af4d2f26f1c6..286b32ca526f 100644
--- a/drivers/mcb/mcb-pci.c
+++ b/drivers/mcb/mcb-pci.c
@@ -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);
--
2.13.6
Add the Altera PCI Vendor id to pci_ids.h and remove the private
definitions from xillybus_pcie.c and altera-cvp.c.
Signed-off-by: Johannes Thumshirn <[email protected]>
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(-)
diff --git a/drivers/char/xillybus/xillybus_pcie.c b/drivers/char/xillybus/xillybus_pcie.c
index dff2d1538164..b888f7c44a09 100644
--- a/drivers/char/xillybus/xillybus_pcie.c
+++ b/drivers/char/xillybus/xillybus_pcie.c
@@ -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
diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
index 00e73d28077c..53ee426d425f 100644
--- a/drivers/fpga/altera-cvp.c
+++ b/drivers/fpga/altera-cvp.c
@@ -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) },
{ }
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index a6b30667a331..6a96a70fb462 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -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
--
2.13.6
Looks good.
Reviewed-by: Michael Moese <[email protected]>
On Tue, Feb 27, 2018 at 02:30:18PM +0100, Johannes Thumshirn wrote:
> 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.
>
> Signed-off-by: Johannes Thumshirn <[email protected]>
> Reported-by: Ben Turner <[email protected]>
> Tested-by: Ben Turner <[email protected]>
> Cc: Andreas Gei?ler <[email protected]>
> Cc: Michael Moese <[email protected]>
> ---
> drivers/mcb/mcb-pci.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c
> index af4d2f26f1c6..286b32ca526f 100644
> --- a/drivers/mcb/mcb-pci.c
> +++ b/drivers/mcb/mcb-pci.c
> @@ -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);
> --
> 2.13.6
>
--
SUSE Linux GmbH, GF: Felix Imend?rffer, Jane Smithard, Graham Norton, HRB 21284 (AG N?rnberg)
On Tue, Feb 27, 2018 at 3:30 PM, Johannes Thumshirn <[email protected]> wrote:
> 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>
Isn't pci.h includes pci_ids.h ?
--
With Best Regards,
Andy Shevchenko
On Tue, Feb 27, 2018 at 3:37 PM, Michael Moese <[email protected]> wrote:
> Looks good.
Do we need redundant header inclusions?
> Reviewed-by: Michael Moese <[email protected]>
> On Tue, Feb 27, 2018 at 02:30:18PM +0100, Johannes Thumshirn wrote:
>> 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.
--
With Best Regards,
Andy Shevchenko
On Tue, 2018-02-27 at 17:32 +0200, Andy Shevchenko wrote:
> On Tue, Feb 27, 2018 at 3:30 PM, Johannes Thumshirn <[email protected]>
> wrote:
> >
> > 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>
>
> 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
--
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
On Tue, Feb 27, 2018 at 04:42:07PM +0100, Johannes Thumshirn wrote:
> On Tue, 2018-02-27 at 17:32 +0200, Andy Shevchenko wrote:
> > On Tue, Feb 27, 2018 at 3:30 PM, Johannes Thumshirn <[email protected]>
> > wrote:
> > >
> > > 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>
> >
> > 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.
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
On 27/02/18 17:42, Johannes Thumshirn wrote:
> On Tue, 2018-02-27 at 17:32 +0200, Andy Shevchenko wrote:
>
>> On Tue, Feb 27, 2018 at 3:30 PM, Johannes Thumshirn<[email protected]>
>> wrote:
>>
>>> 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>
>>>
>> 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
>
>