Archive for November, 2005

Ottawa Sanity

Sunday, November 27th, 2005

[Update: The Canadian government has been toppled in an unprecidented vote of no-confidence. Hopefully the liberals will return on January 23. ]

Ottawa has pledged extra money to keep skilled workers in Canada rather than force them to leave before applying for citizenship. This is excellent news, and makes my goals even more achievable. Anyone want to offer me a job? :-)

Now all Martin needs is to get past Monday and those annoying Conservatives. Every country has its very own pointless political institutions. Many of them begin with the letter “C” and just don’t seem to get the tree-huggingness of my perfect political environment.

It’s 04:51. I’m on JST again.

Jon.

Thanksgiving

Saturday, November 26th, 2005

This weekend is the US Thanksgiving (Canadian Thanksgiving is in October and celebrates the generally earlier Canadian harvest), which is basically a celebration of the tibulations of a bunch of Pilgrims who fled to the New World to escape religious persecution (having tried Holland but not gotten on so well with the dutch). It’s interesting, because most of the pilgrims died in the first year and had a truly horrid time – so historically, not the best of outcomes for people heading to North America. Today, it would seem that Thanksgiving is such an important family event because it’s the one time in the year when the whole country enters a shutdown for a long weekend (bearing in mind that my US friends are lucky if they have 4 weeks of holiday a year vs. our statutory allowances) and people can go visit one another – it’s also a very important shopping weekend and marks the turn in trade as things subsequently ramp up for the pre-Christmas shopping days which now lie ahead. Anyway, as part of my North American studies, I’m going to a Thanksgiving tomorrow and am looking forward to that with some interest.

I’ve booked a bunch more flights and just generally gone a little crazy over the last day. I’m now up to 10 flights around the States and a few booked trains so far (including going to Toronto basically just to get some Maple Tea for myself – I’ll need to bring back a few kilos – and to convince Whittard tasters that they should have it). I’ve been talking to some guys I know in States I’ve not been to yet – the map below shows that I’ve generally only been to the coastal regions. Next year, I hope to visit Texas and some of the American heartland States. I’d also like to do a road trip on US66 if that can be arranged ahead of next summer’s OLS. I will try to go to Burning Man next year, since it’s something all the cool cats have been to and I hate feeling left out.

US Map with visited locations marked

Figure: Plan for world domination 2005 – visited 22% of US States by year’s end.

I was tinkering around with OSS last night for various reasons. Turns out that setting mixer settings is actually not as hard as I thought, but I’m sure it is lovingly more complex under ALSA. Anyway, since I didn’t care to spend hours reading ALSA API, I found that it all I needed was a couple of ioctls and a bit of masking magic to do what I wanted – the moral is, never underestimate the power of what was there before. I had sushi at the Canonical offices yesterday and found an excellent little cookie and coffee place on Kensington Highstreet. I’ve got a few articles done, just three more to get finished up over the weekend and a chapter on the book.

Jon.

Various bits and pieces

Wednesday, November 23rd, 2005

Last night was a super conference call day knockout bonanza! Amongst other things, I had a chat with the kind folks at Cray about their XD1 and Linux involvement over the last few years. I pointed out that I used my first Cray around 10 years ago and that of the Virtex II Pro technology they use, I did one of the three Linux ports myself. So, we had some good pretext for a lively conversation – then I learned that the guys I was talking to were mostly in Canada at the time (I thought so, from the accents) and just geeked out a little bit more. Looks like I’ll be up visiting a UK installation over the next couple of weeks – I’d be keen to get involved with that a bit more (I’ve probably still got some massively parallel array sorts I wrote kicking around here someplace). After that call, the next call with the publisher went quite well too and I decided to try sleeping early and getting online again early today.

Planning for $thing at the moment. Certainly should be quite interesting (looking forward to being able to say more about it) but will require a bit more time this week. Currently, I’m using my uptime to get synced up with some deadlines as I’m out and about on Thurs/Fri of this week doing the lunch thang. Andrew Morton is being typically demanding by asking that my floppy fix from a couple of weeks back actually work under all circumstances :-) It’s not easy with the current driver because it likes to poll the floppy drive async with respect to operations which need to know if they can currently write to the inserted disk. All this means is that I’m going to have to re-jig bits of the rest of it so that it works how I wanted. On the subject of amusing kernel patches (was I on that subject anyway?), Greg KH posted a super-piss-off-the-anti-GPL-people patch yesterday with his not so subtle s/EXPORT_SYMBOL/EXPORT_SYMBOL_GPL/ replacement in the PCI core driver code. That’ll make it impossible to write non-GPL PCI drivers if it gets accepted (cool!).

Back to work now.

Jon.

Trip Planning, Meetups, and writing fun

Sunday, November 20th, 2005

My current flight itinerary for December (updated as it changes):

UA9230 LHR (2005/12/15 11:05) -> MUC (2005/12/15 13:50)
UA8871 MUC (2005/12/15 15:15) -> JFK (2005/12/15 18:25)
UA21 JFK (2005/12/19 08:00) -> SFO (2005/12/19 11:21)
UA886 SFO (2005/12/19 12:11) -> LAX (2005/12/19 13:30)
UA304 LAX (2005/12/20 13:45) -> SFO (2005/12/20 15:06)
UA830 SFO (2005/12/24 10:55) -> ORD (2005/12/24 17:10)
UA7690 ORD (2005/12/24 17:45) -> YUL (2005/12/24 20:54)
AC706 YYZ (2005/12/29 10:15) -> LGA (2005/12/29 11:40)
UA8840 JFK (2005/12/29 16:05) -> FRA (2005/12/30 05:30)
UA8809 FRA (2005/12/30 07:25) -> LHR (2005/12/30 08:05)

Train itinerary (updated as it changes):

VIA33 Montreal (2005/12/26 10:00) -> Ottawa (2005/12/26 11:39)
VIA43 Ottawa (2005/12/28 08:40) -> Toronto (2005/12/28 13:00)

I went to The Orange Tree in Richmond yesterday afternoon to see Three in the back, two in the head, an interesting small theatre production concerning the events surrounding the cold war and the Star Wars project. I went with one of the London meetup groups I have joined. It’s a cool way of hanging out with Canadians and other North Americans as well as various other interesting people. Hopefully, we’ll organise a trip to Snowdon for January. Actually the social thing is fun – I’m hanging out with the local climbing group a bit more now too. I went along on Thursday evening and tried solving a few problems the guys were making up, but I need to go to the gym more often if I’m going to hope to keep up with Dan and Stefan.

Figure: North America trip, December 2005.

I’m going to be hooking up with Bill for a few days in December, so I’ve got to book some more flights within the US. In an ideal world where I sort out my full itinerary soon, then I’ll fly via Los Angeles so I can hook up with Daniel while he’s simultaneously on vacation – and can then potentially swing by Anaheim for some coffee. I’m booked to fly into NYC on Dec 15 and then must go and see Washington D.C. (the Smithsonian in particular) before Christmas. I’m also expecting to take a train to Boston (in the US trains seem to run mostly in the mornings between these places so I have a choice of crashing in a hotel or taking the late coach back – depends on the price) and will then fly over to San Francisco for a few days. I’ll then take a train from NYC to Montreal and hang out with Eric, before going on to Ottawa. I haven’t decided yet whether I can really fit in going to Halifax this time, but I’d like to.

IBM sent me an OpenPower 710 to play around with. It’s nice and heavy and filled with 64-bit goodness. I’ll use it to test things for the book and to play around with the hardware virtualisation support under Linux. Now that I’ve got some decent POWER5 kit I can actually hack on the ppc64 tree a little. My floppy patch from before turned out to need a fix which exposed some other problems in the floppy driver I need to look at – in fact there’s a whole bunch of stuff I should help to fix.

The Wall Street Journal called me up last week as a source for an article on Ottawa. I had more than a few nice things to say about the place and why everyone should go visit.

Jon.

San Francisco – gun ban law passes

Thursday, November 10th, 2005

According to Google News, voters did pass the gun ban law I mentioned last week. Unfortunately, it’s looking doubtful that it will come to fuition because:

  • A similar law in 1982 was overturned as pre-empted by State law.
  • The NRA and gun toting second amendment nuts are out in force.

That’s a shame. As I said before, I really grok the reasoning people have for owning guns and really grok the dangerous uses they have. I generally don’t like repressive laws but in this case the voters (the people) have decided they don’t want guns – and if the people wanted guns again then they could get another bill put before the legislature.

I doubt very much that they’ll see sense. There are too many people saying it’s a bad thing for this ban to last very long. I wouldn’t pass legislation against owning handguns anyway, I’d simply go for the aggressive taxation approach. Just like for tobacco, if we made it so prohibitively expensive for anyone to smoke or own guns then the problems would soon improve.

[ED: I don't mean that we currently have high tobacco taxes. I'm talking super taxation. ]

Jon.

ppc4xx_dma sucks

Wednesday, November 9th, 2005

The DMA generic handling code for ppc4xx is broken. This is apparently well known enough that nobody is relying upon it. I learned this the hard way when implementing DMA to/from NAND flash MTD devices. Here’s a handy hacker’s guide to doing it right. The key thing is to not rely on any of the generic routines and to do direct setup of the DMA engine for yourself. To configure channel 2 (numbers in brackets correspond to the datasheet):

mtdcr(DCRN_DMACR2, 0);
/* 1. Set the transfer width: */
mtdcr(DCRN_DMACR2, SET_DMA_PW(PW_8));
/* 2. Source Address: */
mtdcr(DCRN_DMASA2, source_address);
/* 2. Destination Address: */
mtdcr(DCRN_DMADA2, destination_address);
/* 3. Set Count: */
mtdcr(DCRN_DMACT2, len);
/* 4. Clear Status: */
mtdcr(DCRN_DMASR, DMA_CS2|DMA_TS2|DMA_CH2_ERR);
/* Source Increment: */
mtdcr(DCRN_DMACR2, mfdcr(DCRN_DMACR2) | SET_DMA_SAI(0));
/* 5. Destination Increment: */
mtdcr(DCRN_DMACR2, mfdcr(DCRN_DMACR2) | SET_DMA_DAI(1));
/* 5. Software memory-to-memory: */
mtdcr(DCRN_DMACR2, mfdcr(DCRN_DMACR2) | SET_DMA_TM(TM_S_MM));
/* 5. Interrupt Enable: */
mtdcr(DCRN_DMACR2, mfdcr(DCRN_DMACR2) | SET_DMA_CIE_ENABLE(1));
mtdcr(DCRN_DMACR2, mfdcr(DCRN_DMACR2) | SET_DMA_PL(EXTERNAL_PERIPHERAL));
mtdcr(DCRN_DMACR2, mfdcr(DCRN_DMACR2) | SET_DMA_ETD(1)); /* 1 req. */
mtdcr(DCRN_DMACR2, mfdcr(DCRN_DMACR2) | SET_DMA_TCE(1)); /* 1 req. */

To display the configuration:

printk("DMA Configuration:\n\n");
printk("DCRN_DMACR2=0x%08x\n", mfdcr(DCRN_DMACR2));
printk("DCRN_DMASA2=0x%08x\n", mfdcr(DCRN_DMASA2));
printk("DCRN_DMADA2=0x%08x\n", mfdcr(DCRN_DMADA2));
printk("DCRN_DMACT2=0x%08x\n", mfdcr(DCRN_DMACT2));
printk("DCRN_DMASR=0x%08x\n", mfdcr(DCRN_DMASR));

To enable the operation:

mtdcr(DCRN_DMACR2, mfdcr(DCRN_DMACR2) | SET_DMA_CE_ENABLE(1)); /* 5. Channel enable */

Sit and wait on an completion and have the interrupt handler also do this:

mtdcr(DCRN_DMASR, DMA_CS2|DMA_TS2|DMA_CH2_ERR); /* zero status */

Apprently, there’s talk of a generic DMA abstraction, which would be nice. I’m keen to help out with that once I get back onto playing with 2.6 proper.

I spent a bit of time over the weekend tidying up odds and ends on the magazine and doing some other writing. I’ve received an advance on the book now (and figured out how to pay a dollar cheque into my bank – that was fun) and am officially writing. Not that I’ve gotten very far yet but the important thing is I’ve at least started trying to make some progress. I’ve also written a bunch of other stuff and started reading more Bill Bryson. I’ve developed a morning routine of having coffee, a pasty, reading a bit of my book and catching up with The Independent. That’s a quality newspaper. I was shocked yesterday to discover that as of January all offences will become arrestable under law (no matter how trivial) and today they’re doing a good job of bashing Blair over the 90 day terror detention crap.

Jon.

Californian Sanity

Saturday, November 5th, 2005

San Francisco voters will decide on Tuesday whether to ban the sale and posession of hand guns within city limits. This is good news, for a variety of reasons but on the whole will do little to impact upon the horrifying national gun crime statistics for the United States as a whole. See, I believe on a fundamental level that I should have a right to bear arms (I don’t in the UK in general) but I’m really glad we don’t allow just anyone to walk in off the street and buy a gun so they can go postal with it. If it weren’t for the fact that the US doesn’t implement gun control in a sane fashion and that you’re statisically far more likely to accidentally kill one of your family members than defend against a would-be burglar then I might understand the realities of a country which still believes it necessary for people to own guns to prevent the government from being too powerful. While it’s quaint that the constitution provides for this measure, they didn’t have nukes back then or big insane guns that exist today – the average person aint gonna take on the US government and win any more so quit with that rhetoric already.

Still, in the UK, it’s the first day of the first hunting season after the ban on fox hunting. There are still a few insane whackjobs out there trying to exploit loopholes or just ignore the law completely (because they believe that cruelty to animals is an acceptable side effect of their “sport”) but hopefully they’ll slowly be convinced that it’s no longer acceptable in society. I really do feel for those people losing livelihoods over the whole thing, but in much the same way that the tabacco industry is going to suffer, I think it’s right in the end. I would like to see more government provision for these people to retrain in less callous endevaours however.

Jon.