From: Murali Karicheri <m-karicheri2@ti.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<w-kwok2@ti.com>, <davem@davemloft.net>,
<gregkh@linuxfoundation.org>, <stable@vger.kernel.org>
Cc: <nsekhar@ti.com>
Subject: [PATCH 3/7] net: netcp: move netcp_register_interface() to after attach module
Date: Wed, 23 Sep 2015 13:37:07 -0400 [thread overview]
Message-ID: <1443029831-22035-4-git-send-email-m-karicheri2@ti.com> (raw)
In-Reply-To: <1443029831-22035-1-git-send-email-m-karicheri2@ti.com>
The netcp interface is not fully initialized before attach the module
to the interface. For example, the tx pipe/rx pipe is initialized
in ethss module as part of attach(). So until this is complete, the
interface can't be registered. So move registration of interface to
net device outside the current loop that attaches the modules to the
interface.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
drivers/net/ethernet/ti/netcp_core.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index c0bc4b9..cf693de 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -291,13 +291,6 @@ static int netcp_module_probe(struct netcp_device *netcp_device,
interface_list) {
struct netcp_intf_modpriv *intf_modpriv;
- /* If interface not registered then register now */
- if (!netcp_intf->netdev_registered)
- ret = netcp_register_interface(netcp_intf);
-
- if (ret)
- return -ENODEV;
-
intf_modpriv = devm_kzalloc(dev, sizeof(*intf_modpriv),
GFP_KERNEL);
if (!intf_modpriv)
@@ -323,6 +316,18 @@ static int netcp_module_probe(struct netcp_device *netcp_device,
continue;
}
}
+
+ /* Now register the interface with netdev */
+ list_for_each_entry(netcp_intf,
+ &netcp_device->interface_head,
+ interface_list) {
+ /* If interface not registered then register now */
+ if (!netcp_intf->netdev_registered) {
+ ret = netcp_register_interface(netcp_intf);
+ if (ret)
+ return -ENODEV;
+ }
+ }
return 0;
}
--
1.9.1
next prev parent reply other threads:[~2015-09-23 17:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-23 17:37 [PATCH 0/7] net: netcp: a set of bug fixes Murali Karicheri
2015-09-23 17:37 ` [PATCH 1/7] net: netcp: ethss: fix error in calling sgmii api with incorrect offset Murali Karicheri
2015-09-23 17:37 ` [PATCH 2/7] net: netcp: remove dead code from the driver Murali Karicheri
2015-09-23 17:37 ` Murali Karicheri [this message]
2015-09-23 17:37 ` [PATCH 4/7] net: netcp: add error check to netcp_allocate_rx_buf() Murali Karicheri
2015-09-23 17:37 ` [PATCH 5/7] net: netcp: check for interface handle in netcp_module_probe() Murali Karicheri
2015-09-23 17:37 ` [PATCH 6/7] net: netcp: allocate buffers to desc before re-enable interrupt Murali Karicheri
2015-09-23 17:37 ` [PATCH 7/7] net: netcp: fix deadlock reported by lockup detector Murali Karicheri
2015-09-23 21:39 ` [PATCH 0/7] net: netcp: a set of bug fixes David Miller
2015-09-25 13:35 ` Murali Karicheri
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=1443029831-22035-4-git-send-email-m-karicheri2@ti.com \
--to=m-karicheri2@ti.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=stable@vger.kernel.org \
--cc=w-kwok2@ti.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
all inboxes | Powered by JetHome®