Re: [RFC/context] add serdev interfaces to n_gsm

From: Pavel Machek
Date: Fri Feb 19 2021 - 17:07:11 EST


Hi!

> > > > > +config GNSS_MOTMDM
> > > > > + tristate "Motorola Modem TS 27.010 serdev GNSS receiver support"
> > > > > + depends on SERIAL_DEV_N_GSM
> > > >
> > > > You need to post this driver together with the serdev-ngsm driver. This
> > > > one cannot currently even be built without it, but we also need to see
> > > > the greater picture here.
> > >
> > > Well, here it is, for greater picture. But it is not ready. Current
> > > problem I have is gsm_serdev_register_tty_port(). The way I do
> > > platform device registration causes oops on module unload. Help with
> > > that would be welcome
> >
> > I would not mind comments on parent patch and some help here.
> >
> > Basically I tried to work around limitation in
> >
> > int serdev_device_add(struct serdev_device *serdev)
> > {
> > ...
> > /* Only a single slave device is currently supported. */
> > if (ctrl->serdev) {
> > ...
>
> I haven't really had time to look at the code yet, but trying to work
> around the single-client (slave) assumption seems wrong. You still have
> only one client per port even if the mux driver provides multiple
> (virtual) ports.

Correct.

But this limitation prevents me to registering multiple slave ports
with master serdev as their parent.

a) There's a physical line

b) Then there's serdev connected to it

c) Mux splits it to many virtual ports, but I still need something to
specify as their parent. serdev b) would be most suitable, but this
check prevents that.

> But judging from a quick look it appears that you are indeed registering
> one tty device per mux channel in gsm_serdev_register_tty_port() (as you
> should) so perhaps that's not the issue here.
>
> Do you have a stack trace from the oops? Are the client drivers holding
> the ports open while you unload the parent driver? That sounds like
> something which could go boom unless you pin the parent for example
> (serdev doesn't support hangups).
>
> Also, did you forget to post the gsm_tty_driver implementation? I don't
> see a definition of that symbol in the patch.

I'll gather the data in next debugging session.

But .... this way I have to provide fake platform device parent for
gsmtty1 and friends, and that just feels wrong.

Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek

Attachment: signature.asc
Description: Digital signature