From mboxrd@z Thu Jan 1 00:00:00 1970 From: nschichan@freebox.fr (Nicolas Schichan) Date: Mon, 02 Dec 2013 16:15:54 +0100 Subject: Spurious timeouts in mvmdio Message-ID: <529CA42A.3040504@freebox.fr> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, During 3.13-rc1 testing, I have found out that the mvmdio driver would report timeouts on the kernel console: [ 11.011334] orion-mdio orion-mdio: Timeout: SMI busy for too long The hardware is a MV88F6281 Kirkwood CPU. The mvmdio driver is using the irq line 46 (ge00_err). I am inclined to believe that it is due to the fact that wait_event_timeout() is called with a timeout parameter of 1 jiffy in orion_mdio_wait_ready(). If the timer interrupt ticks right after calling wait_event_timeout(), we may end up spending much less time than MVMDIO_SMI_TIMEOUT (1 msec) in wait_event_timeout(), and as a result report a timeout as the MDIO access did not complete in such a short time. As to how to fix this, I see two options (I don't know which one would be prefered): - Option 1: always pass a timeout of at least 2 jiffy to wait_event_timeout(). - Option 2: switch to wait_event_hrtimeout(). I can provide patches for both options. Regards, -- Nicolas Schichan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151Ab3LBPP6 (ORCPT ); Mon, 2 Dec 2013 10:15:58 -0500 Received: from ns.iliad.fr ([212.27.33.1]:38157 "EHLO ns.iliad.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751438Ab3LBPPz (ORCPT ); Mon, 2 Dec 2013 10:15:55 -0500 Message-ID: <529CA42A.3040504@freebox.fr> Date: Mon, 02 Dec 2013 16:15:54 +0100 From: Nicolas Schichan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: LKML , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org CC: "David S. Miller" , Florian Fainelli , Leigh Brown , Sebastian Hesselbarth Subject: Spurious timeouts in mvmdio Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, During 3.13-rc1 testing, I have found out that the mvmdio driver would report timeouts on the kernel console: [ 11.011334] orion-mdio orion-mdio: Timeout: SMI busy for too long The hardware is a MV88F6281 Kirkwood CPU. The mvmdio driver is using the irq line 46 (ge00_err). I am inclined to believe that it is due to the fact that wait_event_timeout() is called with a timeout parameter of 1 jiffy in orion_mdio_wait_ready(). If the timer interrupt ticks right after calling wait_event_timeout(), we may end up spending much less time than MVMDIO_SMI_TIMEOUT (1 msec) in wait_event_timeout(), and as a result report a timeout as the MDIO access did not complete in such a short time. As to how to fix this, I see two options (I don't know which one would be prefered): - Option 1: always pass a timeout of at least 2 jiffy to wait_event_timeout(). - Option 2: switch to wait_event_hrtimeout(). I can provide patches for both options. Regards, -- Nicolas Schichan