All of lore.kernel.org
 help / color / mirror / Atom feed
* gcc 3.4 / bad_unaligned_access_length
@ 2004-10-06 14:51 Gregory Nutt
  2004-10-06 14:59 ` Au1100 Serial Driver Gregory Nutt
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Nutt @ 2004-10-06 14:51 UTC (permalink / raw)
  To: linux-mips

Hi, List,

I have been struggling to bring up 2.6.8-rc2 on an Au1100 processor.  I
am using gcc 3.4.1 which seems to the be source of most of the issues
that I have been having.

Here is the last issue:

- At boot time, I was encountering a fault in slab.c -- ac_data
  was returning a NULL pointer.  But when I put in lots of printk's
  the problem disappeared.  Hmmm.. sound like an optimization
  issue.  Has anyone else seen this?

- So I tried lowering the optimization to -O1 by editting the top-
  level Makefile.  Now, to my surprise, I can no longer link the
  kernel.  I get:

  "fs/built-in.o(.text+0x3a0c4): In function `parse_extended':
  : undefined reference to `bad_unaligned_access_length'"

  This repeats several times.

I grep'ped through the kernel.  I see that bad_unaligned_access_length()
is externed in include/asm-mips/unaligned.h.  It is also used in the
default: case of several inline functions in that same file.  It is not
referenced or defined anywhere else in the kernel.

My hunch is that at -O2 the calls to bad_unaligned_access_length() were
optimized away and all is well.  But at -O1 they are not.

Greg Nutt
-- 
Gregory Nutt <greg.nutt@cadenux.com>
Cadenux, LLC

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

* Au1100 Serial Driver
  2004-10-06 14:51 gcc 3.4 / bad_unaligned_access_length Gregory Nutt
@ 2004-10-06 14:59 ` Gregory Nutt
  2004-10-10  2:38   ` Pete Popov
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Nutt @ 2004-10-06 14:59 UTC (permalink / raw)
  To: linux-mips

I think I see an error in the serial driver for the Au1100.  In the
function serial8250_isa_init_ports() there is the line:

  up->port.uartclk  = get_au1x00_uart_baud_base();

Shouldn't this be:

  up->port.uartclk  = get_au1x00_uart_baud_base() * 16;

Isn't the UART clock (normally) 16x the baud_base for this (and most)
UARTs?

Also... beware of:

  baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); 
  quot = serial8250_get_divisor(port, baud);
  quot = 0x35; /* FIXME */

For me, 0x35 is not correct.  For me, the above 16x fix eliminates
the need for this kind of FIXME.

Greg
-- 
Gregory Nutt <greg.nutt@cadenux.com>
Cadenux, LLC

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

* Re: Au1100 Serial Driver
  2004-10-06 14:59 ` Au1100 Serial Driver Gregory Nutt
@ 2004-10-10  2:38   ` Pete Popov
  0 siblings, 0 replies; 3+ messages in thread
From: Pete Popov @ 2004-10-10  2:38 UTC (permalink / raw)
  To: greg.nutt; +Cc: linux-mips

Gregory Nutt wrote:

>I think I see an error in the serial driver for the Au1100.  In the
>function serial8250_isa_init_ports() there is the line:
>
>  up->port.uartclk  = get_au1x00_uart_baud_base();
>
>Shouldn't this be:
>
>  up->port.uartclk  = get_au1x00_uart_baud_base() * 16;
>
>Isn't the UART clock (normally) 16x the baud_base for this (and most)
>UARTs?
>
>Also... beware of:
>
>  baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); 
>  quot = serial8250_get_divisor(port, baud);
>  quot = 0x35; /* FIXME */
>
>For me, 0x35 is not correct.  For me, the above 16x fix eliminates
>the need for this kind of FIXME.
>  
>
Looks like an old hack that someone forgot to revisit :) Thanks for the 
patch.

Pete

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

end of thread, other threads:[~2004-10-10  2:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-06 14:51 gcc 3.4 / bad_unaligned_access_length Gregory Nutt
2004-10-06 14:59 ` Au1100 Serial Driver Gregory Nutt
2004-10-10  2:38   ` Pete Popov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.