* [PATCH v3 0/2] net: time stamping fixes
@ 2011-10-24 17:55 Richard Cochran
2011-10-24 17:55 ` [PATCH v3 1/2] dp83640: use proper function to free transmit time stamping packets Richard Cochran
2011-10-24 17:55 ` [PATCH v3 2/2] dp83640: free packet queues on remove Richard Cochran
0 siblings, 2 replies; 3+ messages in thread
From: Richard Cochran @ 2011-10-24 17:55 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Eric Dumazet, Johannes Berg
[ Changes in v3: omit accepted patch and fixup the dp83640 patches. ]
These two patches depend on commit da92b194 and fix two bugs in a
PTP Hardware Clock driver. This driver was first introduced in Linux
version 3.0.
Richard Cochran (2):
dp83640: use proper function to free transmit time stamping packets
dp83640: free packet queues on remove
drivers/net/phy/dp83640.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
--
1.7.2.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v3 1/2] dp83640: use proper function to free transmit time stamping packets
2011-10-24 17:55 [PATCH v3 0/2] net: time stamping fixes Richard Cochran
@ 2011-10-24 17:55 ` Richard Cochran
2011-10-24 17:55 ` [PATCH v3 2/2] dp83640: free packet queues on remove Richard Cochran
1 sibling, 0 replies; 3+ messages in thread
From: Richard Cochran @ 2011-10-24 17:55 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Eric Dumazet, Johannes Berg, stable
Commit da92b194 introduced a new rule for handling the cloned packets
for transmit time stamping. These packets must not be freed using any other
function than skb_complete_tx_timestamp. This commit fixes the one and only
driver using this API.
The driver first appeared in v3.0.
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Cc: <stable@vger.kernel.org>
---
drivers/net/phy/dp83640.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index edd7304..311f5cb 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -1060,7 +1060,7 @@ static void dp83640_txtstamp(struct phy_device *phydev,
struct dp83640_private *dp83640 = phydev->priv;
if (!dp83640->hwts_tx_en) {
- kfree_skb(skb);
+ skb_complete_tx_timestamp(skb, NULL);
return;
}
skb_queue_tail(&dp83640->tx_queue, skb);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v3 2/2] dp83640: free packet queues on remove
2011-10-24 17:55 [PATCH v3 0/2] net: time stamping fixes Richard Cochran
2011-10-24 17:55 ` [PATCH v3 1/2] dp83640: use proper function to free transmit time stamping packets Richard Cochran
@ 2011-10-24 17:55 ` Richard Cochran
1 sibling, 0 replies; 3+ messages in thread
From: Richard Cochran @ 2011-10-24 17:55 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Eric Dumazet, Johannes Berg, stable
If the PHY should disappear (for example, on an USB Ethernet MAC), then
the driver would leak any undelivered time stamp packets. This commit
fixes the issue by calling the appropriate functions to free any packets
left in the transmit and receive queues.
The driver first appeared in v3.0.
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <stable@vger.kernel.org>
---
drivers/net/phy/dp83640.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 311f5cb..dc44b73 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -875,6 +875,7 @@ static void dp83640_remove(struct phy_device *phydev)
struct dp83640_clock *clock;
struct list_head *this, *next;
struct dp83640_private *tmp, *dp83640 = phydev->priv;
+ struct sk_buff *skb;
if (phydev->addr == BROADCAST_ADDR)
return;
@@ -882,6 +883,12 @@ static void dp83640_remove(struct phy_device *phydev)
enable_status_frames(phydev, false);
cancel_work_sync(&dp83640->ts_work);
+ while ((skb = skb_dequeue(&dp83640->rx_queue)) != NULL)
+ kfree_skb(skb);
+
+ while ((skb = skb_dequeue(&dp83640->tx_queue)) != NULL)
+ skb_complete_tx_timestamp(skb, NULL);
+
clock = dp83640_clock_get(dp83640->clock);
if (dp83640 == clock->chosen) {
--
1.7.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-24 17:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24 17:55 [PATCH v3 0/2] net: time stamping fixes Richard Cochran
2011-10-24 17:55 ` [PATCH v3 1/2] dp83640: use proper function to free transmit time stamping packets Richard Cochran
2011-10-24 17:55 ` [PATCH v3 2/2] dp83640: free packet queues on remove Richard Cochran
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).