From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Greg KH <greg@kroah.com>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
linux-ia64@vger.kernel.org, "Luck, Tony" <tony.luck@intel.com>,
Linas Vepstas <linas@austin.ibm.com>,
long <tlnguyen@snoqualmie.dp.intel.com>,
linux-pci@atrey.karlin.mff.cuni.cz,
linuxppc64-dev <linuxppc64-dev@ozlabs.org>
Subject: Re: [PATCH 2.6.13-rc1 01/10] IOCHK interface for I/O error handling/detecting
Date: Fri, 08 Jul 2005 21:22:17 +0900 [thread overview]
Message-ID: <42CE6FF9.4040505@jp.fujitsu.com> (raw)
In-Reply-To: <1120775239.31924.262.camel@gaston>
Benjamin Herrenschmidt wrote:
> On Thu, 2005-07-07 at 11:41 -0700, Greg KH wrote:
>>How about the issue of tying this into the other pci error reporting
>>infrastructure that is being worked on?
>
> The other infrastructure is for asynchronous reporting and recovery.
> We still need synchronous detection & reporting. So this is a bit
> different.
The interesting point is that it seems that both could use for reporting.
> However, it would be nice if Hidetoshi's work could be adapted a bit so
> that 1) naming is a bit more consistent with the other stuff (pcierr_*
> maybe) and 2) the error "token" is the same. The later is especially
> important if we start adding ways to query the error token to know what
> the error precisely was etc... There is no reason to have 2 different
> ways of representing error details.
The naming doesn't really matter. iochk_* is just my preference.
However it would be worth a try to move generic codes from iomap.*
(historical home) to pci.* and rename iochk_* to pcierr_*.
Well, I'd like to use this opportunity to sort out my thoughts...
Now iochk_read() returns a boolean value, whether there was a error
or not. Of course I agree that it would be more useful if it can return
the detail of the error.
A quick solution is return "token" instead of boolean value 1.
-extern int iochk_read(iocookie *cookie);
+extern token iochk_read(iocookie *cookie);
The token should be a pointer or a bitmask having proper flags, not 0.
So this still work:
if(iochk_read(cookie)) return -EIO;
and now this will also work:
if((token=iochk_read(cookie))!=0){
switch(severity(token)) {
...
}}
The error "token", tentatively named "pci_error_token" in document
you posted, is now temporarily defined in recent Linas's patch using
other alias:
enum pci_channel_state {
pci_channel_io_normal = 0, /* I/O channel is in normal state */
pci_channel_io_frozen = 1, /* I/O to channel is blocked */
pci_channel_io_perm_failure, /* pci card is dead */
};
Of course this will be not enough in near future.
I have already agree with what few month ago you said:
> The token should be an opaque type with accessors. You could define a
> pci_error_get_severity(token) to return the severity. The idea is to
> define accessors which return an error when the data requested isn't
> present in the error info. The actual content of the token is to be
> defined. I was thinking about a type plus a union. I was hoping Seto
> could provide something here ...
For example:
/* offsets */
enum {
pcierr_io_frozen = 0, /* I/O to channel is blocked */
pcierr_io_perm_failure, /* pci card is dead */
pcierr_severity_valid, /* 1:valid */
pcierr_severity, /* 0:non-fatal 1:fatal */
};
#define pcierr_perm_failure(token) \
test_bit(pcierr_io_perm_failure, token)
int pcierr_get_severity(token)
{
if(test_bit(pcierr_severity_valid, token)) {
return test_bit(pcierr_severity, token);
}
return -1;
}
Objections?
Are there any better place to put a group of codes like above than
include/linux/pci.h?
By the way, if token says frozen but not perm_failure, is it mean
"recovery processing now"? Are there any special state which
synchronous detection have to report?
Thanks,
H.Seto
prev parent reply other threads:[~2005-07-08 12:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-06 4:53 [PATCH 2.6.13-rc1 01/10] IOCHK interface for I/O error handling/detecting Hidetoshi Seto
2005-07-06 5:00 ` [PATCH 2.6.13-rc1 02/10] " Hidetoshi Seto
2005-07-06 5:04 ` [PATCH 2.6.13-rc1 03/10] " Hidetoshi Seto
2005-07-12 19:51 ` Linas Vepstas
2005-07-13 0:18 ` Benjamin Herrenschmidt
2005-07-13 22:42 ` Linas Vepstas
2005-07-13 1:33 ` Hidetoshi Seto
2005-07-06 5:07 ` [PATCH 2.6.13-rc1 04/10] " Hidetoshi Seto
2005-07-06 5:11 ` [PATCH 2.6.13-rc1 05/10] " Hidetoshi Seto
2005-07-18 19:21 ` Grant Grundler
2005-07-06 5:14 ` [PATCH 2.6.13-rc1 06/10] " Hidetoshi Seto
2005-07-06 5:17 ` [PATCH 2.6.13-rc1 07/10] " Hidetoshi Seto
2005-07-08 4:37 ` david mosberger
2005-07-08 5:44 ` Hidetoshi Seto
2005-07-12 21:14 ` Linas Vepstas
2005-07-13 2:00 ` Hidetoshi Seto
2005-07-06 5:18 ` [PATCH 2.6.13-rc1 08/10] " Hidetoshi Seto
2005-07-12 22:22 ` Linas Vepstas
2005-07-13 1:36 ` Hidetoshi Seto
2005-07-06 5:20 ` [PATCH 2.6.13-rc1 09/10] " Hidetoshi Seto
2005-07-06 5:21 ` [PATCH 2.6.13-rc1 10/10] " Hidetoshi Seto
2005-07-06 6:26 ` [PATCH 2.6.13-rc1 01/10] " YOSHIFUJI Hideaki / 吉藤英明
2005-07-06 10:15 ` Hidetoshi Seto
2005-07-07 18:41 ` Greg KH
2005-07-07 22:27 ` Benjamin Herrenschmidt
2005-07-08 12:22 ` Hidetoshi Seto [this message]
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=42CE6FF9.4040505@jp.fujitsu.com \
--to=seto.hidetoshi@jp.fujitsu.com \
--cc=benh@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=linas@austin.ibm.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=linuxppc64-dev@ozlabs.org \
--cc=tlnguyen@snoqualmie.dp.intel.com \
--cc=tony.luck@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