Re: 2.4 vs 2.6 versions of include/linux/ioport.h

From: Gene Heskett (gene.heskett_at_verizon.net)
Date: 08/06/03

  • Next message: Jeff Garzik: "Re: [PATCH] remove the release timer from all pcmcia net drivers"
    To: "Randy.Dunlap" <rddunlap@osdl.org>
    Date:	Tue, 5 Aug 2003 20:50:07 -0400
    
    
    

    On Tuesday 05 August 2003 10:57, Randy.Dunlap wrote:
    >On Tue, 5 Aug 2003 10:41:08 -0400 Gene Heskett
    <gene.heskett@verizon.net> wrote:
    >| Greetings;
    >|
    >| In the 2.4 includes, find this in ioport.h
    >| ----
    >| /* Compatibility cruft */
    >| #define check_region(start,n) __check_region(&ioport_resource,
    >| (start), (n))
    >| [snip]
    >| extern int __check_region(struct resource *, unsigned long,
    >| unsigned long);
    >| ----
    >| But in the 2.6 version, find this:
    >| ----
    >| /* Compatibility cruft */
    >| [snip]
    >| extern int __check_region(struct resource *, unsigned long,
    >| unsigned long);
    >| [snip]
    >| static inline int __deprecated check_region(unsigned long s,
    >| unsigned long n)
    >| {
    >| return __check_region(&ioport_resource, s, n);
    >| }
    >| ----
    >| First, the define itself is missing in the 2.6 version.
    >|
    >| Many drivers seem to use this call, and in that which I'm trying
    >| to build, the nforce and advansys modules use it. And while the
    >| modules seem to build, they do not run properly.
    >|
    >| I cannot run 2.6.x for extended tests because of the advansys
    >| breakage this causes. I also haven't even tried to run X because
    >| of the nforce error reported when its built, the same error as
    >| attacks the advansys code.
    >|
    >| Can I ask why this change was made, and is there a suitable
    >| replacement call available that these drivers could use instead of
    >| check_region(), as shown here in a snip from advansys.c?
    >| ----
    >| if (check_region(iop, ASC_IOADR_GAP) != 0) {
    >| ...
    >| if (check_region(iop_base, ASC_IOADR_GAP) != 0) {
    >| ...
    >|
    >| Hopeing for some hints here.
    >
    >check_region() was racy. Use request_region() instead.
    >
    > if (!request_region(iop, ASC_IOADR_GAP, "advansys")) {
    > ...
    >
    > if (!request_region(iop_base, ASC_IOADR, "advansys")) {
    > ...
    >
    >Of course, if successful, this assigns the region to the driver,
    >while check_region() didn't do this, so release_region() should be
    >used as needed to return the resources.

    Randy, look the attached patch over & see if its suitable. Its
    against the driver in the 2.6.0-test2 archive, and was done from
    within the drivers/scsi directory. Its working fine here, booting
    and accessing my tape drive just fine with the advansys driver
    incorporated into the kernel, or as a module. I didn't see any
    memory leakage, but my test method isn't definitive.

    If its suitable, pass it on to Linus. It will add one more card to
    the NOT broken by 2.6 list.

    -- 
    Cheers, Gene
    AMD K6-III@500mhz 320M
    Athlon1600XP@1400mhz  512M
    99.27% setiathome rank, not too shabby for a WV hillbilly
    Yahoo.com attornies please note, additions to this message
    by Gene Heskett are:
    Copyright 2003 by Maurice Eugene Heskett, all rights reserved.
    
    

    -
    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: Jeff Garzik: "Re: [PATCH] remove the release timer from all pcmcia net drivers"

    Relevant Pages

    • Re: Buslogic driver warnings
      ... >I noticed this when I started a test build for my workstation ... >Is anyone working on this driver these days? ... Copyright 2003 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.4 vs 2.6 versions of include/linux/ioport.h
      ... the nforce and advansys modules use it. ... about releasing it, if ever, for a kernel driver thats either there, ... Copyright 2003 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • SOLVED (kind of) (was Re: OT: inaccessable Advansys SCSI driver)
      ... option and sure enough the Advansys driver became available for selection. ... In the general case I would appreciate any tips on determining the kernel make ...
      (Debian-User)
    • Re: Advansys SCSI driver and 2.6.16
      ... The DMA conversion of the advansys driver is still ... Add a #warning to the driver and a comment ... Device Information for AdvanSys SCSI Host 0: ...
      (Linux-Kernel)
    • dummy help on io
      ... driver for a pci card with 3 each 82C55's on it, ... ports of chip 1, 0xnn10-1C for chip 2, etc, where the nn is the ... Copyright 2004 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)