From: Alexey Starikovskiy <aystarik@gmail.com>
To: Zhao Yakui <yakui.zhao@intel.com>
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, andi@firstfloor.org,
rui.zhang@intel.com
Subject: Re: the errors about two EC patches
Date: Thu, 11 Sep 2008 12:14:00 +0400 [thread overview]
Message-ID: <48C8D348.6050209@gmail.com> (raw)
In-Reply-To: <1221100968.3989.224.camel@yakui_zhao.sh.intel.com>
Zhao Yakui wrote:
> On Wed, 2008-09-10 at 16:37 +0400, Alexey Starikovskiy wrote:
> thanks for the so quick response.
>
> In the update patch it seems that spin_lock is used in the function of
> ec_read_command/acpi_ec_write_cmd.
> IMO this is not reasonable.
> Maybe the spin_lock is already called before OS evaluates some ACPI
> object, in which the EC internal register will be accessed. In such case
> there will give the following warning message.
> >2 locks held by swapper/1
>
>
I've just consulted with Greg KH about the non-sense you tell about.
spinlock will always be acquired while already holding a mutex, and
released while still holding mutex. This is perfectly fine use of mutexes
and spinlocks. You should never use reverse order, obviously.
>>
>> Ok. Fixed, now -ETIME is returned in this case.
>>
> Yes. The code flow seems logic and reasonable after the -Etime is added.
> If the timeout happens when EC transaction is not finished, it is
> regarded as timeout.
>
> But we should investigate why EC transaction is not finished when
> timeout happens. Is it related with EC hardware or EC driver?
> If EC can't update the status register in time after issuing
> command/address, it is reasonable that it is regarded as timeout. If
> not, maybe it is related with the EC driver.
>
>
We should investigate that only if we receive such timeouts.
This is clearly only needed for debug purposes, as no user
of EC driver is interested in why exactly it did not made a
transaction, only that it failed temporarily (as opposed to
-EFAIL or -ENODEV), which indicate permanent failure.
Thus, there is no reason to make flowchart (your favorite)
any more complex.
> In fact when timeout happens in the above cases, OS has no opportunity
> to issue the EC command set completely.
> For example: Read Command:
> a. Maybe OS has no opportunity to issue the accessed EC register
> address.
> b. Maybe OS has no opportunity to read the returned data from EC
> controller
> In such case it is not appropriate that it is still regarded as timeout.
>
> Maybe we should use the several phases to issue the EC transaction. And
> In every phase OS should check whether the EC status is what OS expected
> in the predefined time. If in some phase EC status is not what OS
> expected, it can be regarded as timeout.
> For example: EC Read transaction:
> a. Issuing the read command. (Write the 0x80 to EC Cmd port)
> b. Checking whether the input buffer is empty(IBF bit) and write
> the accessed address to EC Data port.
> c. Checking wheter the data is already(OBF bit) and read the
> returned data from EC controller
>
> Based on the above analysis IMO the flow of EC transaction is quite
> reasonable. Of course what should be improved is how to make it
> reasonable when waiting whether EC status is what OS expected.
>
> Please check whether the attached is reasonable.
>
> Of course in the attached patch there is no detect mechanism of EC GPE
> interrupt storm.
>
>
Regards,
Alex.
next prev parent reply other threads:[~2008-09-11 8:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-10 8:51 the errors about two EC patches Zhao Yakui
2008-09-10 12:37 ` Alexey Starikovskiy
2008-09-10 14:26 ` Rafael J. Wysocki
2008-09-10 21:55 ` Alexey Starikovskiy
2008-09-11 2:42 ` Zhao Yakui
2008-09-11 8:14 ` Alexey Starikovskiy [this message]
2008-09-11 9:16 ` Zhao Yakui
2008-09-17 9:02 ` the errors about the EC patch from Alexey 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=48C8D348.6050209@gmail.com \
--to=aystarik@gmail.com \
--cc=andi@firstfloor.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rui.zhang@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).