dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lekensteyn <lekensteyn@gmail.com>
To: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	linux-acpi@vger.kernel.org, "Len Brown" <lenb@kernel.org>,
	"Heinz Diehl" <htd@fritha.org>,
	"Martin Peres" <martin.peres@labri.fr>,
	"Heinz Diehl" <htd@fancy-poultry.org>,
	"David Airlie" <airlied@linux.ie>,
	"Ben Skeggs" <bskeggs@redhat.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Paweł Sikora" <pawel.sikora@agmk.net>
Subject: Re: Linux 3.7-rc1 (nouveau_bios_score oops).
Date: Sun, 21 Oct 2012 22:07:27 +0200	[thread overview]
Message-ID: <2998525.z8RPfWksxL@al> (raw)
In-Reply-To: <20121021144908.GC22587@joi.lan>

On Sunday 21 October 2012 16:49:08 Marcin Slusarz wrote:
> On Sun, Oct 21, 2012 at 07:38:58AM -0700, Linus Torvalds wrote:
> > On Sun, Oct 21, 2012 at 5:09 AM, Marcin Slusarz
> > 
> > <marcin.slusarz@gmail.com> wrote:
> > > This looks like ACPI bug...
> >
> > I'm shocked to hear that firmware would be fragile.
> >
> > Anyway, here's the #1 thing to keep in mind about firmware:
> > 
> >  - firmware is always buggy.
> 
> I know. But this bug is not about broken firmware. It's about Linux kernel
> ACPI implementation, which (I think) wrongly interprets ACPI script.

The ACPI implementation is fine, it is just the fw engineers that suck. I see I 
have not cc'd the linux-vger ml when replying to a previous mail. I'll paste 
it below:

Since commit 9a334cd "drm/nouveau/bios: fix shadowing of ACPI ROMs larger than 
64KiB" chunks are not always read in multiples of 4KiB anymore (less is 
possible). That is the only obvious thing I can think of atm (besides the 
kmalloc(0) bug for which Martin submitted a patch in the previous mail).

Do you still still have an Asus laptop with the same BIOS as in 
https://bugzilla.kernel.org/show_bug.cgi?id=19702? (if yes, then the acpidump 
from that bug still applies).

This is the ACPI _ROM method that is being called:
Method (_ROM, 2, NotSerialized)  // _ROM: Read-Only Memory
{
    Add (Arg0, RBUF, Local0)
    ShiftLeft (Arg1, 0x03, Local1) // times 8, bytes to bits?
    Name (VBUF, Buffer (Arg1) {}) 
    OperationRegion (VROM, SystemMemory, Local0, Local1)
    Field (VROM, ByteAcc, NoLock, Preserve)
    {   
        ROMI,   65536
    }   

    Store (ROMI, VBUF)
    Return (VBUF)
}

Arg0 is the offset (0 when first reading the size), Arg1 is the number of read 
bytes (3). Note the use of Local1 in OperationRegion. The meaning there is 
bytes, but a multiple of the requested bytes is passed. So if we request 4096 
bytes, we end up with a VROM of size 32KiB. ROMI is 65536 bits (or 8192 
bytes), hence reading 4096 does not give errors. But reading only 3 bytes will 
fail. Martin, I saw your second patch (https://lkml.org/lkml/2012/10/20/150) 
which takes care of the first case, but it skips the case where the ROM is of 
an odd size (does that even happen, something like 64KiB+1 bytes? No idea.)

Addition: Conclusion: this means that the request must have a length must be 
at least 1 KiB or it will fail with the ACPI error that you have seen before. 
This AML snippet suck.

Regards,
Peter

  parent reply	other threads:[~2012-10-21 20:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1724445.dN2yMEzN6d@localhost>
2012-10-19 21:25 ` Linux 3.7-rc1 (nouveau_bios_score oops) Linus Torvalds
2012-10-19 22:41   ` Martin Peres
2012-10-19 22:52     ` Linus Torvalds
2012-10-20  9:26   ` Heinz Diehl
2012-10-20  9:40     ` Martin Peres
2012-10-20 10:42       ` Heinz Diehl
2012-10-20 20:28         ` Marcin Slusarz
2012-10-20 20:35           ` Marcin Slusarz
2012-10-20 21:20           ` Heinz Diehl
2012-10-20 21:42             ` Marcin Slusarz
2012-10-20 21:45               ` Marcin Slusarz
2012-10-21  8:54               ` Heinz Diehl
2012-10-20 22:19             ` Marcin Slusarz
2012-10-21  6:58               ` Paweł Sikora
2012-10-21  9:26                 ` Heinz Diehl
2012-10-21 12:09                 ` Marcin Slusarz
2012-10-21 13:31                   ` Heinz Diehl
2012-10-21 14:38                   ` Linus Torvalds
2012-10-21 14:49                     ` Marcin Slusarz
2012-10-21 17:13                       ` Linus Torvalds
2012-10-21 20:07                       ` Lekensteyn [this message]
2012-10-22  0:07               ` Ben Skeggs
2012-10-25 17:53       ` Paweł Sikora
2012-10-25 18:06         ` Heinz Diehl
2012-10-26 19:51           ` Paweł Sikora

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=2998525.z8RPfWksxL@al \
    --to=lekensteyn@gmail.com \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=htd@fancy-poultry.org \
    --cc=htd@fritha.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.com \
    --cc=martin.peres@labri.fr \
    --cc=pawel.sikora@agmk.net \
    --cc=torvalds@linux-foundation.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).