Staging
v0.8.1
https://github.com/torvalds/linux
Revision 3e3183bab0257a6d02038658c53b491e1378612f authored by David Woodhouse on 05 August 2006, 19:15:19 UTC, committed by Linus Torvalds on 06 August 2006, 15:57:49 UTC
While busy-waiting for completion, check the hardware after scheduling;
don't schedule and then immediately check the _timeout_.  If the yield()
took a long time (as it does on my OLPC prototype board when it's busy),
we'd report a timeout even though the hardware was now ready.

This fixes it, and also switches the yield() for a cond_resched() because
we don't actually want to be _that_ nice about it.  I see nice
tightly-packed SMBus transactions now, rather than waiting for milliseconds
between successive phases.

Actually, we shouldn't be busy-waiting here at all.  We should be using
interrupts.  That's an exercise for another day though.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Cc: Christer Weinigel <wingel@nano-system.com>
Cc: <Jordan.Crouse@amd.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 225add6
Raw File
Tip revision: 3e3183bab0257a6d02038658c53b491e1378612f authored by David Woodhouse on 05 August 2006, 19:15:19 UTC
[PATCH] SCX200_ACB: eliminate spurious timeout errors
Tip revision: 3e3183b
kcopyd.h
/*
 * Copyright (C) 2001 Sistina Software
 *
 * This file is released under the GPL.
 *
 * Kcopyd provides a simple interface for copying an area of one
 * block-device to one or more other block-devices, with an asynchronous
 * completion notification.
 */

#ifndef DM_KCOPYD_H
#define DM_KCOPYD_H

#include "dm-io.h"

/* FIXME: make this configurable */
#define KCOPYD_MAX_REGIONS 8

#define KCOPYD_IGNORE_ERROR 1

/*
 * To use kcopyd you must first create a kcopyd client object.
 */
struct kcopyd_client;
int kcopyd_client_create(unsigned int num_pages, struct kcopyd_client **result);
void kcopyd_client_destroy(struct kcopyd_client *kc);

/*
 * Submit a copy job to kcopyd.  This is built on top of the
 * previous three fns.
 *
 * read_err is a boolean,
 * write_err is a bitset, with 1 bit for each destination region
 */
typedef void (*kcopyd_notify_fn)(int read_err,
				 unsigned int write_err, void *context);

int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from,
		unsigned int num_dests, struct io_region *dests,
		unsigned int flags, kcopyd_notify_fn fn, void *context);

#endif
back to top