Bug 3333 - Problem reading /proc/acpi/battery/BAT0/info
Summary: Problem reading /proc/acpi/battery/BAT0/info
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Other (show other bugs)
Hardware: i386 Linux
: P2 low
Assignee: Len Brown
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-02 20:01 UTC by Shaohua
Modified: 2004-12-05 19:45 UTC (History)
2 users (show)

See Also:
Kernel Version: All 2.6 kernel
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
a sample patch (11.54 KB, patch)
2004-09-02 20:05 UTC, Shaohua
Details | Diff
migrate to seq file interface (18.31 KB, patch)
2004-09-19 19:20 UTC, Shaohua
Details | Diff

Description Shaohua 2004-09-02 20:01:32 UTC
>>Date: Sat, 28 Aug 2004 23:20:38 -0500
>>From: Joseph Pingenot <trelane@digitasaru.net>
>>To: linux-kernel@vger.kernel.org
>>Subject: Problem reading /proc/acpi/battery/BAT0/info
>>
>>
>>Hello.
>>
>>I'm writing some code to read battery status, but am having problems
>>reading
>>  /proc/acpi/battery/BAT0/info.
>>If I read that file, I can fill *one* and *only one* buffer before I get
>>  EOF (read returns 0 bytes read on the next buffer).  This is regardless
>>  of buffer length--I can use 1 or 3 or 10 bytes.  First read succeeds,
>>  second read fails.  Errno is 0.
>>With the *same code*, I can read the entire file without issue.
>>Any hints as to what's going on here?
>>Thanks!
>>
>>Puzzled,
>>-Joseph
Comment 1 Shaohua 2004-09-02 20:05:35 UTC
Created attachment 3625 [details]
a sample patch

Yi, I wrote a sample test case and test the attached patch, it seems ok, but
you should double check it. Other ACPI drivers possibly need migrate to
seq_interface as well, could you please provide a completed patch to fix all
such issues? Thanks, Shaohua.
Comment 2 Shaohua 2004-09-02 20:06:45 UTC
Comment on attachment 3625 [details]
a sample patch

The patch isn't completed. A final fix is needed.
Comment 3 Shaohua 2004-09-19 19:20:58 UTC
Created attachment 3679 [details]
migrate to seq file interface
Comment 4 Len Brown 2004-11-04 14:01:41 UTC
Joseph, does the patch above work for you?
Comment 5 Len Brown 2004-11-10 21:41:35 UTC
applied to 2.6.10 acpi-test tree
Comment 6 Len Brown 2004-12-05 19:45:44 UTC
shipped in 2.6.10-rc3 
closing. 

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