public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Linas Vepstas <linas@austin.ibm.com>
To: Jesse Barnes <jbarnes@engr.sgi.com>
Cc: linux-pci@atrey.karlin.mff.cuni.cz,
	Linus Torvalds <torvalds@osdl.org>,
	Jeff Garzik <jgarzik@pobox.com>,
	Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	linux-ia64@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"Luck, Tony" <tony.luck@intel.com>
Subject: Re: [PATCH/RFC] I/O-check interface for driver's error handling
Date: Wed, 2 Mar 2005 13:46:40 -0600	[thread overview]
Message-ID: <20050302194640.GK1220@austin.ibm.com> (raw)
In-Reply-To: <200503021041.07090.jbarnes@engr.sgi.com>

On Wed, Mar 02, 2005 at 10:41:06AM -0800, Jesse Barnes was heard to remark:
> On Wednesday, March 2, 2005 10:22 am, Linas Vepstas wrote:
> > On Tue, Mar 01, 2005 at 08:49:45AM -0800, Linus Torvalds was heard to 
> remark:
> > > The new API is what _allows_ a driver to care. It doesn't handle DMA, but
> > > I think that's because nobody knows how to handle it (ie it's probably
> > > hw-dependent and all existign implementations would thus be
> > > driver-specific anyway).
> >
> > ?
> > We could add a call
> >
> > int pci_was_there_an_error_during_dma (struct pci_dev);
> >
> > right?  And it could return true/false, right?  I can certainly
> > do that today with ppc64.  I just can't tell you which dma triggered
> > the problem.
> 
> One issue with that is how to notify drivers that they need to make this call.  
> In may cases, DMA completion will be signalled by an interrupt, but if the 
> DMA failed, that interrupt may never happen, which means the call to 
> pci_unmap or the above function from the interrupt handler may never occur.

Hmm. Well, I notice that e100/e1000 has a heartbeat built into it, so
that if the card doesn't respond, it resets the card.  So this would 
be a natural place for them.  And I suspect that *all* scsi drivers
have timeouts; they initiate a cascade of reset sequences if they
don't get data back after X seconds.

I see nothing wrong with adding a requirement, something that says
"If a device driver wants to be pci-error aware, then yea-verily it 
must use a dma-timeout timer (say 15 seconds) and check for 
pci errors in the dma-timeout handler".

> Some I/O errors are by nature asynchronous and unpredictable, so I think we 
> need a separate thread and callback interface to deal with errors where the 
> beginning of the transaction and the end of the transaction occur in 
> different contexts, in addition to the PIO transaction interface already 
> proposed.

I don't know what the pci-express implementation is like, but the 
ppc64 implementation is *not* transactional, so I don't have that issue.

If some pci chipsets only report dma errors on a transactional basis,
then we need to modify pci_map_sg() and pci_map_single() and etc. to
take a cookie as well.  It would be up to the device driver to alloc
and retire cookies as the dma's complete (and make sure it can find
its cookies in any context).  Is this or something like this that 
is needed? 

--linas


  reply	other threads:[~2005-03-02 19:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-01  8:33 [PATCH/RFC] I/O-check interface for driver's error handling Hidetoshi Seto
2005-03-01 14:42 ` Matthew Wilcox
2005-03-01 19:27   ` Linas Vepstas
2005-03-01 19:37     ` Linus Torvalds
2005-03-02  6:13     ` Hidetoshi Seto
2005-03-02 19:20       ` Linas Vepstas
2005-03-04  2:03         ` Hidetoshi Seto
2005-03-04 16:46           ` Linas Vepstas
2005-03-01 16:37 ` Jeff Garzik
2005-03-01 16:49   ` Linus Torvalds
2005-03-01 16:59     ` Matthew Wilcox
2005-03-01 17:10       ` Jesse Barnes
2005-03-01 18:33         ` Linas Vepstas
2005-03-01 22:27           ` Benjamin Herrenschmidt
2005-03-02 20:02             ` Linas Vepstas
2005-03-02 22:46               ` Benjamin Herrenschmidt
2005-03-02 23:37                 ` Linas Vepstas
2005-03-01 22:23         ` Benjamin Herrenschmidt
2005-03-02  3:13         ` Hidetoshi Seto
2005-03-04 13:54         ` Pavel Machek
2005-03-04 17:50           ` Jesse Barnes
2005-03-04 22:37           ` Benjamin Herrenschmidt
2005-03-04 22:57             ` Pavel Machek
2005-03-04 23:03               ` Benjamin Herrenschmidt
2005-03-04 23:18                 ` Pavel Machek
2005-03-04 23:27                   ` Benjamin Herrenschmidt
2005-03-02  2:28       ` Hidetoshi Seto
2005-03-02 17:44         ` Linas Vepstas
2005-03-02 18:03           ` linux-os
2005-03-02 22:40             ` Benjamin Herrenschmidt
2005-03-04  2:21           ` Hidetoshi Seto
2005-03-01 22:20     ` Benjamin Herrenschmidt
2005-03-02 18:22     ` Linas Vepstas
2005-03-02 18:41       ` Jesse Barnes
2005-03-02 19:46         ` Linas Vepstas [this message]
2005-03-02 22:43         ` Benjamin Herrenschmidt
2005-03-02 22:41       ` Benjamin Herrenschmidt
2005-03-02 23:30         ` Linas Vepstas
2005-03-02 23:40           ` Jesse Barnes
2005-03-01 19:17   ` Linas Vepstas
2005-03-01 22:15   ` Benjamin Herrenschmidt
2005-03-01 17:19 ` Andi Kleen
2005-03-01 18:08   ` Linus Torvalds
2005-03-01 18:45     ` Andi Kleen
2005-03-01 18:59     ` Linas Vepstas
2005-03-01 22:26     ` Benjamin Herrenschmidt
2005-03-01 22:24   ` Benjamin Herrenschmidt
2005-03-04 12:40 ` 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=20050302194640.GK1220@austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=jbarnes@engr.sgi.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=tony.luck@intel.com \
    --cc=torvalds@osdl.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