Re: PATCH: switch ide-proc to use the ide_key functionality

From: Alan Cox
Date: Tue Aug 17 2004 - 07:16:28 EST


On Tue, Aug 17, 2004 at 12:48:12PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > Which means my cunning plan from the previous mail doesn't actually work
> > unless we take ide_cfg_sem at the top of the proc code before setting_sem.
> > Also looking over it I need to send you the bits to take the sems in each
> > proc routine for that case.
>
> Yes, on the other hand we may try to do real refcounting.

refcounting doesn't solve the need for keys however due to the way procfs works
I've fixed the keys in my tree by taking the cfg/settings sem for all those
proc functions. I've also done it for the hwif level proc functions.

I'll have a look at what occurs if we make the ->key functions ref count
and add "put" functions. I think that can be made to work cleanly without
changing the rest of the code to refcounts at the same time. It'll still need
some locking because of the memset. We would still have keys but we'd
refcount usage off them as a starting point.

> more about it - i.e. what protects us from removing hwif while it is being
> configured by host driver?

A hwif is only removed by the owner. Thus for the PCI devices it is
protected by higher level serializing.

> I also can't see how sysfs can help with synchronizing writes to ISA/PCI
> config space with ongoing I/O?

The question is do we need it ?

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/