bugGNU GRUB - Bugs: bug #31173, GRUB loses characters on HP...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #31173: GRUB loses characters on HP Integrated Lights Out 2 (iLO2) Virtual Serial Port session

Submitter:  Oscar Perez <iloguy>
Submitted:  Thu 30 Sep 2010 03:16:24 PM UTC
   
 
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  iLO Guy
Open/Closed:  Closed Release:  1.97
Release:  Reproducibility:  Every Time
Planned Release:  None

Sat 16 Oct 2010 07:02:39 PM UTC, comment #4: 

I applied the patch. If problem persists please reopen the bug.

Vladimir Serbinenko <phcoder>
Group administrator
Wed 06 Oct 2010 12:48:29 PM UTC, comment #3: 

It's ok for 200 ms waiting. As for restting to zero, it's quite difficult to predict how exactly the UART is broken. If it's able to transmit more than 50% of characters, broken count will come back to zero. If it's not then it's probably broken. Could you test my patch with 200 instead of 100 ms?

Vladimir Serbinenko <phcoder>
Group administrator
Fri 01 Oct 2010 05:14:58 PM UTC, comment #2: 

I looked at the patch. I like the solution a lot but, may I request a more generous initial timeout?
I just want to be sure, GRUB won't begin dropping characters, if iLO2 has to host the UART_EMPTY_TRANSMITTER bit longer than the initial 100ms.

Also, how about going back to zero when the UART is not detected broken?

Thanks.

-----------
static void
serial_hw_put (struct grub_serial_port *port, const int c)
{
   grub_uint64_t endtime;

   do_real_config (port);
 
   if (port->broken > 5)
      endtime = grub_get_time_ms ();
   else if (port->broken > 1)
      endtime = grub_get_time_ms () + 50;
   else
      endtime = grub_get_time_ms () + 200;
   /* Wait until the transmitter holding register is empty.  */
   while ((grub_inb (port->port + UART_LSR) & UART_EMPTY_TRANSMITTER) == 0)
   {
      if (grub_get_time_ms () > endtime)
      {
  port->broken++;
  /* There is something wrong. But what can I do?  */
  return;
      }
   }
 
   if (port->broken)
      port->broken = 0;

   grub_outb (c, port->port + UART_TX);
}

Oscar Perez <iloguy>
Fri 01 Oct 2010 07:13:13 AM UTC, comment #1: 

Trouble with bigger timeouts is that broken UART can stall GRUB and essentially give an impression of hanged bootloader. But it's possible to use a generous timeout by default and decrease it on errors. Please test the attached patch

(file #21589)

Vladimir Serbinenko <phcoder>
Group administrator
Thu 30 Sep 2010 03:16:24 PM UTC, original submission:  

Hello,

I'm new here so please bear with me. I work for HP third level support and I came here to file a new bug.

Description:
Our HP Integrated Lights Out 2 (iLO2) product contains a virtual UART that present itself to the host server as a regular COM port. iLO2 firmware has special code that allows customers to open Telnet or SSH session to iLO2 then, iLO2 would forward all the traffic back and forth to the server via this virtual serial port.

The issue we have with any Grub version is related to fact that the timeout value inside the serial_hw_put() function is way too short for iLO2.

I explain why; Since iLO2 UART is virtual, baudrate for us is meaningless. As soon as Grub writes one byte to the iLO2 Virtual UART TX register, iLO2 gets the interrupt, iLO2 ISR reads the byte and stores it in a buffer. The UART_EMPTY_TRANSMITTER bit gets automatically set whenever the ISR reads the character from the UART. But this causes Grub to come back and write the next byte very quickly. The process repeats and iLO2 incoming buffer gets full very fast.
Once iLO2 buffer gets full, iLO2 will hold the UART_EMPTY_TRANSMITTER bit low waiting for the buffer to be processed and all the data gets sent via the network to the Telnet/SSH client.
But, if the network connection is slow or the data we have to send is too much then, iLO2 holds the UART_EMPTY_TRANSMITTER bit low for too long, Grub times out and Grub begins dropping characters.

We have increased our buffer size as a workaround but, I think Grub needs to increase the timeout inside serial_hw_put() a whole lot.

How to reproduce:
- Get an HP ProLiant server with iLO2 (Any G5 or G6 server)
- Upgrade iLO2 firmware to version 2.01
- Set up Grub to use the Virtual Serial Port (Default is COM2 but, this can be changed in ROM BIOS)
- Add at least 10 menu entries in GRUB in order to make it scroll when navigating. This makes GRUB write lots of data to the port.
- SSH into iLO2, log in then type VSP
- Reboot server and wait for GRUB to show up.
- You should see characters being lost while navigating through the menu.



Oscar Perez <iloguy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #21589:  serialdelay.diff added by phcoder (2KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Updated the item)
  • -email is unavailable- added by iloguy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-10-16 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2010-10-01 phcoder Attached File- Added serialdelay.diff, #21589

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code