All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] qmi: Optimize structure allocations
Date: Tue, 04 Apr 2017 10:37:41 -0500	[thread overview]
Message-ID: <44fd1c14-0d00-e7e7-751a-65f3df685e2d@gmail.com> (raw)
In-Reply-To: <9e6ec554-a321-88e6-661e-1c277bcb4bce@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

Hi Lukasz,

On 04/04/2017 02:53 AM, Lukasz Nowak wrote:
> Hi Denis,
>
> On 03/04/17 19:13, Denis Kenzior wrote:
>> struct discovery was allocated for every discovery procedure that was
>> kicked off, which itself allocated a structure.  This patch uses a
>> class/subclass concept to only allocate a single structure per discovery
>> procedure.
>
> The primary problem with this is that it still does not cover the shutdown

Yes I know.  But as I mentioned before, I don't think the shutdown logic 
should be lumped together with the various discovery procedures. 
Besides, the shutdown code was bizarre and not thought through properly.

I have now pushed this patch out as well as another commit that should 
fix the shutdown case.

> callback, which is 100% segfaulting for me.
> I am pretty sure that shutdown_reply() and gobi.c:shutdown_cb() is currently
> guaranteed to arrive after gobi_remove() calls g_free(data).

I actually don't see how.  We should only be calling qmi_device_shutdown 
if the modem is being turned off cleanly (e.g. via Powered=False).  In 
the case of a hot-unplug, we'd be going directly to the .remove method. 
Is your device jumping off the USB bus when .disable is being called by 
any chance?

If so, then you should consider fixing your driver or tell the 
manufacturer to fix their firmware ;)

Regards,
-Denis

  reply	other threads:[~2017-04-04 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 18:13 [PATCH] qmi: Optimize structure allocations Denis Kenzior
2017-04-04  5:46 ` Jonas Bonn
2017-04-04  7:53 ` Lukasz Nowak
2017-04-04 15:37   ` Denis Kenzior [this message]
2017-04-04 20:10     ` Lukasz Nowak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44fd1c14-0d00-e7e7-751a-65f3df685e2d@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.