LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] How drivers notice a HW error?
Date: Thu, 27 Nov 2003 12:37:47 +0100	[thread overview]
Message-ID: <m3n0aim48k.fsf@averell.firstfloor.org> (raw)
In-Reply-To: <WpR1.1LG.3@gated-at.bofh.it> (Hidetoshi Seto's message of "Thu, 27 Nov 2003 09:40:11 +0100")

Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> writes:

> On some platform, for example IA64, the chipset detects an error caused by
> driver's operation such as I/O read, and reports it to kernel. Linux kernel
> analyzes the error and decides to kill the driver or reboot at worst.
> I want to convey the error information to the offending driver, and want to
> enable the driver to recover the failed operation.
>A
> So, just a plan, I think about a readb_check function that has checking ability
> enable it to return error value if error is occurred on read. Drivers could use
> readb_check instead of usual readb, and could diagnosis whether a retry be
> required or not, by the return value of readb_check.

I don't think that's an good portable API. On many architectures it is hard to 
associate an MCE with an specific instruction because the MCE 
happnes asynchronously. All the MCE handler gets is an address. Also
adding error checks to every read* would make the driver source quite 
unreadable.

Also I think most drivers would not attempt to specially handle every
access but just implement a generic handler that shutdowns the device
(otherwise it would be a testing nightmare). 

So better would be:

Add a callback to the pci_dev/device. When an error occurs in a mmio
area associated with a driver call that callback.

Add another function to register other memory areas (in case a driver
does mmio not visible in PCI config)  for error handling.

-Andi


       reply	other threads:[~2003-11-27 11:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <WpR1.1LG.3@gated-at.bofh.it>
2003-11-27 11:37 ` Andi Kleen [this message]
2003-11-27  8:28 Hidetoshi Seto

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=m3n0aim48k.fsf@averell.firstfloor.org \
    --to=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --subject='Re: [RFC] How drivers notice a HW error?' \
    /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

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).