[PATCH] serial-port: turn open_count assertion in mm_serial_port_close into simple return

Ben Chan benchan at chromium.org
Tue Mar 18 00:08:43 PDT 2014


On Mon, Jan 13, 2014 at 12:57 AM, Aleksander Morgado <
aleksander at aleksander.es> wrote:

> On 13/01/14 03:48, Ben Chan wrote:
> >> One option would be to have all the MMQueueData items be completed in an
> >> > idle, so that when they are really completed the port was already
> marked
> >> > as forced_close. I know it's probably too much just to handle this
> case,
> >> > but I also think it's important to warn about the incorrect open/close
> >> > counts; and the idle completion is actually a good idea as we avoid
> >> > chaining up normal close()s within the forced_close() call.
> >> >
> >> > I'd suggest to wait until we release 1.2, because after that I'd like
> to
> >> > merge the 'aleksander/ports-refactor' branch, and in that branch the
> >> > change needed to have the MMQueueData item (named CommandContext in
> the
> >> > branch) completed in idle is just a rename of
> >> > g_simple_async_result_complete() to
> >> > g_simple_async_result_complete_in_idle().
> >> >
> > complete_in_idle would work but that requires all contexts to be aware
> > of the semantics. Is the CommandContext going to replace all contexts
> > (i.e. one rename is enough)?
>
> It should be just one rename, yes. CommandContext (GSimpleAsyncResult
> based) will replace the MMQueueData struct internally, and as long as
> the GSimpleAsyncResult contains everything needed to propagate either
> the error or result string to upper layers, there shouldn't be any major
> other issue to handle.
>
>
I submitted a patch to make sure that the result is completed in idle as we
discussed before.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/modemmanager-devel/attachments/20140318/653e7bce/attachment.html>


More information about the ModemManager-devel mailing list