From: W. van den Akker Date: Thu, 5 Feb 2009 22:44:15 +0100 Subject: [ath9k-devel] [RFC] Serialization of writes In-Reply-To: <20090205213332.GB12298@tesla> References: <20090204011216.GA8220@tesla> <200902052144.52031.listsrv@wilsoft.nl> <20090205213332.GB12298@tesla> Message-ID: <200902052244.15862.listsrv@wilsoft.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On Thursday 05 February 2009 22:33:32 Luis R. Rodriguez wrote: > On Thu, Feb 05, 2009 at 12:44:51PM -0800, W. van den Akker wrote: > > On Thursday 05 February 2009 20:42:55 Luis R. Rodriguez wrote: > > > On Thu, Feb 5, 2009 at 10:28 AM, W. van den Akker > > > > wrote: > > > > On Thursday 05 February 2009, W. van den Akker wrote: > > > >> > On Wed, Feb 4, 2009 at 2:43 PM, Chris Kennedy wrote: > > > >> >> On Feb 4, 2009, at 4:06 PM, Luis R. Rodriguez wrote: > > > >> >>> On Wed, Feb 04, 2009 at 01:02:06PM -0800, Chris Kennedy wrote: > > > >> >>>> On Feb 4, 2009, at 2:49 PM, W. van den Akker wrote: > > > >> >>>>> On Wednesday 04 February 2009, W. van den Akker wrote: > > > >> >>>>>> On Wednesday 04 February 2009, Luis R. Rodriguez wrote: > > > >> >>>>>>> On Tue, Feb 3, 2009 at 5:12 PM, Luis R. Rodriguez > > > >> >>>>>>> > > > >> >>>>>>> wrote: > > > >> >>>>>>>> Some devices requires serialization of writes, this is > > > >> >>>>>>>> required for AR5416 and AR9280 PCI devices. This was not > > > >> >>>>>>>> implemented in ath9k > > > >> >>>>>>>> though. Here's an attempt, but I have no way of testing > > > >> >>>>>>>> this as I haven't had issues with my systems or cards. I am > > > >> >>>>>>>> not sure if this > > > >> >>>>>>>> should fix some of the current issues being reported but it > > > >> >>>>>>>> may help. > > > >> >>>>>>>> > > > >> >>>>>>>> Those who have issues on SMP systems with hostapd locking > > > >> >>>>>>>> up -- please give this a whirl, let me know if it helps. > > > >> >>>>>>>> > > > >> >>>>>>>> This has 3 patches in 1 file, the one that counts it the > > > >> >>>>>>>> third one > > > >> >>>>>>>> but just apply it all together, 'patch -p1 serialize.patch' > > > >> >>>>>>>> ( for compat-wireless users or testers) or 'git am > > > >> >>>>>>>> serialize.patch' for git users. > > > >> >>>>>>>> > > > >> >>>>>>>> Feedback on results is appreciated. > > > >> >>>>>>>> > > > >> >>>>>>>> http://www.kernel.org/pub/linux/kernel/people/mcgrof/patche > > > >> >>>>>>>>s/ ath9k/tmp/ > > > >> >>>>>>>> se rialize.patch > > > >> >>>>>>> > > > >> >>>>>>> On second thought, this should be pretty useless since > > > >> >>>>>>> because we have > > > >> >>>>>>> only one tasklet and tasklets are not re-entrant on > > > >> >>>>>>> different CPUs. > > > >> >>>>>>> Hm,,, > > > >> >>>>>> > > > >> >>>>>> I will test this and will report back.. > > > >> >>>>> > > > >> >>>>> I have updated the git and applied the patch. But hostapd > > > >> >>>>> cannot start the > > > >> >>>>> adapter to work: > > > >> >>>>> > > > >> >>>>> xxx:/home/xx# hostapd -dd /etc/hostapd/hostapd.conf > > > >> >>>>> Configuration file: /etc/hostapd/hostapd.conf > > > >> >>>>> ctrl_interface_group=0 > > > >> >>>>> Opening raw packet socket for ifindex 1688 > > > >> >>>>> BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits) > > > >> >>>>> Failed to set country code > > > >> >>>>> wlan0: Unable to setup interface. > > > >> >>>>> rmdir[ctrl_interface]: No such file or directory > > > >> >>>>> > > > >> >>>>> I am using hostapd 0.6.7. > > > >> >>>> > > > >> >>>> I'm not sure why this happened on my system, because i have > > > >> >>>> two duplicated identical systems and one works without the > > > >> >>>> patch without needing this. The one doing the same thing as > > > >> >>>> yours I just put a card in though so I was thinking maybe it > > > >> >>>> was something I did, but if yours is doing it too then that's > > > >> >>>> odd. On mine, for the time being till I figure it out, I get it > > > >> >>>> to work by doing the following (which is odd because I'm > > > >> >>>> basically jump-starting udev, but udev should be working and > > > >> >>>> does the second reg set)... > > > >> >>>> > > > >> >>>> export COUNTRY=CO > > > >> >>>> /sbin/crda > > > >> >>>> hostapd -dd /etc/hostapd/hostapd.conf > > > >> >>>> > > > >> >>>> For some reason I just have to run crda manually (I have udev > > > >> >>>> script setup in proper place), > > > >> >>> > > > >> >>> I've now have heard a few issues with crda udev stuff. > > > >> >>> Please test the udev rule by writing a bash script for your > > > >> >>> /sbin/crda with something like this: > > > >> >>> > > > >> >>> #!/bin/bash > > > >> >>> LOG=/tmp/crda.log > > > >> >>> echo $(date) >> $LOG > > > >> >>> echo $COUNTRY >> $LOG > > > >> >>> echo ------ >> $LOG > > > >> >>> /sbin/crda > > > >> >>> > > > >> >>> Please keep in mind the old crda used to put the udev rule into > > > >> >>> /etc/udev/rules.d/regulatory.rules -- this can be removed and > > > >> >>> the new place is /lib/udev/rules.d/85-regulatory.rules > > > >> >>> > > > >> >>> Note that restarting udev is not required as udev has an inotify > > > >> >>> for the daemon on the directories IIRC. > > > >> >> > > > >> >> Oddly when I removed script from /etc/udev/rules.d and modified > > > >> >> the / lib/udev/ one nothing was in /tmp/, but when > > > >> >> putting the new script in the /etc/udev/rules.d/ then I got the > > > >> >> /tmp/ log thingy working. > > > >> >> Also I was able to have it actually work right, seems to have > > > >> >> done it properly now, > > > >> >> only thing different would be that I remove/replaced that udev > > > >> >> rule file in /etc/udev/ and have it > > > >> >> doing the log now in that script now. > > > >> >> > > > >> >> Here's the log, seems correct, all I can think is that during > > > >> >> bootup it isn't doing > > > >> >> this properly. did possibly moving the script away/back make udev > > > >> >> see it now? > > > >> >> How is /lib/udev/ exactly working, doesn't seem to be used by my > > > >> >> system, that > > > >> >> script is sitting in there all alone :), and doesn't seem to play > > > >> >> ball with the udev system (version 124). > > > >> >> > > > >> >> > > > >> >> ----- > > > >> >> Wed Feb 4 16:21:26 CST 2009 > > > >> >> 00 > > > >> >> ----- > > > >> >> Wed Feb 4 16:21:26 CST 2009 > > > >> >> CO > > > >> >> ----- > > > >> >> Wed Feb 4 16:21:49 CST 2009 > > > >> >> US > > > >> >> ----- > > > >> >> > > > >> >> > > > >> >> Also this explains why I've had to manually put the udev rules > > > >> >> into / etc/udev/rules.d/, > > > >> >> and didnt' realize it was putting one into /lib/udevl/rules.d, > > > >> >> yet that just doesn't work > > > >> >> on my system at all (newest Gentoo, everything up to date). Not > > > >> >> sure why one system > > > >> >> boots up fine and does this, always has, and other system I just > > > >> >> put a card into didn't > > > >> >> on bootup but now does when I went through unloading ath9k, > > > >> >> mac80211, cfg80211 and > > > >> >> reloading ath9k and running hostapd, now everything went smooth > > > >> >> as the log shows. > > > >> >> > > > >> >> So definitely I'm confused now, can't just reboot this system > > > >> >> till later tonight to see if it all reboots > > > >> >> correctly now, but I'm suspecting it will since the mod load > > > >> >> worked like it should, that log of > > > >> >> my bootup does seem like it may load the driver pretty early, not > > > >> >> sure if that could be a problem. > > > >> > > > > >> > Something with the udev rule location may be fishy -- the reason I > > > >> > started putting it into /lib/udev/ was the big fat warning on > > > >> > debian systems on the README on /etc/udev/rules.d/ and > > > >> > /lib/udev/rules.d. According to it packages should not put rules > > > >> > into /etc/udev/rules.d and it seems /lib/udev/rules.d/ is the > > > >> > common place. I verified this at least on FC10, Debian and Ubuntu. > > > >> > > > >> First I have to make crda running on my system. It isnt installed on > > > >> debian. > > > >> > > > >> Will report back.... > > > > > > > > I try to run the CRDA\Udev stuff. I installed the rules in > > > > the /lib/udev/rules.d directory. Then running crda (also after > > > > booting) > > > > > > > > then I 'export COUNTRY=NL' > > You shouldn't be setting this, CRDA will set it to what it should be, > the kernel will reject any country it doesn't expect. The example I gave > was to print it out to see if the udev script was being picked up. > > Luis Whatever I have filled in (hostapd.conf entry country_code set or default) is giving the same result. The 'NL' option is recognized. I browsed the code of crda and the check for the country code is ok. Also udevadm monitor doesnt give any feedback on user-events. I woud assume if I use crda or start hostapd it would give some kind of output.. gr, Willem -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.