From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq2jZ-0000Nz-Gw for qemu-devel@nongnu.org; Wed, 06 May 2015 13:03:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yq2jY-0003Ze-AO for qemu-devel@nongnu.org; Wed, 06 May 2015 13:03:45 -0400 Message-ID: <554A4967.2050306@redhat.com> Date: Wed, 06 May 2015 11:03:35 -0600 From: Eric Blake MIME-Version: 1.0 References: <20150506162011.55A5049ED81@webmail.sinamail.sina.com.cn> In-Reply-To: <20150506162011.55A5049ED81@webmail.sinamail.sina.com.cn> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2dNUM4S8SBKVWFflN7GiNgWB55Vmqi0tK" Subject: Re: [Qemu-devel] [PATCH] keyboard:fix ps2 keyboard can't use 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) --2dNUM4S8SBKVWFflN7GiNgWB55Vmqi0tK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/06/2015 10:20 AM, penghao122@sina.com wrote: Missing a 'v2' in the subject line (hint: git send-email -v2) Subject line doesn't make sense, and has incorrect spacing after colon. What was wrong with my suggestion that I gave on your v1? keyboard: handle ps2 typing buffer overrun > Starting a linux guest with ps2 keyboard, if you type many times during= leaving=20 Trailing whitespace in your commit message. > grub and into linux kernel,then you can't use keyboard after linux init= ialization > finished. Specally when you setup linux guest from iso file,you will ty= pe in grub. s/Specally/Specifically,/ s/file,you/file, you/ > During grub,the work method of ps2 keyboard is like this: s/grub,the/grub, the/ (in general, space after comma in English prose; I'll quit pointing it out) > First, ps2 keyboard driver send command KBD_CCMD_KBD_ENABLE. Second, if= there is > a keyboard input, then ps2 keyboard driver read data. Third, ps2 keyboa= rd driver=20 > send command KBD_CCMD_KBD_ENABLE again. > After leaving grub and before finishing linux kernel ps2 driver initial= ization,=20 > if you type many times, the input data keep saving in ps2 queue of qemu= =2E=20 > Before linux kernel initialize ps2 keyboard,linux call i8042_controller= _check, > if i8042_controller_check return fail, then ps2 keyboard driver will ne= ver initialize.=20 >=20 > (i8042.c in kernel 2.6.32 ) > 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 < I804= 2_BUFFER_SIZE)) { > udelay(50); > data =3D i8042_read_data(); > i++; > } > return i; > } > During calling i8042_flush it is full in ps2 queue of qemu. ps_read_dat= a will execute=20 > kbd_update_irq(s->update_arg, q->count !=3D 0). Because q->count!=3D0, = kbd_update_irq can=20 > set I8042_STR_OBF. Then i8042_flush() will return I8042_BUFFER_SIZE. > Signed-off-by: Hao Peng > ---- Incorrect separator. Git relies on exactly '---' as the division between commit message and explanatory text, and then ignores any garbage until the first 'diff' line. Also missing a diffstat, which 'git format-patch' will automatically insert as part of the explanatory text. > diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c > index 9b9a7d7..f4fbcfc 100644 > --- a/hw/input/pckbd.c > +++ b/hw/input/pckbd.c > @@ -207,6 +207,8 @@ static uint64_t kbd_read_status(void *opaque, hwadd= r addr, > KBDState *s =3D opaque; > int val; > val =3D s->status; > + if(s->write-cmd =3D=3D KBD_CCMD_KBD_ENABLE) Your patch is fatally flawed: $ git am ../\[Qemu-devel\]\ \[PATCH\]\ keyboard\:fix\ ps2\ keyboard\ can\'t\ use.eml Applying: keyboard:fix ps2 keyboard can't use fatal: corrupt patch at line 6 Patch failed at 0001 keyboard:fix ps2 keyboard can't use The copy of the patch that failed is found in: /home/eblake/qemu/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". You probably pasted the contents of your patch into an email composer that adjusted whitespace, and in the process made your patch useless. PLEASE read http://wiki.qemu.org/Contribute/SubmitAPatch, and follow the advice there for sending a patch. While it is possible to send a patch without using 'git send-email', it is so tricky to get it right that we strongly encourage new contributors to just use what git already provides. In particular, I advise that you FIRST send a patch to yourself using 'git send-email', and then use 'git am' to apply the patch locally, to make sure that your configuration is correct and that your patches will survive a round trip through email. Once you have that working, then it is okay to send to the list. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --2dNUM4S8SBKVWFflN7GiNgWB55Vmqi0tK 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/ iQEcBAEBCAAGBQJVSklnAAoJEKeha0olJ0NqxKMH+gI0/OBjnxw9vHJ2LDIyHRQ1 4vxdK4QRkahL4BOtvYFKlCDd7gclVcl7HQySel5UV7itWHP4nv5SAMCRuDylrsi4 v0PKJ6LXb4m/kdCTUkbEpkH6kSmTwkOdaPMK5Z2PIKFncpq9t7b1Ap+KDHteaGhA 6PlQBkegkLehWs74mX1JRNMbD9pMcvM1RxCpYEfnzoYisxZPxQzY4RG3EAZBjJmL ZoFVK1TqKKIIad6JVvZNq+dRTmp4vATawhry0srxbP/H6uagvVv37/vK25i67uwY cDCXFZMAzOLmZchWwvusObBxWFmLidCrM+rkxYWIM8ERLb/TT6tZVSufMcsTOdM= =xb7c -----END PGP SIGNATURE----- --2dNUM4S8SBKVWFflN7GiNgWB55Vmqi0tK--