All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: Johan Hovold <johan@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Rob Herring <robh@kernel.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v2 00/19] Dynamically load/remove serdev devices via sysfs*
Date: Thu, 14 Jun 2018 17:20:40 +0200	[thread overview]
Message-ID: <CAPybu_1ps+tEr5W_uvMSeH4_gwbjgKHnz0MoSEJO=Ut0a4sx6Q@mail.gmail.com> (raw)
In-Reply-To: <20180614145531.GE32411@localhost>

Hi Johan,
On Thu, Jun 14, 2018 at 4:55 PM Johan Hovold <johan@kernel.org> wrote:
>
> On Thu, Jun 14, 2018 at 04:06:18PM +0200, Ricardo Ribalda Delgado wrote:
> > Hi Johan,
> > On Thu, Jun 14, 2018 at 3:34 PM Johan Hovold <johan@kernel.org> wrote:
>
> > > And there are more issues with the series which are less apparent than
> > > the rx (and partial tx) regression.
> >
> > Any hints about this? What else should I change on the series?
>
> There are implementation issues and there's the more fundamental
> question about whether your approach to this is the right one.
>
> Like Rob, I'm not sure we want to have the device topology depend on a
> kernel config symbol (serdev and your ttydev driver). We may need to
> explore Rob's sibling-device idea further.

From my point of view, if the user enables serdev, then everything has
to be a serdev, because serdev does not provide the same functionality
as a core tty device I had to implement, serdev-ttydev.c. Which is
nothing more than a wrapper.

It is very hacky, but allows replacing the core tty device with another serdev.

>
> I also want to make sure that this can be used for discoverable buses
> (e.g. the USB CEC device the I've used as an example before).
>

I have tried your patch:

https://github.com/ribalda/linux/commit/5cb30b4ce6477132a23492c674d8b3dc81ecff86

the only issue is that the serdev device sometimes explotes (OOPS)
when the usb is unplugged :S.

And that might be quite tricy to solve

> As for the current implementation there are both larger and smaller
> issues, like for example:
>
>  - the fact that your sysfs and lookup interface does not use any
>    locking whatsoever and thus is susceptible to races

I thought that sysfs access where serialised. If that is not the case
yes, we need a lock.

>
>  - your ttyport driver currently breaks the sysfs interface for all
>    serial (core) devices by ignoring the attribute groups

Yep, you are right, I screwed up that one :).

>
>  - the ttyport driver is arguably a hack with layering issues (which
>    admittedly may be hard to avoid given the retrofitting of serdev into
>    the tty layer)
>
> Again, I suggest you submit a subset of your series (aim at 10 patches
> or so) as an RFC which can be used as a basis for further discussion. No
> point in discussing every implementation detail if the underlying
> approach needs to be revised.

Will do. Give me some time to give it a hand of paint.

Thanks for time reviewing my little moster

>
> > > It's legacy as in old, and to be used for one-off hacks and such. But
> > > sure, that is also what this series aims at even if that doesn't mean
> > > you *have to* copy the interface.
> >
> > It is not only one-off hack. It is the ONLY way to use i2c devices
> > that are not enumerated.
> >
> > The same way as today we do not have any way of using serdev on non
> > enumerated devices.
>
> You're missing the point: none of that means you have to copy the
> interface.
>
> Johan



-- 
Ricardo Ribalda

WARNING: multiple messages have this Message-ID (diff)
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: Johan Hovold <johan@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Rob Herring <robh@kernel.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v2 00/19] Dynamically load/remove serdev devices via sysfs*
Date: Thu, 14 Jun 2018 17:20:40 +0200	[thread overview]
Message-ID: <CAPybu_1ps+tEr5W_uvMSeH4_gwbjgKHnz0MoSEJO=Ut0a4sx6Q@mail.gmail.com> (raw)
In-Reply-To: <20180614145531.GE32411@localhost>

Hi Johan,
On Thu, Jun 14, 2018 at 4:55 PM Johan Hovold <johan@kernel.org> wrote:
>
> On Thu, Jun 14, 2018 at 04:06:18PM +0200, Ricardo Ribalda Delgado wrote:
> > Hi Johan,
> > On Thu, Jun 14, 2018 at 3:34 PM Johan Hovold <johan@kernel.org> wrote:
>
> > > And there are more issues with the series which are less apparent than
> > > the rx (and partial tx) regression.
> >
> > Any hints about this? What else should I change on the series?
>
> There are implementation issues and there's the more fundamental
> question about whether your approach to this is the right one.
>
> Like Rob, I'm not sure we want to have the device topology depend on a
> kernel config symbol (serdev and your ttydev driver). We may need to
> explore Rob's sibling-device idea further.

>From my point of view, if the user enables serdev, then everything has
to be a serdev, because serdev does not provide the same functionality
as a core tty device I had to implement, serdev-ttydev.c. Which is
nothing more than a wrapper.

It is very hacky, but allows replacing the core tty device with another serdev.

>
> I also want to make sure that this can be used for discoverable buses
> (e.g. the USB CEC device the I've used as an example before).
>

I have tried your patch:

https://github.com/ribalda/linux/commit/5cb30b4ce6477132a23492c674d8b3dc81ecff86

the only issue is that the serdev device sometimes explotes (OOPS)
when the usb is unplugged :S.

And that might be quite tricy to solve

> As for the current implementation there are both larger and smaller
> issues, like for example:
>
>  - the fact that your sysfs and lookup interface does not use any
>    locking whatsoever and thus is susceptible to races

I thought that sysfs access where serialised. If that is not the case
yes, we need a lock.

>
>  - your ttyport driver currently breaks the sysfs interface for all
>    serial (core) devices by ignoring the attribute groups

Yep, you are right, I screwed up that one :).

>
>  - the ttyport driver is arguably a hack with layering issues (which
>    admittedly may be hard to avoid given the retrofitting of serdev into
>    the tty layer)
>
> Again, I suggest you submit a subset of your series (aim at 10 patches
> or so) as an RFC which can be used as a basis for further discussion. No
> point in discussing every implementation detail if the underlying
> approach needs to be revised.

Will do. Give me some time to give it a hand of paint.

Thanks for time reviewing my little moster

>
> > > It's legacy as in old, and to be used for one-off hacks and such. But
> > > sure, that is also what this series aims at even if that doesn't mean
> > > you *have to* copy the interface.
> >
> > It is not only one-off hack. It is the ONLY way to use i2c devices
> > that are not enumerated.
> >
> > The same way as today we do not have any way of using serdev on non
> > enumerated devices.
>
> You're missing the point: none of that means you have to copy the
> interface.
>
> Johan



-- 
Ricardo Ribalda

  reply	other threads:[~2018-06-14 15:21 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 11:52 [PATCH v2 00/19] Dynamically load/remove serdev devices via sysfs* Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 01/24] serdev: Add id_table to serdev_device_driver Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 02/24] Bluetooth: hci_bcm: Add serdev_id_table Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 03/24] Bluetooth: hci_ll: " Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 04/24] Bluetooth: hci_nokia: " Ricardo Ribalda Delgado
2018-06-11 12:56   ` Marcel Holtmann
2018-06-11 13:04     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 05/24] serdev: Introduce modalias field Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 06/24] serdev: Support bus matching with " Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 07/24] serdev: Allows dynamic creation of devices via sysfs Ricardo Ribalda Delgado
2018-06-11 12:39   ` Andy Shevchenko
2018-06-11 13:03     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 08/24] serdev: Provide modalias attribute for modalias devices Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 09/24] serdev: Provide modalias uevent " Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 10/24] file2alias: Support for serdev devices Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 11/24] Bluetooth: hci_bcm: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 12:59   ` Marcel Holtmann
2018-06-11 13:31     ` Andy Shevchenko
2018-06-11 13:31       ` Andy Shevchenko
2018-06-11 11:52 ` [PATCH v2 12/24] Bluetooth: hci_ll: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 13/24] Bluetooth: hci_nokia: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 14/24] mfd: rave-sp: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 13:14   ` Marcel Holtmann
2018-06-11 15:18     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 15/24] net: qualcomm: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 13:01   ` Marcel Holtmann
2018-06-11 15:09     ` Ricardo Ribalda Delgado
2018-06-11 15:28       ` Marcel Holtmann
2018-06-11 15:33         ` Ricardo Ribalda Delgado
2018-06-11 15:52           ` Marcel Holtmann
2018-06-11 16:21             ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 16/24] serdev: ttyport: Move serport structure to its own header Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 17/24] serdev: Mark controllers compatible with ttyport Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 18/24] serdev: ttydev: Serdev driver that creates an standard TTY port Ricardo Ribalda Delgado
2018-06-13  1:20   ` Rob Herring
2018-06-13  6:35     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 19/24] serdev: Instantiate a ttydev serdev if acpi and of fails Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 20/24] serdev: Make match_id accessible by drivers Ricardo Ribalda Delgado
2018-06-11 12:47   ` Andy Shevchenko
2018-06-11 13:10     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 21/24] rave-sp: Support for variants on modalias drivers Ricardo Ribalda Delgado
2018-06-11 12:54   ` Andy Shevchenko
2018-06-11 13:38     ` Marcel Holtmann
2018-06-11 15:21       ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 22/24] serdev: Replace IDA functions with IDR Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 23/24] serdev: get/put controller Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 24/24] serdev: serdev_controller_add_probed_device Ricardo Ribalda Delgado
2018-06-14 10:48 ` [PATCH v2 00/19] Dynamically load/remove serdev devices via sysfs* Johan Hovold
2018-06-14 11:06   ` Ricardo Ribalda Delgado
2018-06-14 11:06     ` Ricardo Ribalda Delgado
2018-06-14 13:33     ` Johan Hovold
2018-06-14 14:06       ` Ricardo Ribalda Delgado
2018-06-14 14:55         ` Johan Hovold
2018-06-14 15:20           ` Ricardo Ribalda Delgado [this message]
2018-06-14 15:20             ` Ricardo Ribalda Delgado
2018-06-14 15:47             ` Johan Hovold

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='CAPybu_1ps+tEr5W_uvMSeH4_gwbjgKHnz0MoSEJO=Ut0a4sx6Q@mail.gmail.com' \
    --to=ricardo.ribalda@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=robh@kernel.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.