Bug 3575 - (IRDA) PNP Support in nsc-ircc
Summary: (IRDA) PNP Support in nsc-ircc
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Network (show other bugs)
Hardware: i386 Linux
: P2 low
Assignee: Jeff Garzik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-15 18:08 UTC by Herbert Xu
Modified: 2007-11-02 08:45 UTC (History)
5 users (show)

See Also:
Kernel Version: 2.6.8.1
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
ThinkPad nsc-ircc PNP hack (5.03 KB, patch)
2006-02-17 08:52 UTC, Henrique de Moraes Holschuh
Details | Diff
[IRDA]: nsc-ircc: SuperIO chip IDs for IBM Thinkpads (712 bytes, patch)
2006-06-03 07:21 UTC, Henrique de Moraes Holschuh
Details | Diff

Description Herbert Xu 2004-10-15 18:08:38 UTC
Since some of the devices this driver supports are PNP-capable, this driver
should use the PNP subsystem so that hotplug can load it automatically.  See

http://bugzilla.ubuntu.com/show_bug.cgi?id=2129

for such a device.
Comment 1 Henrique de Moraes Holschuh 2006-02-17 08:50:57 UTC
See http://thinkwiki.org/wiki/How_to_make_use_of_IrDA for another group of users
(almost all IBM/Lenovo ThinkPad users) that need this.

I will attach the patch used by ThinkPad T43 (and some other model) owners to
support enough of PNP so as to use the device.  The patch is probably not what
is needed to really close this bug.
Comment 2 Henrique de Moraes Holschuh 2006-02-17 08:52:12 UTC
Created attachment 7385 [details]
ThinkPad nsc-ircc PNP hack

It is ugly, but might be useful.
Comment 3 Henrique de Moraes Holschuh 2006-02-17 08:55:44 UTC
Even with this patch, one problem persists:  8250_pnp insists in taking over the
device (since it looks like a 16550A).  nsc-ircc must have the chance to probe
the device first, before 8250_pnp does so if automatic configuration is to work.

This is also a big problem when using udev: 8250_pnp must be blacklisted and
manually loaded later, or it takes over the nsc-ircc port.  This is suboptimal,
no manual configuration should be required, if possible.
Comment 4 Henrique de Moraes Holschuh 2006-03-28 18:59:12 UTC
This issue has been addressed in 2.6.16-git15:

commit 0ed79c9b7dea5cd9a55589a495cf96f00cd037d9 
tree 8f4b0224cf320f5a16d354ce2a732e045de6d21a 
parent 3b99b93baba4cbf4fd3d206e65e81a070b21b560 
author Jean Tourrilhes <jt@hpl.hp.com> Mon, 20 Mar 2006 18:59:40 -0800 
committer David S. Miller <davem@davemloft.net> Mon, 20 Mar 2006 18:59:40 -0800 

    [IRDA]: nsc-ircc: support for yet another Thinkpad IrDA chipset
    
    This patch simply adds support for a variation of the nsc-ircc PC8739x
    chipset, found in some IBM Thinkpad laptops.
    
    Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
    Signed-off-by: Samuel Ortiz <samuel.ortiz@nokia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 3b99b93baba4cbf4fd3d206e65e81a070b21b560 
tree 7aa59a126614296b561b4d27bd92730a65fa188c 
parent ec4f32d550b94b4b66c9c7689bc09c6b32c8e82e 
author Dmitry Torokhov <dtor@mail.ru> Mon, 20 Mar 2006 18:59:05 -0800 
committer David S. Miller <davem@davemloft.net> Mon, 20 Mar 2006 18:59:05 -0800 

    [IRDA]: nsc-ircc: PM update
    
    This patch brings the nsc-ircc code to a more up to date power
    management scheme, following the current device model.
    
    Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
    Signed-off-by: Rudolf Marek <r.marek@sh.cvut.cz>
    Signed-off-by: Samuel Ortiz <samuel.ortiz@nokia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit ec4f32d550b94b4b66c9c7689bc09c6b32c8e82e 
tree b9eca8a87257ebf0585bc4817ec78c5cf98de47e 
parent 4277a083ecd2c8771058641132bcecea04ca6608 
author Jean Tourrilhes <jt@hpl.hp.com> Mon, 20 Mar 2006 18:54:03 -0800 
committer David S. Miller <davem@davemloft.net> Mon, 20 Mar 2006 18:54:03 -0800 

    [IRDA]: nsc-ircc: ISAPnP support
    
    This enables PnP support for the nsc-ircc chipset.
    Since we can't fetch the chipset cfg_base from the PnP layer, we just use
    the PnP information as one more hint when probing the chip.
    
    Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
    Signed-off-by: Samuel Ortiz <samuel.ortiz@nokia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>


I have not tested if these patches address all issues in my T43 yet, however.
Comment 5 Henrique de Moraes Holschuh 2006-06-02 11:51:24 UTC
Apparently, there are still problems with the updated driver targeted at 2.6.17
(at least when running on a 2.6.16.16+ tree -- I didn't test 2.6.17-rc5 proper):
 module removal is not working, it causes kernel oopses after a while (or when
doing rmmod nsc-ircc ; modprobe nsc-ircc).

There is at least one report of the module causing a sw-suspend2 suspend-to-disk
cycle to hang in the linux-thinkpad mailing-list, he was also using the
2.6.17-rc5 nsc-ircc with a 2.6.16 tree.

Also, the NS PC8394T chip in Thinkpads T43/R52 are not recognized by the module.
The datasheet is not publicly available, but probably the 39x will just work
with it.  Chip id is 0xf9.

I will send a better bug report when I have the opportunity to test this thing a
bit more.
Comment 6 Henrique de Moraes Holschuh 2006-06-03 07:21:15 UTC
Created attachment 8247 [details]
[IRDA]: nsc-ircc: SuperIO chip IDs for IBM Thinkpads

This patch renames the recently added "IBM" chip ID to something more
descriptive, and adds an ID for the NS PC8394T (TPM module with SuperIO) which
is found on Thinkpads T43, T43p and R52.

It is not known at this time if the PC8394T really works in FIR mode with this
patch, but since I need the patch to properly report nsc-ircc crashes, and
those crashes seem not to have anything to do with IrDA operation anyway, I am
attaching them.

Signed-off-by: Henrique de Moraes Holschuh <hmh@debian.org>
Comment 7 Henrique de Moraes Holschuh 2006-06-03 12:15:48 UTC
The problems I (and others) had with nsc-ircc as it is in 2.6.17-rc5 seem to be
traceable to it not being compatible with 2.6.16 (well, duh).  So, no bug here.

I will open a new bug and re-submit the patch I added to this bug report (id
8247) with the new chip-id for thinkpads *after* I get a report of working FIR
support with it.

IMHO, this bug can be closed as FIXED in 2.6.17.
Comment 8 Jon K 2006-07-24 00:52:51 UTC
I have an IBM T23 laptop with nsc-ircc. I have been using it in SIR mode for
years. With 2.6.17, SIR no longer works. (On the other hand, FIR works.)

This has been reported as Debian bug
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377539
Complete logs and strace traces can be found there.

Here's part of the dmesg log:

nsc_ircc_pnp_probe() : From PnP, found firbase 0x2F8 ; irq 3 ; dma 3.
nsc-ircc, chip->init
nsc-ircc, Found chip at base=0x02e
nsc-ircc, driver loaded (Dag Brattli)
nsc_ircc_open(), can't get iobase of 0x2f8
nsc-ircc, Found chip at base=0x02e
nsc-ircc, driver loaded (Dag Brattli)
nsc_ircc_open(), can't get iobase of 0x2f8
pnp: Device 00:14 disabled.

and when I run 'irattach /dev/ttyS1 -s', this gets written to
/var/log/messages:

Jul  9 21:58:52 localhost kernel: ttyS1: LSR safety check engaged!
Jul  9 21:58:52 localhost irattach: Stopping device /dev/ttyS1
Jul  9 21:58:52 localhost irattach: ioctl(SIOCGIFFLAGS): No such device
Jul  9 21:58:52 localhost irattach: exiting ...

To me, this looks like PNP shutting down the serial device I'm using for IRDA.
Comment 9 Jon K 2006-08-12 13:55:45 UTC
I shouldn't be making guesses about the failure mechanism. But I have built
nsc-ircc with the power management changes since 2.6.16, but without the PNP
changes, and run it with 2.6.18-rc4. SIR works with that version of the driver.
There is no doubt that PNP has introduced a regression.

The thing about SIR is that it's very easy to configure, which is why the howtos
advise users to try this mode first. It's much slower than FIR, but most of the
time, you are using IRDA with phones or PDA's which are slow anyway.
Comment 10 David Campbell 2007-07-12 19:54:21 UTC
I have a Clevo D870P notebook running Fedora Core 7 (2.6.21-1.3228.fc7), and as above I see:

nsc-ircc, chip->init
nsc-ircc, Found chip at base=0x02e
nsc-ircc, driver loaded (Dag Brattli)
nsc_ircc_open(), can't get iobase of 0x2f8
nsc-ircc, Found chip at base=0x02e
nsc-ircc, driver loaded (Dag Brattli)
nsc_ircc_open(), can't get iobase of 0x2f8
pnp: Device 00:0c disabled. 
Comment 11 Natalie Protasevich 2007-09-22 21:14:27 UTC
Can you please attach your boot log and lspci -vv.
Comment 12 Natalie Protasevich 2007-10-16 06:44:59 UTC
Herbert and others affected by this problem, has it been fixed in latest kernels (2.6.23+)?
Thanks.
Comment 13 Jeff Garzik 2007-11-02 08:45:59 UTC
The original bugs were fixed, please open a new bug if other bad behavior persists.

Note You need to log in before you can comment on or make changes to this bug.