Skip to contentSkip to conversation

v3.14-rc1+: new error: "nsc-ircc, Wrong chip version ff"

DISCUSSION Paul Bolle 3 participants 5 messages Mar 16, 2014 – Mar 18, 2014

Subsystems (3)
lore
Share & tools
lore

Paul Bolle

author
#0 lore raw

Rafael,

0) Ever since v3.14-rc1 I've noticed two new boot messages on an, outdated, ThinkPad X41:
nsc-ircc, Found chip at base=0x164e
nsc-ircc, Wrong chip version ff

The first is printed at info level, so I would have ignored it, but the second is printed at error level.

1) I've finally managed to bisect these messages to commit 202317a573b2 ("ACPI / scan: Add acpi_device objects for all device nodes in the namespace"). That's a rather big commit, so I've not even bothered to try to revert it on top on v3.14-rc6.

2) What should I do to make that error go away?

Paul Bolle

#1 lore raw
Quoted 9 lines · Paul Bolle

Rafael,

0) Ever since v3.14-rc1 I've noticed two new boot messages on an, outdated, ThinkPad X41:
nsc-ircc, Found chip at base=0x164e
nsc-ircc, Wrong chip version ff

The first is printed at info level, so I would have ignored it, but the second is printed at error level.

It looks like one driver thinks there's something interesting for it, but finds out that there really is nothing and gives up.

Quoted 4 lines

1) I've finally managed to bisect these messages to commit 202317a573b2 ("ACPI / scan: Add acpi_device objects for all device nodes in the namespace"). That's a rather big commit, so I've not even bothered to try to revert it on top on v3.14-rc6.

And there really is no reason to do that, because those messages don't indicate any real problems. :-)

Quoted 1 line

2) What should I do to make that error go away?

This is not an error, but a message whose log level is too high. It basically means "I found something, but I don't like it, so I'm not going to handle it."

The messages come from nsc_ircc_setup(), which is called from nsc_ircc_open(), which in turn is called by nsc_ircc_init(), which is a module intialization function of the nsc-ircc module.

I *guess* what happens is that the PNP layer creates a PNP device object for something it didn't create an object for previously, so I wonder if the patch below makes those messages go away?

Rafael

---
 drivers/acpi/internal.h    |    1 -
 drivers/pnp/pnpacpi/core.c |    5 ++++-
 include/acpi/acpi_bus.h    |    1 +
 3 files changed, 5 insertions(+), 2 deletions(-)
drivers/pnp/pnpacpi/core.c +4 -1
Index: linux-pm/drivers/pnp/pnpacpi/core.c
===================================================================
@@ -258,7 +258,10 @@ static int __init pnpacpi_add_device(str
 	if (!pnpid)
 		return 0;
 
-	if (is_exclusive_device(device) || !device->status.present)
+	if (acpi_bus_get_status(device))
+		return 0;
+
+	if (is_exclusive_device(device) || !acpi_device_is_present(device))
 		return 0;
 
 	dev = pnp_alloc_dev(&pnpacpi_protocol, num, pnpid);
drivers/acpi/internal.h +0 -1
Index: linux-pm/drivers/acpi/internal.h
===================================================================
@@ -97,7 +97,6 @@ void acpi_device_add_finalize(struct acp
 void acpi_free_pnp_ids(struct acpi_device_pnp *pnp);
 int acpi_bind_one(struct device *dev, struct acpi_device *adev);
 int acpi_unbind_one(struct device *dev);
-bool acpi_device_is_present(struct acpi_device *adev);
 bool acpi_device_is_battery(struct acpi_device *adev);
 
 /* --------------------------------------------------------------------------
include/acpi/acpi_bus.h +1 -0
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
@@ -422,6 +422,7 @@ void acpi_bus_put_acpi_device(struct acp
 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
 				       unsigned long long *sta);
 int acpi_bus_get_status(struct acpi_device *device);
+bool acpi_device_is_present(struct acpi_device *adev);
 
 int acpi_bus_set_power(acpi_handle handle, int state);
 const char *acpi_power_state_string(int state);
author
#2 lore raw

Rafael J. Wysocki schreef op ma 17-03-2014 om 01:02 [+0100]:

Quoted 5 lines · Paul Bolle
Quoted 1 line

2) What should I do to make that error go away?

This is not an error, but a message whose log level is too high. It basically means "I found something, but I don't like it, so I'm not going to handle it."

I see. It's actually quite old and is mentioned rather often on the web. I must have seen if before, when I actually used IrDA, but that's a few years ago now.

Quoted 7 lines

The messages come from nsc_ircc_setup(), which is called from nsc_ircc_open(), which in turn is called by nsc_ircc_init(), which is a module intialization function of the nsc-ircc module.

I *guess* what happens is that the PNP layer creates a PNP device object for something it didn't create an object for previously, so I wonder if the patch below makes those messages go away?

No, they're still there (with this patch applied on top of v3.14-rc7).

Quoted 27 lines
---
 drivers/acpi/internal.h    |    1 -
 drivers/pnp/pnpacpi/core.c |    5 ++++-
 include/acpi/acpi_bus.h    |    1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

Index: linux-pm/drivers/pnp/pnpacpi/core.c
===================================================================

drivers/pnp/pnpacpi/core.c +4 -1
@@ -258,7 +258,10 @@ static int __init pnpacpi_add_device(str
 	if (!pnpid)
 		return 0;
 
-	if (is_exclusive_device(device) || !device->status.present)
+	if (acpi_bus_get_status(device))
+		return 0;
+
+	if (is_exclusive_device(device) || !acpi_device_is_present(device))
 		return 0;
 
 	dev = pnp_alloc_dev(&pnpacpi_protocol, num, pnpid);

Index: linux-pm/drivers/acpi/internal.h
===================================================================

drivers/acpi/internal.h void acpi_device_add_finalize(struct acp · line 102

Quoted 7 lines
drivers/acpi/internal.h +0 -1
@@ -97,7 +97,6 @@ void acpi_device_add_finalize(struct acp
 void acpi_free_pnp_ids(struct acpi_device_pnp *pnp);
 int acpi_bind_one(struct device *dev, struct acpi_device *adev);
 int acpi_unbind_one(struct device *dev);
-bool acpi_device_is_present(struct acpi_device *adev);
 bool acpi_device_is_battery(struct acpi_device *adev);
 
 /* --------------------------------------------------------------------------

This hunk required a trivial context change in v3.14-rc7.

include/acpi/acpi_bus.h void acpi_bus_put_acpi_device(struct acp · line 428

Quoted 12 lines

Index: linux-pm/include/acpi/acpi_bus.h
===================================================================

include/acpi/acpi_bus.h +1 -0
@@ -422,6 +422,7 @@ void acpi_bus_put_acpi_device(struct acp
 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
 				       unsigned long long *sta);
 int acpi_bus_get_status(struct acpi_device *device);
+bool acpi_device_is_present(struct acpi_device *adev);
 
 int acpi_bus_set_power(acpi_handle handle, int state);
 const char *acpi_power_state_string(int state);

Thanks,

Paul Bolle

#3 lore raw
Quoted 10 lines · Paul Bolle

Rafael J. Wysocki schreef op ma 17-03-2014 om 01:02 [+0100]:

Quoted 5 lines · Paul Bolle
Quoted 1 line

2) What should I do to make that error go away?

This is not an error, but a message whose log level is too high. It basically means "I found something, but I don't like it, so I'm not going to handle it."

I see. It's actually quite old and is mentioned rather often on the web. I must have seen if before, when I actually used IrDA, but that's a few years ago now.

I see.

Quoted 9 lines
Quoted 7 lines

The messages come from nsc_ircc_setup(), which is called from nsc_ircc_open(), which in turn is called by nsc_ircc_init(), which is a module intialization function of the nsc-ircc module.

I *guess* what happens is that the PNP layer creates a PNP device object for something it didn't create an object for previously, so I wonder if the patch below makes those messages go away?

No, they're still there (with this patch applied on top of v3.14-rc7).

Beats me then.

I'm sure it can be tracked down, but I'm not sure it's worth spending the time.

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#4 lore raw
In reply to Paul Bolle
Quoted 6 lines · Paul Bolle

Rafael,

0) Ever since v3.14-rc1 I've noticed two new boot messages on an, outdated, ThinkPad X41:
nsc-ircc, Found chip at base=0x164e
nsc-ircc, Wrong chip version ff

Looks like that driver calls request_region for its "fir_base" IO ports too late.

Parts of nsc_ircc_open:

..

        IRDA_MESSAGE("%s, Found chip at base=0x%03x\n", driver_name,
                     info->cfg_base);

        if ((nsc_ircc_setup(info)) == -1)
                return -1;

=> fails while attempting to write to info->fir_base + 3 and then read
from info->fir_base + 0

..

        /* Initialize IO */
        self->io.cfg_base  = info->cfg_base;
        self->io.fir_base  = info->fir_base;
        self->io.irq       = info->irq;
        self->io.fir_ext   = CHIP_IO_EXTENT;
        self->io.dma       = info->dma;
        self->io.fifo_size = 32;
        
        /* Reserve the ioports that we need */
        ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name);

Maybe reorder this a bit, requesting the fir_base IO ports before calling nsc_ircc_setup? You'll have to reorder the error cleanups too.

Quoted 7 lines

The first is printed at info level, so I would have ignored it, but the second is printed at error level.

1) I've finally managed to bisect these messages to commit 202317a573b2 ("ACPI / scan: Add acpi_device objects for all device nodes in the namespace"). That's a rather big commit, so I've not even bothered to try to revert it on top on v3.14-rc6.

My guess is that you've got some pnp device now claiming the FIR IO ports. cat /proc/ioports may help you find out what to look for?

Bjørn