[ibm-acpi-devel] [ltp] Re: thinkpad-acpi release 0.17-20071002 uploaded to ibm-acpi.sf.net

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Thu, 4 Oct 2007 10:02:55 -0300


On Thu, 04 Oct 2007, Chris Hanson wrote:
> OK, I have a lot more information now.
> 
> Contrary to what I previously (thought? I) saw, the procfs interface now
> works OK after writing a bad value to sysfs.  So this is a sysfs-only
> problem, I think.
> 
> The bug is definitely in the backlight implementation, and not in
> thinkpad-acpi.  What is happening is that after I write "8\n" to the
> brightness attribute, those characters are never removed from the input
> buffer, and subsequent input is just appended, e.g. "8\n7\n".  So the
> string never parses after that.

Thanks.  That really narrows it down.  I will look into it.

> There's something odd about the sysfs protocol that I don't get.  If
> backlight_store_brightness is more-or-less a handler for write(), I
> don't see how it could return an error and _also_ cause the input to be
> discarded.  Where is the buffer contents discarded?

When a sysfs handler returns, it is supposed to tell how many chars it
consumed (and as you noticed, it better consume them all :) ), or to return
a negative value (error).  My handlers consume them all, and return EINVAL
if anything is left after the value (but they skip blanks, tabs and EOLs
before and after the value).  Maybe backlight does it differently.

> There are no other patches being applied for these tests.  The patch
> process is completely clean.  I'm running Debian unstable and I update
> daily, so everything is current as of a few hours ago.  gcc is version
> 4.2.1 (Debian 4.2.1-6).

Ok, I can test with that gcc.  I am compiling the kernel with Debian stable,
but it is no trouble at all to try with latest Debian unstable.

> I don't know if it matters, but thinkpad-acpi is compiled in rather than
> built as a module.  FYI I've attached my config file.

It might matter. I will check that.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh