<libv>
pthread_mutex_unlock and the world goes poof.
<mnemoc>
libv: :o
<andoma>
weird
<mnemoc>
TestModule: the "lcd" driver is misnamed
<mnemoc>
Alex1269_: pong
RITRedbeard has joined #arm-netbook
<TestModule>
ah
RITRedbeard_ has quit [Ping timeout: 245 seconds]
Kebianizao|work has joined #arm-netbook
TestModule has quit [Quit: Page closed]
aholler_ is now known as aholler
hipboi has joined #arm-netbook
pcat has quit [Ping timeout: 248 seconds]
ZaEarl has quit [Ping timeout: 255 seconds]
hg_5 has joined #arm-netbook
<Alex1269_>
Hi
<Alex1269_>
Are you still here ? :)
<mnemoc>
Alex1269_: who?
<Alex1269_>
mnemoc, I got libgpio working and gpio read/write too... But want to make exported gpio names looks like 'gpio111_ph21'. This require allocating array of strings. What the correct way to allocate/fill it for kernel driver ?
<mnemoc>
char name[32]; ?
<mnemoc>
just make the name part of the struct
<Alex1269_>
dynamic array of char name[32] for gpiochip structure ?
<mnemoc>
no
<mnemoc>
each gpio has it's struct, stick the name in there
<mnemoc>
if you show your code I can make a more specific suggestion
<mnemoc>
but don't extra dynamic allocations is wrong
<Alex1269_>
Just have no ide how to show you a core. Look at driver drivers/gpio/cs5535-gpio.c line 274. There is an array of strings passed into gpiochip structure 'names' member...
<Alex1269_>
In my code driver reads sysconfig gpio_para for gpios and can't use static naming...
<mnemoc>
you only need to allocate once. read the number of gpios in the fex and then allocate an array of struct, one struct for each gpio, including a name field
<Alex1269_>
So I have to alloc and fill it... But don't known how to make it correctly
<mnemoc>
the driver can construct it's state struct with whatever is needed
<mnemoc>
as long as it has the right sub structs inside
<mnemoc>
that way you only allocate once
<mnemoc>
making error handling much cleaner
<Alex1269_>
There is a gpiolib structure "gpiochip" which want its names member as an array of strings. I have to kzalloc array of char* and then allocate space for each string... and then fill it. Not very clean :(
<mnemoc>
make a superstructure above gpiochip and include the array of strings on it
<mnemoc>
then you allocate only the superstructure
focus has joined #arm-netbook
rellla has quit [Ping timeout: 260 seconds]
<mnemoc>
if you need to kzalloc twice, you are doing it wrong
rellla has joined #arm-netbook
<Alex1269_>
Got it. :) Thanks.
<mnemoc>
uhm... iirc that gpiochip should be only one for the whole driver
<mnemoc>
let me look at the code :p
<slapin>
mnemoc: NO! noooooooooo!
<slapin>
gpiochip should be per GPIO module
<mnemoc>
slapin: but in a gpio_para world there is only one module
<Alex1269_>
It should be one for logic group of gpios... For example one driver can add all a10 gpios as one gpiochip (with 32 gpios) for every bank.
<mnemoc>
then you are stepping out of script.bin
<slapin>
Alex1269_: yep
<mnemoc>
fine for 3.8+
<mnemoc>
not for 3.0/3.4
hansg has joined #arm-netbook
<slapin>
mnemoc: why?
<mnemoc>
but for 3.8+ we already have a proper driver
<Alex1269_>
Yes, so I should use only one gpiochip structure with all that names :(
<slapin>
don't forget about irqchip thing, too
<mnemoc>
slapin: he is trying to add "decent" gpio support for the legacy kernel
<mnemoc>
not to reimplement the world
<mnemoc>
because for future it's already implemented properly
<slapin>
mnemoc: and what is wrong about multiple gpio chips?
<mnemoc>
slapin: it doesn't fit in the current implementation of the core
<Alex1269_>
1+n kzalloc... or alloc 32*n+n*sizeof(int)
<mnemoc>
slapin: he has a lost of gpio fex entries, bank is not relevant
<mnemoc>
s/lost/list/
<ibot>
mnemoc meant: slapin: he has a list of gpio fex entries, bank is not relevant
<slapin>
mnemoc: this doesn't change actual gpio numbers, nothing really changes
<slapin>
mnemoc: nothing needs to care about actual gpio chips, so nothing prevents from using multiple, just try ind see
<mnemoc>
that imho should be faked as a single gpio chip
<mnemoc>
with 3 gpios
<mnemoc>
that's all
<slapin>
mnemoc: eeeeewwwww....
<mnemoc>
why do we need extra complexity in something that only needs to solve a problem on a legacy kernel?
<slapin>
green LED is flashing again, bad, bad morning it will be...
<mnemoc>
:(
<slapin>
mnemoc: I wonder why it is needed at all (gpios from userspace)
<Alex1269_>
mnemoc, I did this and it works just fine... But gpio names in /dev/class/gpio looks like gpio254, gpio 255... etc...
<mnemoc>
slapin: for people using sunxi boards with pins for home automation
* slapin
is not one to talk - his last product uses devmem to configure fremebuffer
<mnemoc>
who need something to use today, and not in 2 years
<mnemoc>
/dev/mem needs root :)
<mnemoc>
sunxi-tools's pio can also play via /dev/mem now
<mnemoc>
but it's not something you want everyone playing with
<Alex1269_>
To make them readable I should create names array and pass it with gpiochip structure for gpiolib.
<slapin>
mnemoc: strange, why this is in fex file at all...
<mnemoc>
there is a gpio driver already
<mnemoc>
it just doesn't use the right class, and works only for outputs
<mnemoc>
(and it's called ugly_gpio :p)
<slapin>
wicked, damn wicked
* slapin
hates avery bit of it
<slapin>
s/every/every/
<slapin>
damn
<slapin>
ant this too
<slapin>
damn
<mnemoc>
:)
* slapin
gets back to $work$
<Alex1269_>
What if I make one kzalloc(32*n+n*sizeof(int)) where n is a number of gpios and than prepare pointers at first n*sizeof(int) bytes ? Is this better than 1+n kzalloc calls ?
<mnemoc>
one struct for each gpio, with a char name[32] on it was the initial suggestion....
<mnemoc>
unless gpiolib wants a char []
<slapin>
mnemoc: and what is wrong with that? you can alloc the array of these structs N*sizeof(...)
<mnemoc>
slapin: i don't know what's wrong with it. that's what I suggested and somehow Alex1269 can't use
<slapin>
mnemoc: gpiolib in itself doesn't care much for names, only for numbers.
<mnemoc>
i did fall in the trap of refactoring the whole script.bin based world to coexist with pinctrl
<mnemoc>
i just don't want Alex1269_ to fall in the same
<mnemoc>
because it's worthless
<mnemoc>
real drivers need refactoring, the core doesn't. it's rewritten
<mnemoc>
once the drivers are decent they can be ported to dt, not rewritten
<mnemoc>
imho
<mnemoc>
:)
<Alex1269_>
slapin, gpiolib can use provided names. Is there any way to get sprunge as ubuntu package ? I installed today a compile server at work (kernel compiled from scratch in 3minutes)
<mnemoc>
one awesome things about sprunge is that you can now append ?c and see it highlightened
<Alex1269_>
wow...
ganbold has quit [Remote host closed the connection]
<mnemoc>
so your problem is sunxi_gpio_chip.names = pnames;
<mnemoc>
i see now
<Alex1269_>
:)
<mnemoc>
yes, you are screwed. you'll need to allocate twice :<
<mnemoc>
and iterate populating
<Alex1269_>
The problem is to create it using one kzalloc :)
<mnemoc>
kzalloc(num*name_size*sizeof(char))
<mnemoc>
sucks
ganbold has joined #arm-netbook
<mnemoc>
be sure to free before err = -ENOMEM;
<mnemoc>
one of those can be properly allocated
<Alex1269_>
This is possible but too complicated code :( kzalloc(name_size*num+num*sizeof(char*)) and then fill it
<slapin>
I don't see why 2 kzallocs is needed
<slapin>
are needed
* slapin
needs a gallon of gasoline...
<slapin>
or gallon of cofee
* slapin
barely can type anything
* slapin
need an excuse for today, non-working Internet was yesterday, any ideas?
<Alex1269_>
not 2... but 2+gpio_num --> one for gpio_struct to keep handlers from sys_config routines, one for variable array of pointers and others to allocate 32 bytes space for strings...
<slapin>
Alex1269_: you can alloc everything in one go if using structs (hint: alignment)
<mnemoc>
slapin: but he has a .names that needs char *[32]
<Alex1269_>
How ? Two variable arrays. One for use with china commented code from sys_config.c and another for gpiolib
<slapin>
mnemoc: I still don't see a problem
<slapin>
you know all amounts at the time of allocation
<slapin>
so you can allocate in one go
<mnemoc>
kzalloc(N*sizeof(T1)+N*sizeof(T2)) is awfull
<mnemoc>
btw, is that kind of stuff accepted upstream? (i know this particular code won't go up there)
pcat has joined #arm-netbook
<hansg>
From my experience for upstream (and for me personally too) readability trumps saving a single kalloc, unless that is in a hotpath.
<hansg>
Basically, esp when the code is device init only, so no hot path, going from n -> 1 alloc is good, going from 2 -> 1 alloc, but requiring all kind of ugliness to do so is bad.
<mnemoc>
that's what I though
<Alex1269_>
So I'll do 2 kzalloc and second will be kzalloc(sizeof(char*)*n+n*32) :)
<Alex1269_>
I planed to write irq code today but stick with this :)
<mnemoc>
Alex1269_: please be sure to test for kfree before -ENOMEM
<mnemoc>
one of the two allocs might have succeed
<Alex1269_>
Ok
<mnemoc>
does .names need to be an array of pointers instead of an array of char[K] ??? yuck
<mnemoc>
but if it's an array of pointers you might prefer to point to a field in the data struct
<mnemoc>
so only N*sizeof(char*)
<hansg>
mnemoc, not sure what you;re talking about, but kfree is NULL pointer tolerant, so what you usually do with multiple allocs is: 1) initialize all pointers to NULL on declaration, 2) "goto error;" on alloc fail of any pointer 3) kfree() all pointers unconditionally in error handling block, since the kfree on the NULL ptrs will be a nop
<hansg>
mnemoc, ah I see, so what most kernel driver code does in cases like this is have 2 exit labels, one for the enomem case, one for the rest, and unconditionally kfree both pointers in the error exit path
<Alex1269_>
this is from struct gpio_chip (include/asm-generic/gpio.h) --> const char *const *names;
<libv>
mali kernel interface changed, and one of the ioctl structs had different sizes and i was not taking this into account
<mnemoc>
libv: oh
<mnemoc>
libv: the 3rd buffer thing?
<libv>
the threading issue for which i pastebinned something earlier
<mnemoc>
i mean the mali interface change that triggered it
<libv>
no, the wait_for_notification ioctl struct is 8 bytes larger than the one i was using which originally came off r2p1
<mnemoc>
i see
<andoma>
isn't the size of the transfered data part of the ioctl id?
<hansg>
andoma, one sane interfaces yes, on the sunxi disp ioctls no :)
<andoma>
ah
<hansg>
AFAIk they just use numbers rather then the IOCTL macros which embed things like data exchange direction and size ..
<andoma>
why am I not surprised :(
<mnemoc>
:)
<libv>
this was the mali interface, so i guess some work is in order there still to flag that there is a difference in size
<libv>
hansg: yes, disp is unbelievably stupid
<libv>
"ioctl nr 2 does not work on linux, why???" is one of the comments allwinner people made
<andoma>
yeah i like that one :)
<mnemoc>
:D
<libv>
disp is broken, we should slowly kill it by dissection
SouL_ has joined #arm-netbook
nemik_ has joined #arm-netbook
SouL_ has left #arm-netbook [#arm-netbook]
hark has joined #arm-netbook
nemik has quit [Ping timeout: 248 seconds]
alcides has joined #arm-netbook
alcides has quit [Quit: man woman || $> Segmentation fault (core dumped)]
ganbold_ has joined #arm-netbook
Alex1269_ has quit [Ping timeout: 245 seconds]
SouL_ has joined #arm-netbook
popolon has joined #arm-netbook
rz2k has joined #arm-netbook
<slapin>
is there any sane USB hub out there? the one which doesn't produce EMI on all ports upon device insert/remove? and which handles power on/off commands properly?
<slapin>
I'd like to have power isolation and control (to switch ports off) then I'd buy 100-300 of them...
hark has quit [Read error: Connection reset by peer]
datagutt has joined #arm-netbook
<mnemoc>
the hubs with power switch I've seen are very crappy
Jonathan_Eyre has joined #arm-netbook
<slapin>
mnemoc: I don't want switches, I want controllable (on/off) isolated dc-dcs (5V-5V)
<slapin>
hub chips support such power control, but nobody cares actually implementing such functionality in devices
<slapin>
or single isolated dc-dc and well-made MOSFET-based switches, controlled from hub chip
<slapin>
but per port isolation is far better
<slapin>
signal isolation is not needed, only power isolation
<slapin>
I can make such hub myself, but it will consume too much time to develop, I'd prefer stock solution.
<slapin>
as I have more things I'd use my time on
<mnemoc>
slapin: if you have code for the on/off I can test it on my orico
herdingcat has joined #arm-netbook
<herdingcat>
Hi all, I purchased a cubieboard and when I compiled the kernel and using Fedora 17 rootfs, after booting the system was stuck here: http://fpaste.org/naws/
<herdingcat>
Can anyone tell me how to debug the problem? I didn't see any error message in kernel stage.
<hansg>
herdingcat, true (gnu-tar & xattr), I thought that was the reason why the official Fedora images no longer include a rootfs tarbal. Probably has something todo with the new composing process then (which is now done through kickstart to closer resemble other archs Fedora supports)
<herdingcat>
hansg, I just feel it's too hard to debug the error on cubieboard. System just hangs w/o any messages
<ganbold_>
herdingcat: I'm doing that more than month, so you are not alone :)
tinti has joined #arm-netbook
<herdingcat>
ganbold, what distro did you use?
<ganbold_>
it is not linux, it is FreeBSD
<herdingcat>
ganbold, I tried the commits, does not work
<herdingcat>
ganbold, I'm just curious how to know the root cause...
<herdingcat>
ganbold, too difficult.
<ganbold_>
better to check step by step
<ganbold_>
rootfs is easy
<herdingcat>
ganbold, I don't think it's a rootfs issue. I used another uImage still stucks..
<ganbold_>
I know
<ganbold_>
it is not rootfs issue
<herdingcat>
ganbold, no obvious error there...
<ganbold_>
better try working kernel or uImage
<ganbold_>
then step by step try to update it
<ganbold_>
one rootfs suffice in that case
<slapin>
mnemoc: ?
hg_5 has quit [Ping timeout: 248 seconds]
<mnemoc>
slapin: it comes "auto". and "off" gives invalid argument :<
<TestModule>
Should i upload after i run this so no-one else has to do this again?
TestModule_ has joined #arm-netbook
<TestModule_>
Is there anywhere i can get this premade for linaro
<TestModule_>
or, if not, can i upload so others do not?
<TestModule_>
By default though, i assume FrameBuffer, accelerated through DMA by default?
TestModule has quit [Ping timeout: 245 seconds]
vinifm has joined #arm-netbook
<Dolence>
hi! I want to use Mele 2000 (AllWinner A10) as embedded platform for running an opencv application, someone could tell me if it would work better/faster in linux or android?
SouL_ has joined #arm-netbook
<Dolence>
(please)
SouL_ has left #arm-netbook [#arm-netbook]
<ZaEarl>
faster? linux of course
<Dolence>
so, tripped down custom linux compiled for A10 should work better?
dyoung is now known as dyoung-away
<Dolence>
*stripped
<netchip>
yes
<netchip>
debootstrap (hint: it's in Debian)
<netchip>
it makes a lightweight system
<netchip>
with only bash and a few other utils
<netchip>
and you can add your own tools
<netchip>
with apt-get\
<Dolence>
hmmm, ok, seens very nice
<Dolence>
I was reading about linux-sunxi
<TestModule_>
netchip see pm
<TestModule_>
Has anyone tried link-time-optimization flags on the sunxi kernel?
<Dolence>
netchip thank you very much for your attention
<Dolence>
;)
<TestModule_>
with the skip-over settings for incompatible modules
eebrah has quit [Ping timeout: 248 seconds]
popolon has joined #arm-netbook
jukivili has joined #arm-netbook
Alex1269 has joined #arm-netbook
rellla has quit [Remote host closed the connection]
eebrah has joined #arm-netbook
TestModule has joined #arm-netbook
<netchip>
TestModule, For what ? :P
<netchip>
it's OK if you don't want to customise
<TestModule>
nm, answered my own question
<TestModule>
;)
<TestModule>
if only someone tested the flto flag :P
TestModule_ has quit [Ping timeout: 245 seconds]
hg_5 has quit [Read error: Connection reset by peer]
TestModule_ has joined #arm-netbook
TestModule has quit [Ping timeout: 245 seconds]
Dolence has left #arm-netbook [#arm-netbook]
<netchip>
/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stdint.h:3:26: fatal error: stdint.h: No such file or directory
<netchip>
in my Debian chroot on Android
<netchip>
:(
tinti has quit [Quit: Leaving]
<WarheadsSE>
roops
netchip has quit [Remote host closed the connection]
<br->
netchip: apt-get install build-essential no help?
<br->
but guessing if the compiler is there, libc6-dev is also supposed to be there
gsilvis has quit [Read error: Connection reset by peer]
L84Supper2 has joined #arm-netbook
L84Supper2 has quit [Changing host]
L84Supper2 has joined #arm-netbook
gsilvis has joined #arm-netbook
popolon has quit [Quit: Quitte]
eebrah has quit [Ping timeout: 264 seconds]
sspiff has quit [Quit: Leaving]
<TestModule_>
br, if on ubuntu: sudo apt-get install libusb-1.0-0-dev uboot-mkimage pkg-config if oyu're doing the bsp
eFfeM has quit [Quit: Leaving.]
gimli has quit [Read error: Operation timed out]
eFfeM has joined #arm-netbook
eebrah has joined #arm-netbook
eebrah has quit [Read error: Connection reset by peer]
L84Supper2 has quit [Quit: gone]
vinifm has quit [Remote host closed the connection]
tinti has joined #arm-netbook
fragmint has quit [Ping timeout: 244 seconds]
alcides has quit [Quit: There's no place like 127.0.0.1]