Commit 00778f7c authored by David S. Miller's avatar David S. Miller

Merge branch 'arcnet-fixes'

Michael Grzeschik says:

====================
arcnet: Collection of latest fixes

Here we sum up the recent fixes I collected on the way to use and
stabilise the framework. Part of it is an possible deadlock that we
prevent as well to fix the calculation of the dev_id that can be setup
by an rotary encoder. Beside that we added an trivial spelling patch and
fix some wrong and missing assignments that improves the code footprint.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents acb4b7df 2a0ea04c
...@@ -756,6 +756,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) ...@@ -756,6 +756,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct arcnet_local *lp; struct arcnet_local *lp;
int recbuf, status, diagstatus, didsomething, boguscount; int recbuf, status, diagstatus, didsomething, boguscount;
unsigned long flags;
int retval = IRQ_NONE; int retval = IRQ_NONE;
arc_printk(D_DURING, dev, "\n"); arc_printk(D_DURING, dev, "\n");
...@@ -765,7 +766,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) ...@@ -765,7 +766,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
lp = netdev_priv(dev); lp = netdev_priv(dev);
BUG_ON(!lp); BUG_ON(!lp);
spin_lock(&lp->lock); spin_lock_irqsave(&lp->lock, flags);
/* RESET flag was enabled - if device is not running, we must /* RESET flag was enabled - if device is not running, we must
* clear it right away (but nothing else). * clear it right away (but nothing else).
...@@ -774,7 +775,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) ...@@ -774,7 +775,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
if (lp->hw.status(dev) & RESETflag) if (lp->hw.status(dev) & RESETflag)
lp->hw.command(dev, CFLAGScmd | RESETclear); lp->hw.command(dev, CFLAGScmd | RESETclear);
lp->hw.intmask(dev, 0); lp->hw.intmask(dev, 0);
spin_unlock(&lp->lock); spin_unlock_irqrestore(&lp->lock, flags);
return retval; return retval;
} }
...@@ -998,7 +999,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) ...@@ -998,7 +999,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
udelay(1); udelay(1);
lp->hw.intmask(dev, lp->intmask); lp->hw.intmask(dev, lp->intmask);
spin_unlock(&lp->lock); spin_unlock_irqrestore(&lp->lock, flags);
return retval; return retval;
} }
EXPORT_SYMBOL(arcnet_interrupt); EXPORT_SYMBOL(arcnet_interrupt);
......
...@@ -212,7 +212,7 @@ static int ack_tx(struct net_device *dev, int acked) ...@@ -212,7 +212,7 @@ static int ack_tx(struct net_device *dev, int acked)
ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */ ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */
ackpkt->soft.cap.mes.ack = acked; ackpkt->soft.cap.mes.ack = acked;
arc_printk(D_PROTO, dev, "Ackknowledge for cap packet %x.\n", arc_printk(D_PROTO, dev, "Acknowledge for cap packet %x.\n",
*((int *)&ackpkt->soft.cap.cookie[0])); *((int *)&ackpkt->soft.cap.cookie[0]));
ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); ackskb->protocol = cpu_to_be16(ETH_P_ARCNET);
......
...@@ -135,6 +135,7 @@ static int com20020pci_probe(struct pci_dev *pdev, ...@@ -135,6 +135,7 @@ static int com20020pci_probe(struct pci_dev *pdev,
for (i = 0; i < ci->devcount; i++) { for (i = 0; i < ci->devcount; i++) {
struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i]; struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i];
struct com20020_dev *card; struct com20020_dev *card;
int dev_id_mask = 0xf;
dev = alloc_arcdev(device); dev = alloc_arcdev(device);
if (!dev) { if (!dev) {
...@@ -166,6 +167,7 @@ static int com20020pci_probe(struct pci_dev *pdev, ...@@ -166,6 +167,7 @@ static int com20020pci_probe(struct pci_dev *pdev,
arcnet_outb(0x00, ioaddr, COM20020_REG_W_COMMAND); arcnet_outb(0x00, ioaddr, COM20020_REG_W_COMMAND);
arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT); arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT);
SET_NETDEV_DEV(dev, &pdev->dev);
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
dev->dev_addr[0] = node; dev->dev_addr[0] = node;
dev->irq = pdev->irq; dev->irq = pdev->irq;
...@@ -179,8 +181,8 @@ static int com20020pci_probe(struct pci_dev *pdev, ...@@ -179,8 +181,8 @@ static int com20020pci_probe(struct pci_dev *pdev,
/* Get the dev_id from the PLX rotary coder */ /* Get the dev_id from the PLX rotary coder */
if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15)) if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15))
dev->dev_id = 0xc; dev_id_mask = 0x3;
dev->dev_id ^= inb(priv->misc + ci->rotary) >> 4; dev->dev_id = (inb(priv->misc + ci->rotary) >> 4) & dev_id_mask;
snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i); snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);
......
...@@ -246,8 +246,6 @@ int com20020_found(struct net_device *dev, int shared) ...@@ -246,8 +246,6 @@ int com20020_found(struct net_device *dev, int shared)
return -ENODEV; return -ENODEV;
} }
dev->base_addr = ioaddr;
arc_printk(D_NORMAL, dev, "%s: station %02Xh found at %03lXh, IRQ %d.\n", arc_printk(D_NORMAL, dev, "%s: station %02Xh found at %03lXh, IRQ %d.\n",
lp->card_name, dev->dev_addr[0], dev->base_addr, dev->irq); lp->card_name, dev->dev_addr[0], dev->base_addr, dev->irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment