Memory leak in Solaris 2.8 kernel PCI-PCI bridge

Memory leak in Solaris 2.8 kernel PCI-PCI bridge

Post by Nigel Horn » Fri, 06 Jul 2001 21:04:45



ddi_getlongprop(9F) allocates the memory to hold the property returned to
the called. In sun4u/io/pci/pci_pci.c the DDI_CTLOPS_NREGS  and
DDI_CTLOPS_REGSIZE operations do not free the memory allocated in this
operation; see about line 361.

        *(int *)result = 0;
        if (ddi_getlongprop(DDI_DEV_T_NONE, rdip,
                DDI_PROP_DONTPASS | DDI_PROP_CANSLEEP, "reg",
                (caddr_t)&drv_regp, &reglen) != DDI_SUCCESS)
                return (DDI_FAILURE);

The fix is to add the following line before the
        return (DDI_SUCCESS);
statement:

        kmem_free(drv_regp, reglen);
        return(DDI_SUCCESS);

--
Nigel Horne. Arranger, Composer, Conductor, Typesetter.
Owner of the brass band group of the Internet. ICQ#20252325

 
 
 

Memory leak in Solaris 2.8 kernel PCI-PCI bridge

Post by Casper H.S. Dik - Network Security Engine » Fri, 06 Jul 2001 23:56:01


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>ddi_getlongprop(9F) allocates the memory to hold the property returned to
>the called. In sun4u/io/pci/pci_pci.c the DDI_CTLOPS_NREGS  and
>DDI_CTLOPS_REGSIZE operations do not free the memory allocated in this
>operation; see about line 361.

Looks like:

         4302431 pci_pci: memory leak in ppb_ctlops()

(fixed in S9)

Quote:>        *(int *)result = 0;
>        if (ddi_getlongprop(DDI_DEV_T_NONE, rdip,
>                DDI_PROP_DONTPASS | DDI_PROP_CANSLEEP, "reg",
>                (caddr_t)&drv_regp, &reglen) != DDI_SUCCESS)
>                return (DDI_FAILURE);
>The fix is to add the following line before the
>        return (DDI_SUCCESS);
>statement:
>        kmem_free(drv_regp, reglen);
>        return(DDI_SUCCESS);

That line is now present in the Solaris source tree.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

1. Forcing PCI-PCI bridge to have memory resources

I'm working with Linux version 2.4.18-xfs with hotswap support.

I'm trying to make a PCI-PCI bridge always have a minimum of 1MB of
memory address space allocated to it. I know that the BIOS we are
using always (correctly, by spec) sets a bridge with no devices behind
it to disable the memory window. It does this by setting the
MEM_LIMIT < MEM_BASE.

I've been going through the sources in drivers/pci, trying to figure
out how things are set up. At the time of the pci scan, the resources
are usually initialized (in bci_read_breidge_bases) by doing a read of
the bridge registers and setting the resource values appropropriately.

For the disabled bridges, the resources are copied from the parent
which in this case results in 0 being set in flags, start and end.

It looks like I will want to call pci_assign_resource(dev, 1); in
order to give it a memory window, but I'm not sure how to initialize
the resources so they are assigned correctly.

Our situation is similiar to what a hotswap CPCI system should encounter
when a hotswap device is inserted behind a previously empty PCI-PCI bridge.

Any help people can give would be greatly appreciated.

-Bret

--
Bret Indrelee                 QLogic Corporation

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. New Mp3 Site

3. 64bit solaris 2.8 memory name resolution memory leak?

4. Delete in Knode

5. S1692DL Tiger 2 unknown PCI bridge :unknown Host bridge :unknown PCI Device

6. .Sig file help!

7. Configuring PCI<-->PCI bridges behind Cardbus bridges

8. Question on SEAM, NIS and X-windows.

9. transparent pci-pci bridges fix

10. detection of a PCI network card on solaris 2.8

11. snapshot tool on solaris 2.8 with a pci bus has color problems

12. PCI to PCI Bridge

13. Solaris 2.8 & 2.9 kernel eating all my memory?