public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Mike Isely <isely@pobox.com>
Cc: isely@isely.net, LMML <linux-media@vger.kernel.org>,
	Andy Walls <awalls@radix.net>, Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH 3/6] ir-kbd-i2c: Switch to the new-style device binding model
Date: Sun, 5 Apr 2009 16:18:03 +0200	[thread overview]
Message-ID: <20090405161803.70810455@hyperion.delvare> (raw)
In-Reply-To: <Pine.LNX.4.64.0904041807300.32720@cnc.isely.net>

Hi Mike,

Selected answers, as most points have already been discussed elsewhere
meanwhile...

On Sat, 4 Apr 2009 18:29:35 -0500 (CDT), Mike Isely wrote:
> On Sun, 5 Apr 2009, Jean Delvare wrote:
> > This is excellent news. As I said in the header comment of the patch,
> > avoiding probing when we know what the IR receiver is and at which
> > address it sits is the way to go. Please send me all the information
> > you have and I'll be happy to add a patch to the series, that skips
> > probing whenever possible. Or write that patch yourself if you prefer.
> 
> I have samples of most of the devices in question and can code proper 
> I2C addresses for each of those for each resident I2C client.  The 
> pvrusb2 driver's device attribute structure already has allowance for 
> specification of the correct I2C addresses to use for chips specific to 
> each device (part of the v4l2-subdev rework I recently did).  Right now 
> the driver has built in defaults, and if a particular model needs 
> something else, it can be overridden as part of the device's profile in 
> pvrusb2-devattr.c.

Good. Declaring the right IR receiver device based on board information
is clearly the way to go.

> > I didn't make any assumption, sorry. I simply copied the code from
> > ir-kbd-i2c. If my code does the wrong thing for some devices, that was
> > already the case before. And this will certainly be easier to fix after
> > my changes than before.
> 
> No, I think the point you are missing is that by moving that logic from 
> ir-kbd-i2c into each driver (e.g. pvrusb2) you are moving logic that 
> *might* be executed into a spot where it *will* be executed.

Yes, you are right.

> Remember 
> that the pvrusb2 driver did not autoload ir-kbd-i2c before this patch.  
> Before this change, a user could elect not to use ir-i2c-kbd simply by 
> not loading it.

Which was pretty fragile because another bridge driver could still have
loaded it.

> The pvrusb2 driver didn't request it, because the 
> intent all along there is that the user makes the choice by loading the 
> desired driver.

Which simply underlines how weird the current situation is... Forcing
the choice on the user is pretty bad from a usability perspective.

>  Now with this change, the pvrusb2 driver is going to 
> attempt to load ir-kbd-i2c where asked for or not.

Not exactly, only the device will be the instantiated, the drivers
won't be loaded, but the result is indeed the same: it's getting in
lirc_i2c's way if that's what the user wants to use.

>  And if not, the 
> resulting binding will prevent lirc_i2c from later on loading.  If the 
> user had been loading lirc_i2c previously, this will cause his/her usage 
> of IR to break.  No, it's not perfect, but it worked.  I'm all for 
> improving things, but not by removing an ability that people are using.

I have just added a disable_ir module parameter to work around this
issue. Set it to 1 and no "ir-kbd" device will be instantiated, letting
lirc_i2c do whatever it wants with the IR receiver device.

You might argue that this is still a regression because the user now
has to pass an extra parameter to get the same result as before, but
OTOH lirc_i2c will need changes pretty soon anyway, its behavior will
have to be changed and the users will notice. There's no way we can go
from the current weird situation to a sane situation without changing
the (unfortunate) user habits.

> (...)
> I really don't want to throw rocks here; it's always better to work out 
> the solution than simply block any changes at all.  I realize that 
> something has to be done here in order to keep ir-kbd-i2c viable as a 
> choice for users of the pvrusb2 driver.  To that end, how about this 
> strategy:
> 
> 1. Just drop the part of the patch for the pvrusb2 driver and get the 
> rest merged.  Yes, I realize that this will break use of ir-kbd-i2c in 
> cooperation with the pvrusb2 driver.

As Mauro already said: not acceptable. Breaking an in-tree driver
(ir-kbd-i2c) is worse than breaking an out-of-tree driver (lirc_i2c)
regardless of the respective number of users or usefulness of these
drivers.

> 2. Once ir-kbd-i2c has been updated, I will push another set of changes 
> into the pvrusb2 driver that will make it usable there.  Basically what 
> I have in mind is similar to what you tried but I'm going to integrate 
> it with the device profiles so that it can be appropriately loaded based 
> on device model, with the correct I2C address in each case.  And most 
> importantly, I will add a module option to enable/disable loading or 
> ir-kbd-i2c.  This will fix my main objection, since then it will still 
> allow lirc to be usable, for now...

This sounds like a good idea.

> 3. I'd like to fix the "abuse" you mention regarding I2C_HW_B_BT848.  
> I'm unclear on what the cleanest solution is there, but if you like to 
> (a) point at some documentation, (b) describe what I should do, or (c) 
> suggest a patch, I will work to deal with the problem.

Ideally these adapter IDs will no longer be needed within a couple
weeks, so it's probably better to leave this alone and just let it die
in silence.

-- 
Jean Delvare

  reply	other threads:[~2009-04-05 14:18 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-04 12:24 [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model Jean Delvare
2009-04-04 12:26 ` [PATCH 1/6] cx18: Fix the handling of i2c bus registration error Jean Delvare
2009-04-04 12:46   ` Andy Walls
2009-04-04 14:23     ` Jean Delvare
2009-04-04 22:30       ` Andy Walls
2009-04-07  9:31     ` Jean Delvare
2009-04-07 12:14       ` Andy Walls
2009-04-04 12:27 ` [PATCH 2/6] ir-kbd-i2c: Don't use i2c_client.name for our own needs Jean Delvare
2009-04-04 12:28 ` [PATCH 3/6] ir-kbd-i2c: Switch to the new-style device binding model Jean Delvare
2009-04-04 13:42   ` Andy Walls
2009-04-04 16:05     ` Mike Isely
2009-04-04 22:24       ` Andy Walls
2009-04-04 22:39         ` Andy Walls
2009-04-04 22:51     ` Jean Delvare
2009-04-05  1:50       ` Andy Walls
2009-04-05 13:08         ` Jean Delvare
2009-04-05 18:13           ` Andy Walls
2009-04-04 15:51   ` Mike Isely
2009-04-04 23:05     ` Jean Delvare
2009-04-04 23:29       ` Mike Isely
2009-04-05 14:18         ` Jean Delvare [this message]
2009-04-05 18:33           ` Mike Isely
2009-04-05 20:19             ` Andy Walls
2009-04-06  3:48               ` Trent Piepho
2009-04-06  3:53             ` pvrusb2 IR changes coming [was: [PATCH 3/6] ir-kbd-i2c: Switch to the new-style device binding model] Mike Isely
2009-04-05  5:46       ` [PATCH 3/6] ir-kbd-i2c: Switch to the new-style device binding model Hans Verkuil
2009-04-05  9:14         ` Mauro Carvalho Chehab
2009-04-05 12:44           ` Andy Walls
2009-04-06 13:08             ` Mauro Carvalho Chehab
2009-04-05 14:05         ` Jean Delvare
2009-04-05 19:35           ` Andy Walls
2009-04-06  9:04             ` Jean Delvare
2009-04-06 12:06               ` Andy Walls
2009-04-05 14:37         ` Janne Grunau
2009-04-05 16:37           ` Jean Delvare
2009-04-05 16:58             ` Janne Grunau
2009-04-05 17:39           ` Andy Walls
2009-04-05 18:31             ` Janne Grunau
2009-04-05 18:58               ` Andy Walls
2009-04-05 20:22                 ` Jean Delvare
2009-04-05 21:22                   ` hermann pitton
2009-04-05 22:00                     ` Andy Walls
2009-04-05 22:21                       ` hermann pitton
2009-04-06  1:49                       ` hermann pitton
2009-04-06  1:51                       ` Mauro Carvalho Chehab
2009-04-06  2:52                         ` Mike Isely
2009-04-06  3:26                           ` hermann pitton
2009-04-06  4:44                           ` Trent Piepho
2009-04-06 12:31                           ` Mauro Carvalho Chehab
2009-04-06  8:40                     ` Jean Delvare
2009-04-06 21:10                       ` hermann pitton
2009-04-07  9:27                         ` Jean Delvare
2009-04-08  3:02                           ` CityK
2009-04-08 11:31                             ` Mauro Carvalho Chehab
2009-04-12 17:37                               ` CityK
2009-04-12 23:35                                 ` hermann pitton
2009-04-09 19:15                         ` Oldrich Jedlicka
2009-04-17 13:42                           ` Jean Delvare
2009-04-06 13:13               ` Jarod Wilson
2009-04-05 18:48         ` Mike Isely
2009-04-06 10:54           ` Mauro Carvalho Chehab
2009-04-04 12:29 ` [PATCH 4/6] ir-kbd-i2c: Use initialization data Jean Delvare
2009-04-04 12:30 ` [PATCH 5/6] saa7134: Simplify handling of IR on MSI TV@nywhere Plus Jean Delvare
2009-04-04 12:31 ` [PATCH 6/6] saa7134: Simplify handling of IR on AVerMedia Cardbus Jean Delvare
2009-04-04 15:58 ` [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model Mike Isely
2009-04-05 10:01 ` Mauro Carvalho Chehab
2009-04-05 14:40   ` Jean Delvare
2009-04-05 18:40     ` Mike Isely
2009-04-06  0:22     ` Test results for ir-kbd-i2c.c changes (Re: [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model) Andy Walls
2009-04-06  8:54       ` Jean Delvare
2009-04-06 11:56         ` Andy Walls
2009-04-06 11:11           ` Jean Delvare
  -- strict thread matches above, loose matches on Subject: below --
2009-04-06  5:35 [PATCH 3/6] ir-kbd-i2c: Switch to the new-style device binding model Uri Shkolnik
2009-04-06 10:45 ` 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=20090405161803.70810455@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=awalls@radix.net \
    --cc=hverkuil@xs4all.nl \
    --cc=isely@isely.net \
    --cc=isely@pobox.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox