public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Linas Vepstas <linas@austin.ibm.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH/RFC] I/O-check interface for driver's error handling
Date: Tue, 01 Mar 2005 18:19:44 +0100	[thread overview]
Message-ID: <m1hdjvi8r3.fsf@muc.de> (raw)
In-Reply-To: <422428EC.3090905@jp.fujitsu.com> (Hidetoshi Seto's message of "Tue, 01 Mar 2005 17:33:48 +0900")

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

>
> int sample_read_with_iochk(struct pci_dev *dev, u32 *buf, int words)
> {
> 	unsigned long ofs = pci_resource_start(dev, 0) + DATA_OFFSET;
> 	int i;
>
> 	/* Create magical cookie on the stack */
> 	iocookie cookie;
>
> 	/* Critical section start */
> 	iochk_clear(&dev, &cookie);
> 	{
> 		/* Get the whole packet of data */
> 		for (i = 0; i < words; i++)
> 			*buf++ = ioread32(dev, ofs);
> 	}
> 	/* Critical section end. Did we have any trouble? */
> 	if ( iochk_read(&cookie) ) return -1;

Looks good for handling PCI-Express errors.

But what would the default handling be? It would be nice if there
was a simple way for a driver to say "just shut me down on an error"
without adding iochk_* to each function. Ideally this would be just
a standard callback that knows how to clean up the driver.

> +void iochk_clear(iocookie *cookie, struct pci_dev *dev)
> +{
> +       local_irq_save(*cookie);
> +}
> +
> +int iochk_read(iocookie *cookie)
> +{
> +       local_irq_restore(*cookie);
> +       return 0;
> +}

These should be inlined.

> +EXPORT_SYMBOL(iochk_init);

This doesn't need to be exported.

-Andi

  parent reply	other threads:[~2005-03-01 17:19 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
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 [this message]
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=m1hdjvi8r3.fsf@muc.de \
    --to=ak@muc.de \
    --cc=benh@kernel.crashing.org \
    --cc=linas@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --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