Topic for #qi-hardware is now Copyleft hardware - http://qi-hardware.com | hardware hackers join here to discuss Ben NanoNote, atben / atusb 802.15.4 wireless, and other community driven hw projects | public logging at http://en.qi-hardware.com/irclogs
Textmode has joined #qi-hardware
Textmode has quit [Remote host closed the connection]
phirsch has quit [Read error: Operation timed out]
lekernel has quit [Read error: Operation timed out]
DocScrutinizer51 has quit [Read error: Operation timed out]
DocAvalanche has joined #qi-hardware
DocAvalanche has quit [Changing host]
DocAvalanche has joined #qi-hardware
DocAvalanche is now known as DocScrutinizer51
phirsch has joined #qi-hardware
lekernel has joined #qi-hardware
<DocScrutinizer51>
>>...operations may not work as intended. Instead of writing zeros to the valid bit of the BTB entry matching the MVA provided, the CP15 “Invalidate Branch Predictor by MVA” operation writes the value currently in the “Instruction L1 System Array Debug Register 0.” << nice, isn't it?
<kristianpaul>
WHAT 149 usd?? ;-)
<kristianpaul>
includes some wireless upgrade or such? ;-)
<wpwrak>
that's wolfgang rewriting the book on marketing :)
<wpwrak>
it's actually a good idea. if it doesn't work, the loss is minimal. if it works, he gets the nobel price in economy
<kristianpaul>
;-)
<wolfspraul>
what now? :-) wait have to restart my machine...
wolfspraul has quit [Quit: leaving]
zear has quit [*.net *.split]
wolfspraul has joined #qi-hardware
<wpwrak>
wolfspraul: we're contemplating the metaphysical dimensions of the price increase :)
zear has joined #qi-hardware
<wolfspraul>
increased happiness
<wolfspraul>
I am *seriously* considering to put a little multiple-choice test before the online shop, where people have to answer questions that show that they understand what they will buy with the Ben & M1 :-)
<wolfspraul>
only because it's too difficult technically (or I'm too lazy) have I not done that yet
<wolfspraul>
good morning everybody btw
<wpwrak>
if you want to add such a test, make it optional
<wolfspraul>
won't do it anyway, just a thought
<wpwrak>
a link "DO YOU HAVE ENOUGH STAMINA FOR THE MILKYMIST ? >>>"
<wolfspraul>
beautiful questions that will make people think about what they buy
<wpwrak>
naw, that's too long
<wpwrak>
"ARE YOU READY FOR THE MILKYMIST ?"
<wpwrak>
for those who have odd associations already, this should enhance the experience :)
<wpwrak>
actually ... make a youtube spot with "ARE YOU READY TO DO THE MILKYMIST ?"
<wolfspraul>
my first goal is very simple, I want to dig into the .bit bitstream and be able to read it better in text form
<wolfspraul>
let's see how that goe
<wolfspraul>
goes
<wpwrak>
"plain C, no C++" yes !! ;-)
<wolfspraul>
see. I wrote those design goals to make you happy! :-)
<wpwrak>
indeed :)
<wolfspraul>
nothing works yet though. next step: go through commands.
<wpwrak>
very good design goals
<wpwrak>
or, rather, design principles
<DocScrutinizer51>
(OMAP silicon errata) http://mg.pov.lt/maemo-irclog/%23maemo.2012-05-21.log.html#t2012-05-21T20:19:58 is where a lengthy but comprehensive discussion starts between freemangordon, me (docscrutinizer), and a few words from javispedro. If you bother to read it, just ignore estel_ posts as they are distracting, to use an euphemism
<DocScrutinizer51>
it goes for almost 2 hours, and I think it sums up the basic issues of the whole topic
<wpwrak>
phew. maybe for the next time when i;ll have to wait at security in an US airport :)
<wpwrak>
i'm sure all involved are grown up enough to not make fools of themselves on linux-arm ;-)
<wolfspraul>
wpwrak: btw, I have to say I love the effect of -Wall during development
<wolfspraul>
I didn't use it before, so I was in the typical struggle circle
<wolfspraul>
write thousands of lines, then a heroic battle with warnings later
<wolfspraul>
often fought with mass casts or simply turning warnings off :-)
<wolfspraul>
but if it's on when first writing something, it's a breeze to fix right at the spot
* kristianpaul
uses pendantic as well
* DocScrutinizer51
even uses lint at work
<DocScrutinizer51>
mandatory procedure according to company policy
<DocScrutinizer51>
plus recently another tool called coverity or similar, I haven't had a look into that one yet
<DocScrutinizer51>
seems lint and coverity are complementary
<wpwrak>
for me, -Wall -Wextra -Wshadow -Wmissing-prototypes -Wmissing-declarations
<wpwrak>
and then valgrind :)
wej has quit [Ping timeout: 272 seconds]
<DocScrutinizer51>
ooh sure
<wpwrak>
-Wshadow can be a tad annoying but catches rather nasty bugs
<wpwrak>
or int items; void bar(int item) { do_something(item); do_something_else(items); }
<wpwrak>
in the 2nd case, you won't get a warning about the unused "item" argument. this sort of name error happens quite easily when you're a bit tired or distracted
<wpwrak>
this code wants a function for the "skb == NULL" case :)
<DocScrutinizer51>
this code wants a refactoring done by a devel with a brain
<DocScrutinizer51>
anyway >> * Copied from unix_stream_recvmsg, but removed credit checks,<<
<wpwrak>
yeah, preferably one without previous experience with the italian kitchen :)
<DocScrutinizer51>
makes me think it'
<DocScrutinizer51>
s not been my colleagues that thought it's a nice idea to test compiler optimization
<DocScrutinizer51>
look at all the useless unconditional assignments to err
<wpwrak>
they're a common pattern in the linux kernel. nothing wrong there.
<wpwrak>
the only issue is see is that the jumps are quite complicated
<DocScrutinizer51>
if (err = sock_error(sk) ) goto unlock; if (sk->sk_shutdown & RCV_SHUTDOWN) { err = -ECONNRESET; goto unlock;};
<DocScrutinizer51>
the first if() maybe style question, the second if case mere common sense
<DocScrutinizer51>
you don't pull out assignemnts out of the if branch for no good reason - even when compiler usually will optimize it
<DocScrutinizer51>
try to trace such code in Lauterbach and get a severe headache, as compiler was feeling nausea and decided to completely rewrite your code
<wpwrak>
your first if will get you a warning
<DocScrutinizer51>
quite possibly
<wpwrak>
and you can safely leave that sort of low-level optimization to the compiler
<DocScrutinizer51>
nonsense
<DocScrutinizer51>
(unless you talk about first if() )
<wpwrak>
focus on code clarity, not what was hard for compilers 30 years ago ;-)
<DocScrutinizer51>
my major consern was exactly about code clarity
<wpwrak>
well, since it seems to be from linux, why not clean it up and send a patch ?
<DocScrutinizer51>
pulling out the err= -ECONNRESET from the if branch is all anti-code-clarity
<DocScrutinizer51>
while a do { } while() spanning over ~80 lines is a nogo in itself
<DocScrutinizer51>
actually one style rule at work is: functions mustn't span more than a screenfull of lines
<wpwrak>
keeping functions short is a good concept
<DocScrutinizer51>
indeed
<DocScrutinizer51>
and instead of if (sk->sk_state == CAIF_CONNECTING) you can use if (CAIF_CONNECTING == sk->sk_state)
<DocScrutinizer51>
as if (CAIF_CONNECTING = sk->sk_state) for sure gives a warning/error
<wpwrak>
both yield a diagnostic
<DocScrutinizer51>
both?
<wpwrak>
try it :)
<DocScrutinizer51>
???
<wpwrak>
gcc complains if you if (var = value) ...
<DocScrutinizer51>
sure
<DocScrutinizer51>
but if probably goes mad when you if (const = var)
<DocScrutinizer51>
and for your case the warning will depend on -Wxxx
<wpwrak>
*shrug* don't f* around without protection :)
<DocScrutinizer51>
hm?
<wpwrak>
you'll have that warning enabled unless you're very careless already
<wpwrak>
(i.e., -Wall enables it)
<DocScrutinizer51>
but yeah, you also tried to teach me not to use parantheses in complex conditions, as you claimed that's what operators precedence is for. Company policy is we *shall* use them
<wpwrak>
and you want to keep it on. else, you'll still trip over a typo in if (var1 == var2)
<wpwrak>
you can solve that by firing all the pascal programmers ;-)
<DocScrutinizer51>
lol
<wpwrak>
and maybe print a few copies of the C operator precedence table. it's very well thought out and, believe it or not, the compiler knows it too ;-)
<wpwrak>
i think i ran into some crappy "C" compiler for CP/M once that did have some precedence bugs. but that was a pretty long time ago
<wpwrak>
once you get past being proud of yourself because you managed to write a 500 character expression that actually seems to work, the inner drive for writing complicated if statement drops dramatically
<DocScrutinizer51>
the whole friggin code in that do loop cries out loud for a case switch
<wpwrak>
hmm, let's call the language with a case statement that can handle that "J" ;-)
<DocScrutinizer51>
hmm, maybe not
<DocScrutinizer51>
nah, call it shell script
<DocScrutinizer51>
or maybe qbasic
<DocScrutinizer51>
but honestly I don't suggest to do THAT
<DocScrutinizer51>
I didn't realize the error checks were all from different sources
<wpwrak>
that code has to do some quite tricky stuff. also note that errors only yield an error code if no data has been moved yet
xwalk has quit [Quit: Leaving]
<DocScrutinizer51>
sure
<DocScrutinizer51>
(<wpwrak> this code wants a function for the "skb == NULL" case) isn't that simple to do either, regarding all the explicit and implicit (break, continue) gotos
<wpwrak>
yes, i know :)
<wpwrak>
but if you spend a few hours on it, maybe you find a nice simplification :)
<DocScrutinizer51>
the whole function caif_stream_recvmsg() already qualifies for a bad example of spaghetti code
<qi-bot>
[commit] Werner Almesberger: b2/subst.c (dump_chunks): closing } was missing when dumping variable expansion (master) http://qi-hw.com/p/eda-tools/cae92bb
<qi-bot>
[commit] Werner Almesberger: b2/: move implicit initialization of FN, F1, ... to explicit function subex_init (master) http://qi-hw.com/p/eda-tools/c6e3944
<qi-bot>
[commit] Werner Almesberger: b2/: resolve FN in subst_init and don't consider an FN match evidence of existance (master) http://qi-hw.com/p/eda-tools/c2414a5
<valhalla>
in the italian increasing the nanonote price looks like a suicidal move (but then it wasn't a big market anyway, and without an EU shop it was probably going do get smaller anyway)
kristoffer has joined #qi-hardware
kilae has joined #qi-hardware
lekernel has quit [Ping timeout: 245 seconds]
lekernel has joined #qi-hardware
rejon has quit [Ping timeout: 240 seconds]
rejon has joined #qi-hardware
rejon has quit [Ping timeout: 256 seconds]
<lekernel>
wolfspraul: (fpgatools) the tool you want to write exists already, it's called xdl. it's proprietary ofc.
<larsc>
which means if you and irq_reg with the rxfifo irq you won't disable it anymore
<Ayla>
why not?
<Ayla>
ah crap
<Ayla>
x_x
<Ayla>
n00b error
<Ayla>
larsc: however, the jz_mmc_irq writes the JZ_REG_MMC_IREG twice
<Ayla>
the second one obviously overriding the first
<larsc>
IREG is write-one-to-clear
<Ayla>
yes
<larsc>
writing a '1' to a bit will clear that bit, writing a '0' will leave it unchanged
<Ayla>
meh, the docs are on my other PC :s
<Ayla>
larsc: but perhaps the two writes occur too rapidly for the hardware? :)
<Ayla>
well I believe writing a '1' two times has no effect anyway
<larsc>
you can change the code to have only one write to IREG
<Ayla>
but why did it need two writes to IREG at the first place?
<larsc>
you don't need them, but it was more convenient that way, that chance that both writes will be exectured in the same irq handler run is pretty low anyway
<Ayla>
why wouldn't they be executed in the same IRQ handler? ...
<Ayla>
they are in the same function
<larsc>
because both writes are conditional
<Ayla>
why do you read the IREG register btw? Does it contain something useful?
<Ayla>
IIRC the interrupt status is located inside another register
<Ayla>
(I really need the doc ...)
<larsc>
The MSC_IREG register shows the currently requested interrupt. The FIFO request interrupts,
<larsc>
TXFIFO_WR_REQ, and RXFIFO_RD_REQ are masked off with the DMA_EN bit in the MSC_CMDAT
<larsc>
register. The software is responsible for monitoring these bit in program I/O mode.
<Ayla>
ok, I think I start to understand the code
<Ayla>
the first write to IREG is there to acknowledge unwanted interrupts
<larsc>
yes
<lekernel>
wpwrak: I already etched some PCBs with HCl + peroxide (and 30%, not 3%). I'm still alive :) though that thing definitely releases chlorine gas you don't want to breathe.
<DocScrutinizer51>
lekernel: real fun starts when you mix some acetone (or other solvent) into this etching liquid
<lekernel>
but I wouldn't call chlorine "very poisonous". think of stuff like dimethylmercury, arsine, germane, etc...
<DocScrutinizer51>
well, it's been called greencross in WW-II iirc
<wpwrak>
chlorine usually doesn't kill you on the spot, but it can cause lasting damage
<Ayla>
larsc: the IREG is written inside the worker thread
<DocScrutinizer51>
very nasty lasting damage
<Ayla>
which does not execute in an interrupt context
<DocScrutinizer51>
got it's own name in medicine
<Ayla>
larsc: what's the behaviour of writing that bit when the interrupt has yet to appear?
<DocScrutinizer51>
chlorine acne
<wpwrak>
and HCl+30% peroxide (without diluting it) is way too fast to get useful results. sure, the etching takes only seconds, but it will be very uneven
<lekernel>
chlorine was only used for a short while, before they found more toxic stuff
<DocScrutinizer51>
undercuts getting a severe problem
<wpwrak>
lekernel: a knife will kill you just as dead as a musket or a modern armor-piercing projectile ;-)
<lekernel>
chloracne is actually not caused by chlorine, but organic compounds
<lekernel>
some containing chlorine atoms in the molecule (thus the name)
<lekernel>
but Cl2 doesn't cause chloracne
<DocScrutinizer51>
hmmm
<DocScrutinizer51>
I'd not bet on that
<larsc>
Ayla: nothing should happen
<lekernel>
only lung damage
<wpwrak>
given an ideal diode of size zero, ...
<DocScrutinizer51>
how's that damage working, chemically?
<wpwrak>
who needs lungs anyway ;-)
<lekernel>
I can imagine there are many reactions. chlorine is a very reactive compound.
<lekernel>
eats through most materials
<DocScrutinizer51>
so what's the result of Cl2 reacting with the organic material in your lungs?
<lekernel>
lung goo
<wpwrak>
the problem isn't the original "pure" gas you inhale. it's the blood you spit later :)
<DocScrutinizer51>
and chloro-organnic compounds, no?
<lekernel>
no, I think that's a different toxicity
<lekernel>
try putting some piece of meat in a bottle of chlorine for a while :)
<larsc>
wpwrak: ah, thats overrated, i've been spitting blood for the last 4 days and i'm still alive ;)
<DocScrutinizer51>
I seem to recall a teacher who poisoned half the class of pupils with chlor gas, and most of them got chlor acne
<wpwrak>
larsc: been in a bar fight again ? :)
<DocScrutinizer51>
but I might be wrong, as that's been a news of 30 years ago
<wpwrak>
was that in chemistry or history ?
<larsc>
wpwrak: I at least look like as if I had been. Had my wisdomtooth removed...
<DocScrutinizer51>
in newspaper?
<DocScrutinizer51>
aaah, in chemistry
<wpwrak>
larsc: ah, dental bliss. always the most exquisite of pains.
<Ayla>
larsc: after a data transfer, the DATA_TRAN_DONE bit is set on the IREG, which is correct, but the doc states that the "stop" command should be sent first
<Ayla>
larsc: and the code first writes the IREG then sends the "stop" command
<larsc>
Ayla: might be an issue, but i doubt it
<Ayla>
if it was not, it wouldn't be written on the doc to do so, no? :)
<whitequark>
oh, Cl2 in lungs is easy: Cl2 + H2O = HCl + HOCl
<whitequark>
it's like drowning in acid
<larsc>
Ayla: which page?
viric has quit [Read error: Connection reset by peer]
<Ayla>
page 477
<larsc>
which file?
<Ayla>
jz4740_pm.pdf
<lekernel>
whitequark: hmm, Cl2 doesn't do that with water on itself
<lekernel>
by itself
<lekernel>
it needs some catalyst or energy source... sunlight works for that (that's why you can remove the chlorine taste of tap water by putting it under daylight for a while... acid has a less potent taste)
viric has joined #qi-hardware
<whitequark>
lekernel: maybe one of 1000s of biological compounds in lungs acts as a catalyst?
<whitequark>
well anyway, I'm pretty sure that Cl2 would attack them on itself, too
<whitequark>
but from my chemistry class I recall that chlorine danger is from its dissolution in water
<lekernel>
sure, if it stays in the air, it won't attack your body which is made mostly of water... unfortunately, chlorine is also very soluble in water
<whitequark>
ah, so you mean that Cl2 can dissolve in water just as any other gas would
<lekernel>
it's _particularly_ soluble in water
<whitequark>
yeah, that's plausible
<whitequark>
interesting
<lekernel>
iirc you can dissolve dozens of liters of Cl2 in a liter of water
<lekernel>
at room temperature and atmospheric pressure
<whitequark>
generally, pH of lungs is near to neutral
<lekernel>
and... chlorine hydrolysis itself changes the pH, as it generates H+
<whitequark>
exactly
<whitequark>
so that'll come to an equilibrium somewhere on the left side
<wpwrak>
conclusion: if you smell chlorine, try to inhale as much of it as possible, to avoid lung damage
<whitequark>
besides which, as the lungs are damaged by low pH, the more chlorine you have (an thus more elemental chlorine), the more pH-generated damage you'll have too
<wpwrak>
i think there may be an opening in the argentina ministry for public health. they need people who think like that ;-)
<whitequark>
wpwrak: you seem to be proud of your government :)
<wpwrak>
whitequark: oh yes, everybody here is proud of it. there were protest marches against it thursday and friday, with more predicted for next week
<whitequark>
huh. and here, the "occupy" movement has finally came from the overseas
<wpwrak>
whitequark: it's all those ungrateful people who don't understand that you don't need a stable currency, an economy, let alone a halfway credible juridical system
<wpwrak>
vive la revolucion mondial ! :)
<wpwrak>
s/al/ale
<qi-bot>
wpwrak meant: "vive la revolucion mondiale ! :)"
<Ayla>
révolution*
<lekernel>
wpwrak: heard of the Shadoks? :)
<wpwrak>
no accents here :)
<wpwrak>
not yet
<lekernel>
"When one tries continuously, one ends up succeeding. Thus, the more one fails, the greater the chance that it will work." etc. :)
<Ayla>
wpwrak: I thought that was french :)
<wpwrak>
i'm just reading wikipedia ... interesting. that's pretty much exactly how our government chooses to do things
<wpwrak>
what caused the latest protests was a rather baffling marie antoinette moment: the government has been trying for a while to get hold of every dollar they can reach. so they decreed import bans, currency exchange restrictions, recently something that looks like travel restrictions, and so on
<wpwrak>
they also lectured the people that it was morally wrong to "bet on dollars" when the national currency is the peso. (which devalues at about 25% per year, making it ideal for long-term savings.)
<wpwrak>
they also told people that it was risky for them to save in dollars, and so on. for months. then, wednesday, the newspapers published in what currencies the various ministers keep their savings, fresh from the latest tax declarations.
<larsc>
hehe
<larsc>
wpwrak: what's the interest for loans?
<wpwrak>
lo and behold, all that had declared more than pocket money had substantial savings in dollars. (one minister, i think of economy, declared to be destitute - zero cash or bank accounts)
<wpwrak>
wait, it gets better
<wpwrak>
then, on thursday morning, head of the senate anibal fernandez, who has been the government's spokesperson for all that sort of nonsense advice, admonitions, and insults against the "evil rich", was questioned by journalists why he had all those dollars when he himself had kept on saying all the time it was morally wrong and a bad idea.
<wpwrak>
his response, for once, was perfectly honest and didn't lack clarity: he said that was none of their business, he got his dollars as it was convenient, there was nothing wrong with that, and he's free to do as he pleases.
<wpwrak>
that night, people were in the streets, voicing their disagreement
<Ayla>
you're on Buenos Aires?
compcube has joined #qi-hardware
compcube has quit [Changing host]
compcube has joined #qi-hardware
<wpwrak>
maybe i should clarify exchange restrictions: to buy dollars in argentina, since a few months, you first have to get the purchase greenlighted by the tax authority. then they set a maximum amount, based on your declared income. surprisingly often, this amount turned out to be zero, even for people who earned quite well and who obediently declared their income.
<wpwrak>
a few weeks ago, they tightened the restrictions. now the result is always zero for a whole class of taxpayers. (all that are in a simplified tax regime for lower incomes) and even more often for the rest as well. one retiree tried to buy ten dollars and was refused.
<wpwrak>
Ayla: yup
<wpwrak>
a consequence of the restriction on dollar purchases was that the black market dollar took off like a rocket. it's usually around 10% above the official dollar. now it's about 30% higher.
<wpwrak>
of course, the government then started a witch hunt on exchange offices and all that. and they have dogs sniffing for money at border crossings. (many people take their pesos to neighbouring countries to exchange them there to dollars)
<wpwrak>
and after months of all that sort of chicanery, that government spokesman simply brushes it all away, telling people HE is free to do what he wants to do (but of course, the plebs isn't)
kuribas has joined #qi-hardware
<wpwrak>
to compound this, the vice president is involved in a corruption scandal. of course, he denies everything, even knowing all the other folks involved. despite all sorts of evidence popping up, including one of those folks he claims to never even have seen living in an apartment he owns.
<wpwrak>
when it got too annoying, the government set out to solve the problem for good and they removed the state attorney, the judge, and the attorney general.
<wpwrak>
to add insult to injury, the guy they want to install as new attorney general, besides being a good friend of that ruling group, has a CV littered with false claims
<Ayla>
:)
<wpwrak>
tuesday, he'll have an interview by the senate, which will then decide whether they'll accept him or not. this will be rather interesting.
<Ayla>
larsc: I have some comments about the jz4740_mmc_read_data
<Ayla>
what's the "i" variable refering to exactly?
<Ayla>
it gets the value "miter->length" but doesn't seem to be used as such
<wpwrak>
larsc: loans ... with a credit card, nominal 41% p.a., effective 50%, total cost of financing (with fees and such) 63%
<Ayla>
larsc: forget about it :)
<larsc>
Ayla: i is the number of .... ok
<wpwrak>
non-card loans are also in the 40-70% segment
<larsc>
if a read operation takes to long to complete jz4740_mmc_read_data will stop reading/writing and when the next interrupt occurs it will be called again
<Ayla>
yes I got that,
<Ayla>
but how will it resume exactly?
<larsc>
it will be called in the irq worker thread
<Ayla>
I mean, if i != 0, and the second mmc_poll_irq() times out, some bytes are lost
<larsc>
sg_miter_next will continue where sg_miter_stop has been called
<larsc>
see the the poll_timeout label
<larsc>
miter->consumed is updated
<Ayla>
what about the while(j) loop then?
<wpwrak>
(that's for loans in pesos)
<Ayla>
it checks 32 times for the IRQ flag, what if it times out at the 31st time?
<Ayla>
the content of "buf" will be lost, because the miter variable is not updated
<Ayla>
and you can't read those bits again, because of the FIFO
<qi-bot>
[commit] Werner Almesberger: b2/test/Common: also provide empty hierarchy if the input is empty; name the file (master) http://qi-hw.com/p/eda-tools/4a586fc
<Ayla>
larsc: when one read times out, the JZ_MMC_IRQ_RXFIFO_RD_REQ interrupt is enabled
<Ayla>
that interrupt is handled by jz_mmc_irq, which starts the jz_mmc_irq_worker thread
<Ayla>
and re-starts a data transfer
<Ayla>
but the JZ_MMC_IRQ_RXFIFO_RD_REQ is never cleared
<Ayla>
errr
<Ayla>
so the transfer should work, as it polls for that flag
<Ayla>
...
<Ayla>
it times out on the first try, so it doesn't read a single byte
abushcrafter has joined #qi-hardware
<Ayla>
larsc: so the jz_mmc_irq pops up because the JZ_MMC_IRQ_RXFIFO_RD_REQ interrupt happens,
<Ayla>
but the transfer times out because the JZ_MMC_IRQ_RXFIFO_RD_REQ flag on IREQ is missing.
<Ayla>
how good is that?
jurting has joined #qi-hardware
<larsc>
that actually makes some sense
<larsc>
can you confirm that it will timeout?
<larsc>
is it really the rd_req timeout?
<larsc>
Receive FIFO read request. Set if data FIFO becomes half full (the number of words is >= 8) or the entries in data FIFO are the last read data.
<larsc>
from the datasheet
<larsc>
since we haven't read anything from the fifo it should still be set
<Ayla>
yes, it is JZ_MMC_IRQ_RXFIFO_RD_REQ
<Ayla>
I read 0x20 on the IREG when the interrupt happens
<larsc>
i suppose removing the last jz4740_mmc_set_irq_enabled in the hardirq handler will fix it
<Ayla>
larsc: it should still be set, yes
<Ayla>
but it's not
<Ayla>
otherwise it would not time out
<larsc>
yep
<larsc>
not acking the interrupts in the hardirq handler seems to be the right fix, because for example we have the same issue for the DATA_TRANSFER_DONE interrupt
<larsc>
uhm and forget about what i said about jz4740_mmc_set_irq_enabled, i meant the writel to IREG
<Ayla>
we're not acking the rd_req interrupt, because it's not possible
<Ayla>
that bit in IREG is read-only
<larsc>
so it is cleared after it has been masked?
<larsc>
in hw?
<Ayla>
it is cleared by the hardware, I believe
<larsc>
yes, but why?
<larsc>
that's what we want to find out
<Ayla>
the first question is why is it cleared, while we can't write it
<Ayla>
the second question, is why is the interrupt reappearing?
<larsc>
one possibility is that it ANDs the irq mask with the pending interrupts in hardware
<larsc>
because we unmask the interrupt again
<larsc>
it's actually easy to test. add a second read to IREG right after the jz4740_mmc_set_irq_enabled in the hardirq handler
<Ayla>
no, I still read 0x20
<Ayla>
after the mask is written
<larsc>
and after writing to ireg?
<Ayla>
same value
<larsc>
uhm, with mth's patch won't poll_irq always timeout?
<larsc>
should this 'if (--timeout_next)' be 'if (--timeout_next == 0)'?
<Ayla>
heh... good point
xwalk has joined #qi-hardware
<Ayla>
ok, now it times out a lot, but it still manages to load the root filesystem
<Ayla>
which means that timeouts are not involved in the bug that occurs during resume
<larsc>
you can't be sure of that
<Ayla>
well, the timeout mechanism seems fine
lekernel has quit [Quit: Konversation terminated!]
<larsc>
it works fine during normal operation
<larsc>
that's all you know
<Ayla>
well, yes
abushcrafter has quit [Ping timeout: 245 seconds]
xwalk has quit [Ping timeout: 245 seconds]
xwalk_ has quit [Ping timeout: 248 seconds]
xwalk_ has joined #qi-hardware
xwalk has joined #qi-hardware
viric has quit [Ping timeout: 244 seconds]
viric has joined #qi-hardware
emeb has joined #qi-hardware
rejon has quit [Ping timeout: 245 seconds]
phirsch_ has joined #qi-hardware
Maroni has joined #qi-hardware
phirsch has quit [Ping timeout: 252 seconds]
phirsch_ is now known as phirsch
compcube has quit [Quit: Leaving]
kristoffer has quit [Quit: Leaving]
kilae has quit [Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120420145725]]
compcube has joined #qi-hardware
compcube has quit [Changing host]
compcube has joined #qi-hardware
Maroni has quit [Ping timeout: 260 seconds]
kuribas has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
lekernel has joined #qi-hardware
Textmode has joined #qi-hardware
<mth>
larsc: you're right about the timeouts
jekhor has quit [Ping timeout: 252 seconds]
<mth>
is it expected that if everything is done on interrupts it won't mount the rootfs on time, or is there still an issue there?
<mth>
mounting a vfat partition shouldn't require all that much data to be read
<Ayla>
mth, it's min-init job to mount the rootfs
<Ayla>
and it already waits for the SD card to appear
<mth>
is it the squashfs mount that times out then?
<Ayla>
what timeout are you speaking about exactly?
<Ayla>
what I know is that min-init tries to mount the VFAT partition until it eventually succeeds
<Ayla>
which is weird, if you ask me, as the SD card should be ready as soon as it appears on /dev
<Ayla>
I mean, the kernel should not allow it to appear in /dev if it's not yet ready
<mth>
at some point the kernel says it cannot start init and will reboot in 5 seconds
<Ayla>
it does so when min-init gives up mounting the VFAT partition or the rootfs
<mth>
so it doesn't try until it succeeds then; it gives up after a while if it doesn't succeed
<Ayla>
it tries 20 times, each try separated by 100ms
<Ayla>
usually it fails a couple of times, that's why you can see errors on dmesg on OD
<Ayla>
it would be better, IMHO, to make all calls return -ETIMEDOUT on the kernel, until the card marks itself as reseted
<Ayla>
well it probably does that already
B_Lizzard has quit [Remote host closed the connection]