Re: [RFClue] pci_get_device, new driver model

From: Alan Cox (alan_at_lxorguk.ukuu.org.uk)
Date: 10/07/05

  • Next message: Patrick McHardy: "Re: [PATCH 0/3] netfilter : 3 patches to boost ip_tables performance"
    To: William D Waddington <william.waddington@beezmo.com>
    Date:	Fri, 07 Oct 2005 18:28:31 +0100
    
    

    On Gwe, 2005-10-07 at 09:18 -0700, William D Waddington wrote:
    > If I convert to pci_get_device, it looks like subsequent calls in the
    > loop "put" the previously "gotten" device. I need the pci_dev struct
    > to persist for later use (DMA, etc). Do I take an additional bump to
    > the ref count for each board found before looping, and "put" each when
    > the driver is unloaded?

    If you are saving the pci device point then yes you should. If you are
    using pci_module_init() and the hotplug interface instead then it may
    not be neccessary.

    > If I just give in to the new driver model how/when do I associate
    > instance/minor numbers with boards found? Is it ever possible for
    > ordinary PCI boards to be (logically) removed and re-added w/out
    > removing the driver? If so, how to maintain association between
    > a particular board and minor number?

    Its up to you how you implement this. One requirement I suspect would be
    that the boards have unique serial numbers. Most drivers do not retain
    state if someone unplugs a board, moves it and plugs it back in. Instead
    they report the old device as "gone" and let user space sort it out

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


  • Next message: Patrick McHardy: "Re: [PATCH 0/3] netfilter : 3 patches to boost ip_tables performance"

    Relevant Pages

    • [PATCH] I2C: Resolve resource conflict between i2c-viapro and via686a
      ... Here comes the finalized version of our patch solving the PCI device ... resource conflict between the i2c-viapro bus driver and and the via686a ... This is legitimate since we only need it at init time to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Buggy PCI drivers - do not mark pci_device_id as discardable data
      ... > That's not a bug. ... The pci device id tables are scanned ... numbers are echoed to the "new_id" driver model entry for the driver. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] 2.6.0-test4 (#7) - correct name field breakage in zoran driver
      ... I suddenly noticed that 2.6.0-test4 seems to have removed the struct ... changed this to pci_name->pci_dev) in my driver, ... correct, except that it is the PCI device ID, and I'm not supposed to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] it8212.c, kernel 2.6.9-ac16
      ... because of the PCI device ID. ... ID to the driver and a small comment for people grepping the ... sources for the controller type. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] ipmi: bump-driver-version
      ... Lots of good changes to the driver lately that userspace will care ... Bump the version from 36.0 to 38.0 ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)