All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: "Mauro Carvalho Chehab" <mchehab@redhat.com>,
	"Christoph Bartelmus" <lirc@bartelmus.de>,
	linux-media@vger.kernel.org, "David Härdeman" <david@hardeman.nu>
Subject: Re: [PATCH 1/3] IR: add core lirc device interface
Date: Fri, 4 Jun 2010 16:17:33 -0400	[thread overview]
Message-ID: <20100604201733.GJ23375@redhat.com> (raw)
In-Reply-To: <AANLkTikr49GiEcENLb6n1shtCkWrDhMXoYh4VJ4IPtdQ@mail.gmail.com>

On Fri, Jun 04, 2010 at 02:57:04PM -0400, Jon Smirl wrote:
> On Fri, Jun 4, 2010 at 2:38 PM, Mauro Carvalho Chehab
> <mchehab@redhat.com> wrote:
> > Em 04-06-2010 12:51, Christoph Bartelmus escreveu:
> >> Hi Mauro,
> >>
> >> on 04 Jun 10 at 01:10, Mauro Carvalho Chehab wrote:
> >>> Em 03-06-2010 19:06, Jarod Wilson escreveu:
> >> [...]
> >>>> As for the compat bits... I actually pulled them out of the Fedora kernel
> >>>> and userspace for a while, and there were only a few people who really ran
> >>>> into issues with it, but I think if the new userspace and kernel are rolled
> >>>> out at the same time in a new distro release (i.e., Fedora 14, in our
> >>>> particular case), it should be mostly transparent to users.
> >>
> >>> For sure this will happen on all distros that follows upstream: they'll
> >>> update lirc to fulfill the minimal requirement at Documentation/Changes.
> >>>
> >>> The issue will appear only to people that manually compile kernel and lirc.
> >>> Those users are likely smart enough to upgrade to a newer lirc version if
> >>> they notice a trouble, and to check at the forums.
> >>
> >>>> Christoph
> >>>> wasn't a fan of the change, and actually asked me to revert it, so I'm
> >>>> cc'ing him here for further feedback, but I'm inclined to say that if this
> >>>> is the price we pay to get upstream, so be it.
> >>
> >>> I understand Christoph view, but I think that having to deal with compat
> >>> stuff forever is a high price to pay, as the impact of this change is
> >>> transitory and shouldn't be hard to deal with.
> >>
> >> I'm not against doing this change, but it has to be coordinated between
> >> drivers and user-space.
> >> Just changing lirc.h is not enough. You also have to change all user-space
> >> applications that use the affected ioctls to use the correct types.
> >> That's what Jarod did not address last time so I asked him to revert the
> >> change.
> >
> > For sure coordination between kernel and userspace is very important. I'm sure
> > that Jarod can help with this sync. Also, after having the changes implemented
> > on userspace, I expect one patch from you adding the minimal lirc requirement
> > at Documentation/Changes.
> 
> Keep the get_version() ioctl stable. The first thing user space would
> do it call the get_version() ioctl. If user space doesn't support the
> kernel version error out and print a message with the url of the
> project web site and tell the user to upgrade.
> 
> If you have the ability to upgrade your kernel you should also have
> the ability to upgrade user space too. I'm no fan of keeping backwards
> compatibility code around. It just becomes piles of clutter that
> nobody maintains. A reliable mechanism to determine version mismatch
> is all that is needed.

That we can definitely do.

> > From what I'm seeing, those are the current used ioctls:
> >
> > +#define LIRC_GET_FEATURES              _IOR('i', 0x00000000, unsigned long)
> > +#define LIRC_GET_LENGTH                _IOR('i', 0x0000000f, unsigned long)
> 
> Has this been set into stone yet? if not a 64b word would be more future proof.

Nope, not set in stone at all, nothing has been merged. A patch I was
carrying in Fedora changed all unsigned long to u64 and unsigned int to
u32, and my current ir wip tree has all u32, but I don't see a reason why
if we're going to make a change, it couldn't be to all u64, for as much
future-proofing as possible.

> Checking the existence of features might be better as sysfs
> attributes. You can have as many sysfs attributes as you want.

I suspect we won't run out of feature bits if we go u64 for the get
features ioctl, and sticking with the ioctl minimizes churn and
potential destabilization.

A perhaps-as-yet unstated desire here is to keep even the out-of-tree,
not-yet-ported-to-ir-core lirc drivers functional with a kernel-provided
lirc_dev. I do plan on porting as many lirc drivers as possible to
ir-core, but it'll take some time, and I don't have hardware for several
of the less common drivers. (For the record, the streamzap, i2c and
zilog drivers are next up for porting, probably zilog first).

> > +#define LIRC_GET_MIN_TIMEOUT           _IOR('i', 0x00000008, uint32_t)
> > +#define LIRC_GET_MAX_TIMEOUT           _IOR('i', 0x00000009, uint32_t)
> >
> > There is also a defined LIRC_GET_REC_MODE that just returns a mask of GET_FEATURES
> > bits, and a LIRC_SET_REC_MODE that do nothing.
> >
> > I can't comment about the other ioctls, as currently there's no code using them, but
> > it seems that some of them would be better implemented as ioctl, like the ones that
> > send carrier/burst, etc.
> 
> If the ioctls haven't been implemented, leave them as comments in the
> h file. Don't implement them with stubs. Stubs will set the parameters
> into stone and the parameters may be wrong.

I'd either go with commented out or omitted entirely. I think I like
commented out better than omitted entirely though.

> > One discussion that may be pertinent is if we should add ioctls for those controls,
> > or if it would be better to just add sysfs nodes for them.
> >
> > As all those ioctls are related to config stuff, IMO, using sysfs would be better, but
> > I haven't a closed opinion about that matter.
> 
> In general sysfs is used to set options that are static or only change
> infrequently.
> 
> If the parameter is set on every request, use an IOCTL.

For the tx case, parameters are set on every request. Not sure about
receive.

> > Btw, a lirc userspace that would work with both the out-of-tree and in-tree lirc-dev
> > can easily check for the proper sysfs nodes to know what version of the driver is being
> > used. It will need access sysfs anyway, to enable the lirc decoder.

Will it though? At least thus far, my thinking was to just always enable
the ir-lirc-codec bridge if it was built, because without explicit
configuration on the userspace side, its not going to result in anything
actually happening. Granted, there's a bit of unnecessary work that would
be done with a superfluous decoder enabled. Probably does make sense to
grow the necessary sysfs support in lirc userspace.

-- 
Jarod Wilson
jarod@redhat.com


  reply	other threads:[~2010-06-04 20:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 20:50 [PATCH 0/3] IR: add lirc support to ir-core Jarod Wilson
2010-06-01 20:51 ` [PATCH 1/3] IR: add core lirc device interface Jarod Wilson
2010-06-03  6:02   ` Mauro Carvalho Chehab
2010-06-03 22:06     ` Jarod Wilson
2010-06-04  4:10       ` Mauro Carvalho Chehab
2010-06-04 15:51         ` Christoph Bartelmus
2010-06-04 18:38           ` Mauro Carvalho Chehab
2010-06-04 18:57             ` Jon Smirl
2010-06-04 20:17               ` Jarod Wilson [this message]
2010-06-04 21:17                 ` Jarod Wilson
2010-06-04 23:16                   ` Jon Smirl
2010-06-05  2:45                     ` Jarod Wilson
2010-06-05 12:43                       ` Jarod Wilson
2010-06-05 17:43                     ` Stefan Richter
2010-06-05 17:24               ` Andy Walls
2010-06-05 17:52                 ` Jon Smirl
2010-06-07 18:44             ` David Härdeman
2010-06-07 19:45               ` Jarod Wilson
2010-06-08 17:40                 ` David Härdeman
2010-07-03  3:27             ` Jarod Wilson
2010-06-01 20:52 ` [PATCH 2/3] IR: add an empty lirc "protocol" keymap Jarod Wilson
2010-06-01 20:52 ` [PATCH 3/3] IR: add ir-core to lirc interface bridge driver Jarod Wilson
2010-07-03  4:05 ` [PATCH v2 0/3] IR: add lirc support to ir-core Jarod Wilson
2010-07-03  4:06   ` [PATCH 1/3] IR: add lirc device interface Jarod Wilson
2010-07-03  4:07   ` [PATCH v2 2/3] IR: add ir-core to lirc userspace decoder bridge driver Jarod Wilson
2010-07-03  4:08   ` [PATCH v2 3/3] IR: add empty lirc pseudo-keymap Jarod Wilson
2010-07-03  4:10   ` [PATCH 4/3] IR/lirc: add docbook info covering lirc device interface Jarod Wilson
2010-07-04 15:31     ` Mauro Carvalho Chehab

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=20100604201733.GJ23375@redhat.com \
    --to=jarod@redhat.com \
    --cc=david@hardeman.nu \
    --cc=jonsmirl@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=lirc@bartelmus.de \
    --cc=mchehab@redhat.com \
    /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.