linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Query about DSP_Close() function
@ 2009-03-30 16:52 Ameya Palande
  2009-03-30 18:16 ` Kanigeri, Hari
  0 siblings, 1 reply; 4+ messages in thread
From: Ameya Palande @ 2009-03-30 16:52 UTC (permalink / raw)
  To: Kanigeri, Hari; +Cc: Doyu Hiroshi, linux-omap

Hi Hari,

I am trying to make sure that when an application closes a file handle
all the resources are freed properly.

I saw that DEV_CleanupProcessState() is never called.
I am not able to locate its definition :(
Is this code intentionally disabled/removed for some reason?

Cheers,
Ameya.

/*
 *  ======== DSP_Close ========
 *      The Calling Process handle is passed to DEV_CleanupProcesState
 *      for cleaning up of any resources used by the application
 */
bool DSP_Close(u32 dwOpenContext)
{
        bool retVal = false;

        DBC_Require(dwOpenContext != 0);

        GT_0trace(curTrace, GT_ENTER, "Entering DSP_Close\n");

#ifndef RES_CLEANUP_DISABLE

        if (DSP_SUCCEEDED(DEV_CleanupProcessState((HANDLE) dwOpenContext))) {
                //GT_0trace(curTrace, GT_1CLASS, "DSP_Close Succeeded \r\n");
                pr_emerg("DSP_Close Succeeded\n");
                retVal = true;
        } else {
                //GT_0trace(curTrace, GT_7CLASS, "DSP_Close failed \r\n");
                pr_emerg("DSP_Close failed\n");
        }
#endif

        return retVal;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Query about DSP_Close() function
  2009-03-30 16:52 Query about DSP_Close() function Ameya Palande
@ 2009-03-30 18:16 ` Kanigeri, Hari
  2009-03-30 18:44   ` Felipe Contreras
  0 siblings, 1 reply; 4+ messages in thread
From: Kanigeri, Hari @ 2009-03-30 18:16 UTC (permalink / raw)
  To: Ameya Palande; +Cc: Doyu Hiroshi, linux-omap

Hi Ameya,

> I am trying to make sure that when an application closes a file handle
> all the resources are freed properly.
>

-- The current Bridge resource cleanup design is handling the resource cleanup in the Bridge open as opposed to do Bridge close.
The Bridge Open function loops through cleaning up the resources (that weren't freed by the User applications) of all the processes that were killed.

Thank you,
Best regards,
Hari

> -----Original Message-----
> From: Ameya Palande [mailto:ameya.palande@nokia.com]
> Sent: Monday, March 30, 2009 11:53 AM
> To: Kanigeri, Hari
> Cc: Doyu Hiroshi; linux-omap@vger.kernel.org
> Subject: Query about DSP_Close() function
> 
> Hi Hari,
> 
> I am trying to make sure that when an application closes a file handle
> all the resources are freed properly.
> 
> I saw that DEV_CleanupProcessState() is never called.
> I am not able to locate its definition :(
> Is this code intentionally disabled/removed for some reason?
> 
> Cheers,
> Ameya.
> 
> /*
>  *  ======== DSP_Close ========
>  *      The Calling Process handle is passed to DEV_CleanupProcesState
>  *      for cleaning up of any resources used by the application
>  */
> bool DSP_Close(u32 dwOpenContext)
> {
>         bool retVal = false;
> 
>         DBC_Require(dwOpenContext != 0);
> 
>         GT_0trace(curTrace, GT_ENTER, "Entering DSP_Close\n");
> 
> #ifndef RES_CLEANUP_DISABLE
> 
>         if (DSP_SUCCEEDED(DEV_CleanupProcessState((HANDLE)
> dwOpenContext))) {
>                 //GT_0trace(curTrace, GT_1CLASS, "DSP_Close Succeeded
> \r\n");
>                 pr_emerg("DSP_Close Succeeded\n");
>                 retVal = true;
>         } else {
>                 //GT_0trace(curTrace, GT_7CLASS, "DSP_Close failed \r\n");
>                 pr_emerg("DSP_Close failed\n");
>         }
> #endif
> 
>         return retVal;
> }


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Query about DSP_Close() function
  2009-03-30 18:16 ` Kanigeri, Hari
@ 2009-03-30 18:44   ` Felipe Contreras
  2009-03-30 18:55     ` Kanigeri, Hari
  0 siblings, 1 reply; 4+ messages in thread
From: Felipe Contreras @ 2009-03-30 18:44 UTC (permalink / raw)
  To: Kanigeri, Hari; +Cc: Ameya Palande, Doyu Hiroshi, linux-omap

On Mon, Mar 30, 2009 at 9:16 PM, Kanigeri, Hari <h-kanigeri2@ti.com> wrote:
> Hi Ameya,
>
>> I am trying to make sure that when an application closes a file handle
>> all the resources are freed properly.
>>
>
> -- The current Bridge resource cleanup design is handling the resource cleanup in the Bridge open as opposed to do Bridge close.
> The Bridge Open function loops through cleaning up the resources (that weren't freed by the User applications) of all the processes that were killed.

Why? Wouldn't it make more sense to cleanup at close, exactly when the
file descriptor is closed?

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Query about DSP_Close() function
  2009-03-30 18:44   ` Felipe Contreras
@ 2009-03-30 18:55     ` Kanigeri, Hari
  0 siblings, 0 replies; 4+ messages in thread
From: Kanigeri, Hari @ 2009-03-30 18:55 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: Ameya Palande, Doyu Hiroshi, linux-omap

Felipe,

> 
> Why? Wouldn't it make more sense to cleanup at close, exactly when the
> file descriptor is closed?
>

-- Yes, I agree with you that it does make more sense and looks cleaner to cleanup the resources at closeup and this is in our TODO list. This change requires some modification to the existing resource cleanup design though.

Thank you,
Best regards,
Hari

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-30 18:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-30 16:52 Query about DSP_Close() function Ameya Palande
2009-03-30 18:16 ` Kanigeri, Hari
2009-03-30 18:44   ` Felipe Contreras
2009-03-30 18:55     ` Kanigeri, Hari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).