* [PATCH 6/6 v2] PS3: gelic: Add support for dual network interface
From: Masakazu Mokuno @ 2008-01-24 5:41 UTC (permalink / raw)
To: netdev; +Cc: linuxppc-dev
In-Reply-To: <20071213211332.BF8C.MOKUNO@sm.sony.co.jp>
Add support for dual network (net_device) interface so that ethernet
and wireless can own separate ethX interfaces.
V2
- Fix the bug that bringing down and up the interface keeps rx
disabled.
- Make 'gelic_net_poll_controller()' extern , as David Woodhouse
pointed out at the previous submission.
- Fix weird usage of member names for the rx descriptor chain
V1
- Export functions which are convenient for both interfaces
- Move irq allocation/release code to driver probe/remove handlers
because interfaces share interrupts.
- Allocate skbs by using dev_alloc_skb() instead of netdev_alloc_skb()
as the interfaces share the hardware rx queue.
- Add gelic_port struct in order to abstract dual interface handling
- Change handlers for hardware queues so that they can handle dual
{source,destination} interfaces.
- Use new NAPI functions
This is a prerequisite for the new PS3 wireless support.
Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
---
drivers/net/ps3_gelic_net.c | 765 +++++++++++++++++++++++++++-----------------
drivers/net/ps3_gelic_net.h | 108 +++++-
2 files changed, 564 insertions(+), 309 deletions(-)
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -48,27 +48,22 @@
#include "ps3_gelic_net.h"
#define DRV_NAME "Gelic Network Driver"
-#define DRV_VERSION "1.0"
+#define DRV_VERSION "1.1"
MODULE_AUTHOR("SCE Inc.");
MODULE_DESCRIPTION("Gelic Network driver");
MODULE_LICENSE("GPL");
-static inline struct device *ctodev(struct gelic_card *card)
-{
- return &card->dev->core;
-}
-static inline u64 bus_id(struct gelic_card *card)
-{
- return card->dev->bus_id;
-}
-static inline u64 dev_id(struct gelic_card *card)
-{
- return card->dev->dev_id;
-}
+
+static inline void gelic_card_enable_rxdmac(struct gelic_card *card);
+static inline void gelic_card_disable_rxdmac(struct gelic_card *card);
+static inline void gelic_card_disable_txdmac(struct gelic_card *card);
+static inline void gelic_card_reset_chain(struct gelic_card *card,
+ struct gelic_descr_chain *chain,
+ struct gelic_descr *start_descr);
/* set irq_mask */
-static int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask)
+int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask)
{
int status;
@@ -76,20 +71,23 @@ static int gelic_card_set_irq_mask(struc
mask, 0);
if (status)
dev_info(ctodev(card),
- "lv1_net_set_interrupt_mask failed %d\n", status);
+ "%s failed %d\n", __func__, status);
return status;
}
+
static inline void gelic_card_rx_irq_on(struct gelic_card *card)
{
- gelic_card_set_irq_mask(card, card->ghiintmask | GELIC_CARD_RXINT);
+ card->irq_mask |= GELIC_CARD_RXINT;
+ gelic_card_set_irq_mask(card, card->irq_mask);
}
static inline void gelic_card_rx_irq_off(struct gelic_card *card)
{
- gelic_card_set_irq_mask(card, card->ghiintmask & ~GELIC_CARD_RXINT);
+ card->irq_mask &= ~GELIC_CARD_RXINT;
+ gelic_card_set_irq_mask(card, card->irq_mask);
}
-static void
-gelic_card_get_ether_port_status(struct gelic_card *card, int inform)
+static void gelic_card_get_ether_port_status(struct gelic_card *card,
+ int inform)
{
u64 v2;
struct net_device *ether_netdev;
@@ -100,7 +98,7 @@ gelic_card_get_ether_port_status(struct
&card->ether_port_status, &v2);
if (inform) {
- ether_netdev = card->netdev;
+ ether_netdev = card->netdev[GELIC_PORT_ETHERNET];
if (card->ether_port_status & GELIC_LV1_ETHER_LINK_UP)
netif_carrier_on(ether_netdev);
else
@@ -108,6 +106,48 @@ gelic_card_get_ether_port_status(struct
}
}
+void gelic_card_up(struct gelic_card *card)
+{
+ pr_debug("%s: called\n", __func__);
+ down(&card->updown_lock);
+ if (atomic_inc_return(&card->users) == 1) {
+ pr_debug("%s: real do\n", __func__);
+ /* enable irq */
+ gelic_card_set_irq_mask(card, card->irq_mask);
+ /* start rx */
+ gelic_card_enable_rxdmac(card);
+
+ napi_enable(&card->napi);
+ }
+ up(&card->updown_lock);
+ pr_debug("%s: done\n", __func__);
+}
+
+void gelic_card_down(struct gelic_card *card)
+{
+ u64 mask;
+ pr_debug("%s: called\n", __func__);
+ down(&card->updown_lock);
+ if (atomic_dec_if_positive(&card->users) == 0) {
+ pr_debug("%s: real do\n", __func__);
+ napi_disable(&card->napi);
+ /*
+ * Disable irq. Wireless interrupts will
+ * be disabled later if any
+ */
+ mask = card->irq_mask & (GELIC_CARD_WLAN_EVENT_RECEIVED |
+ GELIC_CARD_WLAN_COMMAND_COMPLETED);
+ gelic_card_set_irq_mask(card, mask);
+ /* stop rx */
+ gelic_card_disable_rxdmac(card);
+ gelic_card_reset_chain(card, &card->rx_chain,
+ card->descr + GELIC_NET_TX_DESCRIPTORS);
+ /* stop tx */
+ gelic_card_disable_txdmac(card);
+ }
+ up(&card->updown_lock);
+ pr_debug("%s: done\n", __func__);
+}
/**
* gelic_descr_get_status -- returns the status of a descriptor
@@ -133,8 +173,8 @@ static void gelic_descr_set_status(struc
enum gelic_descr_dma_status status)
{
descr->dmac_cmd_status = cpu_to_be32(status |
- (be32_to_cpu(descr->dmac_cmd_status) &
- ~GELIC_DESCR_DMA_STAT_MASK));
+ (be32_to_cpu(descr->dmac_cmd_status) &
+ ~GELIC_DESCR_DMA_STAT_MASK));
/*
* dma_cmd_status field is used to indicate whether the descriptor
* is valid or not.
@@ -225,6 +265,31 @@ iommu_error:
}
/**
+ * gelic_card_reset_chain - reset status of a descriptor chain
+ * @card: card structure
+ * @chain: address of chain
+ * @start_descr: address of descriptor array
+ *
+ * Reset the status of dma descriptors to ready state
+ * and re-initialize the hardware chain for later use
+ */
+static void gelic_card_reset_chain(struct gelic_card *card,
+ struct gelic_descr_chain *chain,
+ struct gelic_descr *start_descr)
+{
+ struct gelic_descr *descr;
+
+ for (descr = start_descr; start_descr != descr->next; descr++) {
+ gelic_descr_set_status(descr, GELIC_DESCR_DMA_CARDOWNED);
+ descr->next_descr_addr = cpu_to_be32(descr->next->bus_addr);
+ }
+
+ chain->head = start_descr;
+ chain->tail = (descr - 1);
+
+ (descr - 1)->next_descr_addr = 0;
+}
+/**
* gelic_descr_prepare_rx - reinitializes a rx descriptor
* @card: card structure
* @descr: descriptor to re-init
@@ -235,21 +300,19 @@ iommu_error:
* Activate the descriptor state-wise
*/
static int gelic_descr_prepare_rx(struct gelic_card *card,
- struct gelic_descr *descr)
+ struct gelic_descr *descr)
{
int offset;
unsigned int bufsize;
if (gelic_descr_get_status(descr) != GELIC_DESCR_DMA_NOT_IN_USE)
dev_info(ctodev(card), "%s: ERROR status \n", __func__);
-
/* we need to round up the buffer size to a multiple of 128 */
bufsize = ALIGN(GELIC_NET_MAX_MTU, GELIC_NET_RXBUF_ALIGN);
/* and we need to have it 128 byte aligned, therefore we allocate a
* bit more */
- descr->skb = netdev_alloc_skb(card->netdev,
- bufsize + GELIC_NET_RXBUF_ALIGN - 1);
+ descr->skb = dev_alloc_skb(bufsize + GELIC_NET_RXBUF_ALIGN - 1);
if (!descr->skb) {
descr->buf_addr = 0; /* tell DMAC don't touch memory */
dev_info(ctodev(card),
@@ -349,7 +412,7 @@ static int gelic_card_alloc_rx_skbs(stru
int ret;
chain = &card->rx_chain;
ret = gelic_card_fill_rx_chain(card);
- chain->head = card->rx_top->prev; /* point to the last */
+ chain->tail = card->rx_top->prev; /* point to the last */
return ret;
}
@@ -361,16 +424,14 @@ static int gelic_card_alloc_rx_skbs(stru
* releases a used tx descriptor (unmapping, freeing of skb)
*/
static void gelic_descr_release_tx(struct gelic_card *card,
- struct gelic_descr *descr)
+ struct gelic_descr *descr)
{
struct sk_buff *skb = descr->skb;
-#ifdef DEBUG
- BUG_ON(!(be32_to_cpu(descr->data_status) &
- (1 << GELIC_DESCR_TX_DMA_FRAME_TAIL)));
-#endif
- dma_unmap_single(ctodev(card),
- be32_to_cpu(descr->buf_addr), skb->len, DMA_TO_DEVICE);
+ BUG_ON(!(be32_to_cpu(descr->data_status) & GELIC_DESCR_TX_TAIL));
+
+ dma_unmap_single(ctodev(card), be32_to_cpu(descr->buf_addr), skb->len,
+ DMA_TO_DEVICE);
dev_kfree_skb_any(skb);
descr->buf_addr = 0;
@@ -386,6 +447,20 @@ static void gelic_descr_release_tx(struc
gelic_descr_set_status(descr, GELIC_DESCR_DMA_NOT_IN_USE);
}
+static void gelic_card_stop_queues(struct gelic_card *card)
+{
+ netif_stop_queue(card->netdev[GELIC_PORT_ETHERNET]);
+
+ if (card->netdev[GELIC_PORT_WIRELESS])
+ netif_stop_queue(card->netdev[GELIC_PORT_WIRELESS]);
+}
+static void gelic_card_wake_queues(struct gelic_card *card)
+{
+ netif_wake_queue(card->netdev[GELIC_PORT_ETHERNET]);
+
+ if (card->netdev[GELIC_PORT_WIRELESS])
+ netif_wake_queue(card->netdev[GELIC_PORT_WIRELESS]);
+}
/**
* gelic_card_release_tx_chain - processes sent tx descriptors
* @card: adapter structure
@@ -397,12 +472,14 @@ static void gelic_card_release_tx_chain(
{
struct gelic_descr_chain *tx_chain;
enum gelic_descr_dma_status status;
+ struct net_device *netdev;
int release = 0;
for (tx_chain = &card->tx_chain;
tx_chain->head != tx_chain->tail && tx_chain->tail;
tx_chain->tail = tx_chain->tail->next) {
status = gelic_descr_get_status(tx_chain->tail);
+ netdev = tx_chain->tail->skb->dev;
switch (status) {
case GELIC_DESCR_DMA_RESPONSE_ERROR:
case GELIC_DESCR_DMA_PROTECTION_ERROR:
@@ -412,13 +489,13 @@ static void gelic_card_release_tx_chain(
"%s: forcing end of tx descriptor " \
"with status %x\n",
__func__, status);
- card->netdev->stats.tx_dropped++;
+ netdev->stats.tx_dropped++;
break;
case GELIC_DESCR_DMA_COMPLETE:
if (tx_chain->tail->skb) {
- card->netdev->stats.tx_packets++;
- card->netdev->stats.tx_bytes +=
+ netdev->stats.tx_packets++;
+ netdev->stats.tx_bytes +=
tx_chain->tail->skb->len;
}
break;
@@ -435,7 +512,7 @@ static void gelic_card_release_tx_chain(
}
out:
if (!stop && release)
- netif_wake_queue(card->netdev);
+ gelic_card_wake_queues(card);
}
/**
@@ -446,9 +523,9 @@ out:
* netdev interface. It also sets up multicast, allmulti and promisc
* flags appropriately
*/
-static void gelic_net_set_multi(struct net_device *netdev)
+void gelic_net_set_multi(struct net_device *netdev)
{
- struct gelic_card *card = netdev_priv(netdev);
+ struct gelic_card *card = netdev_card(netdev);
struct dev_mc_list *mc;
unsigned int i;
uint8_t *p;
@@ -470,8 +547,8 @@ static void gelic_net_set_multi(struct n
"lv1_net_add_multicast_address failed, %d\n",
status);
- if (netdev->flags & IFF_ALLMULTI
- || netdev->mc_count > GELIC_NET_MC_COUNT_MAX) { /* list max */
+ if ((netdev->flags & IFF_ALLMULTI) ||
+ (netdev->mc_count > GELIC_NET_MC_COUNT_MAX)) {
status = lv1_net_add_multicast_address(bus_id(card),
dev_id(card),
0, 1);
@@ -482,7 +559,7 @@ static void gelic_net_set_multi(struct n
return;
}
- /* set multicast address */
+ /* set multicast addresses */
for (mc = netdev->mc_list; mc; mc = mc->next) {
addr = 0;
p = mc->dmi_addr;
@@ -511,8 +588,19 @@ static inline void gelic_card_enable_rxd
{
int status;
+#ifdef DEBUG
+ if (gelic_descr_get_status(card->rx_chain.head) !=
+ GELIC_DESCR_DMA_CARDOWNED) {
+ printk(KERN_ERR "%s: status=%x\n", __func__,
+ be32_to_cpu(card->rx_chain.head->dmac_cmd_status));
+ printk(KERN_ERR "%s: nextphy=%x\n", __func__,
+ be32_to_cpu(card->rx_chain.head->next_descr_addr));
+ printk(KERN_ERR "%s: head=%p\n", __func__,
+ card->rx_chain.head);
+ }
+#endif
status = lv1_net_start_rx_dma(bus_id(card), dev_id(card),
- card->rx_chain.tail->bus_addr, 0);
+ card->rx_chain.head->bus_addr, 0);
if (status)
dev_info(ctodev(card),
"lv1_net_start_rx_dma failed, status=%d\n", status);
@@ -560,33 +648,19 @@ static inline void gelic_card_disable_tx
*
* always returns 0
*/
-static int gelic_net_stop(struct net_device *netdev)
+int gelic_net_stop(struct net_device *netdev)
{
- struct gelic_card *card = netdev_priv(netdev);
-
- napi_disable(&card->napi);
- netif_stop_queue(netdev);
-
- /* turn off DMA, force end */
- gelic_card_disable_rxdmac(card);
- gelic_card_disable_txdmac(card);
-
- gelic_card_set_irq_mask(card, 0);
+ struct gelic_card *card;
- /* disconnect event port */
- free_irq(card->netdev->irq, card->netdev);
- ps3_sb_event_receive_port_destroy(card->dev, card->netdev->irq);
- card->netdev->irq = NO_IRQ;
+ pr_debug("%s: start\n", __func__);
+ netif_stop_queue(netdev);
netif_carrier_off(netdev);
- /* release chains */
- gelic_card_release_tx_chain(card, 1);
- gelic_card_release_rx_chain(card);
-
- gelic_card_free_chain(card, card->tx_top);
- gelic_card_free_chain(card, card->rx_top);
+ card = netdev_card(netdev);
+ gelic_card_down(card);
+ pr_debug("%s: done\n", __func__);
return 0;
}
@@ -612,7 +686,7 @@ gelic_card_get_next_tx_descr(struct geli
}
/**
- * gelic_descr_set_tx_cmdstat - sets the tx descriptor command field
+ * gelic_net_set_txdescr_cmdstat - sets the tx descriptor command field
* @descr: descriptor structure to fill out
* @skb: packet to consider
*
@@ -677,7 +751,7 @@ static inline struct sk_buff *gelic_put_
}
/**
- * gelic_descr_prepare_tx - get dma address of skb_data
+ * gelic_descr_prepare_tx - setup a descriptor for sending packets
* @card: card structure
* @descr: descriptor structure
* @skb: packet to use
@@ -691,10 +765,13 @@ static int gelic_descr_prepare_tx(struct
{
dma_addr_t buf;
- if (card->vlan_index != -1) {
+ if (card->vlan_required) {
struct sk_buff *skb_tmp;
+ enum gelic_port_type type;
+
+ type = netdev_port(skb->dev)->type;
skb_tmp = gelic_put_vlan_tag(skb,
- card->vlan_id[card->vlan_index]);
+ card->vlan[type].tx);
if (!skb_tmp)
return -ENOMEM;
skb = skb_tmp;
@@ -753,14 +830,14 @@ static int gelic_card_kick_txdma(struct
*
* returns 0 on success, <0 on failure
*/
-static int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
+int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
{
- struct gelic_card *card = netdev_priv(netdev);
+ struct gelic_card *card = netdev_card(netdev);
struct gelic_descr *descr;
int result;
unsigned long flags;
- spin_lock_irqsave(&card->tx_dma_lock, flags);
+ spin_lock_irqsave(&card->tx_lock, flags);
gelic_card_release_tx_chain(card, 0);
@@ -769,8 +846,8 @@ static int gelic_net_xmit(struct sk_buff
/*
* no more descriptors free
*/
- netif_stop_queue(netdev);
- spin_unlock_irqrestore(&card->tx_dma_lock, flags);
+ gelic_card_stop_queues(card);
+ spin_unlock_irqrestore(&card->tx_lock, flags);
return NETDEV_TX_BUSY;
}
@@ -780,9 +857,9 @@ static int gelic_net_xmit(struct sk_buff
* DMA map failed. As chanses are that failure
* would continue, just release skb and return
*/
- card->netdev->stats.tx_dropped++;
+ netdev->stats.tx_dropped++;
dev_kfree_skb_any(skb);
- spin_unlock_irqrestore(&card->tx_dma_lock, flags);
+ spin_unlock_irqrestore(&card->tx_lock, flags);
return NETDEV_TX_OK;
}
/*
@@ -800,7 +877,7 @@ static int gelic_net_xmit(struct sk_buff
* kick failed.
* release descriptors which were just prepared
*/
- card->netdev->stats.tx_dropped++;
+ netdev->stats.tx_dropped++;
gelic_descr_release_tx(card, descr);
gelic_descr_release_tx(card, descr->next);
card->tx_chain.tail = descr->next->next;
@@ -810,7 +887,7 @@ static int gelic_net_xmit(struct sk_buff
netdev->trans_start = jiffies;
}
- spin_unlock_irqrestore(&card->tx_dma_lock, flags);
+ spin_unlock_irqrestore(&card->tx_lock, flags);
return NETDEV_TX_OK;
}
@@ -818,27 +895,27 @@ static int gelic_net_xmit(struct sk_buff
* gelic_net_pass_skb_up - takes an skb from a descriptor and passes it on
* @descr: descriptor to process
* @card: card structure
+ * @netdev: net_device structure to be passed packet
*
* iommu-unmaps the skb, fills out skb structure and passes the data to the
* stack. The descriptor state is not changed.
*/
static void gelic_net_pass_skb_up(struct gelic_descr *descr,
- struct gelic_card *card)
+ struct gelic_card *card,
+ struct net_device *netdev)
+
{
- struct sk_buff *skb;
- struct net_device *netdev;
+ struct sk_buff *skb = descr->skb;
u32 data_status, data_error;
data_status = be32_to_cpu(descr->data_status);
data_error = be32_to_cpu(descr->data_error);
- netdev = card->netdev;
/* unmap skb buffer */
- skb = descr->skb;
- dma_unmap_single(ctodev(card),
- be32_to_cpu(descr->buf_addr), GELIC_NET_MAX_MTU,
+ dma_unmap_single(ctodev(card), be32_to_cpu(descr->buf_addr),
+ GELIC_NET_MAX_MTU,
DMA_FROM_DEVICE);
- skb_put(skb, descr->valid_size ?
+ skb_put(skb, be32_to_cpu(descr->valid_size)?
be32_to_cpu(descr->valid_size) :
be32_to_cpu(descr->result_size));
if (!descr->valid_size)
@@ -866,8 +943,8 @@ static void gelic_net_pass_skb_up(struct
skb->ip_summed = CHECKSUM_NONE;
/* update netdevice statistics */
- card->netdev->stats.rx_packets++;
- card->netdev->stats.rx_bytes += skb->len;
+ netdev->stats.rx_packets++;
+ netdev->stats.rx_bytes += skb->len;
/* pass skb up to stack */
netif_receive_skb(skb);
@@ -886,7 +963,8 @@ static int gelic_card_decode_one_descr(s
{
enum gelic_descr_dma_status status;
struct gelic_descr_chain *chain = &card->rx_chain;
- struct gelic_descr *descr = chain->tail;
+ struct gelic_descr *descr = chain->head;
+ struct net_device *netdev = NULL;
int dmac_chain_ended;
status = gelic_descr_get_status(descr);
@@ -903,12 +981,30 @@ static int gelic_card_decode_one_descr(s
return 0;
}
+ /* netdevice select */
+ if (card->vlan_required) {
+ unsigned int i;
+ u16 vid;
+ vid = *(u16 *)(descr->skb->data) & VLAN_VID_MASK;
+ for (i = 0; i < GELIC_PORT_MAX; i++) {
+ if (card->vlan[i].rx == vid) {
+ netdev = card->netdev[i];
+ break;
+ }
+ };
+ if (GELIC_PORT_MAX <= i) {
+ pr_info("%s: unknown packet vid=%x\n", __func__, vid);
+ goto refill;
+ }
+ } else
+ netdev = card->netdev[GELIC_PORT_ETHERNET];
+
if ((status == GELIC_DESCR_DMA_RESPONSE_ERROR) ||
(status == GELIC_DESCR_DMA_PROTECTION_ERROR) ||
(status == GELIC_DESCR_DMA_FORCE_END)) {
dev_info(ctodev(card), "dropping RX descriptor with state %x\n",
status);
- card->netdev->stats.rx_dropped++;
+ netdev->stats.rx_dropped++;
goto refill;
}
@@ -936,7 +1032,7 @@ static int gelic_card_decode_one_descr(s
}
/* ok, we've got a packet in descr */
- gelic_net_pass_skb_up(descr, card);
+ gelic_net_pass_skb_up(descr, card, netdev);
refill:
/*
* So that always DMAC can see the end
@@ -954,8 +1050,8 @@ refill:
*/
gelic_descr_prepare_rx(card, descr);
- chain->head = descr;
- chain->tail = descr->next;
+ chain->tail = descr;
+ chain->head = descr->next;
/*
* Set this descriptor the end of the chain.
@@ -976,17 +1072,15 @@ refill:
/**
* gelic_net_poll - NAPI poll function called by the stack to return packets
- * @netdev: interface device structure
+ * @napi: napi structure
* @budget: number of packets we can pass to the stack at most
*
- * returns 0 if no more packets available to the driver/stack. Returns 1,
- * if the quota is exceeded, but the driver has still packets.
+ * returns the number of the processed packets
*
*/
static int gelic_net_poll(struct napi_struct *napi, int budget)
{
struct gelic_card *card = container_of(napi, struct gelic_card, napi);
- struct net_device *netdev = card->netdev;
int packets_done = 0;
while (packets_done < budget) {
@@ -997,7 +1091,7 @@ static int gelic_net_poll(struct napi_st
}
if (packets_done < budget) {
- netif_rx_complete(netdev, napi);
+ napi_complete(napi);
gelic_card_rx_irq_on(card);
}
return packets_done;
@@ -1009,7 +1103,7 @@ static int gelic_net_poll(struct napi_st
*
* returns 0 on success, <0 on failure
*/
-static int gelic_net_change_mtu(struct net_device *netdev, int new_mtu)
+int gelic_net_change_mtu(struct net_device *netdev, int new_mtu)
{
/* no need to re-alloc skbs or so -- the max mtu is about 2.3k
* and mtu is outbound only anyway */
@@ -1027,8 +1121,7 @@ static int gelic_net_change_mtu(struct n
static irqreturn_t gelic_card_interrupt(int irq, void *ptr)
{
unsigned long flags;
- struct net_device *netdev = ptr;
- struct gelic_card *card = netdev_priv(netdev);
+ struct gelic_card *card = ptr;
u64 status;
status = card->irq_status;
@@ -1036,6 +1129,8 @@ static irqreturn_t gelic_card_interrupt(
if (!status)
return IRQ_NONE;
+ status &= card->irq_mask;
+
if (card->rx_dma_restart_required) {
card->rx_dma_restart_required = 0;
gelic_card_enable_rxdmac(card);
@@ -1043,21 +1138,22 @@ static irqreturn_t gelic_card_interrupt(
if (status & GELIC_CARD_RXINT) {
gelic_card_rx_irq_off(card);
- netif_rx_schedule(netdev, &card->napi);
+ napi_schedule(&card->napi);
}
if (status & GELIC_CARD_TXINT) {
- spin_lock_irqsave(&card->tx_dma_lock, flags);
+ spin_lock_irqsave(&card->tx_lock, flags);
card->tx_dma_progress = 0;
gelic_card_release_tx_chain(card, 0);
/* kick outstanding tx descriptor if any */
gelic_card_kick_txdma(card, card->tx_chain.tail);
- spin_unlock_irqrestore(&card->tx_dma_lock, flags);
+ spin_unlock_irqrestore(&card->tx_lock, flags);
}
/* ether port status changed */
if (status & GELIC_CARD_PORT_STATUS_CHANGED)
gelic_card_get_ether_port_status(card, 1);
+
return IRQ_HANDLED;
}
@@ -1068,55 +1164,17 @@ static irqreturn_t gelic_card_interrupt(
*
* see Documentation/networking/netconsole.txt
*/
-static void gelic_net_poll_controller(struct net_device *netdev)
+void gelic_net_poll_controller(struct net_device *netdev)
{
- struct gelic_card *card = netdev_priv(netdev);
+ struct gelic_card *card = netdev_card(netdev);
gelic_card_set_irq_mask(card, 0);
gelic_card_interrupt(netdev->irq, netdev);
- gelic_card_set_irq_mask(card, card->ghiintmask);
+ gelic_card_set_irq_mask(card, card->irq_mask);
}
#endif /* CONFIG_NET_POLL_CONTROLLER */
/**
- * gelic_card_open - open device and map dma region
- * @card: card structure
- */
-static int gelic_card_open(struct gelic_card *card)
-{
- int result;
-
- result = ps3_sb_event_receive_port_setup(card->dev, PS3_BINDING_CPU_ANY,
- &card->netdev->irq);
-
- if (result) {
- dev_info(ctodev(card),
- "%s:%d: recieve_port_setup failed (%d)\n",
- __func__, __LINE__, result);
- result = -EPERM;
- goto fail_alloc_irq;
- }
-
- result = request_irq(card->netdev->irq, gelic_card_interrupt,
- IRQF_DISABLED, card->netdev->name, card->netdev);
-
- if (result) {
- dev_info(ctodev(card), "%s:%d: request_irq failed (%d)\n",
- __func__, __LINE__, result);
- goto fail_request_irq;
- }
-
- return 0;
-
-fail_request_irq:
- ps3_sb_event_receive_port_destroy(card->dev, card->netdev->irq);
- card->netdev->irq = NO_IRQ;
-fail_alloc_irq:
- return result;
-}
-
-
-/**
* gelic_net_open - called upon ifonfig up
* @netdev: interface device structure
*
@@ -1125,56 +1183,23 @@ fail_alloc_irq:
* gelic_net_open allocates all the descriptors and memory needed for
* operation, sets up multicast list and enables interrupts
*/
-static int gelic_net_open(struct net_device *netdev)
+int gelic_net_open(struct net_device *netdev)
{
- struct gelic_card *card = netdev_priv(netdev);
-
- dev_dbg(ctodev(card), " -> %s:%d\n", __func__, __LINE__);
+ struct gelic_card *card = netdev_card(netdev);
- gelic_card_open(card);
+ dev_dbg(ctodev(card), " -> %s %p\n", __func__, netdev);
- if (gelic_card_init_chain(card, &card->tx_chain,
- card->descr, GELIC_NET_TX_DESCRIPTORS))
- goto alloc_tx_failed;
- if (gelic_card_init_chain(card, &card->rx_chain,
- card->descr + GELIC_NET_TX_DESCRIPTORS,
- GELIC_NET_RX_DESCRIPTORS))
- goto alloc_rx_failed;
-
- /* head of chain */
- card->tx_top = card->tx_chain.head;
- card->rx_top = card->rx_chain.head;
- dev_dbg(ctodev(card), "descr rx %p, tx %p, size %#lx, num %#x\n",
- card->rx_top, card->tx_top, sizeof(struct gelic_descr),
- GELIC_NET_RX_DESCRIPTORS);
- /* allocate rx skbs */
- if (gelic_card_alloc_rx_skbs(card))
- goto alloc_skbs_failed;
-
- napi_enable(&card->napi);
-
- card->tx_dma_progress = 0;
- card->ghiintmask = GELIC_CARD_RXINT | GELIC_CARD_TXINT |
- GELIC_CARD_PORT_STATUS_CHANGED;
-
- gelic_card_set_irq_mask(card, card->ghiintmask);
- gelic_card_enable_rxdmac(card);
+ gelic_card_up(card);
netif_start_queue(netdev);
gelic_card_get_ether_port_status(card, 1);
+ dev_dbg(ctodev(card), " <- %s\n", __func__);
return 0;
-
-alloc_skbs_failed:
- gelic_card_free_chain(card, card->rx_top);
-alloc_rx_failed:
- gelic_card_free_chain(card, card->tx_top);
-alloc_tx_failed:
- return -ENOMEM;
}
-static void gelic_net_get_drvinfo(struct net_device *netdev,
- struct ethtool_drvinfo *info)
+void gelic_net_get_drvinfo(struct net_device *netdev,
+ struct ethtool_drvinfo *info)
{
strncpy(info->driver, DRV_NAME, sizeof(info->driver) - 1);
strncpy(info->version, DRV_VERSION, sizeof(info->version) - 1);
@@ -1183,7 +1208,7 @@ static void gelic_net_get_drvinfo(struct
static int gelic_ether_get_settings(struct net_device *netdev,
struct ethtool_cmd *cmd)
{
- struct gelic_card *card = netdev_priv(netdev);
+ struct gelic_card *card = netdev_card(netdev);
gelic_card_get_ether_port_status(card, 0);
@@ -1219,35 +1244,25 @@ static int gelic_ether_get_settings(stru
return 0;
}
-static int gelic_net_nway_reset(struct net_device *netdev)
+u32 gelic_net_get_rx_csum(struct net_device *netdev)
{
- if (netif_running(netdev)) {
- gelic_net_stop(netdev);
- gelic_net_open(netdev);
- }
- return 0;
-}
-
-static u32 gelic_net_get_rx_csum(struct net_device *netdev)
-{
- struct gelic_card *card = netdev_priv(netdev);
+ struct gelic_card *card = netdev_card(netdev);
return card->rx_csum;
}
-static int gelic_net_set_rx_csum(struct net_device *netdev, u32 data)
+int gelic_net_set_rx_csum(struct net_device *netdev, u32 data)
{
- struct gelic_card *card = netdev_priv(netdev);
+ struct gelic_card *card = netdev_card(netdev);
card->rx_csum = data;
return 0;
}
-static struct ethtool_ops gelic_net_ethtool_ops = {
+static struct ethtool_ops gelic_ether_ethtool_ops = {
.get_drvinfo = gelic_net_get_drvinfo,
.get_settings = gelic_ether_get_settings,
.get_link = ethtool_op_get_link,
- .nway_reset = gelic_net_nway_reset,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum,
.get_rx_csum = gelic_net_get_rx_csum,
@@ -1265,7 +1280,7 @@ static void gelic_net_tx_timeout_task(st
{
struct gelic_card *card =
container_of(work, struct gelic_card, tx_timeout_task);
- struct net_device *netdev = card->netdev;
+ struct net_device *netdev = card->netdev[GELIC_PORT_ETHERNET];
dev_info(ctodev(card), "%s:Timed out. Restarting... \n", __func__);
@@ -1288,11 +1303,11 @@ out:
*
* called, if tx hangs. Schedules a task that resets the interface
*/
-static void gelic_net_tx_timeout(struct net_device *netdev)
+void gelic_net_tx_timeout(struct net_device *netdev)
{
struct gelic_card *card;
- card = netdev_priv(netdev);
+ card = netdev_card(netdev);
atomic_inc(&card->tx_timeout_task_counter);
if (netdev->flags & IFF_UP)
schedule_work(&card->tx_timeout_task);
@@ -1306,7 +1321,8 @@ static void gelic_net_tx_timeout(struct
*
* fills out function pointers in the net_device structure
*/
-static void gelic_ether_setup_netdev_ops(struct net_device *netdev)
+static void gelic_ether_setup_netdev_ops(struct net_device *netdev,
+ struct napi_struct *napi)
{
netdev->open = &gelic_net_open;
netdev->stop = &gelic_net_stop;
@@ -1316,86 +1332,63 @@ static void gelic_ether_setup_netdev_ops
/* tx watchdog */
netdev->tx_timeout = &gelic_net_tx_timeout;
netdev->watchdog_timeo = GELIC_NET_WATCHDOG_TIMEOUT;
- netdev->ethtool_ops = &gelic_net_ethtool_ops;
+ /* NAPI */
+ netif_napi_add(netdev, napi,
+ gelic_net_poll, GELIC_NET_NAPI_WEIGHT);
+ netdev->ethtool_ops = &gelic_ether_ethtool_ops;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ netdev->poll_controller = gelic_net_poll_controller;
+#endif
}
/**
- * gelic_net_setup_netdev - initialization of net_device
+ * gelic_ether_setup_netdev - initialization of net_device
+ * @netdev: net_device structure
* @card: card structure
*
* Returns 0 on success or <0 on failure
*
- * gelic_net_setup_netdev initializes the net_device structure
+ * gelic_ether_setup_netdev initializes the net_device structure
+ * and register it.
**/
-static int gelic_net_setup_netdev(struct gelic_card *card)
+int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
{
- struct net_device *netdev = card->netdev;
- struct sockaddr addr;
- unsigned int i;
int status;
u64 v1, v2;
DECLARE_MAC_BUF(mac);
- SET_NETDEV_DEV(netdev, &card->dev->core);
- spin_lock_init(&card->tx_dma_lock);
-
- card->rx_csum = GELIC_NET_RX_CSUM_DEFAULT;
-
- gelic_ether_setup_netdev_ops(netdev);
-
- netif_napi_add(netdev, &card->napi,
- gelic_net_poll, GELIC_NET_NAPI_WEIGHT);
-
netdev->features = NETIF_F_IP_CSUM;
status = lv1_net_control(bus_id(card), dev_id(card),
GELIC_LV1_GET_MAC_ADDRESS,
0, 0, 0, &v1, &v2);
+ v1 <<= 16;
if (status || !is_valid_ether_addr((u8 *)&v1)) {
dev_info(ctodev(card),
"%s:lv1_net_control GET_MAC_ADDR failed %d\n",
__func__, status);
return -EINVAL;
}
- v1 <<= 16;
- memcpy(addr.sa_data, &v1, ETH_ALEN);
- memcpy(netdev->dev_addr, addr.sa_data, ETH_ALEN);
- dev_info(ctodev(card), "MAC addr %s\n",
- print_mac(mac, netdev->dev_addr));
-
- card->vlan_index = -1; /* no vlan */
- for (i = 0; i < GELIC_NET_VLAN_MAX; i++) {
- status = lv1_net_control(bus_id(card), dev_id(card),
- GELIC_LV1_GET_VLAN_ID,
- i + 1, /* index; one based */
- 0, 0, &v1, &v2);
- if (status == LV1_NO_ENTRY) {
- dev_dbg(ctodev(card),
- "GELIC_VLAN_ID no entry:%d, VLAN disabled\n",
- status);
- card->vlan_id[i] = 0;
- } else if (status) {
- dev_dbg(ctodev(card),
- "%s:get vlan id faild, status=%d\n",
- __func__, status);
- card->vlan_id[i] = 0;
- } else {
- card->vlan_id[i] = (u32)v1;
- dev_dbg(ctodev(card), "vlan_id:%d, %lx\n", i, v1);
- }
- }
+ memcpy(netdev->dev_addr, &v1, ETH_ALEN);
- if (card->vlan_id[GELIC_LV1_VLAN_TX_ETHERNET - 1]) {
- card->vlan_index = GELIC_LV1_VLAN_TX_ETHERNET - 1;
+ if (card->vlan_required) {
netdev->hard_header_len += VLAN_HLEN;
+ /*
+ * As vlan is internally used,
+ * we can not receive vlan packets
+ */
+ netdev->features |= NETIF_F_VLAN_CHALLENGED;
}
status = register_netdev(netdev);
if (status) {
- dev_err(ctodev(card), "%s:Couldn't register net_device: %d\n",
- __func__, status);
+ dev_err(ctodev(card), "%s:Couldn't register %s %d\n",
+ __func__, netdev->name, status);
return status;
}
+ dev_info(ctodev(card), "%s: MAC addr %s\n",
+ netdev->name,
+ print_mac(mac, netdev->dev_addr));
return 0;
}
@@ -1407,72 +1400,171 @@ static int gelic_net_setup_netdev(struct
*
* the card and net_device structures are linked to each other
*/
-static struct gelic_card *gelic_alloc_card_net(void)
+#define GELIC_ALIGN (32)
+static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev)
{
- struct net_device *netdev;
struct gelic_card *card;
+ struct gelic_port *port;
+ void *p;
size_t alloc_size;
-
- alloc_size = sizeof(*card) +
- sizeof(struct gelic_descr) * GELIC_NET_RX_DESCRIPTORS +
- sizeof(struct gelic_descr) * GELIC_NET_TX_DESCRIPTORS;
/*
- * we assume private data is allocated 32 bytes (or more) aligned
- * so that gelic_descr should be 32 bytes aligned.
- * Current alloc_etherdev() does do it because NETDEV_ALIGN
- * is 32.
- * check this assumption here.
+ * gelic requires dma descriptor is 32 bytes aligned and
+ * the hypervisor requires irq_status is 8 bytes aligned.
*/
- BUILD_BUG_ON(NETDEV_ALIGN < 32);
BUILD_BUG_ON(offsetof(struct gelic_card, irq_status) % 8);
BUILD_BUG_ON(offsetof(struct gelic_card, descr) % 32);
+ alloc_size =
+ sizeof(struct gelic_card) +
+ sizeof(struct gelic_descr) * GELIC_NET_RX_DESCRIPTORS +
+ sizeof(struct gelic_descr) * GELIC_NET_TX_DESCRIPTORS +
+ GELIC_ALIGN - 1;
- netdev = alloc_etherdev(alloc_size);
- if (!netdev)
+ p = kzalloc(alloc_size, GFP_KERNEL);
+ if (!p)
return NULL;
+ card = PTR_ALIGN(p, GELIC_ALIGN);
+ card->unalign = p;
+
+ /*
+ * alloc netdev
+ */
+ *netdev = alloc_etherdev(sizeof(struct gelic_port));
+ if (!netdev) {
+ kfree(card->unalign);
+ return NULL;
+ }
+ port = netdev_priv(*netdev);
+
+ /* gelic_port */
+ port->netdev = *netdev;
+ port->card = card;
+ port->type = GELIC_PORT_ETHERNET;
+
+ /* gelic_card */
+ card->netdev[GELIC_PORT_ETHERNET] = *netdev;
- card = netdev_priv(netdev);
- card->netdev = netdev;
INIT_WORK(&card->tx_timeout_task, gelic_net_tx_timeout_task);
init_waitqueue_head(&card->waitq);
atomic_set(&card->tx_timeout_task_counter, 0);
+ init_MUTEX(&card->updown_lock);
+ atomic_set(&card->users, 0);
return card;
}
+static void gelic_card_get_vlan_info(struct gelic_card *card)
+{
+ u64 v1, v2;
+ int status;
+ unsigned int i;
+ struct {
+ int tx;
+ int rx;
+ } vlan_id_ix[2] = {
+ [GELIC_PORT_ETHERNET] = {
+ .tx = GELIC_LV1_VLAN_TX_ETHERNET,
+ .rx = GELIC_LV1_VLAN_RX_ETHERNET
+ },
+ [GELIC_PORT_WIRELESS] = {
+ .tx = GELIC_LV1_VLAN_TX_WIRELESS,
+ .rx = GELIC_LV1_VLAN_RX_WIRELESS
+ }
+ };
+
+ for (i = 0; i < ARRAY_SIZE(vlan_id_ix); i++) {
+ /* tx tag */
+ status = lv1_net_control(bus_id(card), dev_id(card),
+ GELIC_LV1_GET_VLAN_ID,
+ vlan_id_ix[i].tx,
+ 0, 0, &v1, &v2);
+ if (status || !v1) {
+ if (status != LV1_NO_ENTRY)
+ dev_dbg(ctodev(card),
+ "get vlan id for tx(%d) failed(%d)\n",
+ vlan_id_ix[i].tx, status);
+ card->vlan[i].tx = 0;
+ card->vlan[i].rx = 0;
+ continue;
+ }
+ card->vlan[i].tx = (u16)v1;
+
+ /* rx tag */
+ status = lv1_net_control(bus_id(card), dev_id(card),
+ GELIC_LV1_GET_VLAN_ID,
+ vlan_id_ix[i].rx,
+ 0, 0, &v1, &v2);
+ if (status || !v1) {
+ if (status != LV1_NO_ENTRY)
+ dev_info(ctodev(card),
+ "get vlan id for rx(%d) failed(%d)\n",
+ vlan_id_ix[i].rx, status);
+ card->vlan[i].tx = 0;
+ card->vlan[i].rx = 0;
+ continue;
+ }
+ card->vlan[i].rx = (u16)v1;
+
+ dev_dbg(ctodev(card), "vlan_id[%d] tx=%02x rx=%02x\n",
+ i, card->vlan[i].tx, card->vlan[i].rx);
+ }
+
+ if (card->vlan[GELIC_PORT_ETHERNET].tx) {
+ BUG_ON(!card->vlan[GELIC_PORT_WIRELESS].tx);
+ card->vlan_required = 1;
+ } else
+ card->vlan_required = 0;
+
+ /* check wirelss capable firmware */
+ if (ps3_compare_firmware_version(1, 6, 0) < 0) {
+ card->vlan[GELIC_PORT_WIRELESS].tx = 0;
+ card->vlan[GELIC_PORT_WIRELESS].rx = 0;
+ }
+
+ dev_info(ctodev(card), "internal vlan %s\n",
+ card->vlan_required? "enabled" : "disabled");
+}
/**
* ps3_gelic_driver_probe - add a device to the control of this driver
*/
static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
{
- struct gelic_card *card = gelic_alloc_card_net();
+ struct gelic_card *card;
+ struct net_device *netdev;
int result;
- if (!card) {
- dev_info(&dev->core, "gelic_net_alloc_card failed\n");
- result = -ENOMEM;
- goto fail_alloc_card;
- }
-
- ps3_system_bus_set_driver_data(dev, card);
- card->dev = dev;
-
+ pr_debug("%s: called\n", __func__);
result = ps3_open_hv_device(dev);
if (result) {
- dev_dbg(&dev->core, "ps3_open_hv_device failed\n");
+ dev_dbg(&dev->core, "%s:ps3_open_hv_device failed\n",
+ __func__);
goto fail_open;
}
result = ps3_dma_region_create(dev->d_region);
if (result) {
- dev_dbg(&dev->core, "ps3_dma_region_create failed(%d)\n",
- result);
+ dev_dbg(&dev->core, "%s:ps3_dma_region_create failed(%d)\n",
+ __func__, result);
BUG_ON("check region type");
goto fail_dma_region;
}
+ /* alloc card/netdevice */
+ card = gelic_alloc_card_net(&netdev);
+ if (!card) {
+ dev_info(&dev->core, "%s:gelic_net_alloc_card failed\n",
+ __func__);
+ result = -ENOMEM;
+ goto fail_alloc_card;
+ }
+ ps3_system_bus_set_driver_data(dev, card);
+ card->dev = dev;
+
+ /* get internal vlan info */
+ gelic_card_get_vlan_info(card);
+
+ /* setup interrupt */
result = lv1_net_set_interrupt_status_indicator(bus_id(card),
dev_id(card),
ps3_mm_phys_to_lpar(__pa(&card->irq_status)),
@@ -1480,34 +1572,95 @@ static int ps3_gelic_driver_probe(struct
if (result) {
dev_dbg(&dev->core,
- "lv1_net_set_interrupt_status_indicator failed: %s\n",
- ps3_result(result));
+ "%s:set_interrupt_status_indicator failed: %s\n",
+ __func__, ps3_result(result));
result = -EIO;
goto fail_status_indicator;
}
- result = gelic_net_setup_netdev(card);
+ result = ps3_sb_event_receive_port_setup(dev, PS3_BINDING_CPU_ANY,
+ &card->irq);
+
+ if (result) {
+ dev_info(ctodev(card),
+ "%s:gelic_net_open_device failed (%d)\n",
+ __func__, result);
+ result = -EPERM;
+ goto fail_alloc_irq;
+ }
+ result = request_irq(card->irq, gelic_card_interrupt,
+ IRQF_DISABLED, netdev->name, card);
+
+ if (result) {
+ dev_info(ctodev(card), "%s:request_irq failed (%d)\n",
+ __func__, result);
+ goto fail_request_irq;
+ }
+
+ /* setup card structure */
+ card->irq_mask = GELIC_CARD_RXINT | GELIC_CARD_TXINT |
+ GELIC_CARD_PORT_STATUS_CHANGED;
+ card->rx_csum = GELIC_CARD_RX_CSUM_DEFAULT;
+
+
+ if (gelic_card_init_chain(card, &card->tx_chain,
+ card->descr, GELIC_NET_TX_DESCRIPTORS))
+ goto fail_alloc_tx;
+ if (gelic_card_init_chain(card, &card->rx_chain,
+ card->descr + GELIC_NET_TX_DESCRIPTORS,
+ GELIC_NET_RX_DESCRIPTORS))
+ goto fail_alloc_rx;
+
+ /* head of chain */
+ card->tx_top = card->tx_chain.head;
+ card->rx_top = card->rx_chain.head;
+ dev_dbg(ctodev(card), "descr rx %p, tx %p, size %#lx, num %#x\n",
+ card->rx_top, card->tx_top, sizeof(struct gelic_descr),
+ GELIC_NET_RX_DESCRIPTORS);
+ /* allocate rx skbs */
+ if (gelic_card_alloc_rx_skbs(card))
+ goto fail_alloc_skbs;
+
+ spin_lock_init(&card->tx_lock);
+ card->tx_dma_progress = 0;
+ /* setup net_device structure */
+ netdev->irq = card->irq;
+ SET_NETDEV_DEV(netdev, &card->dev->core);
+ gelic_ether_setup_netdev_ops(netdev, &card->napi);
+ result = gelic_net_setup_netdev(netdev, card);
if (result) {
- dev_dbg(&dev->core, "%s:%d: ps3_dma_region_create failed: "
- "(%d)\n", __func__, __LINE__, result);
+ dev_dbg(&dev->core, "%s: setup_netdev failed %d",
+ __func__, result);
goto fail_setup_netdev;
}
+ pr_debug("%s: done\n", __func__);
return 0;
fail_setup_netdev:
+fail_alloc_skbs:
+ gelic_card_free_chain(card, card->rx_chain.head);
+fail_alloc_rx:
+ gelic_card_free_chain(card, card->tx_chain.head);
+fail_alloc_tx:
+ free_irq(card->irq, card);
+ netdev->irq = NO_IRQ;
+fail_request_irq:
+ ps3_sb_event_receive_port_destroy(dev, card->irq);
+fail_alloc_irq:
lv1_net_set_interrupt_status_indicator(bus_id(card),
- dev_id(card),
- 0 , 0);
+ bus_id(card),
+ 0, 0);
fail_status_indicator:
+ ps3_system_bus_set_driver_data(dev, NULL);
+ kfree(netdev_card(netdev)->unalign);
+ free_netdev(netdev);
+fail_alloc_card:
ps3_dma_region_free(dev->d_region);
fail_dma_region:
ps3_close_hv_device(dev);
fail_open:
- ps3_system_bus_set_driver_data(dev, NULL);
- free_netdev(card->netdev);
-fail_alloc_card:
return result;
}
@@ -1518,6 +1671,28 @@ fail_alloc_card:
static int ps3_gelic_driver_remove(struct ps3_system_bus_device *dev)
{
struct gelic_card *card = ps3_system_bus_get_driver_data(dev);
+ struct net_device *netdev0;
+ pr_debug("%s: called\n", __func__);
+
+ /* stop interrupt */
+ gelic_card_set_irq_mask(card, 0);
+
+ /* turn off DMA, force end */
+ gelic_card_disable_rxdmac(card);
+ gelic_card_disable_txdmac(card);
+
+ /* release chains */
+ gelic_card_release_tx_chain(card, 1);
+ gelic_card_release_rx_chain(card);
+
+ gelic_card_free_chain(card, card->tx_top);
+ gelic_card_free_chain(card, card->rx_top);
+
+ netdev0 = card->netdev[GELIC_PORT_ETHERNET];
+ /* disconnect event port */
+ free_irq(card->irq, card);
+ netdev0->irq = NO_IRQ;
+ ps3_sb_event_receive_port_destroy(card->dev, card->irq);
wait_event(card->waitq,
atomic_read(&card->tx_timeout_task_counter) == 0);
@@ -1525,8 +1700,9 @@ static int ps3_gelic_driver_remove(struc
lv1_net_set_interrupt_status_indicator(bus_id(card), dev_id(card),
0 , 0);
- unregister_netdev(card->netdev);
- free_netdev(card->netdev);
+ unregister_netdev(netdev0);
+ kfree(netdev_card(netdev0)->unalign);
+ free_netdev(netdev0);
ps3_system_bus_set_driver_data(dev, NULL);
@@ -1534,6 +1710,7 @@ static int ps3_gelic_driver_remove(struc
ps3_close_hv_device(dev);
+ pr_debug("%s: done\n", __func__);
return 0;
}
--- a/drivers/net/ps3_gelic_net.h
+++ b/drivers/net/ps3_gelic_net.h
@@ -35,12 +35,11 @@
#define GELIC_NET_MAX_MTU VLAN_ETH_FRAME_LEN
#define GELIC_NET_MIN_MTU VLAN_ETH_ZLEN
#define GELIC_NET_RXBUF_ALIGN 128
-#define GELIC_NET_RX_CSUM_DEFAULT 1 /* hw chksum */
+#define GELIC_CARD_RX_CSUM_DEFAULT 1 /* hw chksum */
#define GELIC_NET_WATCHDOG_TIMEOUT 5*HZ
#define GELIC_NET_NAPI_WEIGHT (GELIC_NET_RX_DESCRIPTORS)
#define GELIC_NET_BROADCAST_ADDR 0xffffffffffffL
-#define GELIC_NET_VLAN_POS (VLAN_ETH_ALEN * 2)
-#define GELIC_NET_VLAN_MAX 4
+
#define GELIC_NET_MC_COUNT_MAX 32 /* multicast address list */
/* virtual interrupt status register bits */
@@ -206,6 +205,13 @@ enum gelic_lv1_vlan_index {
/* size of hardware part of gelic descriptor */
#define GELIC_DESCR_SIZE (32)
+
+enum gelic_port_type {
+ GELIC_PORT_ETHERNET = 0,
+ GELIC_PORT_WIRELESS = 1,
+ GELIC_PORT_MAX
+};
+
struct gelic_descr {
/* as defined by the hardware */
__be32 buf_addr;
@@ -222,7 +228,6 @@ struct gelic_descr {
dma_addr_t bus_addr;
struct gelic_descr *next;
struct gelic_descr *prev;
- struct vlan_ethhdr vlan;
} __attribute__((aligned(32)));
struct gelic_descr_chain {
@@ -231,43 +236,116 @@ struct gelic_descr_chain {
struct gelic_descr *tail;
};
+struct gelic_vlan_id {
+ u16 tx;
+ u16 rx;
+};
+
struct gelic_card {
- struct net_device *netdev;
struct napi_struct napi;
+ struct net_device *netdev[GELIC_PORT_MAX];
/*
* hypervisor requires irq_status should be
* 8 bytes aligned, but u64 member is
* always disposed in that manner
*/
u64 irq_status;
- u64 ghiintmask;
+ u64 irq_mask;
struct ps3_system_bus_device *dev;
- u32 vlan_id[GELIC_NET_VLAN_MAX];
- int vlan_index;
+ struct gelic_vlan_id vlan[GELIC_PORT_MAX];
+ int vlan_required;
struct gelic_descr_chain tx_chain;
struct gelic_descr_chain rx_chain;
int rx_dma_restart_required;
- /* gurad dmac descriptor chain*/
- spinlock_t chain_lock;
-
int rx_csum;
- /* guard tx_dma_progress */
- spinlock_t tx_dma_lock;
+ /*
+ * tx_lock guards tx descriptor list and
+ * tx_dma_progress.
+ */
+ spinlock_t tx_lock;
int tx_dma_progress;
struct work_struct tx_timeout_task;
atomic_t tx_timeout_task_counter;
wait_queue_head_t waitq;
+ /* only first user should up the card */
+ struct semaphore updown_lock;
+ atomic_t users;
+
u64 ether_port_status;
+ /* original address returned by kzalloc */
+ void *unalign;
+ /*
+ * each netdevice has copy of irq
+ */
+ unsigned int irq;
struct gelic_descr *tx_top, *rx_top;
- struct gelic_descr descr[0];
+ struct gelic_descr descr[0]; /* must be the last */
};
+struct gelic_port {
+ struct gelic_card *card;
+ struct net_device *netdev;
+ enum gelic_port_type type;
+ long priv[0]; /* long for alignment */
+};
-extern unsigned long p_to_lp(long pa);
+static inline struct gelic_card *port_to_card(struct gelic_port *p)
+{
+ return p->card;
+}
+static inline struct net_device *port_to_netdev(struct gelic_port *p)
+{
+ return p->netdev;
+}
+static inline struct gelic_card *netdev_card(struct net_device *d)
+{
+ return ((struct gelic_port *)netdev_priv(d))->card;
+}
+static inline struct gelic_port *netdev_port(struct net_device *d)
+{
+ return (struct gelic_port *)netdev_priv(d);
+}
+static inline struct device *ctodev(struct gelic_card *card)
+{
+ return &card->dev->core;
+}
+static inline u64 bus_id(struct gelic_card *card)
+{
+ return card->dev->bus_id;
+}
+static inline u64 dev_id(struct gelic_card *card)
+{
+ return card->dev->dev_id;
+}
+
+static inline void *port_priv(struct gelic_port *port)
+{
+ return port->priv;
+}
+
+extern int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask);
+/* shared netdev ops */
+extern void gelic_card_up(struct gelic_card *card);
+extern void gelic_card_down(struct gelic_card *card);
+extern int gelic_net_open(struct net_device *netdev);
+extern int gelic_net_stop(struct net_device *netdev);
+extern int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev);
+extern void gelic_net_set_multi(struct net_device *netdev);
+extern void gelic_net_tx_timeout(struct net_device *netdev);
+extern int gelic_net_change_mtu(struct net_device *netdev, int new_mtu);
+extern int gelic_net_setup_netdev(struct net_device *netdev,
+ struct gelic_card *card);
+
+/* shared ethtool ops */
+extern void gelic_net_get_drvinfo(struct net_device *netdev,
+ struct ethtool_drvinfo *info);
+extern u32 gelic_net_get_rx_csum(struct net_device *netdev);
+extern int gelic_net_set_rx_csum(struct net_device *netdev, u32 data);
+extern void gelic_net_poll_controller(struct net_device *netdev);
#endif /* _GELIC_NET_H */
^ permalink raw reply
* Re: [PATCH] [IPV4] route: fix locking in rt_run_flush()
From: Joonwoo Park @ 2008-01-24 5:06 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
In-Reply-To: <4797A729.4030006@cosmosbay.com>
2008/1/24, Eric Dumazet <dada1@cosmosbay.com>:
>
> Unfortunatly, your patch doesnt work on CONFIG_SMP=n (softirq will be disabled
> for the whole scan of table)
>
> Also, some machines around there have 2^22 slots in hash table, and NR_CPUS=4,
> so softirqs will be disabled for a too long time.
>
> Please try net-2.6.25 and submit patches on top of it if necessary, since
> rt_run_flush() has pending changes, not in net-2.6
>
> Note : The 'soft lockup' can be avoided by other means.
>
>
Eric,
Thank you for your help.
I checked net-2.6.25 in this morining :(
And it brought me a conclusion that the fashion of it is the best solution for
the all circumstances.
I believe that
'cond_resched()'
and
'if (!rth) continue' without disable softirq
of net-2.6.25 is correct answer.
Thanks again!
Joonwoo
^ permalink raw reply
* rebasing net-2.6.25...
From: David Miller @ 2008-01-24 5:00 UTC (permalink / raw)
To: netdev
I am going to work throughout the evening to rebase the net-2.6.25 GIT
tree.
I'm heading off to LCA08 tomorrow afternoon so I wanted to get this
out of the way before leaving.
^ permalink raw reply
* Re: [PATCH] ppp: sparse warning fixes
From: David Miller @ 2008-01-24 4:54 UTC (permalink / raw)
To: shemminger; +Cc: paulus, linux-ppp, netdev
In-Reply-To: <20080123154019.7cd9c471@deepthought>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 23 Jan 2008 15:40:19 -0800
> Fix a bunch of warnings in PPP and related drivers. Mostly because
> sparse doesn't like it when the the function is only marked private
> in the forward declaration.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks Stephen.
^ permalink raw reply
* [PATCH UCC TDM 3/3 ] Modified Documentation to explain dts entries for TDM driver
From: Poonam_Aggrwal-b10812 @ 2008-01-24 4:54 UTC (permalink / raw)
To: kumar.gala, akpm, linux-kernel, netdev, rubini, linuxppc-dev
Cc: michael.barkowski, kim.phillips, ashish.kalra, timur, rich.cutler
From: Poonam Aggrwal <b10812@freescale.com>
Modified Documentation to explain new properties introduced for UCC TDM
driver. Also two new nodes have been added "brg" and "clocks" to configure
a BRG from device tree.
Signed-off-by: Poonam Aggrwal <b10812@freescale.com>
Signed-off-by: Ashish Kalra <ashish.kalra@freescale.com>
Signed-off-by: Kim Phillips <Kim.Phillips@freescale.com>
Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
---
Documentation/powerpc/booting-without-of.txt | 96 +++++++++++++++++++++++++-
1 files changed, 94 insertions(+), 2 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index e9a3cb1..94a6b4b 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1613,8 +1613,8 @@ platforms are moved over to use the flattened-device-tree model.
Required properties:
- device_type : should be "network", "hldc", "uart", "transparent"
- "bisync" or "atm".
- - compatible : could be "ucc_geth" or "fsl_atm" and so on.
+ "bisync", "atm" or "tdm".
+ - compatible : could be "ucc_geth", "fsl_atm" or "fsl,ucc_tdm" and so on.
- model : should be "UCC".
- device-id : the ucc number(1-8), corresponding to UCCx in UM.
- reg : Offset and length of the register set for the device
@@ -1666,7 +1666,44 @@ platforms are moved over to use the flattened-device-tree model.
pio-handle = <140001>;
};
+ Required properties for tdm device_type:
+ - instead of tx-clock and rx-clock following clock properties are
+ required:
+ - fsl,tdm-tx-clk : This property selects the TX clock source for TDM
+ from a bank of clocks.
+ - fsl,tdm-rx-clk : This property selects the RX clock source for TDM
+ from a bank of clocks.
+ - fsl,tdm-tx-sync : This property selects the TX Frame sync source
+ for TDM from a bank of clocks.
+ - fsl,tdm-rx-sync : This property selects the TX Frame sync source
+ for TDM from a bank of clocks.
+
+ All the above mentioned properties are string type with possible
+ values
+ "CLK1", "CLK2", "CLK3"..."CLK24" and so on
+ "BRG1", "BRG2", "BRG3"..."BRG16" and so on
+
+ - fsl,tdm-num : TDM to be used (1,2,3 or 4 for TDMA TDMB TDMC TDMD)
+ - fsl,si-num : Serial Interface to be used.
+ Example:
+ ucc@2000 {
+ device_type = "tdm";
+ compatible = "fsl,ucc-tdm";
+ model = "UCC";
+ device-id = <1>;
+ fsl,tdm-num = <1>;
+ fsl,si-num = <1>;
+ fsl,tdm-tx-clk = "CLK1";
+ fsl,tdm-rx-clk = "CLK1";
+ fsl,tdm-tx-sync = "BRG9";
+ fsl,tdm-rx-sync = "BRG9";
+ reg = <2000 200>;
+ interrupts = <20>;
+ interrupt-parent = <&qeic>;
+ pio-handle = <&ucc1pio>;
+ };
+
v) Parallel I/O Ports
This node configures Parallel I/O ports for CPUs with QE support.
@@ -1772,6 +1809,61 @@ platforms are moved over to use the flattened-device-tree model.
};
};
+ viii) Clocks (clocks)
+ This node specifies the frequency values for all the external clocks
+ viz CLK1 to CLK24 in Hz.
+
+ Required Properties:
+ - compatible : should be "fsl,cpm-clocks".
+ - #clock-cells : It specifies the number of cells occupied by clock-frequency
+ property. Currently #clock-cells = 1 is only supported and implemented.
+ This property is kept for future in case we need frequencies higher than
+ 4 GHz.
+ - clock-frequency : It is a list of u32 values to represent the frequency
+ of each external clock(CLK1 to CLK24) in Hz.Each entry occupies
+ number of cells specified by #clock-cells property(1 for now).
+
+ Example:
+
+ clocks {
+ compatible = "fsl,cpm-clocks";
+ #clock-cells = <1>;
+ /* clock freqs in Hz(for CLK1~CLK24).
+ * CLK11 is 1024KHz,
+ * all other clocks unused
+ */
+ clock-frequency = <0 0 0 0 0 0
+ 0 0 0 0 0 d#1024000 0
+ 0 0 0 0 0 0
+ 0 0 0 0 0 0>;
+ };
+
+ ix) Baud Rate Generator (BRG)
+
+ Required properties:
+ - compatible : shpuld be "fsl,cpm-brg"
+ - fsl,brg-sources : define the input clock for all 16 BRGs. The input
+ clock source could be 1 to 24 for CLK1 to CLK24. Zero means that the
+ particular BRG will be driven by QE clock(BRGCLK).
+ - reg : This property defines the address and size of the memory-mapped
+ registers of the BRG.
+
+ Example:
+
+ brg@640 {
+ compatible = "fsl,qe-brg";
+ /* input clock sources for all the 16 BRGs.
+ * 1-24 for CLK1 to CLK24.
+ * BRG9 uses CLK11 others use
+ * the QE clock.
+ */
+ fsl,brg-sources = <0 0 0 0 0 0 0 0
+ b 0 0 0 0 0 0 0>;
+ reg = <640 7f>;
+ };
+
+ In the above entry, for BRG9 the input clock is 0xb(decimal 11) ie QE_CLK11.
+
j) CFI or JEDEC memory-mapped NOR flash
Flash chips (Memory Technology Devices) are often used for solid state
--
1.5.2.4
^ permalink raw reply related
* Re: [IPV4 4/5] fib_trie: version 0.410
From: David Miller @ 2008-01-24 4:50 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20080123224858.995658134@linux-foundation.org>
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Wed, 23 Jan 2008 14:48:48 -0800
> Increase version to reflect recent changes.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
I'm dropping this and patch 5 for now.
^ permalink raw reply
* [PATCH 2/3] Platform changes for UCC TDM driver for MPC8323ERDB.Also includes related QE changes and dts entries.
From: Poonam_Aggrwal-b10812 @ 2008-01-24 4:49 UTC (permalink / raw)
To: kumar.gala, akpm, linux-kernel, netdev, rubini, linuxppc-dev
Cc: michael.barkowski, kim.phillips, ashish.kalra, timur, rich.cutler
From: Poonam Aggrwal <b10812@freescale.com>
This patch makes necessary changes in the QE and UCC framework to support
TDM. It also adds support to configure the BRG properly through device
tree entries. Includes the device tree changes for UCC TDM driver as well.
It also includes device tree entries for UCC TDM driver.
Tested on MPC8323ERDB platform.
Signed-off-by: Poonam Aggrwal <b10812@freescale.com>
Signed-off-by: Ashish Kalra <ashish.kalra@freescale.com>
Signed-off-by: Kim Phillips <Kim.Phillips@freescale.com>
Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
---
arch/powerpc/boot/dts/mpc832x_rdb.dts | 58 +++++++
arch/powerpc/sysdev/qe_lib/qe.c | 205 ++++++++++++++++++++++++--
arch/powerpc/sysdev/qe_lib/ucc.c | 265 +++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/qe_lib/ucc_fast.c | 37 +++++
include/asm-powerpc/qe.h | 8 +
include/asm-powerpc/ucc.h | 4 +
include/asm-powerpc/ucc_fast.h | 4 +
7 files changed, 568 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..c0e6283 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -105,6 +105,17 @@
device_type = "par_io";
num-ports = <7>;
+ ucc1pio:ucc_pin@01 {
+ pio-map = <
+ /* port pin dir open_drain assignment has_irq */
+ 0 e 2 0 1 0 /* CLK11 */
+ 3 16 1 0 2 0 /* BRG9 */
+ 3 1b 1 0 2 0 /* BRG3 */
+ 0 0 3 0 2 0 /* TDMATxD0 */
+ 0 4 3 0 2 0 /* TDMARxD0 */
+ 3 1b 2 0 1 0>; /* CLK1 */
+ };
+
ucc2pio:ucc_pin@02 {
pio-map = <
/* port pin dir open_drain assignment has_irq */
@@ -169,6 +180,36 @@
};
};
+ clocks {
+ compatible = "fsl,cpm-clocks";
+ /* clock freqs in Hz(for CLK1~CLK24).
+ * CLK11 is 1024KHz,
+ * all other clocks unused
+ * #clock-cells define number of cells
+ * used by the clock-frequency.
+ * right now only #clock cells=1 is
+ * implemented. Provision is there to
+ * handle frequencies >4Gig
+ */
+ #clock-cells = <1>;
+ clock-frequency = <0 0 0 0 0 0
+ 0 0 0 0 d#1024000 0
+ 0 0 0 0 0 0
+ 0 0 0 0 0 0>;
+ };
+
+ brg@640 {
+ compatible = "fsl,cpm-brg";
+ /* input clock sources for all the 16 BRGs.
+ * 1-24 for CLK1 to CLK24.
+ * BRG9 uses CLK11,BRG1 and BRG2-8 use
+ * the QE clock.
+ */
+ fsl,brg-sources = <0 0 0 0 0 0 0 0
+ b 0 0 0 0 0 0 0>;
+ reg = <640 7f>;
+ };
+
spi@4c0 {
device_type = "spi";
compatible = "fsl_spi";
@@ -187,6 +228,23 @@
mode = "cpu";
};
+ ucc@2000 {
+ device_type = "tdm";
+ compatible = "fsl,ucc-tdm";
+ model = "UCC";
+ device-id = <1>;
+ fsl,tdm-num = <1>;
+ fsl,si-num = <1>;
+ fsl,tdm-tx-clk = "CLK1";
+ fsl,tdm-rx-clk = "CLK1";
+ fsl,tdm-tx-sync = "BRG9";
+ fsl,tdm-rx-sync = "BRG9";
+ reg = <2000 200>;
+ interrupts = <20>;
+ interrupt-parent = <&qeic>;
+ pio-handle = <&ucc1pio>;
+ };
+
ucc@3000 {
device_type = "network";
compatible = "ucc_geth";
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1df3b4a..fddc3d8 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -149,20 +149,189 @@ EXPORT_SYMBOL(qe_issue_cmd);
*/
static unsigned int brg_clk = 0;
-unsigned int get_brg_clk(void)
+u32 get_brg_clk(enum qe_clock brgclk, enum qe_clock *brg_source)
{
- struct device_node *qe;
- if (brg_clk)
- return brg_clk;
+ struct device_node *qe, *brg, *clocks;
+ enum qe_clock brg_src;
+ u32 brg_input_freq = 0;
+ u32 brg_num;
+ int ret;
+ const unsigned int *prop;
- qe = of_find_node_by_type(NULL, "qe");
- if (qe) {
+ *brg_source = 0;
+
+ brg_num = brgclk - QE_BRG1;
+ brg = of_find_compatible_node(NULL, NULL, "fsl,cpm-brg");
+ if (brg) {
unsigned int size;
- const u32 *prop = of_get_property(qe, "brg-frequency", &size);
- brg_clk = *prop;
- of_node_put(qe);
- };
- return brg_clk;
+ prop = of_get_property(brg,
+ "fsl,brg-sources", &size);
+ of_node_put(brg);
+
+ if (prop)
+ brg_src = *(prop + brg_num);
+ else {
+ printk(KERN_ERR "%s: invalid fsl,brg-sources in device "
+ "tree\n", __FUNCTION__);
+ ret = -EINVAL;
+ goto err;
+ }
+ if (brg_src == 0) {
+ *brg_source = 0;
+ if (brg_clk > 0)
+ return brg_clk;
+ qe = of_find_node_by_type(NULL, "qe");
+ if (qe) {
+ unsigned int size;
+ prop = of_get_property
+ (qe, "brg-frequency", &size);
+ if (!prop) {
+ printk(KERN_ERR "%s: QE brg-frequency"
+ "not present in device tree\n",
+ __FUNCTION__);
+ ret = -EINVAL;
+ of_node_put(qe);
+ goto err;
+ }
+ if (*prop) {
+ of_node_put(qe);
+ brg_clk = *prop;
+ return *prop;
+ } else {
+ /*
+ * Older versions of U-Boot do not initialize
+ * the brg-frequency property, so in this case
+ * we assume the BRG frequency is half the QE
+ * bus frequency.
+ */
+ prop = of_get_property(qe,
+ "bus-frequency", NULL);
+ of_node_put(qe);
+ if (!prop) {
+ printk(KERN_ERR "%s: "
+ " QE bus-frequency not present"
+ " in device tree\n",
+ __FUNCTION__);
+ ret = -EINVAL;
+ goto err;
+ }
+ if (*prop) {
+ brg_clk = *prop / 2;
+ return brg_clk;
+ } else {
+ printk(KERN_ERR "%s: invalid"
+ " QE bus-frequency in device"
+ " tree\n", __FUNCTION__);
+ ret = -EINVAL;
+ goto err;
+ }
+ }
+ } else {
+ printk(KERN_ERR "%s: no qe node in device tree"
+ "\n", __FUNCTION__);
+ ret = EINVAL;
+ goto err;
+ }
+ } else {
+ *brg_source = brg_src + QE_CLK1 - 1;
+ clocks = of_find_compatible_node(NULL, NULL,
+ "fsl,cpm-clocks");
+ if (!clocks) {
+ printk(KERN_ERR "%s: no clocks node in device"
+ " tree \n", __FUNCTION__);
+ ret = -EINVAL;
+ goto err;
+ } else {
+ prop = of_get_property(clocks,
+ "#clock-cells", &size);
+ /*
+ * clock-cells = 1 only supported right now.
+ */
+ if (!prop || *prop != 1) {
+ printk(KERN_ERR "%s: invalid "
+ "#clock-cells value in device tree \n",
+ __FUNCTION__);
+ of_node_put(clocks);
+ ret = -EINVAL;
+ goto err;
+ }
+
+ prop = of_get_property(clocks,
+ "clock-frequency", &size);
+ if (!prop) {
+ printk(KERN_ERR "%s: no"
+ " #clock-frequency prop in device"
+ " tree\n", __FUNCTION__);
+ of_node_put(clocks);
+ ret = -EINVAL;
+ goto err;
+ }
+ brg_input_freq = *(prop+(brg_src - 1));
+ of_node_put(clocks);
+ return brg_input_freq;
+ }
+ }
+ } else {
+ printk(KERN_ERR "%s: no brg node in device tree\n",
+ __FUNCTION__);
+ ret = -EINVAL;
+ goto err;
+ }
+err: return ret;
+}
+
+u32 qe_brg_src(int brg_num, enum qe_clock brg_src)
+{
+ u32 clock_bits, shift;
+
+ clock_bits = 0;
+
+ switch (brg_num) {
+ case 1:
+ case 2:
+ case 5:
+ case 6:
+ switch (brg_src) {
+ case QE_CLK3: clock_bits = 1; break;
+ case QE_CLK5: clock_bits = 2; break;
+ default: break;
+ }
+ break;
+ case 3:
+ case 4:
+ case 7:
+ case 8:
+ switch (brg_src) {
+ case QE_CLK9: clock_bits = 1; break;
+ case QE_CLK15: clock_bits = 2; break;
+ default: break;
+ }
+ break;
+ case 9:
+ case 10:
+ switch (brg_src) {
+ case QE_CLK11: clock_bits = 1; break;
+ default: break;
+ }
+ break;
+ case 11:
+ case 15:
+ case 16:
+ switch (brg_src) {
+ case QE_CLK13: clock_bits = 1; break;
+ default: break;
+ }
+ break;
+ default: clock_bits = 0; break;
+ }
+ shift = 14;
+
+ if (!clock_bits)
+ return -ENOENT;
+
+ clock_bits <<= shift;
+
+ return clock_bits;
}
/* Program the BRG to the given sampling rate and multiplier
@@ -177,11 +346,18 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
{
u32 divisor, tempval;
u32 div16 = 0;
+ u32 brg_clock;
+ enum qe_clock brgsrc;
+ u32 src_bits = 0;
if ((brg < QE_BRG1) || (brg > QE_BRG16))
return -EINVAL;
- divisor = get_brg_clk() / (rate * multiplier);
+ brg_clock = get_brg_clk(brg, &brgsrc);
+ if (brg_clock < 0)
+ return -EINVAL;
+
+ divisor = brg_clock / (rate * multiplier);
if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
div16 = QE_BRGC_DIV16;
@@ -194,8 +370,11 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
if (!div16 && (divisor & 1))
divisor++;
+ if (brgsrc > 0)
+ src_bits = qe_brg_src(brg - QE_BRG1 + 1, brgsrc);
+
tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
- QE_BRGC_ENABLE | div16;
+ QE_BRGC_ENABLE | div16 | src_bits;
out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
diff --git a/arch/powerpc/sysdev/qe_lib/ucc.c b/arch/powerpc/sysdev/qe_lib/ucc.c
index 0e348d9..f2de0ed 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc.c
@@ -213,3 +213,268 @@ int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
return 0;
}
+
+int ucc_set_tdm_rxtx_clk(int tdm_num, char *clk_src, enum comm_dir mode)
+{
+ enum qe_clock clock;
+ u32 clock_bits, shift;
+ struct qe_mux *qe_mux_reg = NULL;
+
+ clock_bits = 0;
+ qe_mux_reg = &qe_immr->qmx;
+
+ if ((tdm_num > 3 || tdm_num < 0))
+ return -EINVAL;
+
+ /* The communications direction must be RX or TX */
+ if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX)))
+ return -EINVAL;
+
+ clock = qe_clock_source(clk_src);
+ switch (mode) {
+ case COMM_DIR_RX:
+ switch (tdm_num) {
+ case 0:
+ switch (clock) {
+ case QE_BRG3: clock_bits = 1; break;
+ case QE_BRG4: clock_bits = 2; break;
+ case QE_CLK1: clock_bits = 4; break;
+ case QE_CLK2: clock_bits = 5; break;
+ case QE_CLK3: clock_bits = 6; break;
+ case QE_CLK8: clock_bits = 7; break;
+ default: break;
+ }
+ shift = 28;
+ break;
+ case 1:
+ switch (clock) {
+ case QE_BRG3: clock_bits = 1; break;
+ case QE_BRG4: clock_bits = 2; break;
+ case QE_CLK1: clock_bits = 4; break;
+ case QE_CLK2: clock_bits = 5; break;
+ case QE_CLK5: clock_bits = 6; break;
+ case QE_CLK10: clock_bits = 7; break;
+ default: break;
+ }
+ shift = 24;
+ break;
+ case 2:
+ switch (clock) {
+ case QE_BRG3: clock_bits = 1; break;
+ case QE_BRG4: clock_bits = 2; break;
+ case QE_CLK1: clock_bits = 4; break;
+ case QE_CLK2: clock_bits = 5; break;
+ case QE_CLK7: clock_bits = 6; break;
+ case QE_CLK12: clock_bits = 7; break;
+ default: break;
+ }
+ shift = 20;
+ break;
+ case 3:
+ switch (clock) {
+ case QE_BRG3: clock_bits = 1; break;
+ case QE_BRG4: clock_bits = 2; break;
+ case QE_CLK1: clock_bits = 4; break;
+ case QE_CLK2: clock_bits = 5; break;
+ case QE_CLK9: clock_bits = 6; break;
+ case QE_CLK14: clock_bits = 7; break;
+ default: break;
+ }
+ shift = 16;
+ break;
+ default:
+ break;
+ }
+ break;
+ case COMM_DIR_TX:
+ switch (tdm_num) {
+ case 0:
+ switch (clock) {
+ case QE_BRG3: clock_bits = 1; break;
+ case QE_BRG4: clock_bits = 2; break;
+ case QE_CLK1: clock_bits = 4; break;
+ case QE_CLK2: clock_bits = 5; break;
+ case QE_CLK4: clock_bits = 6; break;
+ case QE_CLK9: clock_bits = 7; break;
+ default: break;
+ }
+ shift = 12;
+ break;
+ case 1:
+ switch (clock) {
+ case QE_BRG3: clock_bits = 1; break;
+ case QE_BRG4: clock_bits = 2; break;
+ case QE_CLK1: clock_bits = 4; break;
+ case QE_CLK2: clock_bits = 5; break;
+ case QE_CLK6: clock_bits = 6; break;
+ case QE_CLK11: clock_bits = 7; break;
+ default: break;
+ }
+ shift = 8;
+ break;
+ case 2:
+ switch (clock) {
+ case QE_BRG3: clock_bits = 1; break;
+ case QE_BRG4: clock_bits = 2; break;
+ case QE_CLK1: clock_bits = 4; break;
+ case QE_CLK2: clock_bits = 5; break;
+ case QE_CLK8: clock_bits = 6; break;
+ case QE_CLK13: clock_bits = 7; break;
+ default: break;
+ }
+ shift = 4;
+ break;
+ case 3:
+ switch (clock) {
+ case QE_BRG3: clock_bits = 1; break;
+ case QE_BRG4: clock_bits = 2; break;
+ case QE_CLK1: clock_bits = 4; break;
+ case QE_CLK2: clock_bits = 5; break;
+ case QE_CLK10: clock_bits = 6; break;
+ case QE_CLK15: clock_bits = 7; break;
+ default: break;
+ }
+ shift = 0;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (!clock_bits)
+ return -ENOENT;
+
+ clock_bits <<= shift;
+
+ qe_mux_reg->cmxsi1cr_l |= clock_bits;
+
+ return 0;
+}
+
+int ucc_set_tdm_rxtx_sync(int tdm_num, char *sync_src, enum comm_dir mode)
+{
+ enum qe_clock clock;
+ u32 shift, clock_bits;
+ struct qe_mux *qe_mux_reg = NULL;
+ int source;
+
+ source = -1;
+ qe_mux_reg = &qe_immr->qmx;
+
+ if ((tdm_num > 3 || tdm_num < 0))
+ return -EINVAL;
+
+ /* The communications direction must be RX or TX */
+ if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX)))
+ return -EINVAL;
+
+ switch (mode) {
+ case COMM_DIR_RX:
+ if (strcasecmp("RSYNC", sync_src) == 0) {
+ source = 0;
+ shift = 0;
+ break;
+ }
+ clock = qe_clock_source(sync_src);
+ switch (tdm_num) {
+ case 0:
+ switch (clock) {
+ case QE_BRG9: source = 1; break;
+ case QE_BRG10: source = 2; break;
+ default: source = -1; break;
+ }
+ shift = 30;
+ break;
+ case 1:
+ switch (clock) {
+ case QE_BRG9: source = 1; break;
+ case QE_BRG10: source = 2; break;
+ default: source = -1; break;
+ }
+ shift = 28;
+ break;
+ case 2:
+ switch (clock) {
+ case QE_BRG9: source = 1; break;
+ case QE_BRG11: source = 2; break;
+ default: source = -1; break;
+ }
+ shift = 26;
+ break;
+ case 3:
+ switch (clock) {
+ case QE_BRG9: source = 1; break;
+ case QE_BRG11: source = 2; break;
+ default: source = -1; break;
+ }
+ shift = 24;
+ break;
+ default:
+ source = -1;
+ break;
+ }
+ break;
+ case COMM_DIR_TX:
+ if (strcasecmp("TSYNC", sync_src) == 0) {
+ source = 0;
+ shift = 0;
+ break;
+ }
+ clock = qe_clock_source(sync_src);
+ switch (tdm_num) {
+ case 0:
+ switch (clock) {
+ case QE_BRG9: source = 1; break;
+ case QE_BRG10: source = 2; break;
+ default: source = -1; break;
+ }
+ shift = 14;
+ break;
+ case 1:
+ switch (clock) {
+ case QE_BRG9: source = 1; break;
+ case QE_BRG10: source = 2; break;
+ default: source = -1; break;
+ }
+ shift = 12;
+ break;
+ case 2:
+ switch (clock) {
+ case QE_BRG9: source = 1; break;
+ case QE_BRG11: source = 2; break;
+ default: source = -1; break;
+ }
+ shift = 10;
+ break;
+ case 3:
+ switch (clock) {
+ case QE_BRG9: source = 1; break;
+ case QE_BRG11: source = 2; break;
+ default: source = -1; break;
+ }
+ shift = 8;
+ break;
+ default:
+ source = -1;
+ break;
+ }
+ break;
+ default:
+ source = -1;
+ break;
+ }
+
+ if (source == -1)
+ return -ENOENT;
+
+ clock_bits = (u32) source;
+ clock_bits <<= shift;
+
+
+ qe_mux_reg->cmxsi1syr |= clock_bits;
+
+ return 0;
+}
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
index 3223acb..9c8559f 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -327,6 +327,43 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
ucc_fast_free(uccf);
return -EINVAL;
}
+ } else {
+ /* TDM Rx clock routing */
+ if ((uf_info->tdm_rx_clk != NULL) &&
+ ucc_set_tdm_rxtx_clk(uf_info->ucc_num,
+ uf_info->tdm_rx_clk, COMM_DIR_RX)) {
+ printk(KERN_ERR "%s: illegal value for TDM RX clock",
+ __FUNCTION__);
+ ucc_fast_free(uccf);
+ return -EINVAL;
+ }
+ /* TDM Tx clock routing */
+ if ((uf_info->tdm_tx_clk != NULL) &&
+ ucc_set_tdm_rxtx_clk(uf_info->ucc_num,
+ uf_info->tdm_tx_clk, COMM_DIR_TX)) {
+ printk(KERN_ERR "%s: illegal value for TDM TX clock",
+ __FUNCTION__);
+ ucc_fast_free(uccf);
+ return -EINVAL;
+ }
+ /* TDM Rx sync routing */
+ if ((uf_info->tdm_rx_sync != NULL) &&
+ ucc_set_tdm_rxtx_sync(uf_info->ucc_num,
+ uf_info->tdm_rx_sync, COMM_DIR_RX)) {
+ printk(KERN_ERR "%s: illegal value for TDM RX"
+ "Frame sync", __FUNCTION__);
+ ucc_fast_free(uccf);
+ return -EINVAL;
+ }
+ /* TDM Tx sync routing */
+ if ((uf_info->tdm_tx_sync != NULL) &&
+ ucc_set_tdm_rxtx_sync(uf_info->ucc_num,
+ uf_info->tdm_tx_sync, COMM_DIR_TX)) {
+ printk(KERN_ERR "%s: illegal value for TDM TX"
+ "Frame sync", __FUNCTION__);
+ ucc_fast_free(uccf);
+ return -EINVAL;
+ }
}
/* Set interrupt mask register at UCC level. */
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index bcf60be..51de236 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -497,6 +497,14 @@ struct ucc_slow_pram {
#define UCC_GETH_UCCE_RXF1 0x00000002
#define UCC_GETH_UCCE_RXF0 0x00000001
+/* Transparent UCC Event Register (UCCE) */
+#define UCC_TRANS_UCCE_GRA 0x0080
+#define UCC_TRANS_UCCE_TXE 0x0010
+#define UCC_TRANS_UCCE_RXF 0x0008
+#define UCC_TRANS_UCCE_BSY 0x0004
+#define UCC_TRANS_UCCE_TXB 0x0002
+#define UCC_TRANS_UCCE_RXB 0x0001
+
/* UPSMR, when used as a UART */
#define UCC_UART_UPSMR_FLC 0x8000
#define UCC_UART_UPSMR_SL 0x4000
diff --git a/include/asm-powerpc/ucc.h b/include/asm-powerpc/ucc.h
index 46b09ba..153db97 100644
--- a/include/asm-powerpc/ucc.h
+++ b/include/asm-powerpc/ucc.h
@@ -42,6 +42,10 @@ int ucc_set_qe_mux_mii_mng(unsigned int ucc_num);
int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
enum comm_dir mode);
+int ucc_set_tdm_rxtx_clk(int tdm_num, char *clk_src, enum comm_dir mode);
+
+int ucc_set_tdm_rxtx_sync(int tdm_num, char *clk_src, enum comm_dir mode);
+
int ucc_mux_set_grant_tsa_bkpt(unsigned int ucc_num, int set, u32 mask);
/* QE MUX clock routing for UCC
diff --git a/include/asm-powerpc/ucc_fast.h b/include/asm-powerpc/ucc_fast.h
index f529f70..d267983 100644
--- a/include/asm-powerpc/ucc_fast.h
+++ b/include/asm-powerpc/ucc_fast.h
@@ -152,6 +152,10 @@ struct ucc_fast_info {
enum ucc_fast_rx_decoding_method renc;
enum ucc_fast_transparent_tcrc tcrc;
enum ucc_fast_sync_len synl;
+ char *tdm_rx_clk;
+ char *tdm_tx_clk;
+ char *tdm_rx_sync;
+ char *tdm_tx_sync;
};
struct ucc_fast_private {
--
1.5.2.4
^ permalink raw reply related
* Re: [IPV4 3/5] fib_trie: dump doesnt use RCU
From: David Miller @ 2008-01-24 4:50 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20080123224858.918669715@linux-foundation.org>
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Wed, 23 Jan 2008 14:48:47 -0800
> Since fib dump (via netlink) holds the RTNL mutex, it is unnecessary
> to use RCU, and it is impossible to get truncated (-EBUSY) result.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
You tested this patch, right? :-/
The whole reason we need the nlk->cb[] state is to hold things across
multiple recvmsg() calls that might be necessary to obtain the full
dump.
rtnetlink goes:
rtnl_lock();
netlink_rcv_skb(skb, &rtnetlink_rcv_msg);
...
static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
...
if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
struct sock *rtnl;
rtnl_dumpit_func dumpit;
dumpit = rtnl_get_dumpit(family, type);
if (dumpit == NULL)
return -EOPNOTSUPP;
__rtnl_unlock();
rtnl = net->rtnl;
err = netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
rtnl_lock();
return err;
(NOTE: Drops RTNL semaphore for netlink_dump_start() call)
...
int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
struct nlmsghdr *nlh,
int (*dump)(struct sk_buff *skb,
struct netlink_callback *),
int (*done)(struct netlink_callback *))
{
...
cb->dump = dump;
cb->done = done;
cb->nlh = nlh;
atomic_inc(&skb->users);
cb->skb = skb;
...
mutex_lock(nlk->cb_mutex);
...
nlk->cb = cb;
mutex_unlock(nlk->cb_mutex);
netlink_dump(sk);
...
static int netlink_dump(struct sock *sk)
{
...
mutex_lock(nlk->cb_mutex);
...
len = cb->dump(skb, cb);
if (len > 0) {
mutex_unlock(nlk->cb_mutex);
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, len);
return 0;
}
(NOTE: Therefore cb->dump() runs without RTNL semaphore held)
...
static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len,
int flags)
{
...
if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2)
netlink_dump(sk);
...
Therefore, that RTNL assertion you added should have triggered on any
dump you may have tried since ->dump() is always invoked without the
RTNL semaphore since rtnetlink drops it around the ->dump() call and
the call chain for this fib_trie cause would be:
inet_dump_fib()
fn_trie_dump()
and nothing in that code path retakes the RTNL semaphore.
What test did you run to validate this patch for correctness?
^ permalink raw reply
* [PATCH] UCC TDM driver for QE based MPC83xx platforms.
From: Poonam_Aggrwal-b10812 @ 2008-01-24 4:46 UTC (permalink / raw)
To: kumar.gala, akpm, linux-kernel, netdev, rubini, linuxppc-dev
Cc: michael.barkowski, kim.phillips, ashish.kalra, timur, rich.cutler
From: Poonam Agarwal-b10812 <b10812@freescale.com>
The UCC TDM driver basically multiplexes and demultiplexes data from
different channels. It can interface with for example SLIC kind of devices
to receive TDM data demultiplex it and send to upper modules. At the
transmit end it receives data for different channels multiplexes it and
sends them on the TDM channel. It internally uses TSA( Time Slot Assigner)
which does multiplexing and demultiplexing, UCC to perform SDMA between
host buffers and the TSA, CMX to connect TSA to UCC.
It can be used by a kernel module which can call tdm_register_client to
get access to a TDM device.
The driver is right now a misc driver with no subsystem as such.
There can be a platform independent TDM layer which is planned to be
done after this. TDM bus sort of thing.
The dts file keeps a track of the TDM devices present on the board.
Depending on them the TDM driver initializes those many driver instances
while coming up.
The driver on the upper level can plug to more than one tdm clients
depending on the availablity of TDM devices. At every new request of a TDM
client to bind with a TDM device, a free driver instance is allocated to
the client.
The interface can be described as follows.
tdm_register_client(struct tdm_client *)
This API returns a pointer to the structure tdm_client which is of
type
struct tdm_client {
u32 client_id;
u32 (*tdm_read)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
u32 (*tdm_write)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
wait_queue_head_t *wakeup_event;
}
It consists of:
- client_id: It is basically to identify the particular TDM
device/driver instance.
- tdm_read: It is a function pointer returned by the TDM driver to be
used to read TDM data from a particular TDM channel.
- tdm_write: It is a function pointer returned by the TDM driver to be
used to write TDM data to a particular TDM channel.
- wakeup_event: It is address of a wait_queue event on which the client
keeps on sleeping, and the TDM driver wakes it up periodically. The driver
is configured to
wake up the client after every 10ms.
Once the TDM client gets registered to a TDM driver instance and a TDM
device, it interfaces with the driver using tdm_read, tdm_write and
wakeup_event.
This driver will run on MPC8323E-RDB platforms.
Signed-off-by: Poonam Aggrwal <b10812@freescale.com>
Signed-off-by: Ashish Kalra <ashish.kalra@freescale.com>
Signed-off-by: Kim Phillips <Kim.Phillips@freescale.com>
Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
---
drivers/misc/Kconfig | 14 +
drivers/misc/Makefile | 1 +
drivers/misc/ucc_tdm.c | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++
drivers/misc/ucc_tdm.h | 221 +++++++++++
4 files changed, 1236 insertions(+), 0 deletions(-)
create mode 100644 drivers/misc/ucc_tdm.c
create mode 100644 drivers/misc/ucc_tdm.h
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b5e67c0..628b14b 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -232,4 +232,18 @@ config ATMEL_SSC
If unsure, say N.
+config UCC_TDM
+ bool "Freescale UCC TDM Driver"
+ depends on QUICC_ENGINE && UCC_FAST
+ default n
+ ---help---
+ The TDM driver is for UCC based TDM devices for example, TDM device on
+ MPC832x RDB. Select it to run PowerVoIP on MPC832x RDB board.
+ The TDM driver can interface with SLIC kind of devices to transmit
+ and receive TDM samples. The TDM driver receives Time Division
+ multiplexed samples(for different channels) from the SLIC device,
+ demutiplexes them and sends them to the upper layers. At the transmit
+ end the TDM drivers receives samples for different channels, it
+ multiplexes them and sends them to the SLIC device.
+
endif # MISC_DEVICES
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 87f2685..6f0c49d 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o
obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o
obj-$(CONFIG_FUJITSU_LAPTOP) += fujitsu-laptop.o
obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
+obj-$(CONFIG_UCC_TDM) += ucc_tdm.o
diff --git a/drivers/misc/ucc_tdm.c b/drivers/misc/ucc_tdm.c
new file mode 100644
index 0000000..98e7c72
--- /dev/null
+++ b/drivers/misc/ucc_tdm.c
@@ -0,0 +1,1000 @@
+/*
+ * drivers/misc/ucc_tdm.c
+ *
+ * UCC Based Linux TDM Driver
+ * This driver is designed to support UCC based TDM for PowerPC processors.
+ * This driver can interface with SLIC device to run VOIP kind of
+ * applications.
+ *
+ * Author: Ashish Kalra & Poonam Aggrwal
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/autoconf.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/time.h>
+#include <linux/skbuff.h>
+#include <linux/proc_fs.h>
+#include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/string.h>
+#include <linux/irq.h>
+#include <linux/of_platform.h>
+#include <linux/io.h>
+#include <linux/wait.h>
+#include <linux/timer.h>
+
+#include <asm/immap_qe.h>
+#include <asm/qe.h>
+#include <asm/ucc.h>
+#include <asm/ucc_fast.h>
+#include <asm/ucc_slow.h>
+
+#include "ucc_tdm.h"
+#define DRV_DESC "Freescale QE UCC TDM Driver"
+#define DRV_NAME "ucc_tdm"
+
+
+/*
+ * define the following #define if snooping or hardware-based cache coherency
+ * is disabled on the UCC transparent controller.This flag enables
+ * software-based cache-coherency support by explicitly flushing data cache
+ * contents after setting up the TDM output buffer(s) and invalidating the
+ * data cache contents before the TDM input buffer(s) are read.
+ */
+#undef UCC_CACHE_SNOOPING_DISABLED
+
+#define MAX_NUM_TDM_DEVICES 8
+
+static struct tdm_ctrl *tdm_ctrl[MAX_NUM_TDM_DEVICES];
+
+static int num_tdm_devices;
+static int num_tdm_clients;
+
+static struct ucc_tdm_info utdm_primary_info = {
+ .uf_info = {
+ .tsa = 1,
+ .cdp = 1,
+ .cds = 1,
+ .ctsp = 1,
+ .ctss = 1,
+ .revd = 1,
+ .urfs = 0x128,
+ .utfs = 0x128,
+ .utfet = 0,
+ .utftt = 0x128,
+ .ufpt = 256,
+ .ttx_trx = UCC_FAST_GUMR_TRANSPARENT_TTX_TRX_TRANSPARENT,
+ .tenc = UCC_FAST_TX_ENCODING_NRZ,
+ .renc = UCC_FAST_RX_ENCODING_NRZ,
+ .tcrc = UCC_FAST_16_BIT_CRC,
+ .synl = UCC_FAST_SYNC_LEN_NOT_USED,
+ },
+ .ucc_busy = 0,
+};
+
+static struct ucc_tdm_info utdm_info[8];
+
+static void dump_siram(struct tdm_ctrl *tdm_c)
+{
+#ifdef DEBUG
+ int i;
+ u16 phy_num_ts;
+
+ phy_num_ts = tdm_c->physical_num_ts;
+
+ pr_debug("SI TxRAM dump\n");
+ /* each slot entry in SI RAM is of 2 bytes */
+ for (i = 0; i < phy_num_ts * 2; i++)
+ pr_debug("%x ", in_8(&qe_immr->sir.tx[i]));
+ pr_debug("\nSI RxRAM dump\n");
+ for (i = 0; i < phy_num_ts * 2; i++)
+ pr_debug("%x ", in_8(&qe_immr->sir.rx[i]));
+ pr_debug("\n");
+#endif
+}
+
+static void dump_ucc(struct tdm_ctrl *tdm_c)
+{
+#ifdef DEBUG
+ struct ucc_transparent_pram *ucc_pram;
+
+ ucc_pram = tdm_c->ucc_pram;
+
+ pr_debug("%s Dumping UCC Registers\n", __FUNCTION__);
+ ucc_fast_dump_regs(tdm_c->uf_private);
+ pr_debug("%s Dumping UCC Parameter RAM\n", __FUNCTION__);
+ pr_debug("rbase = 0x%x\n", in_be32(&ucc_pram->rbase));
+ pr_debug("rbptr = 0x%x\n", in_be32(&ucc_pram->rbptr));
+ pr_debug("mrblr = 0x%x\n", in_be16(&ucc_pram->mrblr));
+ pr_debug("rbdlen = 0x%x\n", in_be16(&ucc_pram->rbdlen));
+ pr_debug("rbdstat = 0x%x\n", in_be16(&ucc_pram->rbdstat));
+ pr_debug("rstate = 0x%x\n", in_be32(&ucc_pram->rstate));
+ pr_debug("rdptr = 0x%x\n", in_be32(&ucc_pram->rdptr));
+ pr_debug("tbase = 0x%x\n", in_be32(&ucc_pram->tbase));
+ pr_debug("tbptr = 0x%x\n", in_be32(&ucc_pram->tbptr));
+ pr_debug("tbdlen = 0x%x\n", in_be16(&ucc_pram->tbdlen));
+ pr_debug("tbdstat = 0x%x\n", in_be16(&ucc_pram->tbdstat));
+ pr_debug("tstate = 0x%x\n", in_be32(&ucc_pram->tstate));
+ pr_debug("tdptr = 0x%x\n", in_be32(&ucc_pram->tdptr));
+#endif
+}
+
+/*
+ * For use when a framing bit is not present
+ * Program current-route SI ram
+ * Set SIxRAM TDMx
+ * Entries must be in units of 8.
+ * SIR_UCC -> Channel Select
+ * SIR_CNT -> Number of bits or bytes
+ * SIR_BYTE -> Byte or Bit resolution
+ * SIR_LAST -> Indicates last entry in SIxRAM
+ * SIR_IDLE -> The Tx data pin is Tri-stated and the Rx data pin is
+ * ignored
+ */
+static void set_siram(struct tdm_ctrl *tdm_c, enum comm_dir dir)
+{
+ const u16 *mask;
+ u16 temp_mask = 1;
+ u16 siram_code = 0;
+ u32 i, j, k;
+ u32 ucc;
+ u32 phy_num_ts;
+
+ phy_num_ts = tdm_c->physical_num_ts;
+ ucc = tdm_c->ut_info->uf_info.ucc_num;
+
+ if (dir == COMM_DIR_RX)
+ mask = tdm_c->rx_mask;
+ else
+ mask = tdm_c->tx_mask;
+ k = 0;
+ j = 0;
+ for (i = 0; i < phy_num_ts; i++) {
+ if ((mask[k] & temp_mask) == temp_mask)
+ siram_code = SIR_UCC(ucc) | SIR_CNT(0) | SIR_BYTE;
+ else
+ siram_code = SIR_IDLE | SIR_CNT(0) | SIR_BYTE;
+ if (dir == COMM_DIR_RX)
+ out_be16((u16 *)&qe_immr->sir.rx[i * 2], siram_code);
+ else
+ out_be16((u16 *)&qe_immr->sir.tx[i * 2], siram_code);
+ temp_mask = temp_mask << 1;
+ j++;
+ if (j >= 16) {
+ j = 0;
+ temp_mask = 0x0001;
+ k++;
+ }
+ }
+ siram_code = siram_code | SIR_LAST;
+
+ if (dir == COMM_DIR_RX)
+ out_be16((u16 *)&qe_immr->sir.rx[(phy_num_ts - 1) * 2],
+ siram_code);
+ else
+ out_be16((u16 *)&qe_immr->sir.tx[(phy_num_ts - 1) * 2],
+ siram_code);
+}
+
+static void config_si(struct tdm_ctrl *tdm_c)
+{
+ u8 rxsyncdelay, txsyncdelay, tdm_port;
+ u16 sixmr_val = 0;
+ u32 tdma_mode_off;
+ u16 *si1_tdm_mode_reg;
+
+ tdm_port = tdm_c->tdm_port;
+
+ set_siram(tdm_c, COMM_DIR_RX);
+
+ set_siram(tdm_c, COMM_DIR_TX);
+
+ rxsyncdelay = tdm_c->cfg_ctrl.rx_fr_sync_delay;
+ txsyncdelay = tdm_c->cfg_ctrl.tx_fr_sync_delay;
+ if (tdm_c->cfg_ctrl.com_pin)
+ sixmr_val |= SIMODE_CRT;
+ if (tdm_c->cfg_ctrl.fr_sync_level == 1)
+ sixmr_val |= SIMODE_SL;
+ if (tdm_c->cfg_ctrl.clk_edge == 1)
+ sixmr_val |= SIMODE_CE;
+ if (tdm_c->cfg_ctrl.fr_sync_edge == 1)
+ sixmr_val |= SIMODE_FE;
+ sixmr_val |= (SIMODE_TFSD(txsyncdelay) | SIMODE_RFSD(rxsyncdelay));
+
+ tdma_mode_off = SI_TDM_MODE_REGISTER_OFFSET * tdm_c->tdm_port;
+
+ si1_tdm_mode_reg = (u8 *)&qe_immr->si1 + tdma_mode_off;
+ out_be16(si1_tdm_mode_reg, sixmr_val);
+
+ dump_siram(tdm_c);
+}
+
+static int tdm_init(struct tdm_ctrl *tdm_c)
+{
+ u32 tdm_port, ucc, act_num_ts;
+ int ret, i, err;
+ u32 cecr_subblock;
+ u32 pram_offset;
+ u32 rxbdt_offset;
+ u32 txbdt_offset;
+ u32 rx_ucode_buf_offset, tx_ucode_buf_offset;
+ u16 bd_status, bd_len;
+ enum qe_clock clock;
+ struct qe_bd __iomem *rx_bd, *tx_bd;
+
+ tdm_port = tdm_c->tdm_port;
+ ucc = tdm_c->ut_info->uf_info.ucc_num;
+ act_num_ts = tdm_c->cfg_ctrl.active_num_ts;
+
+ /*
+ * TDM Tx and Rx CLKs = 2048 KHz.
+ */
+ if (strstr(tdm_c->ut_info->uf_info.tdm_tx_clk, "BRG")) {
+ clock = qe_clock_source(tdm_c->ut_info->uf_info.tdm_tx_clk);
+ err = qe_setbrg(clock, 2048000, 1);
+ if (err < 0) {
+ printk(KERN_ERR "%s: Failed to set %s\n", __FUNCTION__,
+ tdm_c->ut_info->uf_info.tdm_tx_clk);
+ return err;
+ }
+ }
+ if (strstr(tdm_c->ut_info->uf_info.tdm_rx_clk, "BRG")) {
+ clock = qe_clock_source(tdm_c->ut_info->uf_info.tdm_rx_clk);
+ err = qe_setbrg(clock, 2048000, 1);
+ if (err < 0) {
+ printk(KERN_ERR "%s: Failed to set %s\n", __FUNCTION__,
+ tdm_c->ut_info->uf_info.tdm_rx_clk);
+ return err;
+ }
+ }
+ /*
+ * TDM FSyncs = 4 KHz.
+ */
+ if (strstr(tdm_c->ut_info->uf_info.tdm_tx_sync, "BRG")) {
+ clock = qe_clock_source(tdm_c->ut_info->uf_info.tdm_tx_sync);
+ err = qe_setbrg(clock, 4000, 1);
+ if (err < 0) {
+ printk(KERN_ERR "%s: Failed to set %s\n", __FUNCTION__,
+ tdm_c->ut_info->uf_info.tdm_tx_sync);
+ return err;
+ }
+ }
+ if (strstr(tdm_c->ut_info->uf_info.tdm_rx_sync, "BRG")) {
+ clock = qe_clock_source(tdm_c->ut_info->uf_info.tdm_rx_sync);
+ err = qe_setbrg(clock, 4000, 1);
+ if (err < 0) {
+ printk(KERN_ERR "%s: Failed to set %s\n", __FUNCTION__,
+ tdm_c->ut_info->uf_info.tdm_rx_sync);
+ return err;
+ }
+ }
+
+ tdm_c->ut_info->uf_info.uccm_mask = (u32)
+ ((UCC_TRANS_UCCE_RXB | UCC_TRANS_UCCE_BSY) << 16);
+
+ if (ucc_fast_init(&(tdm_c->ut_info->uf_info), &tdm_c->uf_private)) {
+ printk(KERN_ERR "%s: Failed to init uccf\n", __FUNCTION__);
+ return -ENOMEM;
+ }
+
+ ucc_fast_disable(tdm_c->uf_private, COMM_DIR_RX | COMM_DIR_TX);
+
+ /* Write to QE CECR, UCCx channel to Stop Transmission */
+ cecr_subblock = ucc_fast_get_qe_cr_subblock(ucc);
+ qe_issue_cmd(QE_STOP_TX, cecr_subblock,
+ (u8) QE_CR_PROTOCOL_UNSPECIFIED, 0);
+
+ pram_offset = qe_muram_alloc(UCC_TRANSPARENT_PRAM_SIZE,
+ ALIGNMENT_OF_UCC_SLOW_PRAM);
+ if (IS_ERR_VALUE(pram_offset)) {
+ printk(KERN_ERR "%s: Cannot allocate MURAM memory for"
+ " transparent UCC\n", __FUNCTION__);
+ ret = -ENOMEM;
+ goto pram_alloc_error;
+ }
+
+ cecr_subblock = ucc_fast_get_qe_cr_subblock(ucc);
+ qe_issue_cmd(QE_ASSIGN_PAGE_TO_DEVICE, cecr_subblock,
+ QE_CR_PROTOCOL_UNSPECIFIED, pram_offset);
+
+ tdm_c->ucc_pram = qe_muram_addr(pram_offset);
+ tdm_c->ucc_pram_offset = pram_offset;
+
+ /*
+ * zero-out pram, this will also ensure RSTATE, TSTATE are cleared, also
+ * DISFC & CRCEC counters will be initialized.
+ */
+ memset(tdm_c->ucc_pram, 0, sizeof(struct ucc_transparent_pram));
+
+ /* rbase, tbase alignment is 8. */
+ rxbdt_offset = qe_muram_alloc(NR_BUFS * sizeof(struct qe_bd),
+ QE_ALIGNMENT_OF_BD);
+ if (IS_ERR_VALUE(rxbdt_offset)) {
+ printk(KERN_ERR "%s: Cannot allocate MURAM memory for RxBDs\n",
+ __FUNCTION__);
+ ret = -ENOMEM;
+ goto rxbd_alloc_error;
+ }
+ txbdt_offset = qe_muram_alloc(NR_BUFS * sizeof(struct qe_bd),
+ QE_ALIGNMENT_OF_BD);
+ if (IS_ERR_VALUE(txbdt_offset)) {
+ printk(KERN_ERR "%s: Cannot allocate MURAM memory for TxBDs\n",
+ __FUNCTION__);
+ ret = -ENOMEM;
+ goto txbd_alloc_error;
+ }
+ tdm_c->tx_bd = qe_muram_addr(txbdt_offset);
+ tdm_c->rx_bd = qe_muram_addr(rxbdt_offset);
+
+ tdm_c->tx_bd_offset = txbdt_offset;
+ tdm_c->rx_bd_offset = rxbdt_offset;
+
+ rx_bd = tdm_c->rx_bd;
+ tx_bd = tdm_c->tx_bd;
+
+ out_be32(&tdm_c->ucc_pram->rbase, (u32) immrbar_virt_to_phys(rx_bd));
+ out_be32(&tdm_c->ucc_pram->tbase, (u32) immrbar_virt_to_phys(tx_bd));
+
+ for (i = 0; i < NR_BUFS - 1; i++) {
+ bd_status = (u16) ((R_E | R_CM | R_I) >> 16);
+ bd_len = 0;
+ out_be16(&rx_bd->length, bd_len);
+ out_be16(&rx_bd->status, bd_status);
+ out_be32(&rx_bd->buf,
+ tdm_c->dma_input_addr + i * SAMPLE_DEPTH * act_num_ts);
+ rx_bd += 1;
+
+ bd_status = (u16) ((T_R | T_CM) >> 16);
+ bd_len = SAMPLE_DEPTH * act_num_ts;
+ out_be16(&tx_bd->length, bd_len);
+ out_be16(&tx_bd->status, bd_status);
+ out_be32(&tx_bd->buf,
+ tdm_c->dma_output_addr + i * SAMPLE_DEPTH * act_num_ts);
+ tx_bd += 1;
+ }
+
+ bd_status = (u16) ((R_E | R_CM | R_I | R_W) >> 16);
+ bd_len = 0;
+ out_be16(&rx_bd->length, bd_len);
+ out_be16(&rx_bd->status, bd_status);
+ out_be32(&rx_bd->buf,
+ tdm_c->dma_input_addr + i * SAMPLE_DEPTH * act_num_ts);
+
+ bd_status = (u16) ((T_R | T_CM | T_W) >> 16);
+ bd_len = SAMPLE_DEPTH * act_num_ts;
+ out_be16(&tx_bd->length, bd_len);
+ out_be16(&tx_bd->status, bd_status);
+ out_be32(&tx_bd->buf,
+ tdm_c->dma_output_addr + i * SAMPLE_DEPTH * act_num_ts);
+
+ config_si(tdm_c);
+
+ setbits32(&qe_immr->ic.qimr, (0x80000000UL >> ucc));
+
+ rx_ucode_buf_offset = qe_muram_alloc(32, 32);
+ if (IS_ERR_VALUE(rx_ucode_buf_offset)) {
+ printk(KERN_ERR "%s: Cannot allocate MURAM mem for Rx"
+ " ucode buf\n", __FUNCTION__);
+ ret = -ENOMEM;
+ goto rxucode_buf_alloc_error;
+ }
+
+ tx_ucode_buf_offset = qe_muram_alloc(32, 32);
+ if (IS_ERR_VALUE(tx_ucode_buf_offset)) {
+ printk(KERN_ERR "%s: Cannot allocate MURAM mem for Tx"
+ " ucode buf\n", __FUNCTION__);
+ ret = -ENOMEM;
+ goto txucode_buf_alloc_error;
+ }
+ out_be16(&tdm_c->ucc_pram->riptr, (u16) rx_ucode_buf_offset);
+ out_be16(&tdm_c->ucc_pram->tiptr, (u16) tx_ucode_buf_offset);
+
+ tdm_c->rx_ucode_buf_offset = rx_ucode_buf_offset;
+ tdm_c->tx_ucode_buf_offset = tx_ucode_buf_offset;
+
+ /*
+ * set the receive buffer descriptor maximum size to be
+ * SAMPLE_DEPTH * number of active RX channels
+ */
+ out_be16(&tdm_c->ucc_pram->mrblr, (u16) SAMPLE_DEPTH * act_num_ts);
+
+ /*
+ * enable snooping and BE byte ordering on the UCC pram's
+ * tstate & rstate registers.
+ */
+ out_be32(&tdm_c->ucc_pram->tstate, 0x30000000UL);
+ out_be32(&tdm_c->ucc_pram->rstate, 0x30000000UL);
+
+ /*Put UCC transparent controller into serial interface mode. */
+ out_be32(&tdm_c->uf_regs->upsmr, 0);
+
+ /* Reset TX and RX for UCCx */
+ cecr_subblock = ucc_fast_get_qe_cr_subblock(ucc);
+ qe_issue_cmd(QE_INIT_TX_RX, cecr_subblock,
+ (u8) QE_CR_PROTOCOL_UNSPECIFIED, 0);
+
+ return 0;
+
+txucode_buf_alloc_error:
+ qe_muram_free(rx_ucode_buf_offset);
+rxucode_buf_alloc_error:
+ qe_muram_free(txbdt_offset);
+txbd_alloc_error:
+ qe_muram_free(rxbdt_offset);
+rxbd_alloc_error:
+ qe_muram_free(pram_offset);
+pram_alloc_error:
+ ucc_fast_free(tdm_c->uf_private);
+ return ret;
+}
+
+static void tdm_deinit(struct tdm_ctrl *tdm_c)
+{
+ qe_muram_free(tdm_c->rx_ucode_buf_offset);
+ qe_muram_free(tdm_c->tx_ucode_buf_offset);
+
+ if (tdm_c->rx_bd_offset) {
+ qe_muram_free(tdm_c->rx_bd_offset);
+ tdm_c->rx_bd = NULL;
+ tdm_c->rx_bd_offset = 0;
+ }
+ if (tdm_c->tx_bd_offset) {
+ qe_muram_free(tdm_c->tx_bd_offset);
+ tdm_c->tx_bd = NULL;
+ tdm_c->tx_bd_offset = 0;
+ }
+ if (tdm_c->ucc_pram_offset) {
+ qe_muram_free(tdm_c->ucc_pram_offset);
+ tdm_c->ucc_pram = NULL;
+ tdm_c->ucc_pram_offset = 0;
+ }
+}
+
+
+static irqreturn_t tdm_isr(int irq, void *dev_id)
+{
+ u8 *input_tdm_buffer, *output_tdm_buffer;
+ u32 txb, rxb;
+ u32 ucc;
+ register u32 ucce = 0;
+ struct tdm_ctrl *tdm_c;
+ tdm_c = (struct tdm_ctrl *)dev_id;
+
+ tdm_c->tdm_icnt++;
+ ucc = tdm_c->ut_info->uf_info.ucc_num;
+ input_tdm_buffer = tdm_c->tdm_input_data;
+ output_tdm_buffer = tdm_c->tdm_output_data;
+
+ if (in_be32(tdm_c->uf_private->p_ucce) &
+ (UCC_TRANS_UCCE_BSY << 16)) {
+ out_be32(tdm_c->uf_private->p_ucce,
+ (UCC_TRANS_UCCE_BSY << 16));
+ pr_info("%s: From tdm isr busy interrupt\n",
+ __FUNCTION__);
+ dump_ucc(tdm_c);
+
+ return IRQ_HANDLED;
+ }
+
+ if (tdm_c->tdm_flag == 1) {
+ /* track phases for Rx/Tx */
+ tdm_c->phase_rx += 1;
+ if (tdm_c->phase_rx == MAX_PHASE)
+ tdm_c->phase_rx = 0;
+
+ tdm_c->phase_tx += 1;
+ if (tdm_c->phase_tx == MAX_PHASE)
+ tdm_c->phase_tx = 0;
+
+#ifdef CONFIG_TDM_HW_LB_TSA_SLIC
+ {
+ u32 temp_rx, temp_tx, phase_tx, phase_rx;
+ int i;
+ phase_rx = tdm_c->phase_rx;
+ phase_tx = tdm_c->phase_tx;
+ if (phase_rx == 0)
+ phase_rx = MAX_PHASE;
+ else
+ phase_rx -= 1;
+ if (phase_tx == 0)
+ phase_tx = MAX_PHASE;
+ else
+ phase_tx -= 1;
+ temp_rx = phase_rx * SAMPLE_DEPTH * ACTIVE_CH;
+ temp_tx = phase_tx * SAMPLE_DEPTH * ACTIVE_CH;
+
+ /*check if loopback received data on TS0 is correct. */
+ pr_debug("%s: check if loopback received data on TS0"
+ " is correct\n", __FUNCTION__);
+ pr_debug("%d,%d ", phase_rx, phase_tx);
+ for (i = 0; i < 8; i++)
+ pr_debug("%1d,%1d ",
+ input_tdm_buffer[temp_rx + i],
+ output_tdm_buffer[temp_tx + i]);
+ pr_debug("\n");
+ }
+#endif
+
+ /* schedule BH */
+ wake_up_interruptible(&tdm_c->wakeup_event);
+ } else {
+ if (tdm_c->tdm_icnt == STUTTER_INT_CNT) {
+ txb = in_be32(&tdm_c->ucc_pram->tbptr) -
+ in_be32(&tdm_c->ucc_pram->tbase);
+ rxb = in_be32(&tdm_c->ucc_pram->rbptr) -
+ in_be32(&tdm_c->ucc_pram->rbase);
+ tdm_c->phase_tx = txb / sizeof(struct qe_bd);
+ tdm_c->phase_rx = rxb / sizeof(struct qe_bd);
+
+#ifdef CONFIG_TDM_HW_LB_TSA_SLIC
+ tdm_c->phase_tx = tdm_c->phase_rx;
+#endif
+
+ /* signal "stuttering" period is over */
+ tdm_c->tdm_flag = 1;
+
+ pr_debug("%s: stuttering period is over\n",
+ __FUNCTION__);
+
+ if (in_be32(tdm_c->uf_private->p_ucce) &
+ (UCC_TRANS_UCCE_TXE << 16)) {
+ u32 cecr_subblock;
+ out_be32(tdm_c->uf_private->p_ucce,
+ (UCC_TRANS_UCCE_TXE << 16));
+ pr_debug("%s: From tdm isr txe interrupt\n",
+ __FUNCTION__);
+
+ cecr_subblock =
+ ucc_fast_get_qe_cr_subblock(ucc);
+ qe_issue_cmd(QE_RESTART_TX, cecr_subblock,
+ (u8) QE_CR_PROTOCOL_UNSPECIFIED,
+ 0);
+ }
+ }
+ }
+
+ ucce = (in_be32(tdm_c->uf_private->p_ucce)
+ & in_be32(tdm_c->uf_private->p_uccm));
+
+ out_be32(tdm_c->uf_private->p_ucce, ucce);
+
+ return IRQ_HANDLED;
+}
+
+static int tdm_start(struct tdm_ctrl *tdm_c)
+{
+ if (request_irq(tdm_c->ut_info->uf_info.irq, tdm_isr,
+ 0, "tdm", tdm_c)) {
+ printk(KERN_ERR "%s: request_irq for tdm_isr failed\n",
+ __FUNCTION__);
+ return -ENODEV;
+ }
+
+ ucc_fast_enable(tdm_c->uf_private, COMM_DIR_RX | COMM_DIR_TX);
+
+ pr_info("%s 16-bit linear pcm mode active with"
+ " slots 0 & 2\n", __FUNCTION__);
+
+ dump_siram(tdm_c);
+ dump_ucc(tdm_c);
+
+ setbits8(&(qe_immr->si1.siglmr1_h), (0x1 << tdm_c->tdm_port));
+ pr_info("%s UCC based TDM enabled\n", __FUNCTION__);
+
+ return 0;
+}
+
+static void tdm_stop(struct tdm_ctrl *tdm_c)
+{
+ u32 port, si;
+ u32 ucc;
+ u32 cecr_subblock;
+
+ port = tdm_c->tdm_port;
+ si = tdm_c->si;
+ ucc = tdm_c->ut_info->uf_info.ucc_num;
+ cecr_subblock = ucc_fast_get_qe_cr_subblock(ucc);
+
+ qe_issue_cmd(QE_GRACEFUL_STOP_TX, cecr_subblock,
+ (u8) QE_CR_PROTOCOL_UNSPECIFIED, 0);
+ qe_issue_cmd(QE_CLOSE_RX_BD, cecr_subblock,
+ (u8) QE_CR_PROTOCOL_UNSPECIFIED, 0);
+
+ clrbits8(&qe_immr->si1.siglmr1_h, (0x1 << port));
+ ucc_fast_disable(tdm_c->uf_private, COMM_DIR_RX);
+ ucc_fast_disable(tdm_c->uf_private, COMM_DIR_TX);
+ free_irq(tdm_c->ut_info->uf_info.irq, tdm_c);
+}
+
+
+static void config_tdm(struct tdm_ctrl *tdm_c)
+{
+ u32 i, j, k;
+
+ j = 0;
+ k = 0;
+
+ /* Set Mask Bits */
+ for (i = 0; i < ACTIVE_CH; i++) {
+ tdm_c->tx_mask[k] |= (1 << j);
+ tdm_c->rx_mask[k] |= (1 << j);
+ j++;
+ if (j >= 16) {
+ j = 0;
+ k++;
+ }
+ }
+ /* physical number of slots in a frame */
+ tdm_c->physical_num_ts = NUM_TS;
+
+ /* common receive and transmit pins */
+ tdm_c->cfg_ctrl.com_pin = 1;
+
+ /* L1R/TSYNC active logic "1" */
+ tdm_c->cfg_ctrl.fr_sync_level = 0;
+
+ /*
+ * TX data on rising edge of clock
+ * RX data on falling edge
+ */
+ tdm_c->cfg_ctrl.clk_edge = 0;
+
+ /* Frame sync sampled on falling edge */
+ tdm_c->cfg_ctrl.fr_sync_edge = 0;
+
+ /* no bit delay */
+ tdm_c->cfg_ctrl.rx_fr_sync_delay = 0;
+
+ /* no bit delay */
+ tdm_c->cfg_ctrl.tx_fr_sync_delay = 0;
+
+#ifndef CONFIG_TDM_HW_LB_TSA_SLIC
+ if (tdm_c->leg_slic) {
+ /* Need 1 bit delay for Legrity SLIC */
+ tdm_c->cfg_ctrl.rx_fr_sync_delay = 1;
+ tdm_c->cfg_ctrl.tx_fr_sync_delay = 1;
+ pr_info("%s Delay for Legerity!\n", __FUNCTION__);
+ }
+#endif
+
+ tdm_c->cfg_ctrl.active_num_ts = ACTIVE_CH;
+}
+
+static void tdm_read(u32 client_id, short chn_id, short *pcm_buffer,
+ short len)
+{
+ int i;
+ u32 phase_rx;
+ /* point to where to start for the current phase data processing */
+ u32 temp_rx;
+
+ struct tdm_ctrl *tdm_c = tdm_ctrl[client_id];
+
+ u16 *input_tdm_buffer =
+ (u16 *)tdm_c->tdm_input_data;
+
+ phase_rx = tdm_c->phase_rx;
+ if (phase_rx == 0)
+ phase_rx = MAX_PHASE;
+ else
+ phase_rx -= 1;
+
+ temp_rx = phase_rx * SAMPLE_DEPTH * EFF_ACTIVE_CH;
+
+#ifdef UCC_CACHE_SNOOPING_DISABLED
+ flush_dcache_range((size_t) &input_tdm_buffer[temp_rx],
+ (size_t) &input_tdm_buffer[temp_rx +
+ SAMPLE_DEPTH * ACTIVE_CH]);
+#endif
+ for (i = 0; i < len; i++)
+ pcm_buffer[i] =
+ input_tdm_buffer[i * EFF_ACTIVE_CH + temp_rx + chn_id];
+
+}
+
+static void tdm_write(u32 client_id, short chn_id, short *pcm_buffer,
+ short len)
+{
+ int i;
+ int phase_tx;
+ u32 txb;
+ /* point to where to start for the current phase data processing */
+ int temp_tx;
+ struct tdm_ctrl *tdm_c = tdm_ctrl[client_id];
+
+ u16 *output_tdm_buffer;
+ output_tdm_buffer = (u16 *)tdm_c->tdm_output_data;
+ txb = in_be32(&tdm_c->ucc_pram->tbptr) -
+ in_be32(&tdm_c->ucc_pram->tbase);
+ phase_tx = txb / sizeof(struct qe_bd);
+
+ if (phase_tx == 0)
+ phase_tx = MAX_PHASE;
+ else
+ phase_tx -= 1;
+
+ temp_tx = phase_tx * SAMPLE_DEPTH * EFF_ACTIVE_CH;
+
+ for (i = 0; i < len; i++)
+ output_tdm_buffer[i * EFF_ACTIVE_CH + temp_tx + chn_id] =
+ pcm_buffer[i];
+
+#ifdef UCC_CACHE_SNOOPING_DISABLED
+ flush_dcache_range((size_t) &output_tdm_buffer[temp_tx],
+ (size_t) &output_tdm_buffer[temp_tx + SAMPLE_DEPTH *
+ ACTIVE_CH]);
+#endif
+}
+
+
+static int tdm_register_client(struct tdm_client *tdm_client)
+{
+ u32 i;
+ if (num_tdm_clients == num_tdm_devices) {
+ printk(KERN_ERR "all TDM devices busy\n");
+ return -EBUSY;
+ }
+
+ for (i = 0; i < num_tdm_devices; i++) {
+ if (!tdm_ctrl[i]->device_busy) {
+ tdm_ctrl[i]->device_busy = 1;
+ break;
+ }
+ }
+ num_tdm_clients++;
+ tdm_client->client_id = i;
+ tdm_client->tdm_read = tdm_read;
+ tdm_client->tdm_write = tdm_write;
+ tdm_client->wakeup_event =
+ &(tdm_ctrl[i]->wakeup_event);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(tdm_register_client);
+
+static int tdm_deregister_client(struct tdm_client *tdm_client)
+{
+ num_tdm_clients--;
+ tdm_ctrl[tdm_client->client_id]->device_busy = 0;
+ return 0;
+}
+EXPORT_SYMBOL_GPL(tdm_deregister_client);
+
+static int ucc_tdm_probe(struct of_device *ofdev,
+ const struct of_device_id *match)
+{
+ struct device_node *np = ofdev->node;
+ struct resource res;
+ const unsigned int *prop;
+ u32 ucc_num, device_num, err, ret = 0;
+ struct device_node *np_tmp = NULL;
+ dma_addr_t physaddr;
+ void *tdm_buff;
+ struct ucc_tdm_info *ut_info;
+
+ prop = of_get_property(np, "device-id", NULL);
+ ucc_num = *prop - 1;
+ if ((ucc_num < 0) || (ucc_num > 7))
+ return -ENODEV;
+
+ ut_info = &utdm_info[ucc_num];
+ if (ut_info == NULL) {
+ printk(KERN_ERR "additional data missing\n");
+ return -ENODEV;
+ }
+ if (ut_info->ucc_busy) {
+ printk(KERN_ERR "UCC in use by another TDM driver instance\n");
+ return -EBUSY;
+ }
+ if (num_tdm_devices == MAX_NUM_TDM_DEVICES) {
+ printk(KERN_ERR "All TDM devices already initialized\n");
+ return -ENODEV;
+ }
+
+ ut_info->ucc_busy = 1;
+ tdm_ctrl[num_tdm_devices++] =
+ kzalloc(sizeof(struct tdm_ctrl), GFP_KERNEL);
+ if (!tdm_ctrl[num_tdm_devices - 1]) {
+ printk(KERN_ERR "%s: no memory to allocate for"
+ " tdm control structure\n", __FUNCTION__);
+ num_tdm_devices--;
+ return -ENOMEM;
+ }
+ device_num = num_tdm_devices - 1;
+
+ tdm_ctrl[device_num]->device = &ofdev->dev;
+ tdm_ctrl[device_num]->ut_info = ut_info;
+
+ tdm_ctrl[device_num]->ut_info->uf_info.ucc_num = ucc_num;
+
+ prop = of_get_property(np, "fsl,tdm-num", NULL);
+ if (prop == NULL) {
+ ret = -EINVAL;
+ goto get_property_error;
+ }
+
+ tdm_ctrl[device_num]->tdm_port = *prop - 1;
+
+ if (tdm_ctrl[device_num]->tdm_port > 3) {
+ ret = -EINVAL;
+ goto get_property_error;
+ }
+
+ prop = of_get_property(np, "fsl,si-num", NULL);
+ if (prop == NULL) {
+ ret = -EINVAL;
+ goto get_property_error;
+ }
+
+ tdm_ctrl[device_num]->si = *prop - 1;
+
+ tdm_ctrl[device_num]->ut_info->uf_info.tdm_tx_clk =
+ (char *) of_get_property(np, "fsl,tdm-tx-clk", NULL);
+ if (tdm_ctrl[device_num]->ut_info->uf_info.tdm_tx_clk == NULL) {
+ ret = -EINVAL;
+ goto get_property_error;
+ }
+
+ tdm_ctrl[device_num]->ut_info->uf_info.tdm_rx_clk =
+ (char *) of_get_property(np, "fsl,tdm-rx-clk", NULL);
+ if (tdm_ctrl[device_num]->ut_info->uf_info.tdm_rx_clk == NULL) {
+ ret = -EINVAL;
+ goto get_property_error;
+ }
+
+ tdm_ctrl[device_num]->ut_info->uf_info.tdm_tx_sync =
+ (char *) of_get_property(np, "fsl,tdm-tx-sync", NULL);
+ if (tdm_ctrl[device_num]->ut_info->uf_info.tdm_tx_sync == NULL) {
+ ret = -EINVAL;
+ goto get_property_error;
+ }
+
+ tdm_ctrl[device_num]->ut_info->uf_info.tdm_rx_sync =
+ (char *) of_get_property(np, "fsl,tdm-rx-sync", NULL);
+ if (tdm_ctrl[device_num]->ut_info->uf_info.tdm_rx_sync == NULL) {
+ ret = -EINVAL;
+ goto get_property_error;
+ }
+
+ tdm_ctrl[device_num]->ut_info->uf_info.irq =
+ irq_of_parse_and_map(np, 0);
+ err = of_address_to_resource(np, 0, &res);
+ if (err) {
+ ret = EINVAL;
+ goto get_property_error;
+ }
+ tdm_ctrl[device_num]->ut_info->uf_info.regs = res.start;
+ tdm_ctrl[device_num]->uf_regs = of_iomap(np, 0);
+
+ np_tmp = of_find_compatible_node(np_tmp, "slic", "legerity-slic");
+ if (np_tmp != NULL)
+ tdm_ctrl[device_num]->leg_slic = 1;
+ else
+ tdm_ctrl[device_num]->leg_slic = 0;
+
+ config_tdm(tdm_ctrl[device_num]);
+
+ tdm_buff = dma_alloc_coherent(NULL, 2 * NR_BUFS * SAMPLE_DEPTH *
+ tdm_ctrl[device_num]->cfg_ctrl.active_num_ts,
+ &physaddr, GFP_KERNEL);
+ if (!tdm_buff) {
+ printk(KERN_ERR "ucc-tdm: could not allocate buffer"
+ "descriptors\n");
+ ret = -ENOMEM;
+ goto get_property_error;
+ }
+
+ tdm_ctrl[device_num]->tdm_input_data = tdm_buff;
+ tdm_ctrl[device_num]->dma_input_addr = physaddr;
+
+ tdm_ctrl[device_num]->tdm_output_data = tdm_buff + NR_BUFS *
+ SAMPLE_DEPTH * tdm_ctrl[device_num]->cfg_ctrl.active_num_ts;
+ tdm_ctrl[device_num]->dma_output_addr = physaddr + NR_BUFS *
+ SAMPLE_DEPTH * tdm_ctrl[device_num]->cfg_ctrl.active_num_ts;
+
+ init_waitqueue_head(&(tdm_ctrl[device_num]->wakeup_event));
+
+ ret = tdm_init(tdm_ctrl[device_num]);
+ if (ret != 0)
+ goto tdm_init_error;
+
+ ret = tdm_start(tdm_ctrl[device_num]);
+ if (ret != 0)
+ goto tdm_start_error;
+
+ dev_set_drvdata(&(ofdev->dev), tdm_ctrl[device_num]);
+
+ pr_info("%s UCC based tdm module installed\n", __FUNCTION__);
+ return 0;
+
+tdm_start_error:
+ tdm_deinit(tdm_ctrl[device_num]);
+tdm_init_error:
+ dma_free_coherent(NULL, 2 * NR_BUFS * SAMPLE_DEPTH *
+ tdm_ctrl[device_num]->cfg_ctrl.active_num_ts,
+ tdm_ctrl[device_num]->tdm_input_data,
+ tdm_ctrl[device_num]->dma_input_addr);
+
+get_property_error:
+ kfree(tdm_ctrl[device_num]);
+ return ret;
+}
+
+static int ucc_tdm_remove(struct of_device *ofdev)
+{
+ struct tdm_ctrl *tdm_c;
+ struct ucc_tdm_info *ut_info;
+ u32 ucc_num;
+
+ tdm_c = dev_get_drvdata(&(ofdev->dev));
+ ucc_num = tdm_c->ut_info->uf_info.ucc_num;
+ ut_info = &utdm_info[ucc_num];
+ tdm_stop(tdm_c);
+ tdm_deinit(tdm_c);
+
+ ucc_fast_free(tdm_c->uf_private);
+
+ dma_free_coherent(NULL, 2 * NR_BUFS * SAMPLE_DEPTH *
+ tdm_c->cfg_ctrl.active_num_ts,
+ tdm_c->tdm_input_data,
+ tdm_c->dma_input_addr);
+
+ num_tdm_devices--;
+ kfree(tdm_c);
+
+ ut_info->ucc_busy = 0;
+
+ pr_info("%s UCC based tdm module uninstalled\n", __FUNCTION__);
+ return 0;
+}
+
+static struct of_device_id ucc_tdm_match[] = {
+ {
+ .type = "tdm",
+ .compatible = "fsl,ucc-tdm",
+ }, {},
+};
+
+MODULE_DEVICE_TABLE(of, ucc_tdm_match);
+
+static struct of_platform_driver ucc_tdm_driver = {
+ .name = DRV_NAME,
+ .match_table = ucc_tdm_match,
+ .probe = ucc_tdm_probe,
+ .remove = ucc_tdm_remove,
+};
+
+static int __init ucc_tdm_init(void)
+{
+ u32 i;
+
+ pr_info("ucc_tdm: " DRV_DESC "\n");
+ for (i = 0; i < 8; i++)
+ memcpy(&(utdm_info[i]), &utdm_primary_info,
+ sizeof(utdm_primary_info));
+
+ return of_register_platform_driver(&ucc_tdm_driver);
+}
+
+static void __exit ucc_tdm_exit(void)
+{
+ of_unregister_platform_driver(&ucc_tdm_driver);
+}
+
+module_init(ucc_tdm_init);
+module_exit(ucc_tdm_exit);
+MODULE_AUTHOR("Freescale Semiconductor, Inc");
+MODULE_DESCRIPTION(DRV_DESC);
+MODULE_LICENSE("GPL");
diff --git a/drivers/misc/ucc_tdm.h b/drivers/misc/ucc_tdm.h
new file mode 100644
index 0000000..eaf2848
--- /dev/null
+++ b/drivers/misc/ucc_tdm.h
@@ -0,0 +1,221 @@
+/*
+ * drivers/misc/ucc_tdm.h
+ *
+ * UCC Based Linux TDM Driver
+ * This driver is designed to support UCC based TDM for PowerPC processors.
+ * This driver can interface with SLIC device to run VOIP kind of
+ * applications.
+ *
+ * Author: Ashish Kalra & Poonam Aggrwal
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#ifndef TDM_H
+#define TDM_H
+
+#define NUM_TS 8
+#define ACTIVE_CH 8
+
+/* SAMPLE_DEPTH is the sample depth is the number of frames before
+ * an interrupt. Must be a multiple of 4
+ */
+#define SAMPLE_DEPTH 80
+
+/* define the number of Rx interrupts to go by for initial stuttering */
+#define STUTTER_INT_CNT 1
+
+/* BMRx Field Descriptions to specify tstate and rstate in UCC parameter RAM*/
+#define EN_BUS_SNOOPING 0x20
+#define BE_BO 0x10
+
+/* UPSMR Register for Transparent UCC controller Bit definitions*/
+#define NBO 0x00000000 /* Normal Mode 1 bit of data per clock */
+
+/* SI Mode register bit definitions */
+#define NORMAL_OPERATION 0x0000
+#define AUTO_ECHO 0x0400
+#define INTERNAL_LB 0x0800
+#define CONTROL_LB 0x0c00
+#define SIMODE_CRT (0x8000 >> 9)
+#define SIMODE_SL (0x8000 >> 10)
+#define SIMODE_CE (0x8000 >> 11)
+#define SIMODE_FE (0x8000 >> 12)
+#define SIMODE_GM (0x8000 >> 13)
+#define SIMODE_TFSD(val) (val)
+#define SIMODE_RFSD(val) ((val) << 8)
+
+#define SI_TDM_MODE_REGISTER_OFFSET 0
+
+#define R_CM 0x02000000
+#define T_CM 0x02000000
+
+#define SET_RX_SI_RAM(n, val) \
+ out_be16((u16 *)&qe_immr->sir.rx[(n)*2], (u16)(val))
+
+#define SET_TX_SI_RAM(n, val) \
+ out_be16((u16 *)&qe_immr->sir.tx[(n)*2], (u16)(val))
+
+/* SI RAM entries */
+#define SIR_LAST 0x0001
+#define SIR_CNT(n) ((n) << 2)
+#define SIR_BYTE 0x0002
+#define SIR_BIT 0x0000
+#define SIR_IDLE 0
+#define SIR_UCC(uccx) (((uccx+9)) << 5)
+
+/* BRGC Register Bit definitions */
+#define BRGC_RESET (0x1<<17)
+#define BRGC_EN (0x1<<16)
+#define BRGC_EXTC_QE (0x00<<14)
+#define BRGC_EXTC_CLK3 (0x01<<14)
+#define BRGC_EXTC_CLK5 (0x01<<15)
+#define BRGC_EXTC_CLK9 (0x01<<14)
+#define BRGC_EXTC_CLK11 (0x01<<14)
+#define BRGC_EXTC_CLK13 (0x01<<14)
+#define BRGC_EXTC_CLK15 (0x01<<15)
+#define BRGC_ATB (0x1<<13)
+#define BRGC_DIV16 (0x1)
+
+/* structure representing UCC transparent parameter RAM */
+struct ucc_transparent_pram {
+ __be16 riptr;
+ __be16 tiptr;
+ __be16 res0;
+ __be16 mrblr;
+ __be32 rstate;
+ __be32 rbase;
+ __be16 rbdstat;
+ __be16 rbdlen;
+ __be32 rdptr;
+ __be32 tstate;
+ __be32 tbase;
+ __be16 tbdstat;
+ __be16 tbdlen;
+ __be32 tdptr;
+ __be32 rbptr;
+ __be32 tbptr;
+ __be32 rcrc;
+ __be32 res1;
+ __be32 tcrc;
+ __be32 res2;
+ __be32 res3;
+ __be32 c_mask;
+ __be32 c_pres;
+ __be16 disfc;
+ __be16 crcec;
+ __be32 res4[4];
+ __be16 ts_tmp;
+ __be16 tmp_mb;
+};
+
+#define UCC_TRANSPARENT_PRAM_SIZE 0x100
+
+struct tdm_cfg {
+ u8 com_pin; /* Common receive and transmit pins
+ * 0 = separate pins
+ * 1 = common pins
+ */
+
+ u8 fr_sync_level; /* SLx bit Frame Sync Polarity
+ * 0 = L1R/TSYNC active logic "1"
+ * 1 = L1R/TSYNC active logic "0"
+ */
+
+ u8 clk_edge; /* CEx bit Tx Rx Clock Edge
+ * 0 = TX data on rising edge of clock
+ * RX data on falling edge
+ * 1 = TX data on falling edge of clock
+ * RX data on rising edge
+ */
+
+ u8 fr_sync_edge; /* FEx bit Frame sync edge
+ * Determine when the sync pulses are sampled
+ * 0 = Falling edge
+ * 1 = Rising edge
+ */
+
+ u8 rx_fr_sync_delay; /* TFSDx/RFSDx bits Frame Sync Delay
+ * 00 = no bit delay
+ * 01 = 1 bit delay
+ * 10 = 2 bit delay
+ * 11 = 3 bit delay
+ */
+
+ u8 tx_fr_sync_delay; /* TFSDx/RFSDx bits Frame Sync Delay
+ * 00 = no bit delay
+ * 01 = 1 bit delay
+ * 10 = 2 bit delay
+ * 11 = 3 bit delay
+ */
+
+ u8 active_num_ts; /* Number of active time slots in TDM
+ * assume same active Rx/Tx time slots
+ */
+};
+
+struct ucc_tdm_info {
+ struct ucc_fast_info uf_info;
+ u32 ucc_busy;
+};
+
+struct tdm_ctrl {
+ u32 device_busy;
+ struct device *device;
+ struct ucc_fast_private *uf_private;
+ struct ucc_tdm_info *ut_info;
+ u32 tdm_port; /* port for this tdm:TDMA,TDMB,TDMC,TDMD */
+ u32 si; /* serial interface: 0 or 1 */
+ struct ucc_fast __iomem *uf_regs; /* UCC Fast registers */
+ u16 rx_mask[8]; /* Active Receive channels LSB is ch0 */
+ u16 tx_mask[8]; /* Active Transmit channels LSB is ch0 */
+ /* Only channels less than the number of FRAME_SIZE are implemented */
+ struct tdm_cfg cfg_ctrl; /* Signaling controls configuration */
+ u8 *tdm_input_data; /* buffer used for Rx by the tdm */
+ u8 *tdm_output_data; /* buffer used for Tx by the tdm */
+
+ dma_addr_t dma_input_addr; /* dma mapped buffer for TDM Rx */
+ dma_addr_t dma_output_addr; /* dma mapped buffer for TDM Tx */
+ u16 physical_num_ts; /* physical number of timeslots in the tdm
+ frame */
+ u32 phase_rx; /* cycles through 0, 1, 2 */
+ u32 phase_tx; /* cycles through 0, 1, 2 */
+ /*
+ * the following two variables are for dealing with "stutter" problem
+ * "stutter" period is about 20 frames or so, varies depending active
+ * channel num depending on the sample depth, the code should let a
+ * few Rx interrupts go by
+ */
+ u32 tdm_icnt;
+ u32 tdm_flag;
+ struct ucc_transparent_pram __iomem *ucc_pram;
+ struct qe_bd __iomem *tx_bd;
+ struct qe_bd __iomem *rx_bd;
+ u32 ucc_pram_offset;
+ u32 tx_bd_offset;
+ u32 rx_bd_offset;
+ u32 rx_ucode_buf_offset;
+ u32 tx_ucode_buf_offset;
+ bool leg_slic;
+ wait_queue_head_t wakeup_event;
+};
+
+struct tdm_client {
+ u32 client_id;
+ void (*tdm_read)(u32 client_id, short chn_id,
+ short *pcm_buffer, short len);
+ void (*tdm_write)(u32 client_id, short chn_id,
+ short *pcm_buffer, short len);
+ wait_queue_head_t *wakeup_event;
+ };
+
+#define MAX_PHASE 1
+#define NR_BUFS 2
+#define EFF_ACTIVE_CH ACTIVE_CH / 2
+
+#endif
--
1.5.2.4
^ permalink raw reply related
* Re: [IPV4 2/5] fib_trie: remove unneeded NULL check
From: David Miller @ 2008-01-24 4:38 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20080123224858.844259513@linux-foundation.org>
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Wed, 23 Jan 2008 14:48:46 -0800
> Since fib_route_seq_show now uses hlist_for_each_entry(), the
> leaf info can not be NULL.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [IPV4 1/5] fib_trie: more whitespace cleanup
From: David Miller @ 2008-01-24 4:37 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20080123224858.767903581@linux-foundation.org>
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Wed, 23 Jan 2008 14:48:45 -0800
> Remove extra blank lines.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [NET_SCHED 00/15]: Make use of new netlink API features
From: David Miller @ 2008-01-24 4:37 UTC (permalink / raw)
To: kaber; +Cc: netdev
In-Reply-To: <20080123163555.6459.69501.sendpatchset@localhost.localdomain>
From: Patrick McHardy <kaber@trash.net>
Date: Wed, 23 Jan 2008 17:36:35 +0100 (MET)
> these patches change the packet schedulers/classifers/actions to make use
> of the features of the new netlink API, like typeful attribute dumping and
> parsing, automatic basic attribute validation etc. The also fix a bug and
> a warning introduced by my last set of patches.
>
> Please apply, thanks.
All applied, thanks for doing this work Patrick.
^ permalink raw reply
* [PATCH UCC TDM 0/3] UCC based TDM driver for QE based MPC83xx platforms
From: Aggrwal Poonam @ 2008-01-24 4:13 UTC (permalink / raw)
To: Kumar Gala, akpm, linux-kernel, netdev, rubini, linuxppc-dev
Cc: Barkowski Michael, Phillips Kim, Kalra Ashish, Tabi Timur,
Cutler Richard
Reworked patches after incorporating comments of Andrew, Stephen and
Tabi and Kumar.
Kumar could you please consider them for linux-2.6.25.
There are three patches
[PATCH 1/3] drivers/misc : UCC TDM driver for mpc83xx platforms. This
driver is usable in VoIP iind of applications to interface with SLIC
kind of devices to exchange TDM voice samples.
The driver is right now in misc category and exposes a kind of non
standard interface to the clients.
TDM Driver Interface Details
The TDM driver right now is a misc driver with no subsystem as such.
The dts file keeps a track of the TDM devices present on the board.
Depending on them the TDM driver initializes those many driver instances
while coming up.
The driver on the upper level can plug to more than one tdm clients
depending on the availablity of TDM devices.
At every new request of the TDM client to bind with a TDM device, a free
driver instance is allocated to the client.
The interface can be described as follows.
tdm_register_client(struct tdm_client *)
This API returns a pointer to the structure tdm_client which is
of type
struct tdm_client {
u32 client_id;
u32 (*tdm_read)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
u32 (*tdm_write)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
wait_queue_head_t *wakeup_event;
}
It consists of:
- driver_handle: It is basically to identify the particular TDM
device/driver instance.
- tdm_read: It is a function pointer returned by the TDM driver to be
used to read TDM data from a particular TDM channel.
- tdm_write: It is a function pointer returned by the TDM driver to
be used to write TDM data to a particular TDM channel.
- wakeup_event: It is address of a wait_queue event on which the
client keeps on sleeping, and the TDM driver wakes it up periodically.
The driver is configured to wake up the client after every 10ms.
Once the TDM client gets registered to a TDM driver instance and a TDM
device, it interfaces with the driver using tdm_read, tdm_write and
wakeup_event.
Note: The TDM driver can be used by only kernel level modules. The
driver does not expose any file interface for User Applications. Can be
compared to the spi driver which interfaces with the SPI clients(kernel
mode clients) through some APIs.
This interface can be improved by writing a platform independent TDM
layer. Then all the TDM platforms can be supported below this wrapper
layer. This is planned to be done later.
[PATCH 2/3] arch/ : Platform changes
- device tree entries for UCC TDM driver for MPC8323ERDB platform.
- QE changes related to TDM , like,
1) Modified ucc_fast_init so that it can be used by fast UCC
based TDM driver. Mainly changes have been made to configure TDM clocks
and Fsyncs.
2) Modified get_brg_clk so that it can return the input frequncy
and input source of any BRG by reading the corresponding entries from
device tree.
3) Added new nodes brg and clocks in the device tree which
represent input clocks for different BRGs.
4) Modified qe_setbrg accordingly.
- new device tree entries added for "clocks" and "brg"
[PATCH 3/3] Documentation
- Modified Documentation to explain the device tree entries related to
UCC TDM driver and the new nodes added("clocks" and "brg")
The patch applies over a merge of galak's for-2.6.25 plus for-2.6.24
plus of_doc_update branches.
In brief the steps were
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git
powerpc-galak
git checkout -b for-2.6.25 origin/for-2.6.25 git checkout -b for-2.6.24
origin/for-2.6.24 git checkout -b of_doc_update origin/of_doc_update
git pull . for-2.6.24 # merge the other two
git pull . for-2.6.25
git checkout -b tdm # clean slate for tdm rebase work
Also after applying the patches changes have to be made corresponding to
Tabi's patch "qe: add function qe_clock_source".
The driver has been tested with a VoIP stack and application on
MPC8323ERDB.
With Regards
Poonam
^ permalink raw reply
* [PATCH 1/2] sky2: restore multicast addresses after recovery
From: Stephen Hemminger @ 2008-01-24 3:11 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
If the sky2 deadman timer forces a recovery, the multicast hash
list is lost. Move the call to sky2_set_multicast to the end
of sky2_up() so all paths that bring device up will restore multicast.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
Please apply for 2.6.24
--- a/drivers/net/sky2.c 2008-01-23 16:00:34.000000000 -0800
+++ b/drivers/net/sky2.c 2008-01-23 16:04:20.000000000 -0800
@@ -1412,6 +1412,7 @@ static int sky2_up(struct net_device *de
imask |= portirq_msk[port];
sky2_write32(hw, B0_IMSK, imask);
+ sky2_set_multicast(dev);
return 0;
err_out:
@@ -3533,8 +3534,6 @@ static int sky2_set_ringparam(struct net
err = sky2_up(dev);
if (err)
dev_close(dev);
- else
- sky2_set_multicast(dev);
}
return err;
@@ -4368,8 +4367,6 @@ static int sky2_resume(struct pci_dev *p
dev_close(dev);
goto out;
}
-
- sky2_set_multicast(dev);
}
}
^ permalink raw reply
* [PATCH 2/2] sky2: fix Wake On Lan interaction with BIOS
From: Stephen Hemminger @ 2008-01-24 3:16 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
In-Reply-To: <20080123191151.1423a045@deepthought>
This patch disables config mode access after clearing PCI settings.
Some BIOS's seem to not do WOL if config bit still set.
Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=9721
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
Please get this into 2.6.24.
--- a/drivers/net/sky2.c 2008-01-23 16:31:13.000000000 -0800
+++ b/drivers/net/sky2.c 2008-01-23 16:31:16.000000000 -0800
@@ -621,6 +621,7 @@ static void sky2_phy_power(struct sky2_h
static const u32 phy_power[] = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD };
static const u32 coma_mode[] = { PCI_Y2_PHY1_COMA, PCI_Y2_PHY2_COMA };
+ sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
/* Turn on/off phy power saving */
if (onoff)
@@ -632,7 +633,8 @@ static void sky2_phy_power(struct sky2_h
reg1 |= coma_mode[port];
sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
- reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+ sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+ sky2_pci_read32(hw, PCI_DEV_REG1);
udelay(100);
}
@@ -2427,6 +2429,7 @@ static void sky2_hw_intr(struct sky2_hw
if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) {
u16 pci_err;
+ sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
pci_err = sky2_pci_read16(hw, PCI_STATUS);
if (net_ratelimit())
dev_err(&pdev->dev, "PCI hardware error (0x%x)\n",
@@ -2434,12 +2437,14 @@ static void sky2_hw_intr(struct sky2_hw
sky2_pci_write16(hw, PCI_STATUS,
pci_err | PCI_STATUS_ERROR_BITS);
+ sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
}
if (status & Y2_IS_PCI_EXP) {
/* PCI-Express uncorrectable Error occurred */
u32 err;
+ sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS,
0xfffffffful);
@@ -2447,6 +2452,7 @@ static void sky2_hw_intr(struct sky2_hw
dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err);
sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
+ sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
}
if (status & Y2_HWE_L1_MASK)
@@ -2812,6 +2818,7 @@ static void sky2_reset(struct sky2_hw *h
}
sky2_power_on(hw);
+ sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
for (i = 0; i < hw->ports; i++) {
sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET);
^ permalink raw reply
* bluetooth : lockdep warning on rfcomm
From: Dave Young @ 2008-01-24 3:02 UTC (permalink / raw)
To: LKML; +Cc: Netdev, Marcel Holtmann, David Miller, bluez-devel
=============================================
[ INFO: possible recursive locking detected ]
2.6.24-rc8-mm1 #8
---------------------------------------------
bluepush/3213 is trying to acquire lock:
(sk_lock-AF_BLUETOOTH){--..}, at: [<f8978c80>]
l2cap_sock_bind+0x40/0x100 [l2cap]
but task is already holding lock:
(sk_lock-AF_BLUETOOTH){--..}, at: [<f894a31e>]
rfcomm_sock_connect+0x3e/0xe0 [rfcomm]
other info that might help us debug this:
2 locks held by bluepush/3213:
#0: (sk_lock-AF_BLUETOOTH){--..}, at: [<f894a31e>]
rfcomm_sock_connect+0x3e/0xe0 [rfcomm]
#1: (rfcomm_mutex){--..}, at: [<f8947556>] rfcomm_dlc_open+0x26/0x60 [rfcomm]
stack backtrace:
Pid: 3213, comm: bluepush Not tainted 2.6.24-rc8-mm1 #8
[<c0132128>] ? printk+0x18/0x20
[<c0154437>] print_deadlock_bug+0xc7/0xe0
[<c01544bc>] check_deadlock+0x6c/0x80
[<c01548fc>] validate_chain+0x14c/0x320
[<c0156221>] __lock_acquire+0x1c1/0x730
[<c0156d89>] lock_acquire+0x79/0xb0
[<f8978c80>] ? l2cap_sock_bind+0x40/0x100 [l2cap]
[<c03c05f5>] lock_sock_nested+0x55/0x70
[<f8978c80>] ? l2cap_sock_bind+0x40/0x100 [l2cap]
[<f8978c80>] l2cap_sock_bind+0x40/0x100 [l2cap]
[<c03bdb4a>] kernel_bind+0xa/0x10
[<f8947afc>] rfcomm_session_create+0x4c/0x110 [rfcomm]
[<f8947509>] __rfcomm_dlc_open+0x129/0x150 [rfcomm]
[<f8947568>] rfcomm_dlc_open+0x38/0x60 [rfcomm]
[<f894a396>] rfcomm_sock_connect+0xb6/0xe0 [rfcomm]
[<c03bcd39>] sys_connect+0x99/0xd0
[<c010f509>] ? cache_add_dev+0x39/0x1a0
[<c015323d>] ? put_lock_stats+0xd/0x30
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c018e86c>] ? fget+0x7c/0x100
[<c0156b97>] ? __lock_release+0x47/0x70
[<c018e86c>] ? fget+0x7c/0x100
[<c02611b7>] ? copy_from_user+0x37/0x70
[<c03bd855>] sys_socketcall+0xa5/0x230
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c010501b>] ? restore_nocheck+0x12/0x15
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply
* Re: 2.6.24-rc8-mm1 : net tcp_input.c warnings
From: Dave Young @ 2008-01-24 2:42 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: LKML, Netdev, Andrew Morton
In-Reply-To: <Pine.LNX.4.64.0801231256360.31652@kivilampi-30.cs.helsinki.fi>
On Jan 23, 2008 7:01 PM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
> On Wed, 23 Jan 2008, Ilpo Järvinen wrote:
>
> > On Wed, 23 Jan 2008, Dave Young wrote:
> >
> > > On Jan 23, 2008 3:41 PM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
> > > >
> > > > On Tue, 22 Jan 2008, David Miller wrote:
> > > >
> > > > > From: "Dave Young" <hidave.darkstar@gmail.com>
> > > > > Date: Wed, 23 Jan 2008 09:44:30 +0800
> > > > >
> > > > > > On Jan 22, 2008 6:47 PM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
> > > > > > > [PATCH] [TCP]: debug S+L
> > > > > >
> > > > > > Thanks, If there's new findings I will let you know.
> > > > >
> > > > > Thanks for helping with this bug Dave.
> > > >
> > > > I noticed btw that there thing might (is likely to) spuriously trigger at
> > > > WARN_ON(sacked != tp->sacked_out); because those won't be equal when SACK
> > > > is not enabled. If that does happen too often, I send a fixed patch for
> > > > it, yet, the fact that I print print tp->rx_opt.sack_ok allows
> > > > identification of those cases already as it's zero when SACK is not
> > > > enabled.
> > > >
> > > > Just ask if you need the updated debug patch.
> > >
> > > Thanks, please send, I would like to get it.
> >
> > There you go. I fixed non-SACK case by adding tcp_is_sack checks there and
> > also added two verifys to tcp_ack to see if there's corruption outside of
> > TCP.
>
> There's some discussion about a problem that is very likely the same as in
> here (sorry for not remembering to cc you in there due to rapid progress):
>
> http://marc.info/?t=120107174200003&r=1&w=2
Thanks.
New warning trigged with your debug patch:
ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 16 (level, low) -> IRQ 16
PCI: Setting latency timer of device 0000:00:1b.0 to 64
e100: Intel(R) PRO/100 Network Driver, 3.5.23-k4-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
ACPI: PCI Interrupt 0000:03:08.0[A] -> GSI 20 (level, low) -> IRQ 20
e100: eth1: e100_probe: addr 0xefaff000, irq 20, MAC addr 00:13:72:e7:4d:66
eth0: setting full-duplex.
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0150030>] ? timer_list_show_tickdevices+0xf0/0x110
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c0153251>] ? put_lock_stats+0x21/0x30
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c0186af4>] ? check_bytes_and_report+0x24/0xc0
[<c0186af4>] ? check_bytes_and_report+0x24/0xc0
[<c0186bf1>] ? check_pad_bytes+0x61/0x80
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03f7509>] ? tcp_clean_rtx_queue+0x2d9/0x5b0
[<c03f5540>] tcp_add_reno_sack+0x30/0x50
[<c03f6d72>] tcp_fastretrans_alert+0x3d2/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f3e>] ? __do_softirq+0x6e/0x120
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 1 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s1 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0250030>] ? generic_make_request+0x1c0/0x2e0
[<c0132128>] ? printk+0x18/0x20
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c03f674e>] tcp_try_to_open+0x2e/0x160
[<c03f6e9e>] tcp_fastretrans_alert+0x4fe/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f3e>] ? __do_softirq+0x6e/0x120
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 1 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s1 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c0186af4>] ? check_bytes_and_report+0x24/0xc0
[<c0186bf1>] ? check_pad_bytes+0x61/0x80
[<c0186dbd>] ? check_object+0xad/0x1e0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c015561c>] ? trace_hardirqs_on+0x7c/0x130
[<c03c1578>] ? kfree_skbmem+0x98/0xc0
[<c03fcf03>] tcp_write_xmit+0x63/0x290
[<c03c1578>] ? kfree_skbmem+0x98/0xc0
[<c03fd147>] __tcp_push_pending_frames+0x17/0x80
[<c03fa23e>] tcp_rcv_established+0x40e/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f3e>] ? __do_softirq+0x6e/0x120
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 1 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s1 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0132128>] ? printk+0x18/0x20
[<c01317da>] ? print_oops_end_marker+0x2a/0x30
[<c0131849>] ? warn_on_slowpath+0x59/0x80
[<c025f9e4>] ? vsnprintf+0x2d4/0x4f0
[<c0132128>] ? printk+0x18/0x20
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c0186bf1>] ? check_pad_bytes+0x61/0x80
[<c03f7509>] tcp_clean_rtx_queue+0x2d9/0x5b0
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c03f7dd2>] tcp_ack+0x122/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f3e>] ? __do_softirq+0x6e/0x120
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 1 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s1 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0132438>] ? vprintk+0x308/0x320
[<c025f9e4>] ? vsnprintf+0x2d4/0x4f0
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03f7509>] ? tcp_clean_rtx_queue+0x2d9/0x5b0
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c03f6a93>] tcp_fastretrans_alert+0xf3/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f3e>] ? __do_softirq+0x6e/0x120
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 1 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s1 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0250030>] ? generic_make_request+0x1c0/0x2e0
[<c0132128>] ? printk+0x18/0x20
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c03f5540>] tcp_add_reno_sack+0x30/0x50
[<c03f6d72>] tcp_fastretrans_alert+0x3d2/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f3e>] ? __do_softirq+0x6e/0x120
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 2 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s2 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0250030>] ? generic_make_request+0x1c0/0x2e0
[<c0132128>] ? printk+0x18/0x20
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c03f674e>] tcp_try_to_open+0x2e/0x160
[<c03f6e9e>] tcp_fastretrans_alert+0x4fe/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f3e>] ? __do_softirq+0x6e/0x120
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 2 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s2 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c0186af4>] ? check_bytes_and_report+0x24/0xc0
[<c0132438>] ? vprintk+0x308/0x320
[<c0186bf1>] ? check_pad_bytes+0x61/0x80
[<c0186dbd>] ? check_object+0xad/0x1e0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c015561c>] ? trace_hardirqs_on+0x7c/0x130
[<c03c1578>] ? kfree_skbmem+0x98/0xc0
[<c03fcf03>] tcp_write_xmit+0x63/0x290
[<c03c1578>] ? kfree_skbmem+0x98/0xc0
[<c03fd147>] __tcp_push_pending_frames+0x17/0x80
[<c03fa23e>] tcp_rcv_established+0x40e/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f3e>] ? __do_softirq+0x6e/0x120
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 2 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s2 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0132128>] ? printk+0x18/0x20
[<c01317da>] ? print_oops_end_marker+0x2a/0x30
[<c0131849>] ? warn_on_slowpath+0x59/0x80
[<c025f9e4>] ? vsnprintf+0x2d4/0x4f0
[<c0132128>] ? printk+0x18/0x20
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c0186bf1>] ? check_pad_bytes+0x61/0x80
[<c03f7509>] tcp_clean_rtx_queue+0x2d9/0x5b0
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c03f7dd2>] tcp_ack+0x122/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 2 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s2 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0132438>] ? vprintk+0x308/0x320
[<c025f9e4>] ? vsnprintf+0x2d4/0x4f0
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03f7509>] ? tcp_clean_rtx_queue+0x2d9/0x5b0
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c03f6a93>] tcp_fastretrans_alert+0xf3/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 2 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s2 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0250030>] ? generic_make_request+0x1c0/0x2e0
[<c0132128>] ? printk+0x18/0x20
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c03f5540>] tcp_add_reno_sack+0x30/0x50
[<c03f6d72>] tcp_fastretrans_alert+0x3d2/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 0 vs 0 S: 0 vs 3 w: 2044790889-2044796616 (0)
TCP wq(s) <
TCP wq(h) +++h+<
l0 s3 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_input.c:2169 tcp_mark_head_lost+0x122/0x150()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c03f6052>] tcp_mark_head_lost+0x122/0x150
[<c03f60ca>] tcp_update_scoreboard+0x4a/0x190
[<c03f6e7a>] tcp_fastretrans_alert+0x4da/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c01317da>] ? print_oops_end_marker+0x2a/0x30
[<c0131849>] ? warn_on_slowpath+0x59/0x80
[<c03ffe54>] ? tcp_print_queue+0x1a4/0x230
[<c0132438>] ? vprintk+0x308/0x320
[<c0132438>] ? vprintk+0x308/0x320
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c03f5ffc>] tcp_mark_head_lost+0xcc/0x150
[<c03f60ca>] tcp_update_scoreboard+0x4a/0x190
[<c03f6e7a>] tcp_fastretrans_alert+0x4da/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 5 vs 5 S: 0 vs 3 w: 2044790889-2044796616 (0)
TCP wq(s) LLLLl<
TCP wq(h) +++h+<
l5 s3 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_output.c:1977 tcp_xmit_retransmit_queue+0x388/0x420()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0132438>] ? vprintk+0x308/0x320
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c03f5ffc>] ? tcp_mark_head_lost+0xcc/0x150
[<c03fdf38>] tcp_xmit_retransmit_queue+0x388/0x420
[<c03f6c27>] tcp_fastretrans_alert+0x287/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c01317da>] ? print_oops_end_marker+0x2a/0x30
[<c0131849>] ? warn_on_slowpath+0x59/0x80
[<c0132438>] ? vprintk+0x308/0x320
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03f5ffc>] ? tcp_mark_head_lost+0xcc/0x150
[<c03fdea4>] tcp_xmit_retransmit_queue+0x2f4/0x420
[<c03f6c27>] tcp_fastretrans_alert+0x287/0x700
[<c03f7e63>] tcp_ack+0x1b3/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 5 vs 5 S: 0 vs 3 w: 2044790889-2044796616 (0)
TCP wq(s) LLLLl<
TCP wq(h) +++h+<
l5 s3 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_output.c:1467 tcp_write_xmit+0x288/0x290()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0186af4>] ? check_bytes_and_report+0x24/0xc0
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c0186bf1>] ? check_pad_bytes+0x61/0x80
[<c0186dbd>] ? check_object+0xad/0x1e0
[<c0155539>] ? mark_held_locks+0x39/0x80
[<c01880ac>] ? __slab_free+0xac/0x150
[<c015561c>] ? trace_hardirqs_on+0x7c/0x130
[<c03c1578>] ? kfree_skbmem+0x98/0xc0
[<c03fd128>] tcp_write_xmit+0x288/0x290
[<c03c1578>] ? kfree_skbmem+0x98/0xc0
[<c03fd147>] __tcp_push_pending_frames+0x17/0x80
[<c03fa23e>] tcp_rcv_established+0x40e/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c01317da>] ? print_oops_end_marker+0x2a/0x30
[<c0131849>] ? warn_on_slowpath+0x59/0x80
[<c0186af4>] ? check_bytes_and_report+0x24/0xc0
[<c03ffff6>] ? tcp_verify_wq+0x116/0x1c0
[<c0186bf1>] ? check_pad_bytes+0x61/0x80
[<c0186dbd>] ? check_object+0xad/0x1e0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c015561c>] ? trace_hardirqs_on+0x7c/0x130
[<c03c1578>] ? kfree_skbmem+0x98/0xc0
[<c03fcf03>] tcp_write_xmit+0x63/0x290
[<c03c1578>] ? kfree_skbmem+0x98/0xc0
[<c03fd147>] __tcp_push_pending_frames+0x17/0x80
[<c03fa23e>] tcp_rcv_established+0x40e/0x710
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c04021fb>] tcp_v4_rcv+0x5db/0x660
[<c0401fa7>] ? tcp_v4_rcv+0x387/0x660
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c03e5f44>] ip_local_deliver_finish+0x84/0x1d0
[<c03e5eed>] ? ip_local_deliver_finish+0x2d/0x1d0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03e6147>] ip_local_deliver+0xb7/0xc0
[<c03e6202>] ip_rcv_finish+0xb2/0x3c0
[<c03c01d8>] ? sock_def_readable+0x48/0xa0
[<c03be061>] ? sock_queue_rcv_skb+0xb1/0x1a0
[<c03be0a7>] ? sock_queue_rcv_skb+0xf7/0x1a0
[<c03e669f>] ip_rcv+0x18f/0x290
[<c042fb10>] ? packet_rcv_spkt+0xd0/0x130
[<c03c8da6>] netif_receive_skb+0x2b6/0x330
[<c03c8c17>] ? netif_receive_skb+0x127/0x330
[<c03c8ea3>] ? process_backlog+0x83/0x100
[<c03c8eae>] process_backlog+0x8e/0x100
[<c03c90bc>] net_rx_action+0x13c/0x230
[<c03c8fd9>] ? net_rx_action+0x59/0x230
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c01078b1>] do_IRQ+0x41/0x80
[<c0155659>] ? trace_hardirqs_on+0xb9/0x130
[<c01059ca>] common_interrupt+0x2e/0x34
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 5 vs 5 S: 0 vs 3 w: 2044790889-2044796616 (0)
TCP wq(s) LLLLl<
TCP wq(h) +++h+<
l5 s3 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_input.c:1767 tcp_enter_frto+0x28c/0x2a0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0156244>] ? __lock_acquire+0x1e4/0x730
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c03f58dc>] tcp_enter_frto+0x28c/0x2a0
[<c03ff612>] tcp_retransmit_timer+0x102/0x400
[<c043675b>] ? _spin_lock+0x4b/0x80
[<c03ff924>] ? tcp_write_timer+0x14/0x110
[<c03ffa03>] tcp_write_timer+0xf3/0x110
[<c013b95b>] run_timer_softirq+0xbb/0x190
[<c03ff910>] ? tcp_write_timer+0x0/0x110
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c011a91d>] smp_apic_timer_interrupt+0x2d/0x40
[<c0105aab>] apic_timer_interrupt+0x33/0x38
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 0, comm: swapper Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c01317da>] ? print_oops_end_marker+0x2a/0x30
[<c0131849>] ? warn_on_slowpath+0x59/0x80
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c03f5748>] tcp_enter_frto+0xf8/0x2a0
[<c03ff612>] tcp_retransmit_timer+0x102/0x400
[<c043675b>] ? _spin_lock+0x4b/0x80
[<c03ff924>] ? tcp_write_timer+0x14/0x110
[<c03ffa03>] tcp_write_timer+0xf3/0x110
[<c013b95b>] run_timer_softirq+0xbb/0x190
[<c03ff910>] ? tcp_write_timer+0x0/0x110
[<c0136f63>] __do_softirq+0x93/0x120
[<c013706a>] do_softirq+0x7a/0x80
[<c0137135>] irq_exit+0x65/0x90
[<c011a91d>] smp_apic_timer_interrupt+0x2d/0x40
[<c0105aab>] apic_timer_interrupt+0x33/0x38
[<c0103390>] ? mwait_idle_with_hints+0x40/0x50
[<c01033a0>] ? mwait_idle+0x0/0x20
[<c01033b2>] mwait_idle+0x12/0x20
[<c0103141>] cpu_idle+0x61/0x110
[<c04339fd>] rest_init+0x5d/0x60
[<c05a47fa>] start_kernel+0x1fa/0x260
[<c05a4190>] ? unknown_bootoption+0x0/0x130
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 5 vs 5 S: 0 vs 3 w: 2044790889-2044796616 (0)
TCP wq(s) LLLLl<
TCP wq(h) +++h+<
l5 s3 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_output.c:1467 tcp_write_xmit+0x288/0x290()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 2987, comm: ssmtp Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0156244>] ? __lock_acquire+0x1e4/0x730
[<c0155567>] ? mark_held_locks+0x67/0x80
[<c03fd128>] tcp_write_xmit+0x288/0x290
[<c03fd147>] __tcp_push_pending_frames+0x17/0x80
[<c03f1130>] tcp_sendmsg+0x760/0xb40
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c03bb85c>] sock_sendmsg+0xdc/0x110
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0147420>] ? autoremove_wake_function+0x0/0x50
[<c0156244>] ? __lock_acquire+0x1e4/0x730
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c03bb5ff>] ? sockfd_lookup_light+0x2f/0x70
[<c03bcfe1>] sys_sendto+0xd1/0x120
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c015323d>] ? put_lock_stats+0xd/0x30
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c01413f1>] ? sys_times+0x81/0xe0
[<c03bd062>] sys_send+0x32/0x40
[<c03bd8e6>] sys_socketcall+0x136/0x230
[<c010501b>] ? restore_nocheck+0x12/0x15
[<c0104fba>] syscall_call+0x7/0xb
=======================
---[ end trace 14b601818e6903ac ]---
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 2987, comm: ssmtp Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c01317da>] ? print_oops_end_marker+0x2a/0x30
[<c0131849>] ? warn_on_slowpath+0x59/0x80
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0156244>] ? __lock_acquire+0x1e4/0x730
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c03fcf03>] tcp_write_xmit+0x63/0x290
[<c03fd147>] __tcp_push_pending_frames+0x17/0x80
[<c03f1130>] tcp_sendmsg+0x760/0xb40
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c03bb85c>] sock_sendmsg+0xdc/0x110
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0147420>] ? autoremove_wake_function+0x0/0x50
[<c0156244>] ? __lock_acquire+0x1e4/0x730
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c03bb5ff>] ? sockfd_lookup_light+0x2f/0x70
[<c03bcfe1>] sys_sendto+0xd1/0x120
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c015323d>] ? put_lock_stats+0xd/0x30
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c01413f1>] ? sys_times+0x81/0xe0
[<c03bd062>] sys_send+0x32/0x40
[<c03bd8e6>] sys_socketcall+0x136/0x230
[<c010501b>] ? restore_nocheck+0x12/0x15
[<c0104fba>] syscall_call+0x7/0xb
=======================
---[ end trace 14b601818e6903ac ]---
P: 5 L: 5 vs 5 S: 0 vs 3 w: 2044790889-2044796616 (0)
TCP wq(s) LLLLl<
TCP wq(h) +++h+<
l5 s3 f0 p5 seq: su2044790889 hs2044795029 sn2044796616
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_input.c:2855 tcp_clean_rtx_queue+0x552/0x5b0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 2987, comm: ssmtp Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c0186dbd>] ? check_object+0xad/0x1e0
[<c0155539>] ? mark_held_locks+0x39/0x80
[<c01880ac>] ? __slab_free+0xac/0x150
[<c015561c>] ? trace_hardirqs_on+0x7c/0x130
[<c03c1534>] ? kfree_skbmem+0x54/0xc0
[<c01881e7>] ? kmem_cache_free+0x97/0xe0
[<c03c1534>] ? kfree_skbmem+0x54/0xc0
[<c03c1534>] ? kfree_skbmem+0x54/0xc0
[<c03c1534>] ? kfree_skbmem+0x54/0xc0
[<c03f7782>] tcp_clean_rtx_queue+0x552/0x5b0
[<c03f7dd2>] tcp_ack+0x122/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0147420>] ? autoremove_wake_function+0x0/0x50
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c03f17e3>] tcp_prequeue_process+0x73/0xa0
[<c03f1dae>] tcp_recvmsg+0x42e/0x830
[<c03c0873>] sock_common_recvmsg+0x43/0x60
[<c03bbacf>] sock_recvmsg+0xef/0x120
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0147420>] ? autoremove_wake_function+0x0/0x50
[<c03bb5ff>] ? sockfd_lookup_light+0x2f/0x70
[<c03bd0f7>] sys_recvfrom+0x87/0xf0
[<c015323d>] ? put_lock_stats+0xd/0x30
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c015323d>] ? put_lock_stats+0xd/0x30
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c013601f>] ? do_setitimer+0x1ef/0x2e0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03bd192>] sys_recv+0x32/0x40
[<c03bd905>] sys_socketcall+0x155/0x230
[<c010501b>] ? restore_nocheck+0x12/0x15
[<c0104fba>] syscall_call+0x7/0xb
=======================
---[ end trace 14b601818e6903ac ]---
------------[ cut here ]------------
WARNING: at net/ipv4/tcp_ipv4.c:197 tcp_verify_wq+0x1b6/0x1c0()
Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss eeprom e100 psmouse
snd_hda_intel snd_pcm snd_timer btusb bluetooth serio_raw snd 3c59x sg
evdev thermal soundcore rtc_cmos snd_page_alloc rtc_core rtc_lib
i2c_i801 processor button intel_agp dcdbas pcspkr agpgart
Pid: 2987, comm: ssmtp Not tainted 2.6.24-rc8-mm1 #8
[<c0132100>] ? have_callable_console+0x20/0x30
[<c0131844>] warn_on_slowpath+0x54/0x80
[<c01317da>] ? print_oops_end_marker+0x2a/0x30
[<c0131849>] ? warn_on_slowpath+0x59/0x80
[<c0186dbd>] ? check_object+0xad/0x1e0
[<c0155539>] ? mark_held_locks+0x39/0x80
[<c01880ac>] ? __slab_free+0xac/0x150
[<c015561c>] ? trace_hardirqs_on+0x7c/0x130
[<c03c1534>] ? kfree_skbmem+0x54/0xc0
[<c0400096>] tcp_verify_wq+0x1b6/0x1c0
[<c01881e7>] ? kmem_cache_free+0x97/0xe0
[<c03c1534>] ? kfree_skbmem+0x54/0xc0
[<c03c1534>] ? kfree_skbmem+0x54/0xc0
[<c03f7509>] tcp_clean_rtx_queue+0x2d9/0x5b0
[<c03f7dd2>] tcp_ack+0x122/0x3a0
[<c03fa21b>] tcp_rcv_established+0x3eb/0x710
[<c0147420>] ? autoremove_wake_function+0x0/0x50
[<c0401c05>] tcp_v4_do_rcv+0xe5/0x100
[<c03f17e3>] tcp_prequeue_process+0x73/0xa0
[<c03f1dae>] tcp_recvmsg+0x42e/0x830
[<c03c0873>] sock_common_recvmsg+0x43/0x60
[<c03bbacf>] sock_recvmsg+0xef/0x120
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0154982>] ? validate_chain+0x1d2/0x320
[<c0147420>] ? autoremove_wake_function+0x0/0x50
[<c03bb5ff>] ? sockfd_lookup_light+0x2f/0x70
[<c03bd0f7>] sys_recvfrom+0x87/0xf0
[<c015323d>] ? put_lock_stats+0xd/0x30
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c010af95>] ? native_sched_clock+0x85/0xe0
[<c015323d>] ? put_lock_stats+0xd/0x30
[<c01532c0>] ? lock_release_holdtime+0x60/0x80
[<c013601f>] ? do_setitimer+0x1ef/0x2e0
[<c0156b97>] ? __lock_release+0x47/0x70
[<c03bd192>] sys_recv+0x32/0x40
[<c03bd905>] sys_socketcall+0x155/0x230
[<c010501b>] ? restore_nocheck+0x12/0x15
[<c0104fba>] syscall_call+0x7/0xb
=======================
---[ end trace 14b601818e6903ac ]---
P: 4 L: 4 vs 4 S: 0 vs 3 w: 2044792269-2044796616 (0)
TCP wq(s) LLLl<
TCP wq(h) ++h+<
l4 s3 f0 p4 seq: su2044792269 hs2044795029 sn2044796616
^ permalink raw reply
* Re: [PATCH 0/6] PS3: gelic: gelic updates for 2.6.25
From: John W. Linville @ 2008-01-24 2:36 UTC (permalink / raw)
To: Geoff Levand
Cc: Geert.Uytterhoeven, Paul Mackerras, Linux/PPC Development, netdev
In-Reply-To: <4796B0AC.5060205@am.sony.com>
On Tue, Jan 22, 2008 at 07:12:44PM -0800, Geoff Levand wrote:
> On 01/22/2008 04:58 PM, John W. Linville wrote:
> > I thought Geert's had been applied, but I guess I was looking at
> > it wrong. Is there a powerpc tree that has them?
>
> Not yet, they are now only in ps3-linux.git. I sent them out to
> Paul last Friday the 18th for inclusion in 2.6.25. Here is a link
> to the message:
>
> http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050213.html
>
> > Perhaps 1-6 above
> > and the wireless patch should just be applied to that tree (if there
> > is one) and all merged together?
>
> I think Paul will accept them if they have the Sign-off-by's of
> the proper network maintainers.
Feel free to add:
Signed-off-by: John W. Linville <linville@tuxdriver.com>
(Or Acked-by if you would prefer) to the wireless bits. FWIW, the
wired bits seemed OK to me as well, but I didn't look too closely...
Thanks,
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply
* Re: [PATCH] [POWERPC] Add fixed-phy support for fs_enet
From: Kumar Gala @ 2008-01-24 1:51 UTC (permalink / raw)
To: Jochen Friedrich
Cc: Kernel, Linux, linuxppc-dev, Paul Mackerras, netdev, Scott Wood,
Garzik, Jeff
In-Reply-To: <4767E677.7010200@scram.de>
On Tue, 18 Dec 2007, Jochen Friedrich wrote:
> This patch adds support to use the fixed-link property
> of an ethernet node to fs_enet for the
> CONFIG_PPC_CPM_NEW_BINDING case.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> Acked-by: Jeff Garzik <jeff@garzik.org>
> Acked-by: Vitali Bordug <vitb@kernel.crashing.org>
> ---
> drivers/net/fs_enet/fs_enet-main.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
applied.
- k
^ permalink raw reply
* Re: [PATCH] bluetooth : move children of connection device to NULL before connection down
From: Dave Young @ 2008-01-24 1:26 UTC (permalink / raw)
To: Andrew Morton
Cc: Marcel Holtmann, davem, netdev, linux-kernel, bluez-devel,
cornelia.huck, gombasg, htejun, viro, kay.sievers, greg
In-Reply-To: <20080124011926.GA2950@darkstar.te-china.tietoenator.com>
On Thu, Jan 24, 2008 at 09:19:26AM +0800, Dave Young wrote:
> On Wed, Jan 23, 2008 at 02:06:29PM -0800, Andrew Morton wrote:
> > > On Tue, 22 Jan 2008 07:18:16 +0100 Marcel Holtmann <marcel@holtmann.org> wrote:
> > > Hi Dave,
> > >
> > > > > Add people missed in cc-list.
> > > >
> > > > Thanks Dave for your continued efforts on Bluetooth bugs like this.
> > > >
> > > > Marcel, are you going to review/ACK/integrate/push-upstream/whatever
> > > > any of these Bluetooth patches?
> > > >
> > > > It hasn't been getting much love from you as of late, you are one of
> > > > the listed maintainers, and I don't want to lose any of Dave's
> > > > valuable bug fixing work.
> > >
> > > I will be fully back in business next week. Just got stuck in a project
> > > that needed 200% of my time to get it going.
> > >
> >
> > These patches in -mm:
> >
> > bluetooth-hidp_process_hid_control-remove-unnecessary-parameter-dealing.patch
> > bluetooth-uninlining.patch
> > drivers-bluetooth-bpa10xc-fix-memleak.patch
> > drivers-bluetooth-btsdioc-fix-double-free.patch
> > bluetooth-blacklist-another-broadcom-bcm2035-device.patch
> > bluetooth-rfcomm-tty_close-before-destruct.patch
> > hci_ldisc-fix-null-pointer-deref.patch
> >
> > could benefit from some attention please.
>
> Hi, andrew
>
> For the patch bluetooth-rfcomm-tty_close-before-destruct.patch I have to rethinkabout it.
>
> 1. The subject is not correct, should be rfcomm-tty-destroy-before-tty_close.
> 2. Don't know what I was thinking that time, could you replace it with the following better one? Sorry for that.
>
> ---
> rfcomm dev could be deleted in tty_hangup, so we must not call rfcomm_dev_del again to prevent from destroying rfcomm dev before tty close.
>
> Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
>
> ---
> net/bluetooth/rfcomm/tty.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff -upr a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
> --- a/net/bluetooth/rfcomm/tty.c 2008-01-24 09:03:59.000000000 +0800
> +++ b/net/bluetooth/rfcomm/tty.c 2008-01-24 09:03:59.000000000 +0800
> @@ -429,6 +429,8 @@ static int rfcomm_release_dev(void __use
> if (dev->tty)
> tty_vhangup(dev->tty);
>
> + if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
> + rfcomm_dev_del(dev);
> rfcomm_dev_del(dev);
~~~~~~~~~~~~~~~~~
> rfcomm_dev_put(dev);
> return 0;
Please ignore the previous silly one, now resubmit :
----------
rfcomm dev could be deleted in tty_hangup, so we must not call rfcomm_dev_del again to prevent from destroying rfcomm dev before tty close.
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
net/bluetooth/rfcomm/tty.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff -upr a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
--- a/net/bluetooth/rfcomm/tty.c 2008-01-24 09:21:56.000000000 +0800
+++ b/net/bluetooth/rfcomm/tty.c 2008-01-24 09:21:56.000000000 +0800
@@ -429,7 +429,8 @@ static int rfcomm_release_dev(void __use
if (dev->tty)
tty_vhangup(dev->tty);
- rfcomm_dev_del(dev);
+ if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
+ rfcomm_dev_del(dev);
rfcomm_dev_put(dev);
return 0;
}
^ permalink raw reply
* Re: [PATCH] bluetooth : move children of connection device to NULL before connection down
From: Dave Young @ 2008-01-24 1:19 UTC (permalink / raw)
To: Andrew Morton
Cc: Marcel Holtmann, davem, netdev, linux-kernel, bluez-devel,
cornelia.huck, gombasg, htejun, viro, kay.sievers, greg
In-Reply-To: <20080123140629.c24d4d68.akpm@linux-foundation.org>
On Wed, Jan 23, 2008 at 02:06:29PM -0800, Andrew Morton wrote:
> > On Tue, 22 Jan 2008 07:18:16 +0100 Marcel Holtmann <marcel@holtmann.org> wrote:
> > Hi Dave,
> >
> > > > Add people missed in cc-list.
> > >
> > > Thanks Dave for your continued efforts on Bluetooth bugs like this.
> > >
> > > Marcel, are you going to review/ACK/integrate/push-upstream/whatever
> > > any of these Bluetooth patches?
> > >
> > > It hasn't been getting much love from you as of late, you are one of
> > > the listed maintainers, and I don't want to lose any of Dave's
> > > valuable bug fixing work.
> >
> > I will be fully back in business next week. Just got stuck in a project
> > that needed 200% of my time to get it going.
> >
>
> These patches in -mm:
>
> bluetooth-hidp_process_hid_control-remove-unnecessary-parameter-dealing.patch
> bluetooth-uninlining.patch
> drivers-bluetooth-bpa10xc-fix-memleak.patch
> drivers-bluetooth-btsdioc-fix-double-free.patch
> bluetooth-blacklist-another-broadcom-bcm2035-device.patch
> bluetooth-rfcomm-tty_close-before-destruct.patch
> hci_ldisc-fix-null-pointer-deref.patch
>
> could benefit from some attention please.
Hi, andrew
For the patch bluetooth-rfcomm-tty_close-before-destruct.patch I have to rethinkabout it.
1. The subject is not correct, should be rfcomm-tty-destroy-before-tty_close.
2. Don't know what I was thinking that time, could you replace it with the following better one? Sorry for that.
---
rfcomm dev could be deleted in tty_hangup, so we must not call rfcomm_dev_del again to prevent from destroying rfcomm dev before tty close.
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
net/bluetooth/rfcomm/tty.c | 2 ++
1 file changed, 2 insertions(+)
diff -upr a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
--- a/net/bluetooth/rfcomm/tty.c 2008-01-24 09:03:59.000000000 +0800
+++ b/net/bluetooth/rfcomm/tty.c 2008-01-24 09:03:59.000000000 +0800
@@ -429,6 +429,8 @@ static int rfcomm_release_dev(void __use
if (dev->tty)
tty_vhangup(dev->tty);
+ if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
+ rfcomm_dev_del(dev);
rfcomm_dev_del(dev);
rfcomm_dev_put(dev);
return 0;
^ permalink raw reply
* Re: [IPV4 0/9] TRIE performance patches
From: Stephen Hemminger @ 2008-01-23 23:49 UTC (permalink / raw)
To: Robert Olsson; +Cc: David Miller, netdev
In-Reply-To: <18327.18935.137799.285515@robur.slu.se>
On Wed, 23 Jan 2008 15:06:47 +0100
Robert Olsson <Robert.Olsson@data.slu.se> wrote:
>
> Stephen Hemminger writes:
>
> > Time to handle a full BGP load (163K of routes).
> >
> > Before: Load Dump Flush
> >
> > kmem_cache 3.8 13.0 7.2
> > iter 3.9 12.3 6.9
> > unordered 3.1 11.9 4.9
> > find_node 3.1 0.3 1.2
>
> I certainly like the speed but what will we brake when
> we don't return in longest prefix order?
>
> labb:/# ip r
> default via 10.10.10.1 dev eth0
> 5.0.0.0/8 via 192.168.2.2 dev eth3
> 10.10.10.0/24 dev eth0 proto kernel scope link src 10.10.10.2
> 10.10.11.0/24 dev eth1 proto kernel scope link src 10.10.11.1
> 11.0.0.0/8 via 10.10.11.2 dev eth1
> 192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.2
> 192.168.2.0/24 dev eth3 proto kernel scope link src 192.168.2.1
>
> labb:/# ip route list match 10.10.10.1
> default via 10.10.10.1 dev eth0
> 10.10.10.0/24 dev eth0 proto kernel scope link src 10.10.10.2
> labb:/#
>
> Maybe the unordered dump can be ordered cheaply...
Dumping by prefix is possible, but unless 32x slower. Dumping in
address order is just as logical. Like I said, I'm investigating what
quagga handles.
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply
* [PATCH] ppp: sparse warning fixes
From: Stephen Hemminger @ 2008-01-23 23:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linux-ppp, netdev
Fix a bunch of warnings in PPP and related drivers. Mostly because
sparse doesn't like it when the the function is only marked private
in the forward declaration.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/ppp_deflate.c | 4 ++--
drivers/net/ppp_generic.c | 2 +-
drivers/net/ppp_synctty.c | 2 +-
drivers/net/pppoe.c | 2 ++
drivers/net/slhc.c | 4 ++--
5 files changed, 8 insertions(+), 6 deletions(-)
--- a/drivers/net/ppp_deflate.c 2008-01-23 15:35:22.000000000 -0800
+++ b/drivers/net/ppp_deflate.c 2008-01-23 15:35:40.000000000 -0800
@@ -206,7 +206,7 @@ static void z_comp_reset(void *arg)
* Returns the length of the compressed packet, or 0 if the
* packet is incompressible.
*/
-int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf,
+static int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf,
int isize, int osize)
{
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
@@ -435,7 +435,7 @@ static void z_decomp_reset(void *arg)
* bug, so we return DECOMP_FATALERROR for them in order to turn off
* compression, even though they are detected by inspecting the input.
*/
-int z_decompress(void *arg, unsigned char *ibuf, int isize,
+static int z_decompress(void *arg, unsigned char *ibuf, int isize,
unsigned char *obuf, int osize)
{
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
--- a/drivers/net/ppp_generic.c 2008-01-23 15:34:40.000000000 -0800
+++ b/drivers/net/ppp_generic.c 2008-01-23 15:34:45.000000000 -0800
@@ -1871,7 +1871,7 @@ ppp_mp_insert(struct ppp *ppp, struct sk
* complete packet, or we get to the sequence number for a fragment
* which hasn't arrived but might still do so.
*/
-struct sk_buff *
+static struct sk_buff *
ppp_mp_reconstruct(struct ppp *ppp)
{
u32 seq = ppp->nextseq;
--- a/drivers/net/ppp_synctty.c 2008-01-23 15:35:04.000000000 -0800
+++ b/drivers/net/ppp_synctty.c 2008-01-23 15:35:08.000000000 -0800
@@ -560,7 +560,7 @@ static void ppp_sync_process(unsigned lo
* Procedures for encapsulation and framing.
*/
-struct sk_buff*
+static struct sk_buff*
ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
{
int proto;
--- a/drivers/net/pppoe.c 2008-01-23 15:35:52.000000000 -0800
+++ b/drivers/net/pppoe.c 2008-01-23 15:36:16.000000000 -0800
@@ -989,6 +989,7 @@ out:
}
static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos)
+ __acquires(pppoe_hash_lock)
{
loff_t l = *pos;
@@ -1022,6 +1023,7 @@ out:
}
static void pppoe_seq_stop(struct seq_file *seq, void *v)
+ __releases(pppoe_hash_lock)
{
read_unlock_bh(&pppoe_hash_lock);
}
--- a/drivers/net/slhc.c 2008-01-23 15:36:45.000000000 -0800
+++ b/drivers/net/slhc.c 2008-01-23 15:37:22.000000000 -0800
@@ -174,7 +174,7 @@ put16(unsigned char *cp, unsigned short
/* Encode a number */
-unsigned char *
+static unsigned char *
encode(unsigned char *cp, unsigned short n)
{
if(n >= 256 || n == 0){
@@ -199,7 +199,7 @@ pull16(unsigned char **cpp)
}
/* Decode a number */
-long
+static long
decode(unsigned char **cpp)
{
register int x;
^ permalink raw reply
* [IPV4 3/5] fib_trie: dump doesnt use RCU
From: Stephen Hemminger @ 2008-01-23 22:48 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20080123224844.610730277@linux-foundation.org>
[-- Attachment #1: fib-dump-rtnl.patch --]
[-- Type: text/plain, Size: 3261 bytes --]
Since fib dump (via netlink) holds the RTNL mutex, it is unnecessary
to use RCU, and it is impossible to get truncated (-EBUSY) result.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/net/ipv4/fib_trie.c 2008-01-23 13:55:12.000000000 -0800
+++ b/net/ipv4/fib_trie.c 2008-01-23 14:00:35.000000000 -0800
@@ -1684,7 +1684,7 @@ static int trie_flush_leaf(struct trie *
* Scan for the next right leaf starting at node p->child[idx]
* Since we have back pointer, no recursion necessary.
*/
-static struct leaf *leaf_walk_rcu(struct tnode *p, struct node *c)
+static struct leaf *leaf_walk(struct tnode *p, struct node *c)
{
do {
t_key idx;
@@ -1695,7 +1695,7 @@ static struct leaf *leaf_walk_rcu(struct
idx = 0;
while (idx < 1u << p->bits) {
- c = tnode_get_child_rcu(p, idx++);
+ c = tnode_get_child(p, idx++);
if (!c)
continue;
@@ -1711,14 +1711,14 @@ static struct leaf *leaf_walk_rcu(struct
/* Node empty, walk back up to parent */
c = (struct node *) p;
- } while ( (p = node_parent_rcu(c)) != NULL);
+ } while ( (p = node_parent(c)) != NULL);
return NULL; /* Root of trie */
}
static struct leaf *trie_firstleaf(struct trie *t)
{
- struct tnode *n = (struct tnode *) rcu_dereference(t->trie);
+ struct tnode *n = (struct tnode *) t->trie;
if (!n)
return NULL;
@@ -1726,7 +1726,7 @@ static struct leaf *trie_firstleaf(struc
if (IS_LEAF(n)) /* trie is just a leaf */
return (struct leaf *) n;
- return leaf_walk_rcu(n, NULL);
+ return leaf_walk(n, NULL);
}
static struct leaf *trie_nextleaf(struct leaf *l)
@@ -1737,7 +1737,7 @@ static struct leaf *trie_nextleaf(struct
if (!p)
return NULL; /* trie with just one leaf */
- return leaf_walk_rcu(p, c);
+ return leaf_walk(p, c);
}
/*
@@ -1848,9 +1848,7 @@ static int fn_trie_dump_fa(t_key key, in
s_i = cb->args[4];
i = 0;
- /* rcu_read_lock is hold by caller */
-
- list_for_each_entry_rcu(fa, fah, fa_list) {
+ list_for_each_entry(fa, fah, fa_list) {
if (i < s_i) {
i++;
continue;
@@ -1885,8 +1883,7 @@ static int fn_trie_dump_leaf(struct leaf
s_i = cb->args[3];
i = 0;
- /* rcu_read_lock is hold by caller */
- hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
+ hlist_for_each_entry(li, node, &l->list, hlist) {
if (i < s_i) {
i++;
continue;
@@ -1916,35 +1913,25 @@ static int fn_trie_dump(struct fib_table
struct trie *t = (struct trie *) tb->tb_data;
t_key key = cb->args[2];
- rcu_read_lock();
+ ASSERT_RTNL();
+
/* Dump starting at last key.
* Note: 0.0.0.0/0 (ie default) is first key.
*/
if (!key)
l = trie_firstleaf(t);
- else {
+ else
l = fib_find_node(t, key);
- if (!l) {
- /* The table changed during the dump, rather than
- * giving partial data, just make application retry.
- */
- rcu_read_unlock();
- return -EBUSY;
- }
- }
while (l) {
cb->args[2] = l->key;
- if (fn_trie_dump_leaf(l, tb, skb, cb) < 0) {
- rcu_read_unlock();
+ if (fn_trie_dump_leaf(l, tb, skb, cb) < 0)
return -1;
- }
l = trie_nextleaf(l);
memset(&cb->args[3], 0,
sizeof(cb->args) - 3*sizeof(cb->args[0]));
}
- rcu_read_unlock();
return skb->len;
}
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply
* [IPV4 4/5] fib_trie: version 0.410
From: Stephen Hemminger @ 2008-01-23 22:48 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20080123224844.610730277@linux-foundation.org>
[-- Attachment #1: fib-trie-minor.patch --]
[-- Type: text/plain, Size: 450 bytes --]
Increase version to reflect recent changes.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/net/ipv4/fib_trie.c 2008-01-22 17:50:58.000000000 -0800
+++ b/net/ipv4/fib_trie.c 2008-01-22 17:51:02.000000000 -0800
@@ -50,7 +50,7 @@
* Patrick McHardy <kaber@trash.net>
*/
-#define VERSION "0.408"
+#define VERSION "0.410"
#include <asm/uaccess.h>
#include <asm/system.h>
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox