Re: PCI pci_{un}register_driver interface

From: Martin Mares (mj@suse.cz)
Date: Mon Jan 10 2000 - 15:08:29 EST


Hi Petr,

> I just updated my matroxfb to new pci_{un}register_driver interface

   I'm not sure how wise is updating drivers to the new interface now --
it's quite a moving target. Better wait several days before it stabilizes.

> and I'd like to ask few questions:
> (1) probe callback should return 0 on failure and !=0 on success.
> Is success value somewhat standardized for future compatibility?
> Why it is not 0=success, !=0 error with returning errno.h compatible
> values (-ENOMEM, -ENXIO, ...)?

   You're right, it would be better to use <0 for errors. I'll change that.

> (2) What should suspend & resume callback do? I did not find any
> use in current (2.3.39-pre2) kernel. Should I powerdown/powerup device
> on these callback or what should I do (Matroxes have ACPI power
> states 0 and 3 only)?

   Currently, these hooks are not used at all. They are intended to replace
the suspend/wakeup hooks of the original cardbus interface, but I still didn't
get to do it.

> (3a) Can probe & remove callback sleep or should I spawn init/cleanup
> thread when I need sleep (non-atomic kmalloc and so on? (but doing
> cleanup with thread is impossible in remove callback)

   Currently it cannot sleep as it's called from timer, but I hope this
will change soon.

> (3b) Should not you protect pci_for_each_dev() and pci_remove_device()
> with some mutex (or add an usecount to pci_dev)? Are there some
> other conditions (except that currently no-one calls
> pci_remove_device()) which make them mutually exclusive (for
> example holding kernel_lock when doing these pci calls...).

   Currently they should be protected by the global kernel lock.

                                Have a nice fortnight

-- 
Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/
"To be or not to be? It's simple: $2b or (not $2b) = $ff"

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



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:16 EST