Atheros Continued.

Pat Suwalski pat at suwalski.net
Fri Jun 25 21:38:37 PDT 2004


I decided to take another evening for hal/ath debugging.

Again, very unusual results, as can be seen in the pasted in gdb excerpt 
from mii_get_rate(). The ->udi field goes crazy for no good reason, and 
that it what ultimately causes the program to crash.

There is some sort of memory corruption in mii_get_link(). I know this, 
because if I return right after the first mdio_read, everything is well. 
On the other hand, if I comment out the second mdio_read, it will crash 
because the next line is there. This has been successfully iteratively 
tested by commenting out successive lines.

While I could not come to any conclusions whatsoever, commenting out the 
call to mii_get_link() solves all problems in terms of crashes.

My suspicions lie in the ioctl() calls within mdio_read, which cause the 
following:

[E] linux/net_class_device.c:132 mdio_read() : SIOCGMIIREG on ath0 
failed: Invalid argument

That whole function is suspicious and not documented. The way it 
accesses data[] seems potentially dangerous. The ways it uses 
new_ioctl_nums is cryptic. However that function pokes at my card might 
be what's causing a cascade to prevent other io reads from working later 
and then weird detrimental effects throughout.

I'm wondering if the 'right' thing to do at this point isn't to actually 
blacklist ath* from entering mii_get_link(). :(

--Pat

-----------------------------

(gdb) print *d
$6 = {parent = {g_type_instance = {g_class = 0x0}, ref_count = 0, qdata 
= 0x1}, udi = 0x0, properties = 0x0}
(gdb) n
162             if (ioctl (sockfd, 0x8947, &ifr) >= 0)
(gdb)
164             else if (ioctl (sockfd, SIOCDEVPRIVATE, &ifr) >= 0)
(gdb)
167                     HAL_ERROR (("SIOCGMIIPHY on %s failed: %s",
(gdb)
[E] linux/net_class_device.c:168 mii_get_rate() : SIOCGMIIPHY on 
failed: No such device
169                     close (sockfd);
(gdb)
198             close (sockfd);
(gdb)
199     }
(gdb) print *d
$7 = {parent = {g_type_instance = {g_class = 0x5f69696d}, ref_count = 
1601463655, qdata = 0x65746172}, udi = 0x72724500 <Address 0x72724500 
out of bounds>,
   properties = 0x7220726f}

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list