linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Can I manage/modify console baud rates from userspace?
@ 2010-05-02  0:02 Paul Smith
  2010-05-02  9:58 ` Marco Stornelli
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Smith @ 2010-05-02  0:02 UTC (permalink / raw)
  To: linux-embedded

Hi all.  I need some advice on an issue that just cropped up.  We have a
Linux embedded image (current kernel is 2.6.31-based) that we are
booting up on blade systems using PXE to obtain the kernel image, the
kernel boot line parameters, and an initrd from a server.

On these systems we REALLY need to be able to watch the console, even
after deployment into the field (e.g., not just during
development/internally).

We currently run this image on various hardware platforms, one of which
uses serial-over-LAN, where the console is connected to a dedicated vlan
from the blade to the chassis management module, which you can ssh into
and from there connect to the console on any blade in the chassis.  The
vlan configuration on these blades doesn't support any baud rate over
19200, so in order to get this working we use the PXE configuration file
to add "console=ttyS1,19200" to the kernel boot line.  Works great!

Here's the problem.  The vendor has released a new version of the blade
hardware for this platform, and while the old hardware didn't support
any baud rate above 19200 for serial-over-LAN, the new hardware doesn't
support any baud rate at 19200 or below, so there's no single baud rate
that will work for both types of blades.

These blades are interchangeable in the chassis and since the current
ones are end-of-life we have to start to support the new blade, and we
have to support combinations of new and old blades in the same chassis
(due to replacements).

So I _have_ to find a way to get the console working in this
configuration.  Even if I lose the early boot messages but then managed
to configure the console properly from userspace after the kernel
booted, that would be less than ideal but at least it would be progress.
Is there some way to do this?  Is there some way in the kernel to handle
this kind of situation?

I've looked at setserial and it supports a baud_base parameter but that
doesn't appear to be what I want (I tried it anyway: changing it didn't
work, my console output was still screwed up).

Trying to do something like creating customized PXE configs on the
server based on the MAC addresses of the blades that are "new" (or old)
would be an absolute nightmare as people swap blades between chassis,
add new ones, etc. all the time.


Please help me find a better way... :-(

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I manage/modify console baud rates from userspace?
  2010-05-02  0:02 Can I manage/modify console baud rates from userspace? Paul Smith
@ 2010-05-02  9:58 ` Marco Stornelli
  2010-05-02 16:14   ` Paul Smith
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Stornelli @ 2010-05-02  9:58 UTC (permalink / raw)
  To: paul; +Cc: linux-embedded

02/05/2010 02:02, Paul Smith wrote:
> I've looked at setserial and it supports a baud_base parameter but that
> doesn't appear to be what I want (I tried it anyway: changing it didn't
> work, my console output was still screwed up).
> 
> Trying to do something like creating customized PXE configs on the
> server based on the MAC addresses of the blades that are "new" (or old)
> would be an absolute nightmare as people swap blades between chassis,
> add new ones, etc. all the time.
> 
> 
> Please help me find a better way... :-(
> 

It's strange that it's not possible to change the baud rate, but I'm not
an expert of tty layer. A naive implementation could be patch the kernel
to choose a well-known baud rate for your hw reading a revision register
or something like that.

Marco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I manage/modify console baud rates from userspace?
  2010-05-02  9:58 ` Marco Stornelli
@ 2010-05-02 16:14   ` Paul Smith
  2010-05-02 20:25     ` Sam Ravnborg
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Smith @ 2010-05-02 16:14 UTC (permalink / raw)
  To: linux-embedded

On Sun, 2010-05-02 at 11:58 +0200, Marco Stornelli wrote:
> 02/05/2010 02:02, Paul Smith wrote:
> > I've looked at setserial and it supports a baud_base parameter but that
> > doesn't appear to be what I want (I tried it anyway: changing it didn't
> > work, my console output was still screwed up).
> > 
> > Trying to do something like creating customized PXE configs on the
> > server based on the MAC addresses of the blades that are "new" (or old)
> > would be an absolute nightmare as people swap blades between chassis,
> > add new ones, etc. all the time.
> > 
> > 
> > Please help me find a better way... :-(
> > 
> 
> It's strange that it's not possible to change the baud rate, but I'm not
> an expert of tty layer. A naive implementation could be patch the kernel
> to choose a well-known baud rate for your hw reading a revision register
> or something like that.

I guess; I'd hate to have to modify the kernel like that though.  Plus,
as far as I'm aware at the moment the only way to tell these blades
apart is through querying IPMI which would be a serious bummer to try to
do via the kernel, I believe.  Maybe there's some other way to do it
that's simpler.

Still hoping someone will say "all you have to do is XYZZY..."  Anyone?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I manage/modify console baud rates from userspace?
  2010-05-02 16:14   ` Paul Smith
@ 2010-05-02 20:25     ` Sam Ravnborg
  2010-05-03 17:28       ` Paul Smith
  0 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2010-05-02 20:25 UTC (permalink / raw)
  To: Paul Smith, Alan Cox; +Cc: linux-embedded

On Sun, May 02, 2010 at 12:14:55PM -0400, Paul Smith wrote:
> On Sun, 2010-05-02 at 11:58 +0200, Marco Stornelli wrote:
> > 02/05/2010 02:02, Paul Smith wrote:
> > > I've looked at setserial and it supports a baud_base parameter but that
> > > doesn't appear to be what I want (I tried it anyway: changing it didn't
> > > work, my console output was still screwed up).
> > > 
> > > Trying to do something like creating customized PXE configs on the
> > > server based on the MAC addresses of the blades that are "new" (or old)
> > > would be an absolute nightmare as people swap blades between chassis,
> > > add new ones, etc. all the time.
> > > 
> > > 
> > > Please help me find a better way... :-(
> > > 
> > 
> > It's strange that it's not possible to change the baud rate, but I'm not
> > an expert of tty layer. A naive implementation could be patch the kernel
> > to choose a well-known baud rate for your hw reading a revision register
> > or something like that.
> 
> I guess; I'd hate to have to modify the kernel like that though.  Plus,
> as far as I'm aware at the moment the only way to tell these blades
> apart is through querying IPMI which would be a serious bummer to try to
> do via the kernel, I believe.  Maybe there's some other way to do it
> that's simpler.
> 
> Still hoping someone will say "all you have to do is XYZZY..."  Anyone?
I would suggest asking Alan Cox - he if anyone would know.
I lost the original mail and context above is missing some details.
Anyway added to this mail.

	Sam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I manage/modify console baud rates from userspace?
  2010-05-02 20:25     ` Sam Ravnborg
@ 2010-05-03 17:28       ` Paul Smith
  2010-05-03 19:17         ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Smith @ 2010-05-03 17:28 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Alan Cox, linux-embedded

On Sun, 2010-05-02 at 22:25 +0200, Sam Ravnborg wrote:
> I would suggest asking Alan Cox - he if anyone would know.
> I lost the original mail and context above is missing some details.
> Anyway added to this mail.

Thanks Sam.  Alan, hope you don't mind a direct email.  I'll cut down
the original request to just (I hope) the important details.

I have an environment in which a number of (Intel-based) blades in one
or more blade chassis boot from a host using PXE to download a Linux
kernel (2.6.31-based ATM) and a ramdisk root partition.  These blades
provide access to the console via serial-over-LAN, where the chassis
provides a special vlan connection to the blades' ttyS1 port.  You can
then connect to the chassis management module via SSH, and from there
connect to the console of any of the blades.

We require this capability in our deployed systems, not just during
development, so I need to make sure this is working at all times and
that it's easy to configure and maintain in the field.

Today, all the blades we ship use a maximum baud rate of 19200 so in my
PXE config, I have "console=ttyS1,19200" added to the kernel boot line.
Works great.

The vendor is providing a newer version of these blades and the current
version is end-of-lifed.  The new blades are drop-in replaceable,
individually, with the current blades, which is nice.  Unfortunately
these new blades do not support any overlapping baud rate with the old
blades, so there's no single value I can provide in the PXE
configuration on my host that will work with all blades in a
heterogeneous blade deployment.


So I'm stuck here and don't have a good idea how to move forward.  I
tried using setserial to modify the baud rate (it supports a parameter
baud_base which didn't seem like it would do what I wanted--and it
didn't) but no joy.

Trying to customize the PXE config would be virtually impossible: we'd
have to map all the MAC addresses and figure out which ones were for
newer blades, and maintain that mapping as blades were swapped in and
out and even moved between chassis or between slots in the same chassis.
A nightmare!

Is there some other way to modify the baud rate of the console device
from userspace once I figure out the right one?  It would definitely be
less than ideal since we'd lose all the boot output, except what we can
get from dmesg _if_ the system boots, but it would be something.

Any other thoughts or ideas?


Thanks for reading!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I manage/modify console baud rates from userspace?
  2010-05-03 17:28       ` Paul Smith
@ 2010-05-03 19:17         ` Alan Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2010-05-03 19:17 UTC (permalink / raw)
  To: paul; +Cc: Sam Ravnborg, linux-embedded

> Is there some other way to modify the baud rate of the console device
> from userspace once I figure out the right one?  It would definitely be
> less than ideal since we'd lose all the boot output, except what we can
> get from dmesg _if_ the system boots, but it would be something.

stty 57600 < /dev/ttyS1

etc. The console baud rate and settings should behave exactly as any
other serial port if set from user space.

> Any other thoughts or ideas?

If you don't mind doing some small private kernel tweaks then I guess you
could set the default console baud rate based on the dmi strings which
would hopefully differ between the blade types.

Alan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-03 19:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-02  0:02 Can I manage/modify console baud rates from userspace? Paul Smith
2010-05-02  9:58 ` Marco Stornelli
2010-05-02 16:14   ` Paul Smith
2010-05-02 20:25     ` Sam Ravnborg
2010-05-03 17:28       ` Paul Smith
2010-05-03 19:17         ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).