mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: davem@davemloft.net, andrew@lunn.ch, f.fainelli@gmail.com,
	linux@roeck-us.net, vivien.didelot@savoirfairelinux.com,
	fabf@skynet.be, pavel.nakonechny@skitlab.ru, joe@perches.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Neil Armstrong <narmstrong@baylibre.com>
Subject: [PATCH v3 net-next 1/4] net: dsa: remove DSA link polling
Date: Mon,  7 Dec 2015 13:57:32 +0100	[thread overview]
Message-ID: <1449493055-29047-2-git-send-email-narmstrong@baylibre.com> (raw)
In-Reply-To: <1449493055-29047-1-git-send-email-narmstrong@baylibre.com>

Since no more DSA driver uses the polling callback, and since
the phylib handles the link detection, remove the link polling
work and timer code.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 include/net/dsa.h | 12 ------------
 net/dsa/dsa.c     | 43 -------------------------------------------
 2 files changed, 55 deletions(-)

diff --git a/include/net/dsa.h b/include/net/dsa.h
index 3f23dd9..26a0e86 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -117,13 +117,6 @@ struct dsa_switch_tree {
 	s8			cpu_port;
 
 	/*
-	 * Link state polling.
-	 */
-	int			link_poll_needed;
-	struct work_struct	link_poll_work;
-	struct timer_list	link_poll_timer;
-
-	/*
 	 * Data for the individual switch chips.
 	 */
 	struct dsa_switch	*ds[DSA_MAX_SWITCHES];
@@ -232,11 +225,6 @@ struct dsa_switch_driver {
 			     int regnum, u16 val);
 
 	/*
-	 * Link state polling and IRQ handling.
-	 */
-	void	(*poll_link)(struct dsa_switch *ds);
-
-	/*
 	 * Link state adjustment (called from libphy)
 	 */
 	void	(*adjust_link)(struct dsa_switch *ds, int port,
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index b7448c8..0f41f71 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -508,33 +508,6 @@ static int dsa_switch_resume(struct dsa_switch *ds)
 }
 #endif
 
-
-/* link polling *************************************************************/
-static void dsa_link_poll_work(struct work_struct *ugly)
-{
-	struct dsa_switch_tree *dst;
-	int i;
-
-	dst = container_of(ugly, struct dsa_switch_tree, link_poll_work);
-
-	for (i = 0; i < dst->pd->nr_chips; i++) {
-		struct dsa_switch *ds = dst->ds[i];
-
-		if (ds != NULL && ds->drv->poll_link != NULL)
-			ds->drv->poll_link(ds);
-	}
-
-	mod_timer(&dst->link_poll_timer, round_jiffies(jiffies + HZ));
-}
-
-static void dsa_link_poll_timer(unsigned long _dst)
-{
-	struct dsa_switch_tree *dst = (void *)_dst;
-
-	schedule_work(&dst->link_poll_work);
-}
-
-
 /* platform driver init and cleanup *****************************************/
 static int dev_is_class(struct device *dev, void *class)
 {
@@ -877,8 +850,6 @@ static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
 		}
 
 		dst->ds[i] = ds;
-		if (ds->drv->poll_link != NULL)
-			dst->link_poll_needed = 1;
 
 		++configured;
 	}
@@ -897,15 +868,6 @@ static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
 	wmb();
 	dev->dsa_ptr = (void *)dst;
 
-	if (dst->link_poll_needed) {
-		INIT_WORK(&dst->link_poll_work, dsa_link_poll_work);
-		init_timer(&dst->link_poll_timer);
-		dst->link_poll_timer.data = (unsigned long)dst;
-		dst->link_poll_timer.function = dsa_link_poll_timer;
-		dst->link_poll_timer.expires = round_jiffies(jiffies + HZ);
-		add_timer(&dst->link_poll_timer);
-	}
-
 	return 0;
 }
 
@@ -972,11 +934,6 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst)
 {
 	int i;
 
-	if (dst->link_poll_needed)
-		del_timer_sync(&dst->link_poll_timer);
-
-	flush_work(&dst->link_poll_work);
-
 	for (i = 0; i < dst->pd->nr_chips; i++) {
 		struct dsa_switch *ds = dst->ds[i];
 
-- 
1.9.1


  reply	other threads:[~2015-12-07 13:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 13:22 [PATCH v2 0/6] Further fix for dsa unbinding Neil Armstrong
2015-12-07 12:57 ` [PATCH v3 net-next 0/4] " Neil Armstrong
2015-12-07 12:57   ` Neil Armstrong [this message]
2015-12-07 12:57   ` [PATCH v3 net-next 2/4] net: dsa: cleanup resources upon module removal Neil Armstrong
2015-12-07 12:57   ` [PATCH v3 net-next 3/4] net: dsa: Add missing master netdev dev_put() calls Neil Armstrong
2015-12-07 12:57   ` [PATCH v3 net-next 4/4] net: dsa: move dsa slave destroy code to slave.c Neil Armstrong
2015-12-07 14:28   ` [PATCH v3 net-next 0/4] Further fix for dsa unbinding Andrew Lunn
2015-12-07 20:39   ` Florian Fainelli
2015-12-07 21:36   ` David Miller
2016-03-08  9:36     ` [PATCH] net: dsa: Fix cleanup resources upon module removal Neil Armstrong
2016-03-08 14:52       ` Andrew Lunn
2016-03-10 21:21       ` David Miller

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=1449493055-29047-2-git-send-email-narmstrong@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=fabf@skynet.be \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=pavel.nakonechny@skitlab.ru \
    --cc=vivien.didelot@savoirfairelinux.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®