[PATCH] 8250_pci: Prevent Exar/RTD Boards from binding.

Rob Groner rgroner at RTD.com
Fri Sep 25 13:30:14 EDT 2015


> -----Original Message-----
> From: Greg KH [mailto:greg at kroah.com]
> Sent: Friday, September 25, 2015 1:19 PM
> To: Rob Groner <rgroner at RTD.com>
> Cc: kernelnewbies at kernelnewbies.org
> Subject: Re: [PATCH] 8250_pci: Prevent Exar/RTD Boards from binding.
> 
> On Fri, Sep 25, 2015 at 11:46:29AM -0400, Rob Groner wrote:
> > Serial boards made by RTD using the Exar XR17V358 chip rely on the
> > extra capabilities of the Exar-provided driver to allow configuration
> > of the board.  When support for the Exar chip was added to the kernel
> > 8250_pci driver, this then prevented easy use of the board by
> > customers for anything other than standard serial usage in RS232 mode.
> >
> > This patch prevents RTD sub-vendor boards from being bound by the
> > 8250_pci driver, if it uses the XR17V358 chip.  Other RTD boards using
> > Exar chips are not affected.
> >
> > Signed-off-by Rob Groner <rgroner at rtd.com>
> > ---
> >  drivers/tty/serial/8250/8250_pci.c | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/drivers/tty/serial/8250/8250_pci.c
> > b/drivers/tty/serial/8250/8250_pci.c
> > index 68042dd..89baf7f 100644
> > --- a/drivers/tty/serial/8250/8250_pci.c
> > +++ b/drivers/tty/serial/8250/8250_pci.c
> > @@ -359,6 +359,16 @@ static void pci_ni8430_exit(struct pci_dev *dev)
> >  	iounmap(p);
> >  }
> >
> > +/*
> > + * RTD Embedded Technologies, Inc. boards
> > + * Prevent from being bound to 8250 driver  */ static int
> > +pci_xr17v35x_rtd_probe(struct pci_dev *dev) {
> > +	return -ENODEV;
> > +}
> > +
> >  /* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */  static int
> > sbs_setup(struct serial_private *priv, const struct pciserial_board
> > *board, @@ -2105,6 +2115,8 @@ pci_wch_ch38x_setup(struct
> serial_private *priv,
> >  #define PCI_DEVICE_ID_PERICOM_PI7C9X7954	0x7954
> >  #define PCI_DEVICE_ID_PERICOM_PI7C9X7958	0x7958
> >
> > +#define PCI_SUBVENDOR_ID_RTD		0x1435
> > +
> >  /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
> >  #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584	0x1584
> >  #define PCI_SUBDEVICE_ID_UNKNOWN_0x1588	0x1588
> > @@ -2608,6 +2620,14 @@ static struct pci_serial_quirk pci_serial_quirks[]
> __refdata = {
> >  	{
> >  		.vendor = PCI_VENDOR_ID_EXAR,
> >  		.device = PCI_DEVICE_ID_EXAR_XR17V358,
> > +		.subvendor = PCI_SUBVENDOR_ID_RTD,
> > +		.subdevice	= PCI_ANY_ID,
> > +		.probe		= pci_xr17v35x_rtd_probe,
> > +		.setup		= pci_xr17v35x_setup,
> 
> Why do you need the .setup callback if you are just not wanting to bind to
> this driver?
> 

You're right, that doesn't need to be set.

Rob Groner




More information about the Kernelnewbies mailing list