public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pmac_zilog: initialize port spinlock on all init paths
  2004-07-12 22:09   ` pmac_zilog: driver loads (and crashes) without hardware David Eger
@ 2004-07-13  0:39     ` David Eger
  2004-07-13  4:16       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 9+ messages in thread
From: David Eger @ 2004-07-13  0:39 UTC (permalink / raw)
  To: benh; +Cc: linux-kernel

Dear Ben,

This patch fixes the Zilog driver so it doesn't freak on my TiBook.

( of course, it still spews diahrea of 'IN from bad port XXXXXXXX'
  but then, I don't have the hardware.... still, seems weird that OF
  would report that I do have said hardware :-/ )

Please look it over and send it on.

-dte

pmac_zilog: initialize the serial ports' spinlocks even if console over 
   serial is not enabled; disable this driver by default for ppc

This lock not being initialized was Oopsing my TiBook :-P

Signed-off-by: David Eger <eger@havoc.gtf.org>

diff -Nru a/arch/ppc/defconfig b/arch/ppc/defconfig
--- a/arch/ppc/defconfig	2004-07-13 02:30:37 +02:00
+++ b/arch/ppc/defconfig	2004-07-13 02:30:37 +02:00
@@ -689,7 +689,7 @@
 # Input Device Drivers
 #
 CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_KEYBOARD_SUNKBD is not set
 # CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
@@ -724,8 +724,8 @@
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_PMACZILOG=y
+# CONFIG_SERIAL_CORE is not set
+# CONFIG_SERIAL_PMACZILOG is not set
 # CONFIG_SERIAL_PMACZILOG_CONSOLE is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
diff -Nru a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
--- a/drivers/serial/pmac_zilog.c	2004-07-13 02:30:37 +02:00
+++ b/drivers/serial/pmac_zilog.c	2004-07-13 02:30:37 +02:00
@@ -1490,6 +1490,7 @@
 	uap->port.ops = &pmz_pops;
 	uap->port.type = PORT_PMAC_ZILOG;
 	uap->port.flags = 0;
+	spin_lock_init(&uap->port.lock);
 
 	/* Setup some valid baud rate information in the register
 	 * shadows so we don't write crap there before baud rate is
@@ -1985,8 +1986,6 @@
 	/* Probe ports */
 	pmz_probe();
 
-#ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE
-#endif
 	/* TODO: Autoprobe console based on OF */
 	/* pmz_console.index = i; */
 	register_console(&pmz_console);

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

* Re: [PATCH] pmac_zilog: initialize port spinlock on all init paths
  2004-07-13  0:39     ` [PATCH] pmac_zilog: initialize port spinlock on all init paths David Eger
@ 2004-07-13  4:16       ` Benjamin Herrenschmidt
  2004-07-14  4:04         ` David Eger
  0 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2004-07-13  4:16 UTC (permalink / raw)
  To: David Eger; +Cc: Linux Kernel list

On Mon, 2004-07-12 at 19:39, David Eger wrote:
> Dear Ben,
> 
> This patch fixes the Zilog driver so it doesn't freak on my TiBook.

The spinlock should be initialized by the serial core when registering
the ports ... can you find out for me how do you end up with the
port not registered but still trying to use the lock ? The port
do exist on tipb's even if it has no visible connectors (actually
some tipbs have an irda output on port B and port A is available
on the motherboard, I think on the modem connector, though there
is no "adapter" that I know of to get it out).

> ( of course, it still spews diahrea of 'IN from bad port XXXXXXXX'
>   but then, I don't have the hardware.... still, seems weird that OF
>   would report that I do have said hardware :-/ )

The IN from bad port is a different issue, it's probably issued by
another driver trying to tap legacy hardware, either serial.o or
ps/2 kbd, I suppose, check what else of that sort you have in your
 .config

Ben.



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

* Re: [PATCH] pmac_zilog: initialize port spinlock on all init paths
  2004-07-13  4:16       ` Benjamin Herrenschmidt
@ 2004-07-14  4:04         ` David Eger
  2004-07-14 23:39           ` Tom Rini
  0 siblings, 1 reply; 9+ messages in thread
From: David Eger @ 2004-07-14  4:04 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Linux Kernel list, rmk

On Mon, Jul 12, 2004 at 11:16:34PM -0500, Benjamin Herrenschmidt wrote:
> On Mon, 2004-07-12 at 19:39, David Eger wrote:
> > Dear Ben,
> > 
> > This patch fixes the Zilog driver so it doesn't freak on my TiBook.
> > [patch that initializes port->lock in pmac_zilog.c
>
> The spinlock should be initialized by the serial core when registering
> the ports ... can you find out for me how do you end up with the
> port not registered but still trying to use the lock ? 

After some testing, I found that the pmac_zilog Oops (which claims we've
not initialized port->lock) only occurs when I also enable 8250/16550
serial support (CONFIG_SERIAL_8250)

I'll try to track down what's going on on the plane tomorrow, but I'm 
curious to hear if any of the recent csets might have caused this...
(hence the cc: rmk)

> > ( of course, it still spews diahrea of 'IN from bad port XXXXXXXX'
> >   but then, I don't have the hardware.... still, seems weird that OF
> >   would report that I do have said hardware :-/ )
> 
> The IN from bad port is a different issue, it's probably issued by
> another driver trying to tap legacy hardware, either serial.o or
> ps/2 kbd, I suppose, check what else of that sort you have in your
>  .config

Sure enough, the "IN from bad port XXXXXXXX" ended up being the i8042
serial PC keyboard driver, enabled with CONFIG_SERIO_I8042.  Don't know
why that's in ppc defconfig....

-dte

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

* Re: [PATCH] pmac_zilog: initialize port spinlock on all init paths
       [not found] <200407141709.i6EH9EYW029131@hera.kernel.org>
@ 2004-07-14 19:27 ` Hollis Blanchard
  2004-07-16 20:51   ` [PATCH] restore ppc defconfig's David Eger
  0 siblings, 1 reply; 9+ messages in thread
From: Hollis Blanchard @ 2004-07-14 19:27 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: linuxppc-dev

On Wed, 2004-07-14 at 11:25, Linux Kernel Mailing List wrote:
> ChangeSet 1.1853, 2004/07/14 09:25:57-07:00, eger@havoc.gtf.org

> diff -Nru a/arch/ppc/defconfig b/arch/ppc/defconfig
> --- a/arch/ppc/defconfig	2004-07-14 10:09:28 -07:00
> +++ b/arch/ppc/defconfig	2004-07-14 10:09:28 -07:00
> @@ -689,7 +689,7 @@
>  # Input Device Drivers
>  #
>  CONFIG_INPUT_KEYBOARD=y
> -CONFIG_KEYBOARD_ATKBD=y
> +# CONFIG_KEYBOARD_ATKBD is not set
>  # CONFIG_KEYBOARD_SUNKBD is not set
>  # CONFIG_KEYBOARD_LKKBD is not set
>  # CONFIG_KEYBOARD_XTKBD is not set
> @@ -724,8 +724,8 @@
>  #
>  # Non-8250 serial port support
>  #
> -CONFIG_SERIAL_CORE=y
> -CONFIG_SERIAL_PMACZILOG=y
> +# CONFIG_SERIAL_CORE is not set
> +# CONFIG_SERIAL_PMACZILOG is not set
>  # CONFIG_SERIAL_PMACZILOG_CONSOLE is not set
>  CONFIG_UNIX98_PTYS=y
>  CONFIG_LEGACY_PTYS=y

Hi, could we not disable AT keyboards (used by CHRP and PReP machines)
and PowerMac serial ports (used by PowerMacs) in the defconfig please?

-- 
Hollis Blanchard
IBM Linux Technology Center


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

* Re: [PATCH] pmac_zilog: initialize port spinlock on all init paths
  2004-07-14  4:04         ` David Eger
@ 2004-07-14 23:39           ` Tom Rini
  2004-07-16 20:15             ` David Eger
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Rini @ 2004-07-14 23:39 UTC (permalink / raw)
  To: David Eger; +Cc: Benjamin Herrenschmidt, Linux Kernel list

On Wed, Jul 14, 2004 at 12:04:03AM -0400, David Eger wrote:

[snip]
> > > ( of course, it still spews diahrea of 'IN from bad port XXXXXXXX'
> > >   but then, I don't have the hardware.... still, seems weird that OF
> > >   would report that I do have said hardware :-/ )
> > 
> > The IN from bad port is a different issue, it's probably issued by
> > another driver trying to tap legacy hardware, either serial.o or
> > ps/2 kbd, I suppose, check what else of that sort you have in your
> >  .config
> 
> Sure enough, the "IN from bad port XXXXXXXX" ended up being the i8042
> serial PC keyboard driver, enabled with CONFIG_SERIO_I8042.  Don't know
> why that's in ppc defconfig....

That's on for all of the ppc boards with an i8042 which the defconfig is
supposed to support (prep & chrp hardware).

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH] pmac_zilog: initialize port spinlock on all init paths
  2004-07-14 23:39           ` Tom Rini
@ 2004-07-16 20:15             ` David Eger
  2004-07-16 20:50               ` Tom Rini
  2004-07-19 15:51               ` Anton Blanchard
  0 siblings, 2 replies; 9+ messages in thread
From: David Eger @ 2004-07-16 20:15 UTC (permalink / raw)
  To: Tom Rini; +Cc: Benjamin Herrenschmidt, Linux Kernel list

On Wed, Jul 14, 2004 at 04:39:20PM -0700, Tom Rini wrote:
> On Wed, Jul 14, 2004 at 12:04:03AM -0400, David Eger wrote:
> > > > ( of course, it still spews diahrea of 'IN from bad port XXXXXXXX'
> > > >   but then, I don't have the hardware.... still, seems weird that OF
> > > >   would report that I do have said hardware :-/ )
> > > 
> > > The IN from bad port is a different issue, it's probably issued by
> > > another driver trying to tap legacy hardware, either serial.o or
> > > ps/2 kbd, I suppose, check what else of that sort you have in your
> > >  .config
> > 
> > Sure enough, the "IN from bad port XXXXXXXX" ended up being the i8042
> > serial PC keyboard driver, enabled with CONFIG_SERIO_I8042.  Don't know
> > why that's in ppc defconfig....
> 
> That's on for all of the ppc boards with an i8042 which the defconfig is
> supposed to support (prep & chrp hardware).

Sorry, I tend to think "ppc == pmac".  So, a couple of thoughts:

(1) Can you make the i8042 disable itself if the hardware isn't there?
    Those damned bad port messages eat my entire syslog buffer.

(2) At the moment, that defconfig is also shared by us TiBook hackers.
    Would it be feasible to have a separate pmac_defconfig?  How do 
    'make menuconfig' and friends choose a defconfig if there isn't a .config?

-dte


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

* Re: [PATCH] pmac_zilog: initialize port spinlock on all init paths
  2004-07-16 20:15             ` David Eger
@ 2004-07-16 20:50               ` Tom Rini
  2004-07-19 15:51               ` Anton Blanchard
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Rini @ 2004-07-16 20:50 UTC (permalink / raw)
  To: David Eger; +Cc: Benjamin Herrenschmidt, Linux Kernel list

On Fri, Jul 16, 2004 at 04:15:15PM -0400, David Eger wrote:

> On Wed, Jul 14, 2004 at 04:39:20PM -0700, Tom Rini wrote:
> > On Wed, Jul 14, 2004 at 12:04:03AM -0400, David Eger wrote:
> > > > > ( of course, it still spews diahrea of 'IN from bad port XXXXXXXX'
> > > > >   but then, I don't have the hardware.... still, seems weird that OF
> > > > >   would report that I do have said hardware :-/ )
> > > > 
> > > > The IN from bad port is a different issue, it's probably issued by
> > > > another driver trying to tap legacy hardware, either serial.o or
> > > > ps/2 kbd, I suppose, check what else of that sort you have in your
> > > >  .config
> > > 
> > > Sure enough, the "IN from bad port XXXXXXXX" ended up being the i8042
> > > serial PC keyboard driver, enabled with CONFIG_SERIO_I8042.  Don't know
> > > why that's in ppc defconfig....
> > 
> > That's on for all of the ppc boards with an i8042 which the defconfig is
> > supposed to support (prep & chrp hardware).
> 
> Sorry, I tend to think "ppc == pmac".  So, a couple of thoughts:
> 
> (1) Can you make the i8042 disable itself if the hardware isn't there?
>     Those damned bad port messages eat my entire syslog buffer.

Ask Vojtech Pavlik.

> (2) At the moment, that defconfig is also shared by us TiBook hackers.
>     Would it be feasible to have a separate pmac_defconfig?  How do 
>     'make menuconfig' and friends choose a defconfig if there isn't a .config?

One already exists.  The short answer is that when .config doesn't
exist, we look at /boot/config-`uname -r` and then
arch/$(ARCH)/defconfig.  I believe the that 'make help' mentions the
next neat trick.  If you do 'make pmac_defconfig' for example,
arch/ppc/configs/pmac_defconfig is used as the base of a new .config
file, with all options not documented in that file being set to 'n'.
You can then either build the kernel, or further tweak via
menuconfig/etc.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* [PATCH] restore ppc defconfig's
  2004-07-14 19:27 ` [PATCH] pmac_zilog: initialize port spinlock on all init paths Hollis Blanchard
@ 2004-07-16 20:51   ` David Eger
  0 siblings, 0 replies; 9+ messages in thread
From: David Eger @ 2004-07-16 20:51 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Linux Kernel Mailing List, linuxppc-dev

Hollis Blanchard said in a fit of pique:
> Hi, could we not disable AT keyboards (used by CHRP and PReP machines)
> and PowerMac serial ports (used by PowerMacs) in the defconfig please?

Apologies.  The AT Keyboard driver does behave well, I'm just really
used to just having ADB.  Also, the zilog isn't oopsing now, hooray.

-dte

diff -Nru a/arch/ppc/defconfig b/arch/ppc/defconfig
--- a/arch/ppc/defconfig	2004-07-16 16:49:53 -04:00
+++ b/arch/ppc/defconfig	2004-07-16 16:49:53 -04:00
@@ -689,7 +689,7 @@
 # Input Device Drivers
 #
 CONFIG_INPUT_KEYBOARD=y
-# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
 # CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
@@ -724,8 +724,8 @@
 #
 # Non-8250 serial port support
 #
-# CONFIG_SERIAL_CORE is not set
-# CONFIG_SERIAL_PMACZILOG is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_PMACZILOG=y
 # CONFIG_SERIAL_PMACZILOG_CONSOLE is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y

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

* Re: [PATCH] pmac_zilog: initialize port spinlock on all init paths
  2004-07-16 20:15             ` David Eger
  2004-07-16 20:50               ` Tom Rini
@ 2004-07-19 15:51               ` Anton Blanchard
  1 sibling, 0 replies; 9+ messages in thread
From: Anton Blanchard @ 2004-07-19 15:51 UTC (permalink / raw)
  To: David Eger; +Cc: Tom Rini, Benjamin Herrenschmidt, Linux Kernel list

 
> Sorry, I tend to think "ppc == pmac".  So, a couple of thoughts:
> 
> (1) Can you make the i8042 disable itself if the hardware isn't there?
>     Those damned bad port messages eat my entire syslog buffer.

We put a quick fix in the ppc64 port. If you pre reserve the i8042 region
then the driver will fail to initialise:

        /*
         * Some machines have an unterminated i8042 so check the device
         * tree and reserve the region if it does not appear. Later on
         * the i8042 code will try and reserve this region and fail.
         */
        if (!(i8042 = of_find_node_by_type(NULL, "8042")))
                request_region(I8042_DATA_REG, 16, "reserved (no i8042)");

Anton

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

end of thread, other threads:[~2004-07-20  2:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200407141709.i6EH9EYW029131@hera.kernel.org>
2004-07-14 19:27 ` [PATCH] pmac_zilog: initialize port spinlock on all init paths Hollis Blanchard
2004-07-16 20:51   ` [PATCH] restore ppc defconfig's David Eger
2004-07-12  7:51 pmac oops: devfs versus power management - fight! David Eger
2004-07-12  8:21 ` oops: pmac power management David Eger
2004-07-12 22:09   ` pmac_zilog: driver loads (and crashes) without hardware David Eger
2004-07-13  0:39     ` [PATCH] pmac_zilog: initialize port spinlock on all init paths David Eger
2004-07-13  4:16       ` Benjamin Herrenschmidt
2004-07-14  4:04         ` David Eger
2004-07-14 23:39           ` Tom Rini
2004-07-16 20:15             ` David Eger
2004-07-16 20:50               ` Tom Rini
2004-07-19 15:51               ` Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox