All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: 2.6.{28,30} Keyboard not working on oldish machine
Date: Sun, 6 Sep 2009 00:51:59 +0100	[thread overview]
Message-ID: <20090905235159.GA23660@gallifrey> (raw)
In-Reply-To: <20090904055139.4BEAB526EA5@mailhub.coreip.homeip.net>

* Dmitry Torokhov (dmitry.torokhov@gmail.com) wrote:
> On Sun, Jun 28, 2009 at 03:04:52PM +0100, Dr. David Alan Gilbert wrote:
> > * Dmitry Torokhov (dmitry.torokhov@gmail.com) wrote:
> > > On Tuesday 23 June 2009 11:58:15 Dr. David Alan Gilbert wrote:
> > 
> > <snip>
> >  
> > > > Yep; I'm OK with the i8042.noaux from my point of view, but it's a
> > > > bit worrying that this used to work fine.  There's obviously been
> > > > a change somewhere since 2.6.18 (and as I remember from the dmesg
> > > > the keyboard and aux ports are being initialised in different orders).
> > > > (Actually I say obviously since 2.6.18 - but the 2.6.18 I tried
> > > > I think I only used the debian version - I should go back and
> > > > see if I can do a vanilla one), but this box has been running
> > > > Linux since the time it was originally bought with loads of distros
> > > > and clean kernels years ago.
> > > >
> > > > While this machine is old, the motherboard was a pretty common one
> > > > at the time.
> > > >
> > > 
> > > Any chance I could get dmesg with i8042.debug with 2.6.18? There was
> > > quite a large change back then when we got rid of the polling timer
> > > in i8042.
> > 
> > Apologies for the delay; attached is the dmesg from the Debian 2.6.18
> > in which keyboard works as previously described.
> > 
> 
> Sorry for taking so long to respond. The only vidible difference beween
> the old and the new way is that we don't "close" serio ports anymore if
> we fail to detect a mouse/keyboard.
> 
> Could you please try the patch below and tell me if it helps?

Yes that fixes it - thank you!
(Tested on 2.6.31-rc8, having first checked rc8 on it's own was still broken)

Dave

> 
> Thanks!
> -- 
> Dmitry
> 
> Input: i8042 - try disabling and re-enabling AUX port at close
> 
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Ever since we switched from having a polling timer to registering IRQ
> handlers for both keyboard and AUX ports at the driver registration
> time, on certain boxes probing for a mouse results in keyboard
> stopping working. The only real difference between old and new way is
> that before we disabled ports after unsuccessful probe whereas now we
> leave them as is. Try to emulate the old behavior by disabling and
> immediately re-enabling AUX port when corresponding serio port is
> being closed.
> 
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
> 
>  drivers/input/serio/i8042.c |   28 ++++++++++++++++++++++++++++
>  1 files changed, 28 insertions(+), 0 deletions(-)
> 
> 
> diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
> index b53a015..a55ad99 100644
> --- a/drivers/input/serio/i8042.c
> +++ b/drivers/input/serio/i8042.c
> @@ -264,6 +264,33 @@ static int i8042_aux_write(struct serio *serio, unsigned char c)
>  					I8042_CMD_MUX_SEND + port->mux);
>  }
>  
> +
> +/*
> + * i8042_aux_close attempts to clear AUX port state by disabling
> + * and then re-enabling it.
> + */
> +
> +static void i8042_aux_close(struct serio *serio)
> +{
> +	i8042_ctr &= ~I8042_CTR_AUXINT;
> +	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
> +		printk(KERN_WARNING
> +			"i8042.c: Can't write CTR while closing AUX port.\n");
> +	udelay(50);
> +
> +	i8042_ctr &= ~I8042_CTR_AUXDIS;
> +	i8042_ctr |= I8042_CTR_AUXINT;
> +	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
> +		printk(KERN_ERR
> +			"i8042.c: Can't reactivate AUX port.\n");
> +
> +	/*
> +	 * See if there is any data appeared while we were messing with
> +	 * port state.
> +	 */
> +	i8042_interrupt(0, NULL);
> +}
> +
>  /*
>   * i8042_start() is called by serio core when port is about to finish
>   * registering. It will mark port as existing so i8042_interrupt can
> @@ -1051,6 +1078,7 @@ static int __devinit i8042_create_aux_port(int idx)
>  	serio->write		= i8042_aux_write;
>  	serio->start		= i8042_start;
>  	serio->stop		= i8042_stop;
> +	serio->close		= i8042_aux_close;
>  	serio->port_data	= port;
>  	serio->dev.parent	= &i8042_platform_device->dev;
>  	if (idx < 0) {
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    | Running GNU/Linux on Alpha,68K| Happy  \ 
\ gro.gilbert @ treblig.org | MIPS,x86,ARM,SPARC,PPC & HPPA | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

  reply	other threads:[~2009-09-05 23:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-13 23:08 Dr. David Alan Gilbert
2009-06-13 22:54 ` Ozan Çağlayan
2009-06-14 17:49   ` Dr. David Alan Gilbert
2009-06-14  6:27 ` Pekka Enberg
2009-06-14  6:27   ` Pekka Enberg
2009-06-14  6:40 ` H. Peter Anvin
2009-06-14 12:27   ` Dr. David Alan Gilbert
2009-06-16  9:27     ` Jiri Kosina
2009-06-17 19:34       ` Dr. David Alan Gilbert
2009-06-17 20:40         ` H. Peter Anvin
2009-06-17 23:28         ` Jiri Kosina
2009-06-20 12:03           ` Dr. David Alan Gilbert
2009-06-22  9:29             ` Jiri Kosina
2009-06-22 19:46             ` Dr. David Alan Gilbert
2009-06-23  8:42               ` Jiri Kosina
2009-06-23 18:58                 ` Dr. David Alan Gilbert
2009-06-23 18:06                   ` Dmitry Torokhov
2009-06-28 14:04                     ` Dr. David Alan Gilbert
2009-06-29  9:06                       ` Jiri Kosina
2009-07-04  1:24                         ` Dr. David Alan Gilbert
2009-09-04  5:18                       ` Dmitry Torokhov
2009-09-05 23:51                         ` Dr. David Alan Gilbert [this message]
2009-09-08  6:12                           ` Dmitry Torokhov
2009-09-09  1:53                             ` Dmitry Torokhov
2009-09-12 15:00                               ` Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090905235159.GA23660@gallifrey \
    --to=linux@treblig.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: 2.6.{28,30} Keyboard not working on oldish machine' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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.