From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1X2Om4-0006A7-1B for mharc-grub-devel@gnu.org; Wed, 02 Jul 2014 13:56:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2Olv-00069L-Gb for grub-devel@gnu.org; Wed, 02 Jul 2014 13:56:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2Olf-0002Yk-0J for grub-devel@gnu.org; Wed, 02 Jul 2014 13:56:43 -0400 Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:65515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2Ole-0002Xo-Pa for grub-devel@gnu.org; Wed, 02 Jul 2014 13:56:26 -0400 Received: by mail-la0-f49.google.com with SMTP id gf5so7179575lab.22 for ; Wed, 02 Jul 2014 10:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=mEZrV3ZJY1rmwsdL6bFxfsxU58o/iI62fLLIlmL/aao=; b=PwkvTR8zKwjjixdiCrrAzZ5jvsg7meyFAhjPNJQbTD3xNdnNxKolynkaWqLUywQJoc RS6hcoOiotOyEqoBDm62UN454IjoJ70omk0qTgR5W/80G44A0OG3E6C5D6MIrk06SJD9 9YeOwzvaNfN4i3zZxCZQsz2EI50Qy6Lgb2LY7fRXy8bfmr0ltd80uU+41M5SQD0povh+ KzWsta8PBnaceRxI4XT0KZnL6/gP9HYq7IqChT5dnIlNZBBhol9b54cYQzXe2/u94HnJ zAwX2mbxKYiW5WT9G9K2n8CM6xaoSEuh9tzZ7FPnUCaFl8cViO0Fex4xiSjg7Z9uL1KE mCnw== X-Received: by 10.112.171.167 with SMTP id av7mr41014lbc.97.1404323785567; Wed, 02 Jul 2014 10:56:25 -0700 (PDT) Received: from opensuse.site (ppp94-29-76-101.pppoe.spdop.ru. [94.29.76.101]) by mx.google.com with ESMTPSA id w7sm12165975laj.9.2014.07.02.10.56.24 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 10:56:24 -0700 (PDT) Date: Wed, 2 Jul 2014 21:56:20 +0400 From: Andrey Borzenkov To: The development of GNU GRUB Subject: Re: [PATCH] Fix ACPI halt for certain DSDTs Message-ID: <20140702215620.1d67dd4c@opensuse.site> In-Reply-To: <3DE0DB36-391C-4CC0-8285-7CFDC56287EC@unimplemented.org> References: <3DE0DB36-391C-4CC0-8285-7CFDC56287EC@unimplemented.org> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/TtP40UmOuucCnt3_BzDR+2/"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 Cc: valentin@unimplemented.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 17:56:50 -0000 --Sig_/TtP40UmOuucCnt3_BzDR+2/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =D0=92 Tue, 1 Jul 2014 01:55:22 +0200 Valentin Dornauer =D0=BF=D0=B8=D1=88=D0=B5=D1= =82: > Hello! >=20 > GRUB2 currently seems to be unable to shut down my Fujitsu Lifebook > E744 laptop using ACPI. After some debugging, I nailed the problem > down to two problems within GRUB=E2=80=99s =E2=80=98acpihalt=E2=80=99 com= mand. Please see > the attached patch for my solution. >=20 See below > + in skip_ext_op(), correctly parse OpRegionOp (TermArgs aren't always > + simply strings!); add function to skip TermArgs. It does not really parse every possible value of Type2Opcode, so commit message should probably reflect it. > + case GRUB_ACPI_OPCODE_ADD: > + case GRUB_ACPI_OPCODE_CONCAT: > + case GRUB_ACPI_OPCODE_SUBTRACT: > + case GRUB_ACPI_OPCODE_MULTIPLY: > ... Sort by name? > + if (add =3D=3D 0) > + return 0; You use if (!add) in another places. Let's be consistent :) > GRUB_ACPI_OPCODE_NAME =3D 8, GRUB_ACPI_OPCODE_BYTE_CONST =3D 0x0a, > + GRUB_ACPI_OPCODE_ALIAS =3D 0x06, Looks like list is ordered by opcode value, so it should go between GRUB_ACPI_OPCODE_NAME and GRUB_ACPI_OPCODE_BYTE_CONST. Same also next hunk. > + GRUB_ACPI_OPCODE_CONCATRES =3D 0x80, In my copy of ACPI spec ConcatRes has opcode 0x84. Otherwise looks good. Vladimir, is it OK to commit? --Sig_/TtP40UmOuucCnt3_BzDR+2/ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlO0R8cACgkQR6LMutpd94y+jACfdUXLZxtW3CiqOjXAxK+ZoHON lccAoL+MqYf1cA+XBksdBMbWR+MBH6xs =8kGm -----END PGP SIGNATURE----- --Sig_/TtP40UmOuucCnt3_BzDR+2/--