Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (28 commits)
  drivers/isdn/hardware/mISDN: Use GFP_ATOMIC when a lock is held
  ksz884x: Add missing validate_addr hook
  ksz884x: convert to netdev_tx_t
  virtio-net: pass gfp to add_buf
  be2net: convert hdr.timeout in be_cmd_loopback_test() to le32
  can: mpc5xxx_can.c: Fix build failure
  net/ipv4/tcp_input.c: fix compilation breakage when FASTRETRANS_DEBUG > 1
  net: sock_queue_err_skb() dont mess with sk_forward_alloc
  netfilter: xtables: stackptr should be percpu
  netfilter: don't xt_jumpstack_alloc twice in xt_register_table
  greth: Fix build after OF device conversions.
  net: fix sk_forward_alloc corruptions
  Phonet: listening socket lock protects the connected socket list
  caif: unlock on error path in cfserl_receive()
  be2net: remove superfluous externs
  be2net: add unlock on error path
  net/rds: Add missing mutex_unlock
  drivers/isdn/hardware/mISDN: Add missing spin_unlock
  fs_enet: Adjust BDs after tx error
  skb: make skb_recycle_check() return a bool value
  ...
  • Loading branch information
Linus Torvalds committed Jun 1, 2010
2 parents e30c7c3 + b42d916 commit 076dab2
Show file tree
Hide file tree
Showing 29 changed files with 157 additions and 90 deletions.
4 changes: 3 additions & 1 deletion drivers/isdn/hardware/mISDN/hfcsusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ static int write_reg(struct hfcsusb *hw, __u8 reg, __u8 val)
hw->name, __func__, reg, val);

spin_lock(&hw->ctrl_lock);
if (hw->ctrl_cnt >= HFC_CTRL_BUFSIZE)
if (hw->ctrl_cnt >= HFC_CTRL_BUFSIZE) {
spin_unlock(&hw->ctrl_lock);
return 1;
}
buf = &hw->ctrl_buff[hw->ctrl_in_idx];
buf->hfcs_reg = reg;
buf->reg_val = val;
Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/hardware/mISDN/netjet.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,12 @@ inittiger(struct tiger_hw *card)
return -ENOMEM;
}
for (i = 0; i < 2; i++) {
card->bc[i].hsbuf = kmalloc(NJ_DMA_TXSIZE, GFP_KERNEL);
card->bc[i].hsbuf = kmalloc(NJ_DMA_TXSIZE, GFP_ATOMIC);
if (!card->bc[i].hsbuf) {
pr_info("%s: no B%d send buffer\n", card->name, i + 1);
return -ENOMEM;
}
card->bc[i].hrbuf = kmalloc(NJ_DMA_RXSIZE, GFP_KERNEL);
card->bc[i].hrbuf = kmalloc(NJ_DMA_RXSIZE, GFP_ATOMIC);
if (!card->bc[i].hrbuf) {
pr_info("%s: no B%d recv buffer\n", card->name, i + 1);
return -ENOMEM;
Expand Down
13 changes: 8 additions & 5 deletions drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
wrb = wrb_from_mccq(adapter);
if (!wrb) {
status = -EBUSY;
goto err;
goto err_unlock;
}
req = cmd->va;
sge = nonembedded_sgl(wrb);
Expand Down Expand Up @@ -1457,7 +1457,10 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
else
status = adapter->flash_status;

err:
return status;

err_unlock:
spin_unlock_bh(&adapter->mcc_lock);
return status;
}

Expand Down Expand Up @@ -1497,7 +1500,7 @@ int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
return status;
}

extern int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
struct be_dma_mem *nonemb_cmd)
{
struct be_mcc_wrb *wrb;
Expand Down Expand Up @@ -1590,7 +1593,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,

be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL,
OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req));
req->hdr.timeout = 4;
req->hdr.timeout = cpu_to_le32(4);

req->pattern = cpu_to_le64(pattern);
req->src_port = cpu_to_le32(port_num);
Expand Down Expand Up @@ -1662,7 +1665,7 @@ int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern,
return status;
}

extern int be_cmd_get_seeprom_data(struct be_adapter *adapter,
int be_cmd_get_seeprom_data(struct be_adapter *adapter,
struct be_dma_mem *nonemb_cmd)
{
struct be_mcc_wrb *wrb;
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/can/mscan/mpc5xxx_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static u32 __devinit mpc52xx_can_get_clock(struct of_device *ofdev,
else
*mscan_clksrc = MSCAN_CLKSRC_XTAL;

freq = mpc5xxx_get_bus_frequency(ofdev->node);
freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node);
if (!freq)
return 0;

Expand Down Expand Up @@ -152,7 +152,7 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev,
}

/* Determine the MSCAN device index from the physical address */
pval = of_get_property(ofdev->node, "reg", &plen);
pval = of_get_property(ofdev->dev.of_node, "reg", &plen);
BUG_ON(!pval || plen < sizeof(*pval));
clockidx = (*pval & 0x80) ? 1 : 0;
if (*pval & 0x2000)
Expand All @@ -168,11 +168,11 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev,
*/
if (clock_name && !strcmp(clock_name, "ip")) {
*mscan_clksrc = MSCAN_CLKSRC_IPS;
freq = mpc5xxx_get_bus_frequency(ofdev->node);
freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node);
} else {
*mscan_clksrc = MSCAN_CLKSRC_BUS;

pval = of_get_property(ofdev->node,
pval = of_get_property(ofdev->dev.of_node,
"fsl,mscan-clock-divider", &plen);
if (pval && plen == sizeof(*pval))
clockdiv = *pval;
Expand Down Expand Up @@ -251,7 +251,7 @@ static int __devinit mpc5xxx_can_probe(struct of_device *ofdev,
const struct of_device_id *id)
{
struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data;
struct device_node *np = ofdev->node;
struct device_node *np = ofdev->dev.of_node;
struct net_device *dev;
struct mscan_priv *priv;
void __iomem *base;
Expand Down
49 changes: 43 additions & 6 deletions drivers/net/fs_enet/mac-fcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,17 +504,54 @@ static int get_regs_len(struct net_device *dev)
}

/* Some transmit errors cause the transmitter to shut
* down. We now issue a restart transmit. Since the
* errors close the BD and update the pointers, the restart
* _should_ pick up without having to reset any of our
* pointers either. Also, To workaround 8260 device erratum
* CPM37, we must disable and then re-enable the transmitter
* following a Late Collision, Underrun, or Retry Limit error.
* down. We now issue a restart transmit.
* Also, to workaround 8260 device erratum CPM37, we must
* disable and then re-enable the transmitterfollowing a
* Late Collision, Underrun, or Retry Limit error.
* In addition, tbptr may point beyond BDs beyond still marked
* as ready due to internal pipelining, so we need to look back
* through the BDs and adjust tbptr to point to the last BD
* marked as ready. This may result in some buffers being
* retransmitted.
*/
static void tx_restart(struct net_device *dev)
{
struct fs_enet_private *fep = netdev_priv(dev);
fcc_t __iomem *fccp = fep->fcc.fccp;
const struct fs_platform_info *fpi = fep->fpi;
fcc_enet_t __iomem *ep = fep->fcc.ep;
cbd_t __iomem *curr_tbptr;
cbd_t __iomem *recheck_bd;
cbd_t __iomem *prev_bd;
cbd_t __iomem *last_tx_bd;

last_tx_bd = fep->tx_bd_base + (fpi->tx_ring * sizeof(cbd_t));

/* get the current bd held in TBPTR and scan back from this point */
recheck_bd = curr_tbptr = (cbd_t __iomem *)
((R32(ep, fen_genfcc.fcc_tbptr) - fep->ring_mem_addr) +
fep->ring_base);

prev_bd = (recheck_bd == fep->tx_bd_base) ? last_tx_bd : recheck_bd - 1;

/* Move through the bds in reverse, look for the earliest buffer
* that is not ready. Adjust TBPTR to the following buffer */
while ((CBDR_SC(prev_bd) & BD_ENET_TX_READY) != 0) {
/* Go back one buffer */
recheck_bd = prev_bd;

/* update the previous buffer */
prev_bd = (prev_bd == fep->tx_bd_base) ? last_tx_bd : prev_bd - 1;

/* We should never see all bds marked as ready, check anyway */
if (recheck_bd == curr_tbptr)
break;
}
/* Now update the TBPTR and dirty flag to the current buffer */
W32(ep, fen_genfcc.fcc_tbptr,
(uint) (((void *)recheck_bd - fep->ring_base) +
fep->ring_mem_addr));
fep->dirty_tx = recheck_bd;

C32(fccp, fcc_gfmr, FCC_GFMR_ENT);
udelay(10);
Expand Down
11 changes: 5 additions & 6 deletions drivers/net/greth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1607,14 +1607,13 @@ static struct of_device_id greth_of_match[] = {
MODULE_DEVICE_TABLE(of, greth_of_match);

static struct of_platform_driver greth_of_driver = {
.name = "grlib-greth",
.match_table = greth_of_match,
.driver = {
.name = "grlib-greth",
.owner = THIS_MODULE,
.of_match_table = greth_of_match,
},
.probe = greth_of_probe,
.remove = __devexit_p(greth_of_remove),
.driver = {
.owner = THIS_MODULE,
.name = "grlib-greth",
},
};

static int __init greth_init(void)
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ksz884x.c
Original file line number Diff line number Diff line change
Expand Up @@ -4854,7 +4854,7 @@ static inline void copy_old_skb(struct sk_buff *old, struct sk_buff *skb)
*
* Return 0 if successful; otherwise an error code indicating failure.
*/
static int netdev_tx(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
{
struct dev_priv *priv = netdev_priv(dev);
struct dev_info *hw_priv = priv->adapter;
Expand Down Expand Up @@ -6863,6 +6863,7 @@ static const struct net_device_ops netdev_ops = {
.ndo_tx_timeout = netdev_tx_timeout,
.ndo_change_mtu = netdev_change_mtu,
.ndo_set_mac_address = netdev_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_do_ioctl = netdev_ioctl,
.ndo_set_rx_mode = netdev_set_rx_mode,
#ifdef CONFIG_NET_POLL_CONTROLLER
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp)

skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len);

err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 2, skb);
err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 2, skb, gfp);
if (err < 0)
dev_kfree_skb(skb);

Expand Down Expand Up @@ -385,8 +385,8 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp)

/* chain first in list head */
first->private = (unsigned long)list;
err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
first);
err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
first, gfp);
if (err < 0)
give_pages(vi, first);

Expand All @@ -404,7 +404,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp)

sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE);

err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 1, page);
err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 1, page, gfp);
if (err < 0)
give_pages(vi, page);

Expand Down
14 changes: 12 additions & 2 deletions drivers/net/wireless/ath/ar9170/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,17 +739,27 @@ static int ar9170_usb_init_device(struct ar9170_usb *aru)
static void ar9170_usb_firmware_failed(struct ar9170_usb *aru)
{
struct device *parent = aru->udev->dev.parent;
struct usb_device *udev;

/*
* Store a copy of the usb_device pointer locally.
* This is because device_release_driver initiates
* ar9170_usb_disconnect, which in turn frees our
* driver context (aru).
*/
udev = aru->udev;

complete(&aru->firmware_loading_complete);

/* unbind anything failed */
if (parent)
device_lock(parent);
device_release_driver(&aru->udev->dev);

device_release_driver(&udev->dev);
if (parent)
device_unlock(parent);

usb_put_dev(aru->udev);
usb_put_dev(udev);
}

static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context)
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
int r;

ath_print(common, ATH_DBG_FATAL,
"Unable to stop TxDMA. Reset HAL!\n");
"Failed to stop TX DMA. Resetting hardware!\n");

spin_lock_bh(&sc->sc_resetlock);
r = ath9k_hw_reset(ah, sc->sc_ah->curchan, false);
Expand Down Expand Up @@ -1728,6 +1728,8 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
} else
bf->bf_isnullfunc = false;

bf->bf_tx_aborted = false;

return 0;
}

Expand Down Expand Up @@ -1989,7 +1991,7 @@ static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf,
int nbad = 0;
int isaggr = 0;

if (bf->bf_tx_aborted)
if (bf->bf_lastbf->bf_tx_aborted)
return 0;

isaggr = bf_isaggr(bf);
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/wireless/libertas/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,8 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
/* create the exported radio header */

/* radiotap header */
radiotap_hdr.hdr.it_version = 0;
/* XXX must check this value for pad */
radiotap_hdr.hdr.it_pad = 0;
memset(&radiotap_hdr, 0, sizeof(radiotap_hdr));
/* XXX must check radiotap_hdr.hdr.it_pad for pad */
radiotap_hdr.hdr.it_len = cpu_to_le16 (sizeof(struct rx_radiotap_hdr));
radiotap_hdr.hdr.it_present = cpu_to_le32 (RX_RADIOTAP_PRESENT);
radiotap_hdr.rate = convert_mv_rate_to_radiotap(prxpd->rx_rate);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt2800usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
*/
rt2x00_desc_read(txi, 0, &word);
rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN,
skb->len - TXINFO_DESC_SIZE);
skb->len + TXWI_DESC_SIZE);
rt2x00_set_field32(&word, TXINFO_W0_WIV,
!test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags));
rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2);
Expand Down
9 changes: 6 additions & 3 deletions drivers/ssb/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,12 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
ssb_printk(KERN_ERR PFX "No SPROM available!\n");
return -ENODEV;
}

bus->sprom_offset = (bus->chipco.dev->id.revision < 31) ?
SSB_SPROM_BASE1 : SSB_SPROM_BASE31;
if (bus->chipco.dev) { /* can be unavailible! */
bus->sprom_offset = (bus->chipco.dev->id.revision < 31) ?
SSB_SPROM_BASE1 : SSB_SPROM_BASE31;
} else {
bus->sprom_offset = SSB_SPROM_BASE1;
}

buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL);
if (!buf)
Expand Down
1 change: 1 addition & 0 deletions drivers/ssb/sprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ bool ssb_is_sprom_available(struct ssb_bus *bus)
/* this routine differs from specs as we do not access SPROM directly
on PCMCIA */
if (bus->bustype == SSB_BUSTYPE_PCI &&
bus->chipco.dev && /* can be unavailible! */
bus->chipco.dev->id.revision >= 31)
return bus->chipco.capabilities & SSB_CHIPCO_CAP_SPROM;

Expand Down
2 changes: 1 addition & 1 deletion include/linux/netfilter/x_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ struct xt_table_info {
* @stacksize jumps (number of user chains) can possibly be made.
*/
unsigned int stacksize;
unsigned int *stackptr;
unsigned int __percpu *stackptr;
void ***jumpstack;
/* ipt_entry tables: one per CPU */
/* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */
Expand Down
2 changes: 1 addition & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
return __alloc_skb(size, priority, 1, -1);
}

extern int skb_recycle_check(struct sk_buff *skb, int skb_size);
extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);

extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
extern struct sk_buff *skb_clone(struct sk_buff *skb,
Expand Down
15 changes: 1 addition & 14 deletions include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -1524,20 +1524,7 @@ extern void sk_stop_timer(struct sock *sk, struct timer_list* timer);

extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);

static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
{
/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
number of warnings when compiling with -W --ANK
*/
if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
(unsigned)sk->sk_rcvbuf)
return -ENOMEM;
skb_set_owner_r(skb, sk);
skb_queue_tail(&sk->sk_error_queue, skb);
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_data_ready(sk, skb->len);
return 0;
}
extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb);

/*
* Recover an error report and clear atomically
Expand Down
Loading

0 comments on commit 076dab2

Please sign in to comment.