All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/30] QMI rework
@ 2018-03-28 18:59 Jonas Bonn
  2018-03-28 18:59 ` [RFC PATCH 01/30] qmi: remove unused fields of service_send_data Jonas Bonn
                   ` (30 more replies)
  0 siblings, 31 replies; 47+ messages in thread
From: Jonas Bonn @ 2018-03-28 18:59 UTC (permalink / raw)
  To: ofono

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

A couple of weeks ago I submitted a patch to fix an issue with QMI
modems where the LTE modem in the pre-sim state would prevent requests
from being cancelled for services created and destroyed in the online
state.  These uncancelled requests would result in callbacks into
destroyed atoms and resulting segfaults.  The comment to that patch was
that the _correct_ fix would be to rework the way QMI handles service
sharing.

So, that said, this is my attempt at cleaning up service sharing in the
QMI core.  The jist of this is that we switch to a model that looks a
bit like file descriptions/descriptors in Linux.  The QMI services
obtain a service description which manages their info and the underlying
connection (client id) state that the 'shared services' actually share.
On top of this service description we provide service descriptors which
provide private state.  Requests and notifications are registered on the
service descriptor and their lifetimes are tied to it; when the service
descriptor is closed (released), the requests and notifications can be
cleaned up without affecting other users of the shared unlying
description.

The patch series is quite long because I tried to do this systematically
in order to make the changes reviewable.  It turned out to be quite
messy and it took me a couple of attempts to actually get a sane series
together.  Everything builds and runs for every patch in the series, BUT
I am aware that there are some details that are ignored along the way
that mean that some subtle behavioural changes may be introduced.  By
the end of the series, though, these issues should mostly have been
taken care of... so please just bear this in mind when reviewing.

Perhaps controversial so I'll state it upfront:  I've introduced the
list.h header from the Linux kernel source tree into the project.  I
really hope this won't be a showstopper... the licensing matches so
there are no legal issues, in any case.  I included the entire header
even though just a few macros are actually used... if size is an issue,
we can pare the file down to about a quarter of its size.

Finally, this is still RFC as I haven't finished reviewing this
completely, myself.  But I'd be happy to get any feedback now if someone
has a chance to look at this.

Thanks,
Jonas


Jonas Bonn (30):
  qmi: remove unused fields of service_send_data
  qmi: remove headroom parameter from req_alloc
  qmi: unify common request header setup
  qmi: request_alloc has no meaningful failure path
  qmi: push request_submit into request_alloc
  qmi: rename request_alloc to request_submit
  qmi: figure out request id without accessing header
  qmi: make qmi_service_send return result
  qmi: drop 'head' pointer from request_submit
  qmi: remove unused qmi_service_cancel
  qmi: remove unused qmi_service_unregister
  qmi: replace GQueues for requests
  qmi: assume version_list is up to date
  qmi: absorb service_create_discover into service_create
  qmi: drop discovery_queue
  qmi: make services always shared
  qmi: switch service_list to list_head type
  qmi: switch notify_list to list_head type
  qmi: drop unused struct field
  qmi: reference version_info from device in services
  qmi: make version_list private
  qmi: move client_id to qmi_version
  qmi: use standard endian macros
  qmi: convert version_list to struct list head
  qmi: move service device to service_info
  qmi: make all services unique instances backed by common description
  qmi: drop qmi_service_ref function
  qmi: rename qmi_service_create/unref to open/close
  qmi: pass service directly to request_submit
  qmi: add requests to service queue

 drivers/qmimodem/devinfo.c              |    6 +-
 drivers/qmimodem/gprs-context.c         |   14 +-
 drivers/qmimodem/gprs.c                 |   12 +-
 drivers/qmimodem/list.h                 |  736 ++++++++++++++++++++
 drivers/qmimodem/location-reporting.c   |    6 +-
 drivers/qmimodem/lte.c                  |    6 +-
 drivers/qmimodem/netmon.c               |    6 +-
 drivers/qmimodem/network-registration.c |    6 +-
 drivers/qmimodem/qmi.c                  | 1120 ++++++++++++-------------------
 drivers/qmimodem/qmi.h                  |   27 +-
 drivers/qmimodem/radio-settings.c       |   12 +-
 drivers/qmimodem/sim-legacy.c           |    6 +-
 drivers/qmimodem/sim.c                  |   12 +-
 drivers/qmimodem/sms.c                  |    6 +-
 drivers/qmimodem/ussd.c                 |    6 +-
 drivers/qmimodem/voicecall.c            |    6 +-
 plugins/gobi.c                          |   76 +--
 17 files changed, 1270 insertions(+), 793 deletions(-)
 create mode 100644 drivers/qmimodem/list.h

-- 
2.15.1


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

end of thread, other threads:[~2018-03-29 18:08 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-28 18:59 [RFC PATCH 00/30] QMI rework Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 01/30] qmi: remove unused fields of service_send_data Jonas Bonn
2018-03-28 19:53   ` Denis Kenzior
2018-03-28 21:09     ` Jonas Bonn
2018-03-28 21:18       ` Denis Kenzior
2018-03-29 10:46     ` Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 02/30] qmi: remove headroom parameter from req_alloc Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 03/30] qmi: unify common request header setup Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 04/30] qmi: request_alloc has no meaningful failure path Jonas Bonn
2018-03-28 19:59   ` Denis Kenzior
2018-03-28 20:51     ` Jonas Bonn
2018-03-28 21:12       ` Denis Kenzior
2018-03-28 18:59 ` [RFC PATCH 05/30] qmi: push request_submit into request_alloc Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 06/30] qmi: rename request_alloc to request_submit Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 07/30] qmi: figure out request id without accessing header Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 08/30] qmi: make qmi_service_send return result Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 09/30] qmi: drop 'head' pointer from request_submit Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 10/30] qmi: remove unused qmi_service_cancel Jonas Bonn
2018-03-28 21:07   ` Denis Kenzior
2018-03-28 18:59 ` [RFC PATCH 11/30] qmi: remove unused qmi_service_unregister Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 12/30] qmi: replace GQueues for requests Jonas Bonn
2018-03-28 20:16   ` Denis Kenzior
2018-03-28 21:06     ` Jonas Bonn
2018-03-28 21:24       ` Denis Kenzior
2018-03-28 18:59 ` [RFC PATCH 13/30] qmi: assume version_list is up to date Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 14/30] qmi: absorb service_create_discover into service_create Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 15/30] qmi: drop discovery_queue Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 16/30] qmi: make services always shared Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 17/30] qmi: switch service_list to list_head type Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 18/30] qmi: switch notify_list " Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 19/30] qmi: drop unused struct field Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 20/30] qmi: reference version_info from device in services Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 21/30] qmi: make version_list private Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 22/30] qmi: move client_id to qmi_version Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 23/30] qmi: use standard endian macros Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 24/30] qmi: convert version_list to struct list head Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 25/30] qmi: move service device to service_info Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 26/30] qmi: make all services unique instances backed by common description Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 27/30] qmi: drop qmi_service_ref function Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 28/30] qmi: rename qmi_service_create/unref to open/close Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 29/30] qmi: pass service directly to request_submit Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 30/30] qmi: add requests to service queue Jonas Bonn
2018-03-28 21:51 ` [RFC PATCH 00/30] QMI rework Denis Kenzior
2018-03-29 10:31   ` Jonas Bonn
2018-03-29 15:55     ` Denis Kenzior
2018-03-29 16:43       ` Jonas Bonn
2018-03-29 18:08         ` Denis Kenzior

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.