#qi-hardware IRC log for Sunday, 2012-06-03

DocScrutinizer51wpwrak: if you're interested:  http://mg.pov.lt/maemo-ssu-irclog/search?q=silicon  http://mg.pov.lt/maemo-ssu-irclog/search?q=errat    http://mg.pov.lt/maemo-irclog/search?q=errat  --  and the two errata: http://cache.freescale.com/files/32bit/doc/errata/IMX50CE.pdf  >>freemangordonDocScrutinizer, the errata which we are told is mutually exclusive (and its number is stated in logs on #beagle dm8tbr is talking about) is 687067<<  and   00:10
DocScrutinizer51THe PRIMARY issue: http://cateee.net/lkddb/web-lkddb/ARM_ERRATA_430973.html00:10
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?00:20
kristianpaulWHAT 149 usd?? ;-)00:22
kristianpaulincludes some wireless upgrade or such? ;-)00:27
DocScrutinizer51kristianpaul: hmm?00:33
kristianpaulDocScrutinizer51: http://lists.en.qi-hardware.com/pipermail/discussion/2012-June/009693.html00:35
wpwrakthat's wolfgang rewriting the book on marketing :)00:37
wpwrakit's actually a good idea. if it doesn't work, the loss is minimal. if it works, he gets the nobel price in economy00:38
wolfspraulwhat now? :-) wait have to restart my machine...00:46
wpwrakwolfspraul: we're contemplating the metaphysical dimensions of the price increase :)00:54
wolfspraulincreased happiness00:55
wolfspraulI 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 :-)00:56
wolfspraulonly because it's too difficult technically (or I'm too lazy) have I not done that yet00:57
wolfspraulgood morning everybody btw00:58
wpwrakif you want to add such a test, make it optional00:59
wolfspraulwon't do it anyway, just a thought01:00
wolfspraulbeautiful questions that will make people think about what they buy01:01
wpwraknaw, that's too long01:01
wpwrakfor those who have odd associations already, this should enhance the experience :)01:02
wpwrakactually ... make a youtube spot with "ARE YOU READY TO DO THE MILKYMIST ?"01:05
wpwrakthen enjoy the video responses :)01:05
wolfspraulI became more interested in the innards of an fpga recently, so I am starting a little educate-myself project here https://github.com/Wolfgang-Spraul/fpgatools01:08
wolfspraulmy first goal is very simple, I want to dig into the .bit bitstream and be able to read it better in text form01:08
wolfspraullet's see how that goe01:09
wpwrak"plain C, no C++" yes !! ;-)01:09
wolfspraulsee. I wrote those design goals to make you happy! :-)01:09
wpwrakindeed :)01:10
wolfspraulnothing works yet though. next step: go through commands.01:10
wpwrakvery good design goals01:10
wpwrakor, rather, design principles01:10
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 euphemism01:11
DocScrutinizer51it goes for almost 2 hours, and I think it sums up the basic issues of the whole topic01:17
wpwrakphew. maybe for the next time when i;ll have to wait at security in an US airport :)01:18
wpwraki'm sure all involved are grown up enough to not make fools of themselves on linux-arm ;-)01:18
wolfspraulwpwrak: btw, I have to say I love the effect of -Wall during development01:29
wolfspraulI didn't use it before, so I was in the typical struggle circle01:29
wolfspraulwrite thousands of lines, then a heroic battle with warnings later01:29
wolfsprauloften fought with mass casts or simply turning warnings off :-)01:29
wolfspraulbut if it's on when first writing something, it's a breeze to fix right at the spot01:30
Action: kristianpaul uses pendantic as well01:39
Action: DocScrutinizer51 even uses lint at work01:42
DocScrutinizer51mandatory procedure according to company policy01:42
DocScrutinizer51plus recently another tool called coverity or similar, I haven't had a look into that one yet01:43
DocScrutinizer51seems lint and coverity are complementary01:44
wpwrakfor me, -Wall -Wextra -Wshadow -Wmissing-prototypes -Wmissing-declarations01:47
wpwrakand then valgrind :)01:47
DocScrutinizer51ooh sure01:47
wpwrak-Wshadow can be a tad annoying but catches rather nasty bugs01:48
wpwrake.g., int foo; ... void bar(int fo) { do_something(foo); }01:49
wpwrakor  int items; void bar(int item) { do_something(item); do_something_else(items); }01:50
wpwrakin 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 distracted01:51
DocScrutinizer51still, if you're facing code as fsckdup as http://lxr.free-electrons.com/source/net/caif/caif_socket.c#L377 ff... :-S01:52
wpwrakthis code wants a function for the "skb == NULL" case :)01:53
DocScrutinizer51this code wants a refactoring done by a devel with a brain01:54
DocScrutinizer51anyway >>  * Copied from unix_stream_recvmsg, but removed credit checks,<<01:54
wpwrakyeah, preferably one without previous experience with the italian kitchen :)01:54
DocScrutinizer51makes me think it'01:54
DocScrutinizer51s not been my colleagues that thought it's a nice idea to test compiler optimization01:55
DocScrutinizer51look at all the useless unconditional assignments to err01:56
wpwrakthey're a common pattern in the linux kernel. nothing wrong there.01:57
wpwrakthe only issue is see is that the jumps are quite complicated01:58
DocScrutinizer51if (err = sock_error(sk) ) goto unlock;   if (sk->sk_shutdown & RCV_SHUTDOWN) { err = -ECONNRESET;  goto unlock;};01:58
DocScrutinizer51the first if() maybe style question, the second if case mere common sense02:00
DocScrutinizer51you don't pull out assignemnts out of the if branch for no good reason - even when compiler usually will optimize it02:00
DocScrutinizer51try to trace such code in Lauterbach and get a severe headache, as compiler was feeling nausea and decided to completely rewrite your code02:02
wpwrakyour first if will get you a warning02:03
DocScrutinizer51quite possibly02:03
wpwrakand you can safely leave that sort of low-level optimization to the compiler02:03
DocScrutinizer51(unless you talk about first if() )02:03
wpwrakfocus on code clarity, not what was hard for compilers 30 years ago ;-)02:04
DocScrutinizer51my major consern was exactly about code clarity02:04
wpwrakwell, since it seems to be from linux, why not clean it up and send a patch ?02:04
DocScrutinizer51pulling out the err= -ECONNRESET from the if branch is all anti-code-clarity02:05
DocScrutinizer51ROTFL @ http://lxr.free-electrons.com/source/net/caif/caif_socket.c#L41502:06
DocScrutinizer51there (s)he did it right02:06
DocScrutinizer51while a do { } while() spanning over ~80 lines is a nogo in itself02:08
DocScrutinizer51actually one style rule at work is: functions mustn't span more than a screenfull of lines02:10
wpwrakkeeping functions short is a good concept02:11
DocScrutinizer51and instead of if (sk->sk_state == CAIF_CONNECTING)  you can use if (CAIF_CONNECTING == sk->sk_state)02:13
DocScrutinizer51as if (CAIF_CONNECTING = sk->sk_state) for sure gives a warning/error02:14
wpwrakboth yield a diagnostic02:14
wpwraktry it :)02:15
wpwrakgcc complains if you  if (var = value) ...02:15
DocScrutinizer51but if probably goes mad when you if (const = var)02:16
DocScrutinizer51and for your case the warning will depend on -Wxxx02:16
wpwrak*shrug* don't f* around without protection :)02:17
wpwrakyou'll have that warning enabled unless you're very careless already02:18
wpwrak(i.e., -Wall enables it)02:19
DocScrutinizer51but 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 them02:19
wpwrakand you want to keep it on. else, you'll still trip over a typo in  if (var1 == var2)02:20
wpwrakyou can solve that by firing all the pascal programmers ;-)02:20
wpwrakand 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 ;-)02:21
wpwraki 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 ago02:22
DocScrutinizer51well, that guy solved it his way: http://lxr.free-electrons.com/source/net/caif/caif_socket.c#L398 +502:23
wpwrakwell, not the worst way to deal with it02:23
DocScrutinizer51you must be kidding02:24
wpwrakonce 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 dramatically02:25
DocScrutinizer51the whole friggin code in that do loop cries out loud for a case switch02:25
wpwrakhmm, let's call the language with a case statement that can handle that "J" ;-)02:26
DocScrutinizer51hmm, maybe not02:27
DocScrutinizer51nah, call it shell script02:28
DocScrutinizer51or maybe qbasic02:28
DocScrutinizer51but honestly I don't suggest to do THAT02:28
DocScrutinizer51I didn't realize the error checks were all from different sources02:29
wpwrakthat code has to do some quite tricky stuff. also note that errors only yield an error code if no data has been moved yet02:33
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) gotos02:39
wpwrakyes, i know :)02:41
wpwrakbut if you spend a few hours on it, maybe you find a nice simplification :)02:41
DocScrutinizer51the whole function caif_stream_recvmsg() already qualifies for a bad example of spaghetti code02:41
qi-bot[commit] Werner Almesberger: b2/boom.c (main): run queries also if no variables are set (master) http://qi-hw.com/p/eda-tools/e919b1605:14
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/cae92bb05:14
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/c6e394405:14
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/c2414a505:14
qi-bot[commit] Werner Almesberger: b2/: disallow assigning to FN (master) http://qi-hw.com/p/eda-tools/b35b6e205:14
qi-bot[commit] Werner Almesberger: b2/test/: add first set of substitution tests (master) http://qi-hw.com/p/eda-tools/fb7b24605:14
valhallain 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)07:14
lekernelwolfspraul: (fpgatools) the tool you want to write exists already, it's called xdl. it's proprietary ofc.10:00
lekernelalso see https://github.com/sbourdeauducq/s6bitstream10:01
qi-bot[commit] Paul Cercueil: MMC: JZ4740: Remove duplicated code. (jz-3.4) http://qi-hw.com/p/qi-kernel/92ca0b910:42
Aylalarsc: hi, could you review that patch? http://pastebin.com/EALuMB0r10:46
Aylalarsc: I'd like to know if that code was missing on purpose (so that I'm not adding a bug instead of removing one)10:47
larscAyla: looks good10:52
Aylaok, thank you10:52
qi-bot[commit] Paul Cercueil: MMC: JZ4740: Fix handling of read errors. (jz-3.4) http://qi-hw.com/p/qi-kernel/c36b5d511:05
Aylamth, larsc: I found something interesting about the MMC bug12:55
Aylamth, larsc: http://pastebin.com/yPrJqRKk <= this patch should not change the behaviour of the driver, do you agree?12:56
larscwhy not?13:06
Aylabecause JZ_MMC_IRQ_RXFIFO_RD_REQ should already be inside irq_reg13:07
larscbut you mask out all other irqs13:08
Aylano, inside jz4740_mmc_set_irq_enabled the value is OR'd inside host->irq_mask13:10
Aylaand host->irq_mask is written to the register13:10
Aylaso the other IRQs are not modified13:10
larscyea, but for example JZ_MMC_IRQ_RXFIFO_WR_REQ is never disabled with your patch13:11
Aylaof course it is disabled with the patch13:13
Aylayou mean JZ_MMC_IRQ_TXFIFO_WR_REQ (the write one?)13:13
larscuhm, yes13:13
larscif we hit a timeout when polling for the irq it is enabled13:14
larscand disabled again after the interrupt13:14
Aylayes, but it has to be cleared before starting the interrupt thread13:14
Aylaand it's not13:15
larscdoesn't jz4740_mmc_set_irq_enabled(host, irq_reg, false); disable it?13:16
larscif irq_reg = JZ_MMC_IRQ_TXFIFO_WR_REQ13:16
larscwhich means if you and irq_reg with the rxfifo irq you won't disable it anymore13:18
Aylawhy not?13:20
Aylaah crap13:20
Aylan00b error13:20
Aylalarsc: however, the jz_mmc_irq writes the JZ_REG_MMC_IREG twice13:22
Aylathe second one obviously overriding the first13:22
larscIREG is write-one-to-clear13:23
larscwriting a '1' to a bit will clear that bit, writing a '0' will leave it unchanged13:24
Aylameh, the docs are on my other PC :s13:25
Aylalarsc: but perhaps the two writes occur too rapidly for the hardware? :)13:26
Aylawell I believe writing a '1' two times has no effect anyway13:26
larscyou can change the code to have only one write to IREG13:28
Aylabut why did it need two writes to IREG at the first place?13:31
larscyou 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 anyway13:34
Aylawhy wouldn't they be executed in the same IRQ handler? ...13:35
Aylathey are in the same function13:35
larscbecause both writes are conditional13:36
Aylawhy do you read the IREG register btw? Does it contain something useful?13:39
AylaIIRC the interrupt status is located inside another register13:40
Ayla(I really need the doc ...)13:40
larscThe MSC_IREG register shows the currently requested interrupt. The FIFO request interrupts,13:44
larscTXFIFO_WR_REQ, and RXFIFO_RD_REQ are masked off with the DMA_EN bit in the MSC_CMDAT13:44
larscregister. The software is responsible for monitoring these bit in program I/O mode.13:44
Aylaok, I think I start to understand the code13:52
Aylathe first write to IREG is there to acknowledge unwanted interrupts13:53
lekernelwpwrak: 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.13:57
DocScrutinizer51lekernel: real fun starts when you mix some acetone (or other solvent) into this etching liquid13:59
lekernelbut I wouldn't call chlorine "very poisonous". think of stuff like dimethylmercury, arsine, germane, etc...14:01
DocScrutinizer51well, it's been called greencross in WW-II iirc14:04
wpwrakchlorine usually doesn't kill you on the spot, but it can cause lasting damage14:04
Aylalarsc: the IREG is written inside the worker thread14:04
DocScrutinizer51very nasty lasting damage14:04
Aylawhich does not execute in an interrupt context14:04
DocScrutinizer51got it's own name in medicine14:04
Aylalarsc: what's the behaviour of writing that bit when the interrupt has yet to appear?14:05
DocScrutinizer51chlorine acne14:05
wpwrakand 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 uneven14:05
lekernelchlorine was only used for a short while, before they found more toxic stuff14:06
DocScrutinizer51undercuts getting a severe problem14:06
wpwraklekernel: a knife will kill you just as dead as a musket or a modern armor-piercing projectile ;-)14:07
lekernelchloracne is actually not caused by chlorine, but organic compounds14:07
lekernelsome containing chlorine atoms in the molecule (thus the name)14:07
lekernelbut Cl2 doesn't cause chloracne14:07
DocScrutinizer51I'd not bet on that14:08
larscAyla: nothing should happen14:08
lekernelonly lung damage14:08
wpwrakgiven an ideal diode of size zero, ...14:09
DocScrutinizer51how's that damage working, chemically?14:09
wpwrakwho needs lungs anyway ;-)14:09
lekernelI can imagine there are many reactions. chlorine is a very reactive compound.14:09
lekerneleats through most materials14:09
DocScrutinizer51so what's the result of Cl2 reacting with the organic material in your lungs?14:10
lekernellung goo14:10
wpwrakthe problem isn't the original "pure" gas you inhale. it's the blood you spit later :)14:10
DocScrutinizer51and chloro-organnic compounds, no?14:10
lekernelno, I think that's a different toxicity14:10
lekerneltry putting some piece of meat in a bottle of chlorine for a while :)14:12
larscwpwrak: ah, thats overrated, i've been spitting blood for the last 4 days and i'm still alive ;)14:12
DocScrutinizer51I seem to recall a teacher who poisoned half the class of pupils with chlor gas, and most of them got chlor acne14:12
wpwraklarsc: been in a bar fight again ? :)14:12
DocScrutinizer51but I might be wrong, as that's been a news of 30 years ago14:12
wpwrakwas that in chemistry or history ?14:13
larscwpwrak: I at least look like as if I had been. Had my wisdomtooth removed...14:14
DocScrutinizer51in newspaper?14:14
DocScrutinizer51aaah, in chemistry14:14
wpwraklarsc: ah, dental bliss. always the most exquisite of pains.14:14
Aylalarsc: 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 first14:15
Aylalarsc: and the code first writes the IREG then sends the "stop" command14:15
larscAyla: might be an issue, but i doubt it14:17
Aylaif it was not, it wouldn't be written on the doc to do so, no? :)14:18
whitequarkoh, Cl2 in lungs is easy: Cl2 + H2O = HCl + HOCl14:21
whitequarkit's like drowning in acid14:21
larscAyla: which page?14:21
Aylapage 47714:22
larscwhich file?14:25
lekernelwhitequark: hmm, Cl2 doesn't do that with water on itself14:26
lekernelby itself14:26
lekernelit 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)14:27
whitequarklekernel: maybe one of 1000s of biological compounds in lungs acts as a catalyst?14:30
whitequarkwell anyway, I'm pretty sure that Cl2 would attack them on itself, too14:30
whitequarkbut from my chemistry class I recall that chlorine danger is from its dissolution in water14:31
lekernelsure, 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 water14:32
whitequarkah, so you mean that Cl2 can dissolve in water just as any other gas would14:32
lekernelit's _particularly_ soluble in water14:32
whitequarkyeah, that's plausible14:32
lekerneliirc you can dissolve dozens of liters of Cl2 in a liter of water14:32
lekernelat room temperature and atmospheric pressure14:33
Aylalarsc: that's not a big problem, that interrupt is never un-masked14:33
whitequarkand let me find the ratio of that reaction14:33
lekernelhm, no, that's only 1 liter. still a lot.14:34
whitequarklekernel: https://aquaox.wordpress.com/2010/01/27/chlorine-efficacy/14:37
whitequarklooks like unless you have a real lot of chlorine in water, it's mostly hydrolysed14:37
whitequark(which is somewhat expected)14:37
lekerneldepends on pH http://aquaox.files.wordpress.com/2010/01/r_wqb_chlorine_graph.gif14:39
whitequarkyeah, that's why I said "a lot"14:40
whitequarkgenerally, pH of lungs is near to neutral14:40
lekerneland... chlorine hydrolysis itself changes the pH, as it generates H+14:40
whitequarkso that'll come to an equilibrium somewhere on the left side14:41
wpwrakconclusion: if you smell chlorine, try to inhale as much of it as possible, to avoid lung damage14:42
whitequarkbesides 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 too14:42
wpwraki think there may be an opening in the argentina ministry for public health. they need people who think like that ;-)14:42
whitequarkwpwrak: you seem to be proud of your government :)14:43
wpwrakwhitequark: oh yes, everybody here is proud of it. there were protest marches against it thursday and friday, with more predicted for next week14:43
whitequarkhuh. and here, the "occupy" movement has finally came from the overseas14:44
wpwrakwhitequark: 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 system14:44
wpwrakvive la revolucion mondial ! :)14:47
lekernelwpwrak: heard of the Shadoks? :)14:48
wpwrakno accents here :)14:48
wpwraknot yet14:48
lekernel"When one tries continuously, one ends up succeeding. Thus, the more one fails, the greater the chance that it will work." etc. :)14:49
Aylawpwrak: I thought that was french :)14:49
wpwraki'm just reading wikipedia ... interesting. that's pretty much exactly how our government chooses to do things14:50
wpwrakwhat 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 on14:58
wpwrakthey 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.)14:59
wpwrakthey 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.15:00
larscwpwrak: what's the interest for loans?15:01
wpwraklo 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)15:01
wpwrakwait, it gets better15:02
wpwrakthen, 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.15:04
qi-botThe build has FAILED: http://fidelio.qi-hardware.com/~xiangfu/building/Nanonote/Ben/openwrt-xburst.full_system-20120602-1340 15:05
wpwrakhis 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.15:05
wpwrakthat night, people were in the streets, voicing their disagreement15:06
Aylayou're on Buenos Aires?15:06
wpwrakmaybe 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.15:08
wpwraka 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.15:09
wpwrakAyla: yup15:09
wpwraka 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.15:11
wpwrakof 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)15:12
wpwrakand 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)15:15
wpwrakto 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.15:16
wpwrakwhen 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.15:18
wpwrakto 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 claims15:19
wpwraktuesday, he'll have an interview by the senate, which will then decide whether they'll accept him or not. this will be rather interesting.15:20
Aylalarsc: I have some comments about the jz4740_mmc_read_data15:22
Aylawhat's the "i" variable refering to exactly?15:24
Aylait gets the value "miter->length" but doesn't seem to be used as such15:24
wpwraklarsc: loans ... with a credit card, nominal 41% p.a., effective 50%, total cost of financing (with fees and such) 63%15:25
Aylalarsc: forget about it :)15:25
larscAyla: i is the number of .... ok15:25
wpwraknon-card loans are also in the 40-70% segment15:26
larscif 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 again15:26
Aylayes I got that,15:27
Aylabut how will it resume exactly?15:28
larscit will be called in the irq worker thread15:28
AylaI mean, if i != 0, and the second mmc_poll_irq() times out, some bytes are lost15:28
larscsg_miter_next will continue where sg_miter_stop has been called15:30
larscsee the the poll_timeout label15:30
larscmiter->consumed is updated15:30
Aylawhat about the while(j) loop then?15:30
wpwrak(that's for loans in pesos)15:30
Aylait checks 32 times for the IRQ flag, what if it times out at the 31st time?15:30
Aylathe content of "buf" will be lost, because the miter variable is not updated15:31
Aylaand you can't read those bits again, because of the FIFO15:32
larscwhy is it not updated?15:33
AylaI don't know15:35
Aylait should be,15:35
Aylabut it is not: http://pastebin.com/6br7bGTr15:35
larschm? if there is an timeout it will jump to poll_timeout, which will update it15:36
Aylawhich does not know how many bytes you actually read15:37
larscwhy not?15:39
Aylahow could it?15:39
larscwe increase the address of buf whenever we read data15:40
Aylaok. I give up.15:41
Aylalarsc: the IRQ will be un-masked before the jump to poll_timeout, there might be a race there15:45
Aylanow I'm seriously out of ideas15:46
larscthe thread won't be restarted, before the previous run has finished15:47
larscone thing you can try though is to call request_threaded_irq with IRQF_ONESHOT15:48
larscbecause there might be a race afterall15:48
larscyes, the thread won't be restarted if it is currently running15:51
larscyou could test whether this ever happens by modifing kernel/irq/handle.c and insert a printk in line 6815:52
larscayla, you said the problem was only occuring when you reclocked the cpu freq?15:54
Aylano, it's unrelated to the CPU clock15:54
Aylabut it happens more often at a high clock15:54
larscmakes sense15:55
larscbecause it polls faster15:55
larscthe timeout in jz4740_mmc_poll_irq shouldn't count the number of polls, but rather uses jiffies15:55
larscto make it immune to frequency changes15:56
Aylait's not a problem if it polls faster15:57
AylaI mean it's not related to the current problem15:57
Aylathe bug I'm trying to fix occurs when there is a timeout, having the kernel poll faster just trigger more timeouts15:59
Aylaon both cases the bug is there, that's what I mean16:00
larscit's that it polls faster is another issue16:00
larscthe fix should be IRQF_ONESHOT, this will ensure that the primary handler won't be called as long as the threaded handler is running16:01
Aylaheh, you really think it's that simple? ;)16:02
AylaIRQF_ONESHOT fixes nothing16:02
larscdid you try the printk?16:02
AylaI did, but I'm having a hard time seeing this, as when the bug appears the kernel crashes and my dingoo reboots16:03
Aylanote that if I un-plug the SD, the watchdog kicker in user-space will still work, and the device won't power off16:06
larscso it is a crash in kernel space?16:07
Aylayes, and I think that's what mth said too16:07
larscand you have no backtrace?16:07
AylaIIRC he said that the execution was stuck in the jz_mmc_irq handler16:07
Aylawhich was re-starting as soon as it exits16:07
Aylawhich sounds like a non-masked and non-cleared interrupt16:08
larscdo you have a serial?16:08
AylaI do16:09
larsccan you try to printk the non expected interrupts?16:09
AylaI need mth's code that forces timeouts, I downloaded it some days ago but now I'm on my netbook ...16:10
Aylado you have it on your log perhaps? He wrote the link in #dingoonity16:10
Aylaif I don't use that patch, the bug never appears, because the serial line introduces enough delay16:11
larscit's not in the log anymore16:11
Aylacorrection: it does enter the worker thread16:23
qi-bot[commit] Werner Almesberger: b2/subst.c (prepare_re): recognize % in union pattern (master) http://qi-hw.com/p/eda-tools/e93ff0e16:32
qi-bot[commit] Werner Almesberger: b2/: introduce unit pattern (##), for dimensionless values (master) http://qi-hw.com/p/eda-tools/cc895fe16:32
qi-bot[commit] Werner Almesberger: b2/test/: more substitution tests (master) http://qi-hw.com/p/eda-tools/12b21f016:32
qi-bot[commit] Werner Almesberger: b2/: add regular expression conversion debugging (option -R) (master) http://qi-hw.com/p/eda-tools/da1010f16:32
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/4a586fc16:32
qi-bot[commit] Werner Almesberger: b2/test/subesc: test regexp escaping in substitutions (master) http://qi-hw.com/p/eda-tools/3f4a06816:32
qi-bot[commit] Werner Almesberger: b2/: add "print VAR" command in substitutions (for debugging/tracing) (master) http://qi-hw.com/p/eda-tools/ee0a2a416:32
qi-bot[commit] Werner Almesberger: b2/subex.c (compose): search "out" variables before "in" variables (master) http://qi-hw.com/p/eda-tools/31c1c5816:32
qi-bot[commit] Werner Almesberger: b2/test/subcont: test "continue" in substitutions (master) http://qi-hw.com/p/eda-tools/e56a71e16:32
Aylalarsc: when one read times out, the JZ_MMC_IRQ_RXFIFO_RD_REQ interrupt is enabled16:33
Aylathat interrupt is handled by jz_mmc_irq, which starts the jz_mmc_irq_worker thread16:33
Aylaand re-starts a data transfer16:33
Aylabut the JZ_MMC_IRQ_RXFIFO_RD_REQ is never cleared16:34
Aylaso the transfer should work, as it polls for that flag16:36
Aylait times out on the first try, so it doesn't read a single byte16:38
Aylalarsc: so the jz_mmc_irq pops up because the JZ_MMC_IRQ_RXFIFO_RD_REQ interrupt happens,16:39
Aylabut the transfer times out because the JZ_MMC_IRQ_RXFIFO_RD_REQ flag on IREQ is missing.16:40
Aylahow good is that?16:40
larscthat actually makes some sense16:45
larsccan you confirm that it will timeout?16:45
larscis it really the rd_req timeout?16:47
larscReceive 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.16:47
larscfrom the datasheet16:47
larscsince we haven't read anything from the fifo it should still be set16:47
Aylayes, it is JZ_MMC_IRQ_RXFIFO_RD_REQ16:47
AylaI read 0x20 on the IREG when the interrupt happens16:48
larsci suppose removing the last jz4740_mmc_set_irq_enabled in the hardirq handler will fix it16:48
Aylalarsc: it should still be set, yes16:49
Aylabut it's not16:49
Aylaotherwise it would not time out16:50
larscnot 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 interrupt16:51
larscuhm and forget about what i said about jz4740_mmc_set_irq_enabled, i meant the writel to IREG16:52
Aylawe're not acking the rd_req interrupt, because it's not possible16:52
Aylathat bit in IREG is read-only16:52
larscso it is cleared after it has been masked?16:53
larscin hw?16:54
Aylait is cleared by the hardware, I believe16:54
larscyes, but why?16:55
larscthat's what we want to find out16:55
Aylathe first question is why is it cleared, while we can't write it16:56
Aylathe second question, is why is the interrupt reappearing?16:56
larscone possibility is that it ANDs the irq mask with the pending interrupts in hardware16:56
larscbecause we unmask the interrupt again16:56
larscit's actually easy to test. add a second read to IREG right after the jz4740_mmc_set_irq_enabled in the hardirq handler16:57
Aylano, I still read 0x2016:59
Aylaafter the mask is written17:00
larscand after writing to ireg?17:01
Aylasame value17:03
larscuhm, with mth's patch won't poll_irq always timeout?17:04
larscshould this 'if (--timeout_next)' be 'if (--timeout_next == 0)'?17:04
Aylaheh... good point17:06
Aylaok, now it times out a lot, but it still manages to load the root filesystem17:17
Aylawhich means that timeouts are not involved in the bug that occurs during resume17:19
larscyou can't be sure of that17:19
Aylawell, the timeout mechanism seems fine17:20
larscit works fine during normal operation17:21
larscthat's all you know17:21
Aylawell, yes17:22
mthlarsc: you're right about the timeouts21:43
mthis it expected that if everything is done on interrupts it won't mount the rootfs on time, or is there still an issue there?21:44
mthmounting a vfat partition shouldn't require all that much data to be read21:44
Aylamth, it's min-init job to mount the rootfs21:45
Aylaand it already waits for the SD card to appear21:46
mthis it the squashfs mount that times out then?21:46
Aylawhat timeout are you speaking about exactly?21:47
Aylawhat I know is that min-init tries to mount the VFAT partition until it eventually succeeds21:48
Aylawhich is weird, if you ask me, as the SD card should be ready as soon as it appears on /dev21:48
AylaI mean, the kernel should not allow it to appear in /dev if it's not yet ready21:49
mthat some point the kernel says it cannot start init and will reboot in 5 seconds21:51
Aylait does so when min-init gives up mounting the VFAT partition or the rootfs21:52
mthso it doesn't try until it succeeds then; it gives up after a while if it doesn't succeed21:55
Aylait tries 20 times, each try separated by 100ms21:57
Aylausually it fails a couple of times, that's why you can see errors on dmesg on OD21:58
Aylait would be better, IMHO, to make all calls return -ETIMEDOUT on the kernel, until the card marks itself as reseted22:02
Aylawell it probably does that already22:04
--- Mon Jun 4 201200:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!