lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7780165.E3DXgdWAv1@pali-elitebook>
Date:	Fri, 25 Nov 2011 21:30:28 +0100
From:	Pali Rohár <pali.rohar@...il.com>
To:	Anton Vorontsov <cbouatmailru@...il.com>,
	linux-kernel@...r.kernel.org, Lars-Peter Clausen <lars@...afoo.de>,
	syed rafiuddin <rafiuddin.sayed@...il.com>,
	Rodolfo Giometti <giometti@...ux.it>,
	David Woodhouse <dwmw2@...radead.org>
Subject: Re: [PATCH 8/9] bq27x00: Add miscdevice for each battery with ioctl for reading registers

On Saturday 26 November 2011 00:10:11 you wrote:
> Hello Pali,

Hello,

> 
> On Tue, Nov 01, 2011 at 01:53:26PM +0100, Pali Rohár wrote:
> [...]
> 
> > >> Also on Nokia N900 is needed proprietary pogram BME for
> > >> battery charging which need to access to bq27200 registers. A
> > >> simple
> > >> LD_PRELOAD library which wrap i2c-dev access to this device
> > >> provided
> > >> by this patch is here:
> > >> https://code.launchpad.net/~pali/+junk/maemo_libbqioctl
> > > 
> > > Yes, but that really is a hack to work around the closed source
> > > nature of the BME program. I don't think we should put such hacks
> > > into the kernel.> 
> > Not only BME. All programs (and shell scripts and all which use
> > i2cget) need this interface, bacuse loading bq module will block
> > ic2-dev.
> 
> A million thanks for your work! Though, on this particular patch I
> agree with Lars-Peter here. The raw abi interface ought to exist only
> because proprietary nature of BME, which is not good.

This interface is not only for BME. Also some popular bq27200.sh script which 
print bq registers in human readable form needs this interface (with 
LD_PRELOAD library).

Link for that shell script http://enivax.net/jk/n900/bq.tar

> 
> IIRC, there is some shell script that makes it possible to charge
> N900 without BME?

bq27200 chip is for retrieving informations about battery. Chip bq24150 is 
responsible for charging battery. And yes, there is shell script which use 
this chip and can charge N900 battery (when BME is stopped).

Link: http://enivax.net/jk/n900/charge21.sh.txt

Problem is that this charge script need access to bq27200 registers too and 
the only way is again rmmod bq27x00_battery driver or using that my interface.

> Is it possible to convert it to some "n900 charger driver"?

And two hours ago I started writing kernel driver for chip bq2415x which will 
support charging battery. So I think yes!

So I think, one day I will delete BME from my Nokia N900.

> 
> I applied all patches from this series, except this one.
> 
> Thanks,

Ok, thanks!

I need some interface from userspace which can access to bq27200 registers. 
Problem is that if driver bq27x00_battery is loaded it is not possible to 
access to registers via i2c-tools. If this patch is not acceptable to 
upstream, what is solution to this problem? I think that it is not good idea 
to rmmod bq27x00_batery driver before executing scripts and then modprobing it 
again...

-- 
Pali Rohár
pali.rohar@...il.com
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ