Re: resource questions [initio driver fixes (?)]

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Fri May 19 2000 - 14:40:35 EDT

  • Next message: Jesse Pollard: "Re: Can O_SYNC be implemented by using fsync?"

    Thomas Graichen wrote:
    >
    > i posted this to the scsi list - but nobody answered - maybe
    > someone here can help me ...
    >
    > a few days ago i postet here (and before at the scsi list) patches
    > to get rid of the "Bad boy: i91u (at 0xc4a2b602) called us without a
    > dev_id!" thing in the current (2.3.99-pre) kernels which seems to
    > have gone into 2.2.16-pre3 ... now i have made the same with the
    > other initio driver (a100u2w) and while doing this i did not
    > really understand how the ressource allocation woks here ...
    >
    > in the _detect routine they both call request_irq and request_region
    > but they never free them on module unload (there is no _release
    > funtion calling fre_irq or release_region) ... is this done im-
    > plicitley by the module unload code ? (i don't think so and thus
    > added a simple _release function to them like in most other scsi
    > drivers)

    Your suspicions are correct -- there must be a corresponding free_irq
    for every request_irq, and a corresponding release_region for every
    request_region.

    > the question remaining now for me is: what is the proper way of
    > io and irq ressource management in linux now ? - does it somehow
    > map all the pci ressources by itself or why are the ports already
    > maped ? - can anyone please explain me a bit how all this would
    > look like in a "perfect" driver ? (or point me to some doc about
    > this ?)
      
    If the driver is PCI, you should look into using the pci_register_driver
    interface... (Documentation/pci.txt)

    > one more quite small question: is the 0x100 correct in the
    > request_region call (i would assume 0xff) of both initio
    > drivers ? (ini9100u.c and inia100.c) - i would assume
    > 0xff ...

    Hardware specific, look at 'lspci' output or similar.

            Jeff

    -- 
    Jeff Garzik              | Liberty is always dangerous, but
    Building 1024            | it is the safest thing we have.
    MandrakeSoft, Inc.       |      -- Harry Emerson Fosdick
    

    - 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 : Fri May 19 2000 - 14:42:51 EDT