public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexey Starikovskiy <astarikovskiy@suse.de>
To: Zhao Yakui <yakui.zhao@intel.com>
Cc: Alexey Starikovskiy <aystarik@gmail.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [RFC]  [PATCH] ACPI :Remove the EC space handler explicitly	when failing in _REG object
Date: Thu, 27 Nov 2008 12:42:08 +0300	[thread overview]
Message-ID: <492E6B70.9010006@suse.de> (raw)
In-Reply-To: <1227749343.4053.32.camel@yakui_zhao.sh.intel.com>

Zhao Yakui wrote:
> On Thu, 2008-11-27 at 04:03 +0800, Alexey Starikovskiy wrote:
>> This is hardly a "fix", you just disable EC on this machine... Famous 
> Yes. This can't fix the issue on the box of bug11884. 
> But in theory if the incorrect status is returned by
> acpi_install_address_space_handler, the EC space handler should be
> removed explicitly. Right? In such case the EC device will be disabled
> on this box. 
Wrong. If any function is allowed to fail, you should not call counter function
to recover -- you don't call free() on failed malloc(), you don't call close() on
failed open().
>     But if the EC space handler is not removed and EC flag in AML code
> still indicates that EC operation region is already accessible, the EC
> internal register will be accessed in AML code. At the same time the
> memory region pointed by acpi_ec is already freed. This is the fourth
> argument of ec_space_handler.
I already told you and here is second time -- your fixes come in wrong place.
You should fix acpi_install_address_space_handler(), not all the callers of it.
>     In such case if the EC space handler is still accessed, OS will try
> to access the memory region already freed. Maybe the kernel panic will
> be reported and the system can't be booted.
>     In fact we have a similar bug 10237. And on that box of bug10237 OS
> fails in evaluating _REG object and then kernel panic is reported. 
>     The workaround patch is that OS ignores the error and continue to
> initialize EC device if AE_NOT_FOUND is returned by the _REG object.
> In such case the system can be booted very normally.
Yes, and this workaround should not be in EC driver too.
>> "how windows runs on this machine?" is not answered...
> Windows can work well on such boxes while Linux can't work well.This is
> the gap between Linux and windows. It is our target to narrow the gap.
> Maybe on windows the incorrect status returned by EC _REG object is
> ignored by EC driver. In such case the EC device can be initialized
> correctly.
So, why you disable EC driver instead of ignoring error from _REG completely?
By doing this, you are _widening_ the gap, not narrowing it.
Please consider moving 20edd74fcf9ad02c19efba0c13670a7b6b045099 out of the ec.c and
widen it to ignore failure from _REG method completely.
>> Regards,
>> Alex.


  reply	other threads:[~2008-11-27  9:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26  8:50 [RFC] [PATCH] ACPI :Remove the EC space handler explicitly when failing in _REG object Zhao Yakui
2008-11-26 20:03 ` Alexey Starikovskiy
2008-11-27  1:29   ` Zhao Yakui
2008-11-27  9:42     ` Alexey Starikovskiy [this message]
2008-11-28  2:57       ` Zhao Yakui
2008-11-28  8:08         ` Alexey Starikovskiy
2008-12-01  1:53           ` Zhao Yakui
2008-12-01  2:47           ` Zhao Yakui
2008-12-01  8:12           ` the issue about the bogus ECDT table Zhao Yakui

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=492E6B70.9010006@suse.de \
    --to=astarikovskiy@suse.de \
    --cc=aystarik@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=yakui.zhao@intel.com \
    /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