Re: How does user specify PCI board instance for configuration?

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

 



On Thu, Jan 11, 2018 at 06:43:54PM +0100, Greg KH wrote:
> On Thu, Jan 11, 2018 at 11:36:51AM -0600, Grant Edwards wrote:
>> On Thu, Jan 11, 2018 at 08:26:52AM +0100, Greg KH wrote:
>>
>>> You can, but how are you "configuring a particular board"?
>> 
>> The thought was that there would be a module parameter that contained
>> sets of "board ID" and config values.  What could be used for the
>> "board ID" is the question.  Through a bit of trial and error, the
>> user can determine which pci_name (e.g. 0000:07:00.0) belongs to which
>> board.  If those names are "stable", then the user could then create a
>> module parameter with the desired configuration value(s) for each
>> pci_name.
> 
> Ick, no, don't use module parameters, they do not scale, users never
> know how to use them, they don't work for devices you add after you
> load the module,

None of the boards in question are hot-pluggable, so that last one
doesn't matter.

> and all sorts of other problems.  This isn't the 1990's anymore :)

What do you recommend as a means for providing configuration
information to a serial driver for a PCI multi-port serial board?

> What exactly are you trying to "configure" that can't be done today with
> the existing tty api?

The big issue is which minor number (and therefore device name) goes
with which DB9 connector.  A general solution that allowed arbitrary
mapping would be ideal (our Windows drivers allow this), but it would
be acceptable to have a simpler solution where the starting minor
number for each board could be configured.

> If your PCI devices change, use a differnet naming scheme, like one
> based on a MAC address.

That's what I do (assign user-defined interface names to cards with
specific MAC addresses), but most distros seem to assume that the PCI
address mapping is stable.

>> If the PCI addressing scheme isn't predictable after reboot, then
>> won't the network device name change and the network configuration get
>> broken?
> 
> Yes it will.  Happens all the time :)

It must be stable enough for common cases, since distros like Ubuntu
seem to depend on it.

> Have you looked at the /dev/serial/ links?  That's about the best we can
> get for "deterministic" names for serial devices, sorry.

The customer I'm dealing with at the moment runs RedHat 7.4 (kernel
3.10.0) and doesn't have /dev/serial.  On other systems it looks like
/dev/serial only gets created for USB serial devices -- it doesn't
seem to get created for PCI serial devices.  Should it exist for PCI
serial ports?  [That may be an oversight in the udev rules provided by
the distros. Regardless of the reason, it doesn't look like I can plan
on using /dev/serial.]

> Not much you can do about broken hardware and crazy BIOSes :)

True, but I get paid to try... :)

-- 
Grant

--
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