#qi-hardware IRC log for Thursday, 2013-10-10

DocScrutinizer05apelete: please don't tell you have to mess with MG musb_core :-O01:04
DocScrutinizer05it's some heap of code junk almost as ugly as tty_serial, in linux. Makes your eyes bleed01:05
DocScrutinizer05actually musb_core engine itself gives you brain cancer01:06
DocScrutinizer05a state machine in hw, with no means whatsoever to externally control the state it's in, via sw01:07
DocScrutinizer05so musb_core kernel driver implements another state machine that mirrors the hw state machine and gets synced to it by the messages aka interrupts the hw sends01:08
DocScrutinizer05two state machines that run in sync, unbearably stupid design01:08
wpwrakroutine business in communications :)01:08
DocScrutinizer05and then you got power management, not only for musb_core but also for the ULPI and the CPU<->musb_core bus domains01:10
DocScrutinizer05of course each one separate from the other ones, but with obvious dependencies01:10
DocScrutinizer05on top of that you get OTG suspend01:11
DocScrutinizer05and in the end the whole friggin mus_core hw burns an unbelievable 60mA just for idling, as soon as you power it up01:12
DocScrutinizer05at least that's what I wasn't able to forget, from my enterprise with N900 hostmode01:13
DocScrutinizer05IOW: IIRC01:13
wpwraknice :) i guess the 60 mA are to provide the little demons inhabiting the design with a familiar environmental temperature ;-)01:15
DocScrutinizer05obviously TI thought when a device is operating in hostmode, then energy saving isn't a topic worth considering01:15
DocScrutinizer05I only hope for Nikolaus' statement to be correct, that the other USB cores are less greedy. Otherwise the USB link to modem in GTA04 is prone to kill the design01:17
DocScrutinizer05since that suspend-to-ram concept for OMAP phones is a silly idea01:17
DocScrutinizer05and no modem will really support it01:18
DocScrutinizer05OM only chosen this approach since the S3C24xx were utter crap and had NFC about zero-clock01:19
DocScrutinizer05at least I hope it was the reason to choose this broken-by-design approach01:19
DocScrutinizer05wpwrak: do you recall what's been the deal when considering zero-clock versus suspend-to-ram?01:21
DocScrutinizer05no kernel support (yet) for NOTICK?01:21
DocScrutinizer05or was it actually just the lack of static registers in S3Cxxxx?01:22
DocScrutinizer05I'm *really* unhappy with this USB interface to modem. I just recall that N900 keeps CPU active at 500MHz as long as anything is plugged to USB. I guess that's for a reason - prolly the musb-core can't wake the CPU 01:27
DocScrutinizer05and - depending on modem chipset - I might figure that same happens to the ARM and usb-core used in modem 01:29
DocScrutinizer05I wouldn't like to see both systems (APE and modem) power-up, enumerate, transfer 1 byte, power-down the USB 200 times per second01:31
DocScrutinizer05particularly since this wouldn't be possible to get done 200 times per second01:31
DocScrutinizer05I guess USB ENUM overhead is just too huge for doing that01:32
wpwrak(zero clock) hmm no, don't remember. maybe it wasn't as power-efficient as real suspend, with all the special hw tweaks ?01:32
wpwrakah, no dedicated interrupt line ? that sucks :)01:32
DocScrutinizer05given the difficulties I recall we had with just changing CPU clock frequency in S3C24xx, I doubt it could zero-clock at all, particularly not when peripherals like UART shall still stay on standby and even operational ready to receive a byte to buffer01:34
DocScrutinizer05iirc everything been just cpu clock * $multiplier01:35
DocScrutinizer05so when changing cpu clock (by freq-governor) you had the problem of glitches in UART etc unless you temporarily suspend them, which you can do only after stopping/finishing any ongoing transmission01:36
DocScrutinizer05just that you don't know about 1st byte of a newly started transmissin inbound, before the byte completely is in buffer01:36
DocScrutinizer05(interrupt line) well for sure there's no interrupt line to wake CPU and musb_core, on ULPI level01:38
DocScrutinizer05dunno if there's a wake-irq from musb_core to CPU01:38
DocScrutinizer05ok, on hindsight - and looking on the facts I just summarized - it might have been just the CPU running at 500MHz without any break that caused the 60mA increased system power consumption that we observed as soon as musb_core active01:40
DocScrutinizer05and funny enough this "patch" to nail cpu clock to 500 when USB, it got introduced by Nokia as late as maemo fremantle PR1.2 iirc01:42
wpwrakwell, you lose uart either way ...01:42
DocScrutinizer05hmm?01:42
DocScrutinizer05when uart has own stable clock, you can mess around with cpu clock all you like01:43
wpwrakwhether you stop the clock or suspend the whole cpu. uart is gone then. all you have are your interrupt lines. and maybe rtc and such.01:43
wpwrakokay, if :)01:43
wpwrakbut just keeping the oscillator running is pricy ...01:44
DocScrutinizer05I talked about changing cpu clock (in S3C24xx) not about +stopping* it01:44
DocScrutinizer05been a PITA in GTA02 since you always had windows where you get transmission errors on UART, aiui01:45
wpwrak(interrupt line) well, the module may have some more signals than just usb ? of course, if they really do everything over usb, you lose ...01:45
wpwrakthat's why you want robust protocols :)01:45
DocScrutinizer05all you can do is unset CTS and wait if another few bytes may come in, before you mess around with (uart) clock01:46
DocScrutinizer05I didn't get it why Nikolaus used USB to link to Option module, to start with01:46
DocScrutinizer05there are PCM and serial interface as well01:47
wpwrakask him ?01:47
DocScrutinizer05I did, and I admit I forgot his rationale01:47
DocScrutinizer05maybe sth along the line of "so we don't need muxer"01:48
DocScrutinizer05which otoh opens a path for a sw fix, when we just ignore USB and actually use muxer on serial01:48
DocScrutinizer05heck, GTA04 even has a PHY to talk to Option module01:50
DocScrutinizer05:-o01:50
DocScrutinizer05with charge pump and all01:50
DocScrutinizer05just no VBUS ;-P01:51
DocScrutinizer05and I'm pretty puzzled that Option actually seems to work even without VBUS, in peripheral mode01:52
DocScrutinizer05but there's a ticker along the line of "frequent re-ENUM on modem USB"01:52
DocScrutinizer05ticket even01:53
DocScrutinizer05I wonder why ;-)01:53
DocScrutinizer05USB is a terribly complex module with a lot of overhead, for a simple task like "shuffle bytes between A and B, at high speed with no delay and no errorchecks"01:55
DocScrutinizer05s/module/protocol/01:55
DocScrutinizer05*ENUM* says it all01:56
wpwrakno delay ? you can't mean USB then ...02:02
DocScrutinizer05that's my point, well one of them02:09
DocScrutinizer05USB is overly complex to replace a simple A<->B bytestream single channel duplex connection02:11
DocScrutinizer05feels like using tcp/ip to replace a rs23202:12
DocScrutinizer05actually cheapernet tcp/ip02:15
DocScrutinizer05wpwrak: do you recall who stated that USB was too power greedy and too much overhead and we shouldn't use it for the MC75, back in OM GTA03 days? The Siemens guys? Or sb of OM, even you?02:17
wpwraki does sound like something i may say. not sure if i was involved in that discussion, though.02:26
wpwraktcp/ip is MUCH lighter than USB02:26
DocScrutinizer05indeed02:43
DocScrutinizer05never heard of tcp/ip ENUM or SNP or HNP or suspend, and ports are only a poor description of EP, and UDP not really a similar technics than isochronous02:45
rohDocScrutinizer05: the serial interfaces usually dont get you full datarates possible via 3g06:05
rohmost end at 1.2-2mbit06:05
rohso for hsdpa and similar one might need usb(2) to gain from that. for long-term powersaving usb sucks. correct. thats why basically all these modules do multiple links or augment the usb with proprietary extensions.. and if it only may be 1-2 gpio/irq lines to trigger wakeups or 'resume polling'06:06
rohin openmoko times.. well.. usb1 host would have been what we could have done.. but without 3g on the modem that never made sense ;)06:07
rohalso the calypso doesnt know usb, so that would have been with a hypothetical module which wasnt in discussion since we had to use the fic owned calypso design.. you remember? ;)06:08
DocScrutinizer05I remeber talking to the siemens guys about MCi75 module, for GTA03. But yes, you're basically right07:43
DocScrutinizer05we found serial been fast enough for edge07:43
DocScrutinizer05http://www.wmocean.com/siemens-mc7507:45
DocScrutinizer05I wish the Option would support SSI/HSI07:48
DocScrutinizer05I guess we will have lots of fun with USB drivers until this contraption works like expected, without burning energy for idle standby or introducing seconds of delay for ENUM on start of each transmissin after a few seconds of idle07:50
DocScrutinizer05(this contraption == Option601/801 on OMAP via USB)07:50
wpwraki think you want to look for alternative signaling mechanisms to use in parallel to USB, as roh has suggested07:51
wpwrake.g., get a dedicated interrupt/wakeup line, and only bring up USB when that one tells you there's work to do07:51
apeleteHi there08:02
apeleteDocScrutinizer05 wpwrak: just read the log of last night conversation about dealing with musb08:02
apeleteit's funny how every single kernel hackers seem to think that dealing with usb/musb is a messy enterprise :-)08:03
DocScrutinizer05wpwrak: it's not about the concept - it already occurred to me. It's about the overhead of "bringing up"08:03
DocScrutinizer05USB prolly times out when simply stopped08:04
apeletesince I know little about usb to begin with, I guess I can't tell the difference between what's messy and what's not ;-)08:05
DocScrutinizer05apelete: well for me it was, when I tried to make (and finally made) usb hostmode work on N900, despite the hw bugs08:06
apelete<DocScrutinizer05> apelete: please don't tell you have to mess with MG musb_core :-O08:06
apeleteDocScrutinizer05: what does MG stands for ?08:06
DocScrutinizer05mentor graphics08:06
apeleteok08:06
DocScrutinizer05a company that better gets erradicated from God's great earth08:07
apelete:)08:07
DocScrutinizer05wpwrak: (USB) ...so at very least I guess you need to suspend the USB08:09
DocScrutinizer05if that's feasible at all with non-OTG devices08:09
DocScrutinizer05otherwise you need to re-ENUM and that will take seconds08:10
DocScrutinizer05luckily we don't plan to follow the suspend-to-ram strategy in our frankeN900 aka Neo900, and thus we can tickle USB every second with low penalty in power consumption08:12
DocScrutinizer05but I doubt this will help to wake up the musb-core when modem wants to talk to APE08:13
DocScrutinizer05would need some sort of flow control for USB, and I never heard of such thing08:14
Action: DocScrutinizer05 feels nausea08:14
DocScrutinizer05apelete: can you help me out?08:15
apeleteDocScrutinizer05: sure, help with what ? (don't know if I can, I'm really a noob when it comes to usb :-) )08:28
DocScrutinizer05oh, I got you wrong then08:31
DocScrutinizer05hanks anyway08:31
DocScrutinizer05thanks*08:31
wpwraksuspend doesn't require OTG. not sure how long it takes, though. i regularly choose not to implement it ;-)08:33
wpwrakand the wakeup wouldn't come over USB itself but via some additional signal the module may have (just like it probably does for UART, etc.)08:34
whitequarkwpwrak: iirc suspend takes about 5ms or so09:25
whitequarkit counts missed frames, when it's 4 it suspends09:26
whitequarkI think09:26
DocScrutinizer05wow10:31
DocScrutinizer05so basically auto-suspend?10:32
DocScrutinizer05wpwrak: UART can happily idle along and resume/wake CPU when a byte in buffer10:33
DocScrutinizer05even on start bit getting transmitted I guess10:33
whitequarkrechecked. it's 3ms10:35
whitequarkDocScrutinizer05: yeah10:35
whitequarkfrom the looks of it usb doesn't seem like a power hungry thing (while in idle at least)10:35
whitequarkthere's probably something I'm missing10:35
rohwhitequark: well.. maybe that without special extra lines there is no real idle11:20
rohone needs to poll every 100ms11:20
rohyou only can cheat stuff, like not enumerate the bus and hardcode stuff11:21
rohbut you cannot come around the polling while the link is active, even when there is no traffic11:21
rohthe 'expensive' part is more in the protocol handling. wastes a lot of cputime when all you want to do is what hdlc and serial lines were designed for ;)11:22
rohwell but thats life. sometimes there is no nice way around it. maybe there are modules with fast spi which can do full 3g/4g datarates. dunno.11:23
wpwrak(checked USB suspend/resume) there is non-polling wakeup from both sides. so an all-USB solution (without wakeup signal) should be sufficient. you still need to provide 5 V, though. (unless you have a private agreement among your devices to not need that)12:30
whitequarkroh: rs485!13:07
whitequarkwhy does one need to poll each 100ms?13:07
rohwhitequark: dont ask me. thats how usb works13:10
whitequarkroh: first time I hear that; I could use some reference13:11
rohusb works by pollin13:12
rohg13:12
whitequarkoh13:12
rohthere is no irq line.13:12
whitequarkthat's each 1ms13:12
rohbasically the host needs to ask all devices periodically and the idle poll is atleast 100hz or so13:12
whitequarkwell, it depends on speed I think. full-speed has sof at each 1ms13:12
whitequarkand on high-speed it's each 125us13:14
whitequarkroh: but, if the device is in sleep mode, there's no activity on bus, and wakeup is asynchronous13:14
whitequarkso it's essentially interrupt-driven if you aggressively put the bus to sleep13:14
rohwhitequark: ive never seen that13:14
rohusually the bus sleeps when you suspend the machine and else not13:14
whitequarkroh: which part?13:14
whitequarkoh13:14
rohmost disable suspend because its buggy with loads of devices13:15
whitequarktrue dat13:15
rohhow should a not polled (sleeping) bus client wake up the host?13:15
whitequarkhowever if you control the whole system you can make it work13:15
whitequarkroh: it pulls up one of the lines13:15
whitequarkor maybe both. same idea13:15
rohtrue. still nasty complicated for somesthing that simple13:15
rohah. ok. like a i2c bus?13:16
whitequarksorta13:16
wpwrakmore like high/low speed detection13:18
whitequarkthe timing's not cool though13:18
whitequarkWhen the host wants to wake the device up after a suspend, it does so by reversing the polarity of the signal on the data lines for at least 20ms. The signal is completed with a low speed end of packet signal.13:18
whitequarkIt is also possible for a device with its remote wakeup feature set, to initiate a resume itself. It must have been in the idle state for at least 5ms, and must apply the wakeup K condition for between 1 and 15 ms. The host takes over the driving of the resume signal within 1 ms.13:18
wpwrakin idle/suspend, the bus is J, in resume, it's K. see also figure 11-17 on page 333 of the USB 2.0 spec13:19
wpwrakyeah, that one :)13:19
whitequarknewer phones (eg SGS2) use an USB-ish protocol13:20
whitequarkit's USB2 above physical layer, and on physical they did something to transceivers13:20
whitequarkto make them eat less13:20
whitequarkI'm not sure what in particular though13:20
rohyeah. dont worry.. in a few years we will use pci-express links anyhow for internal modems13:22
whitequarkriiight, let them be bus masters again13:23
whitequarkwhat could go wrong13:23
wpwraknothing. trust us :)13:24
Action: whitequark . o O ( when was wpwrak recruited by NSA? )13:24
rohwhitequark: bus masters? not the issue.. thats what iommu are for13:26
whitequarkiommus are still 'high end' even for pcs13:27
larscwhitequark: who do you think sponsors the anelok development13:27
whitequarkthough I can see how that changes in ~5yrs before we see phones with pcie modems13:27
rohwhitequark: youve seen the arduino from intel?13:28
rohthat one has pci-e13:28
rohso.. lets wait ;)13:28
whitequarkroh: yes, that was hilarious13:28
whitequarkhttp://www.jinx.de/ItsNotAFeature.mp413:34
whitequarkinteresting: http://homes.esat.kuleuven.be/~gacar/fpdetective/#paper13:52
viricwhitequark: yes, interesting. thank you!15:25
wpwrakwhitequark: "... howing a complete disregard towards Do-Not-Track" who would have thought ? :)15:51
viricthe whole idea of adding a flag 'do-not-track' to firefox is evil15:55
viric(meaning the do-not-track http thing)15:56
mthdo-not-track is just another data point to fingerprint15:56
mthadvertisers already said they would use do-not-track to disable the display of targetted ads, not disable the tracking itself16:02
mthhow hiding the results of the information they collect is supposed to make me feel better, I don't know16:03
wpwrakoh, if it hides ads, that could be useful. but yes, it's a fig leave, nothing more16:10
mthit doesn't hide ads, it just replaces targetted ads with random ads16:10
wpwrakso useless and annoying ads are replaced with ads that are marginally more useless and annoying. ah, the marvels of modern technology :)16:12
viricwpwrak: enjoy the boolean option16:20
whitequarkthe whole do-not-track idea is moronic16:26
whitequarkkill third-party cookies, watch the advertisers burn16:27
wpwrakwe should have peer-to-peer identity swapping. when a site asks for something identifiable, present someone else's16:42
wpwrakwould need a whitelist, though, to avoid swapping access credentials. well, unless one is okay with that :)16:43
whitequarkthat implies there is a concept of "identity"16:46
whitequarkbut it's not; it's just a thousand random ways your browser remembers stuff16:46
whitequarkhow do you separate credential cookies from identity cookies?16:49
wpwrakyou make a list ... and maybe never visit sites with "valuable" accounts with that browser16:55
whitequarkyou could just disable cookies then16:55
whitequarkpersistence in web has surprisingly little value besides authentication16:56
mthI have cookies disabled except for whitelisted sites, but it's been a pain since the EU cookie directive17:01
mthbecause sites use cookies to check if they already told you that they use cookies17:01
mthand often won't let you use the site until you dismiss their cookie notice17:02
mththe whole cookie directive is another bad idea17:02
mththey should either have outlawed tracking cookies, or let end users fend for themselves17:03
mthinstead, they picked a half measure which doesn't help privacy and causes a lot of inconvenience17:03
uncloudedI have a cookie whitelist too.  it's great once set up.  I get the occasional redirect loop.  not had trouble with European sites yet though23:02
mththe trouble is that I need to whitelist sites now that I could leave on the default deny previously23:03
--- Fri Oct 11 201300:00

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