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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 12, 2015 at 02:49:29PM -0500, Rob Groner wrote:
> On Thu, 2015-11-12 at 11:36 -0800, Greg KH wrote:
> > On Thu, Nov 12, 2015 at 02:26:12PM -0500, Rob Groner wrote:
> > > On Thu, 2015-11-12 at 09:52 -0800, Greg KH wrote:
> > > > On Thu, Nov 12, 2015 at 03:16:00PM +0000, Rob Groner wrote:
> > > > > 
> > > > > > -----Original Message-----
> > > > > > From: Greg KH [mailto:greg@xxxxxxxxx]
> > > > > > Sent: Thursday, November 12, 2015 9:51 AM
> > > > > > To: Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx>
> > > > > > Cc: Rob Groner <rgroner@xxxxxxx>
> > > > > > Subject: Re: [PATCH] 8250_pci: Prevent Exar/RTD Boards from binding.
> > > > > > 
> > > > > > On Thu, Nov 12, 2015 at 07:24:06PM +0530, Sudip Mukherjee wrote:
> > > > > > > Anyways, I had a glance at the driver today. I think we just need to
> > > > > > > modify the quirks in 8250 code a little bit, and need to see how to
> > > > > > > add your custom ioctl commands. And hopefully, that should be sufficient.
> > > > > > 
> > > > > > Drop the "custom" ioctl commands please, those should not be needed.
> > > > > > 
> > > > > > thanks,
> > > > > > 
> > > > > > greg k-h
> > > > > 
> > > > > We use the following ioctls for configuring the board (RS232/RS422, etc):
> > > > > 
> > > > > #define FIOQSIZE 0x5460
> > > > > #define IOCTL_EXAR_READ_REG (FIOQSIZE + 1)
> > > > > #define IOCTL_EXAR_WRITE_REG (FIOQSIZE + 2)
> > > > 
> > > > What's wrong with the "standard" way of doing this instead?
> > > > 
> > > > > We use the following ioctls to configure the board for non-standard baud rates:
> > > > > 
> > > > > #define 	EXAR_SET_MULTIDROP_MODE_NORMAL   (FIOQSIZE + 3)
> > > > > #define 	EXAR_SET_MULTIDROP_MODE_AUTO     (FIOQSIZE + 4)
> > > > > #define 	EXAR_SET_REMOVE_MULTIDROP_MODE   (FIOQSIZE + 5)
> > > > 
> > > > Again, what's wrong with using the standard way of setting non-standard
> > > > baud rates?  Why does this device need something "special"?
> > > > 
> > > > thanks,
> > > > 
> > > > greg k-h
> > > 
> > > I have no answer for that.
> > > 
> > > So if the IOCTL's change to the "standard" way of doing it, then I'd
> > > just have to change the IOCTL values wherever I use them (libraries,
> > > mainly).  And I'd have to either be able to detect when I'm using Exar's
> > > driver vs. this modified kernel driver, or put out two different
> > > packages for the board based on kernel version number.  That's right?
> > 
> > yes, but then your software works with any serial hardware and isn't
> > tied to one odd serial board :)
> > 
> > thanks,
> > 
> > greg k-h
> 
> Hehe...that would normally be true, but it wouldn't actually make sense
> using it with any other board.  That odd serial board is the only one I
> have to care about.
> 
> The "software package" is basically the driver, a library, and example
> programs so the user can reconfigure the board.  The reconfiguring
> method is specific to our board, so not much portability there.  Perhaps
> the non-standard baud rate example would be more portable, however.

Adding linux-serial@xxxxxxxxxxxxxxx as CC to this thread of discussion.

Looks like they are using these custom ioctl to read and write to the
hardware registers to reconfigure the board and also to use the GPIO as
mentioned by Rob in his mail. So if we just include the hardware in the
standard way then these functionalities will not be available. And
besides, i think the hardware is already working in the standard way
using upstream driver. They want the extra functionalities for some
users who will have the need to reconfigure the board.

So basically their requirement is to either include these extra
functionalities (extra custom ioctl) or remove the hardware id from
8250_pci so the upstream driver doesnot bind with their hardware.
Rob - please correct me if i am wrong in understanding your reqiurement.

And Rob, your initial patch (not binding to these devices) will force
all users to use the out of tree driver. Your device was added to 8250
by Soeren Grunewald and I guess he wants to use an upsteam driver for
his device.

And your driver does not say anything about how you are reconfiguing the
board to RS485. There is another pci card Fintek who are also doing a
reconfiguration. Maybe you can have a look at pci_fintek_rs485_config()
in 8250_pci.c file. If you can post the code to reconfigure the board,
then i think these custom ioctl to reconfigure the board will not be
needed.

Greg - waiting for your opinion on how to do this.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux