linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Williamson <michael.williamson@criticallink.com>
To: cyril@ti.com
Cc: Kevin Hilman <khilman@deeprootsystems.com>,
	"tony@atomide.com" <tony@atomide.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davinci-linux-open-source@linux.davincidsp.com"
	<davinci-linux-open-source@linux.davincidsp.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH v3 00/10] split out emac cpdma and mdio for reuse
Date: Thu, 09 Sep 2010 17:25:40 -0400	[thread overview]
Message-ID: <4C8950D4.9060102@criticallink.com> (raw)
In-Reply-To: <4C893ADE.809@ti.com>

Hi Cyril,

On 09/09/2010 03:51 PM, Cyril Chemparathy wrote:
> Hi Mike,
> 
> [...]
>> The hang is in wait_for_user_access() in the davinci_mdio_read() call.  Looks like
>> the state machine got put back into IDLE somewhere between the MDIO probe and the 
>> EMAC probe. Seems like there should be some sort of time-out and error message 
>> in the wait_for_user_access() method.... (maybe even a check for IDLE??)
>>
>> If I add a patch to check the state machine for IDLE and then re-enable it in the
>> davinci_mdio_read() call, it is able to press on and come up.  I don't see any calls
>> to the davinci_mdio_suspend() call, so I am wondering if the EMAC probe routine, 
>> particularly the application of the SOFTRESET, is causing the MDIO to drop back to 
>> IDLE / disabled.
>>
>> I can post the patch if you like, but it is a bit of a hack...
> 
> An EMAC soft-reset clobbering the MDIO controller state is a
> possibility.  I will poll TI designers to see if this could be the case.
> 
> In any case, a couple of unanswered questions remain:
> 
>   1. Why don't other davinci devices display similar behavior?
> 
>   2. If the answer to #1 above is that the timing window is pretty slim
>      (i.e., only if an MDIO read/write is in progress during EMAC
>      soft-reset), why do we hit this situation consistently on
>      mityomap?

Has it been confirmed that this only happens on mityomap?  Has anyone had success
using a da850 evm or other da850 platform?  The configuration for the mityomap, wrt 
to the EMAC/MII/MDIO, is pretty much identical to the da850 evm using the MII interface.  
The only difference I am aware of is the assigned address to the PHY chip.  The 
reference clocks and rates are identical, AFAIK, to the evm.

> 
> I have put together a quick patch (tested dm365).  See attached.

Your patch doesn't work with my board.  It does attempt to reset the bus on the read call, 
but following wait_for_user_access() calls are timing out and the _read() and _write() calls punt.  
I bumped up the MDIO_TIMEOUT to 100 ms, and it works.  I'm wondering if the scanning logic 
has to complete an entire cycle (all 32 phys) before issuing a request, and if it's a lot 
slower than expected.

I also found that the initial scanning logic would not reliably find the PHY until I bumped
up the delay time following the reset operation.  Sometimes it would, sometimes no.

Also, your while(1) loops with the continue conditions on the second wait_for_user_access() 
in the read and writes might need some consideration, i.e.:

        while (1) {
                ret = wait_for_user_access(data);
                if (ret == -EAGAIN)
                        continue;
                if (ret < 0)
                        break;

                __raw_writel(reg, &data->regs->user[0].access);

                ret = wait_for_user_access(data);
                if (ret == -EAGAIN)
                        continue;
                        ^^^^^^^^^ <--- this will re-issue the request.... what you want?
                if (ret < 0)
                        break;

                reg = __raw_readl(&data->regs->user[0].access);
                ret = (reg & USERACCESS_ACK) ? (reg & USERACCESS_DATA) : -EIO;
                break;
        }

Also, on the shutdown, I get a major kernel trace.  Here is the dump, as much 
as I could catch of it.... (I need a better terminal program)

Deconfiguring network interfaces... ------------[ cut here ]------------
WARNING: at kernel/softirq.c:143 local_bh_enable+0x40/0xb4()
Modules linked in:
[<c002e684>] (unwind_backtrace+0x0/0xec) from [<c003e284>] (warn_slowpath_common+0x4c/0x64)
[<c003e284>] (warn_slowpath_common+0x4c/0x64) from [<c003e2b8>] (warn_slowpath_null+0x1c/0x24)
[<c003e2b8>] (warn_slowpath_null+0x1c/0x24) from [<c0043e80>] (local_bh_enable+0x40/0xb4)
[<c0043e80>] (local_bh_enable+0x40/0xb4) from [<c01f3760>] (__netif_receive_skb+0xf8/0x3d0)
[<c01f3760>] (__netif_receive_skb+0xf8/0x3d0) from [<c01d344c>] (emac_rx_handler+0x40/0xcc)
[<c01d344c>] (emac_rx_handler+0x40/0xcc) from [<c01d3fe8>] (__cpdma_chan_free+0xac/0xb0)
[<c01d3fe8>] (__cpdma_chan_free+0xac/0xb0) from [<c01d40d0>] (__cpdma_chan_process+0xe4/0x114)
[<c01d40d0>] (__cpdma_chan_process+0xe4/0x114) from [<c01d4238>] (cpdma_chan_stop+0xf0/0x1c8)
[<c01d4238>] (cpdma_chan_stop+0xf0/0x1c8) from [<c01d4390>] (cpdma_ctlr_stop+0x80/0xe4)
[<c01d4390>] (cpdma_ctlr_stop+0x80/0xe4) from [<c01d2c00>] (emac_dev_stop+0xb0/0x13c)
[<c01d2c00>] (emac_dev_stop+0xb0/0x13c) from [<c01f5b40>] (__dev_close+0x74/0x98)
[<c01f5b40>] (__dev_close+0x74/0x98) from [<c01f3168>] (__dev_change_flags+0xac/0x13c)
[<c01f3168>] (__dev_change_flags+0xac/0x13c) from [<c01f5994>] (dev_change_flags+0x10/0x44)
[<c01f5994>] (dev_change_flags+0x10/0x44) from [<c023cf60>] (devinet_ioctl+0x2dc/0x6f4)
[<c023cf60>] (devinet_ioctl+0x2dc/0x6f4) from [<c01e484c>] (sock_ioctl+0x1fc/0x258)
[<c01e484c>] (sock_ioctl+0x1fc/0x258) from [<c00aa0f0>] (do_vfs_ioctl+0x550/0x5c0)
[<c00aa0f0>] (do_vfs_ioctl+0x550/0x5c0) from [<c00aa198>] (sys_ioctl+0x38/0x5c)
[<c00aa198>] (sys_ioctl+0x38/0x5c) from [<c0029f00>] (ret_fast_syscall+0x0/0x2c)
---[ end trace 0e686330480db12e ]---
------------[ cut here ]------------
WARNING: at drivers/net/davinci_emac.c:1025 __cpdma_chan_free+0xac/0xb0()
Modules linked in:
[<c002e684>] (unwind_backtrace+0x0/0xec) from [<c003e284>] (warn_slowpath_common+0x4c/0x64)
[<c003e284>] (warn_slowpath_common+0x4c/0x64) from [<c003e2b8>] (warn_slowpath_null+0x1c/0x24)
[<c003e2b8>] (warn_slowpath_null+0x1c/0x24) from [<c01d3fe8>] (__cpdma_chan_free+0xac/0xb0)
[<c01d3fe8>] (__cpdma_chan_free+0xac/0xb0) from [<c01d40d0>] (__cpdma_chan_process+0xe4/0x114)
[<c01d40d0>] (__cpdma_chan_process+0xe4/0x114) from [<c01d4238>] (cpdma_chan_stop+0xf0/0x1c8)
[<c01d4238>] (cpdma_chan_stop+0xf0/0x1c8) from [<c01d4390>] (cpdma_ctlr_stop+0x80/0xe4)
[<c01d4390>] (cpdma_ctlr_stop+0x80/0xe4) from [<c01d2c00>] (emac_dev_stop+0xb0/0x13c)
[<c01d2c00>] (emac_dev_stop+0xb0/0x13c) from [<c01f5b40>] (__dev_close+0x74/0x98)
[<c01f5b40>] (__dev_close+0x74/0x98) from [<c01f3168>] (__dev_change_flags+0xac/0x13c)
[<c01f3168>] (__dev_change_flags+0xac/0x13c) from [<c01f5994>] (dev_change_flags+0x10/0x44)
[<c01f5994>] (dev_change_flags+0x10/0x44) from [<c023cf60>] (devinet_ioctl+0x2dc/0x6f4)
[<c023cf60>] (devinet_ioctl+0x2dc/0x6f4) from [<c01e484c>] (sock_ioctl+0x1fc/0x258)
[<c01e484c>] (sock_ioctl+0x1fc/0x258) from [<c00aa0f0>] (do_vfs_ioctl+0x550/0x5c0)
[<c00aa0f0>] (do_vfs_ioctl+0x550/0x5c0) from [<c00aa198>] (sys_ioctl+0x38/0x5c)
[<c00aa198>] (sys_ioctl+0x38/0x5c) from [<c0029f00>] (ret_fast_syscall+0x0/0x2c)
---[ end trace 0e686330480db12f ]---


Thanks for the help.

-Mike

  parent reply	other threads:[~2010-09-09 21:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 20:25 [PATCH v3 00/10] split out emac cpdma and mdio for reuse Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 01/10] net: davinci_emac: separate out davinci mdio Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 02/10] davinci: add mdio platform devices Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 03/10] omap: " Cyril Chemparathy
2010-09-08  1:00   ` Tony Lindgren
2010-09-07 20:25 ` [PATCH v3 04/10] net: davinci_emac: switch to new mdio Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 05/10] davinci: cleanup unused davinci mdio arch code Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 06/10] omap: " Cyril Chemparathy
2010-09-08  1:00   ` Tony Lindgren
2010-09-07 20:25 ` [PATCH v3 07/10] net: davinci_emac: cleanup unused mdio emac code Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 08/10] net: davinci_emac: separate out cpdma code Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 09/10] net: davinci_emac: switch to new cpdma layer Cyril Chemparathy
2010-09-07 20:25 ` [PATCH v3 10/10] net: davinci_emac: cleanup unused cpdma code Cyril Chemparathy
2010-09-08  1:18 ` [PATCH v3 00/10] split out emac cpdma and mdio for reuse Kevin Hilman
2010-09-08  2:22   ` Michael Williamson
2010-09-08 21:59     ` Cyril Chemparathy
2010-09-09  0:47       ` Michael Williamson
2010-09-09 18:43         ` Michael Williamson
2010-09-09 19:51           ` Cyril Chemparathy
2010-09-09 21:24             ` Cyril Chemparathy
2010-09-09 21:45               ` Michael Williamson
2010-09-09 21:25             ` Michael Williamson [this message]
2010-09-10 15:23               ` Caglar Akyuz
2010-09-11  8:54                 ` Caglar Akyuz
2010-09-13 14:09                   ` Cyril Chemparathy
2010-09-13 15:46                     ` Cyril Chemparathy
2010-09-13 17:51                     ` Caglar Akyuz
2010-09-10 22:59               ` Cyril Chemparathy
2010-09-11 13:14                 ` Michael Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C8950D4.9060102@criticallink.com \
    --to=michael.williamson@criticallink.com \
    --cc=cyril@ti.com \
    --cc=davem@davemloft.net \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).