From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpHPQ-00041t-2X for qemu-devel@nongnu.org; Mon, 04 May 2015 10:31:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpHPO-0005fn-NC for qemu-devel@nongnu.org; Mon, 04 May 2015 10:31:48 -0400 Message-ID: <554782C9.9050901@redhat.com> Date: Mon, 04 May 2015 08:31:37 -0600 From: Eric Blake MIME-Version: 1.0 References: <20150503163241.272593D7131@webmail.sinamail.sina.com.cn> In-Reply-To: <20150503163241.272593D7131@webmail.sinamail.sina.com.cn> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BkpXJWU67KbFtbhoblCgTV3W0dPTShJDe" Subject: Re: [Qemu-devel] [PATCH] ps2 keyboard:fix can't use ps2 keyboard if typing many times After leaving grub and before finishing linux kernel ps2 driver initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: penghao122@sina.com, qemu-devel Cc: qemu-stable This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BkpXJWU67KbFtbhoblCgTV3W0dPTShJDe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/03/2015 10:32 AM, penghao122@sina.com wrote: Poor subject line. Please try to keep subjects under 65 characters in length (see 'git shortlog -30' for good examples). Maybe: keyboard: handle ps2 typing buffer overrun > Starting a linux guest with ps2 keyboard ,if you type many times durin= g leaving grub and into linux kernel ,then you can't use keyboard after l= inux initialization finished. Also, wrap your commit body messages to fit with 78 columns or so. Spacing is wrong: s/Starting a/Staring a/; s/keyboard ,if/keyboard, if/; s/kernel ,then/kernel, then/ > during grub,the work method of ps2 keyboard is like this: > first ,ps2 keyboard driver send command KBD_CCMD_KBD_ENABLE, > second,if there is a keyboard input,then ps2 keyboard driver read data= =2E > third ,ps2 keyboard driver send command KBD_CCMD_KBD_ENABLE, Again, in English, no space before comma, but space afterwards. > ... > this is diffrent method of linux kernel . s/diffrent/different/; s/ ././ > After leaving grub and before finishing linux kernel ps2 driver initia= lization,if you type many times,the input data keep saving the ps2 queue = in qemu .Before linux kernel initialize ps2 keyboard,linux call i8042_ini= t->i8042_controller_check,if i8042_controller_check return fail,then linu= x kernel ps2 keyboard driver will never initialize.=20 More spacing errors; no trailing space, long line. > (linux kernel 2.6.32 i8042.c) > static int i8042_controller_check(void) > { > if (i8042_flush() =3D=3D I8042_BUFFER_SIZE) > return -ENODEV; > return 0; > } > static int i8042_flush(void) > {... > while (((str =3D i8042_read_status()) & I8042_STR_OBF) && (i < I8042_BU= FFER_SIZE)) { > udelay(50); > data =3D i8042_read_data(); > i++; > } > return i; > } Indentation is weird. > =20 > during calling i8042_flush it is full in qemu queue . > ps_read_data: > s->update_irq(s->update_arg, 0); > s->update_irq(s->update_arg, q->count !=3D 0); > because q->count!=3D0, kbd_update_irq can set I8042_STR_OBF.Then i8042_= flush() will return I8042_BUFFER_SIZE. > Signed-off-by: Hao Peng --- ps2.c.orig 2015-04-25 09:44:38.865777168 -0400 Missing the usual '---' separator between the commit body and the patch proper; also missing the diffstat. Life is easier if you use 'git format-patch' and/or 'git send-email' to format your patch messages. More hints at: http://wiki.qemu.org/Contribute/SubmitAPatch --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --BkpXJWU67KbFtbhoblCgTV3W0dPTShJDe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVR4LJAAoJEKeha0olJ0NqYhcIAJV6uq2jHZwdvFhZ/EQlFRze Zloat9JtCWmfJDxtlTBv8i6/ZQO5efiLboGN3niBOfLptVXd/4eQXXqH88inAXUO +ogwUEpKZQ+XBnkMyQ8P5V9tNdVLnwYfsdPE2JajYXm62hhZc1e89cupX0QQk4qj rpB7xAsJnqM9kZCozSstd37+EnvpoTGP3EaltAmyeneU8B7yX/3eJabvTYBGd8xO SVxiseaFqc2FPZl3//dsF89h3/nq492Z+20ThVJ4B0gw7ND6oKgKW5vSj1ygMsFC XgEKPJJBsEBy6BGb8jKcxhlE6aMavzcOh7Eve+bSP5pnaJjjvx9Mx2U3/e5P/5A= =zwtP -----END PGP SIGNATURE----- --BkpXJWU67KbFtbhoblCgTV3W0dPTShJDe--