lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAwP0s0Y329AAXpHW9muOECt5DpgpDm6kefXR7uE1233A1LGWg@mail.gmail.com>
Date:	Fri, 30 Dec 2011 13:58:18 +0100
From:	Javier Martinez Canillas <martinez.javier@...il.com>
To:	Ben Hutchings <ben@...adent.org.uk>
Cc:	netdev@...r.kernel.org,
	Enric Balletbo i Serra <eballetbo@...ebcn.com>
Subject: Re: [BUG] SIOCSIFFLAGS returns -EIO on SMSC LAN911x

On Fri, Dec 30, 2011 at 11:56 AM, Ben Hutchings <ben@...adent.org.uk> wrote:
> On Fri, 2011-12-30 at 10:44 +0100, Javier Martinez Canillas wrote:
>> Hello,
>>
>> We have an issue with the SMSC LAN911x driver with today linux-2.6 [1]
>> executing on an IGEPv2 [2] board using omap2plus_defconfig.
>>
>> When I try to bring up the network interface, the ioctl set interface
>> flags command (SIOCSIFFLAGS)  fails returning -EIO:
> [...]
>> By doing a git bisect we found that this strange behavior exists when
>> the Kconfig tristate compilation condition SMSC_PHY has the value yes
>> to be compiled built-in:
>>
>> SMSC_PHY=y
>>
>> If this config symbol has the value module (m) or not build at all,
>> then bringing up the network interface never fails.
>
> So the PHY driver is doing something that interferes with soft reset.
>

We have more information about the issue. It seems that the LAN9221i
network device has inside a lan8700 phy chip. When we compile with
SMSC_PHY and the smsc.c driver is included the lan8700 phy_driver
enable the energy detect mode for the transceiver.

> The data sheet for this part
> <http://www.smsc.com/media/Downloads_Public/Data_Sheets/9221.pdf> says
> that soft reset does not work if the PHY is in certain states.  Also, it
> doesn't seem to specify a maximum time for soft reset to complete,
> though it does say that PHY reset takes 100 us.
>

One of the states that prevents software reseting the chip is when the
phy is in low power mode. So the reset fails in the ndo_open handler
(ifconfig ethx up).

>> Did anyone have the same problem?
>>
>> The problem is really strange to me, especially since we are sure that
>> all the requirements to software reset the device are meet in both
>> cases (with SMSC_PHY compiled built-in and without it)
>
> I don't know about that.  smsc_phy_config_init() attempts to enable
> power-saving on the PHY, but it is writing to a bit that is reserved
> according to the data sheet for the combined MAC/PHY chip.  dwein

Since the PHY chip is a lan8700, the power-saving seems to be correct.
But the problem is when latter in the open handler a software reset is
attempt.

Probably I can protect the software reset and only try to reset the
device if the PHY is now in a low power mode. But if we don't reset
the device at interface bringing up, when should we do a the reset?

I'm not that familiarized with the networking layer, if someone can
give me some light I can fix the issue and send a patch.

Thanks a lot and best regards,

-- 
Javier Martínez Canillas
(+34) 682 39 81 69
Barcelona, Spain
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ