diff options
| author | David S. Miller <davem@davemloft.net> | 2017-06-29 15:18:38 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-06-29 15:18:38 -0400 |
| commit | 00778f7cadd393630a23e83ffaf60b70fe460879 (patch) | |
| tree | 71d298b46dea34756a8273467111f39de854d373 | |
| parent | acb4b7df48b539cb391287921de57e4e5fae3460 (diff) | |
| parent | 2a0ea04c83ab82c3852c9171d2fa5cd9a1432c9b (diff) | |
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: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/arcnet/arcnet.c | 7 | ||||
| -rw-r--r-- | drivers/net/arcnet/capmode.c | 2 | ||||
| -rw-r--r-- | drivers/net/arcnet/com20020-pci.c | 6 | ||||
| -rw-r--r-- | drivers/net/arcnet/com20020.c | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index 62ee439d5882..53a1cb551def 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
| @@ -756,6 +756,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
| 756 | struct net_device *dev = dev_id; | 756 | struct net_device *dev = dev_id; |
| 757 | struct arcnet_local *lp; | 757 | struct arcnet_local *lp; |
| 758 | int recbuf, status, diagstatus, didsomething, boguscount; | 758 | int recbuf, status, diagstatus, didsomething, boguscount; |
| 759 | unsigned long flags; | ||
| 759 | int retval = IRQ_NONE; | 760 | int retval = IRQ_NONE; |
| 760 | 761 | ||
| 761 | arc_printk(D_DURING, dev, "\n"); | 762 | arc_printk(D_DURING, dev, "\n"); |
| @@ -765,7 +766,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
| 765 | lp = netdev_priv(dev); | 766 | lp = netdev_priv(dev); |
| 766 | BUG_ON(!lp); | 767 | BUG_ON(!lp); |
| 767 | 768 | ||
| 768 | spin_lock(&lp->lock); | 769 | spin_lock_irqsave(&lp->lock, flags); |
| 769 | 770 | ||
| 770 | /* RESET flag was enabled - if device is not running, we must | 771 | /* RESET flag was enabled - if device is not running, we must |
| 771 | * clear it right away (but nothing else). | 772 | * clear it right away (but nothing else). |
| @@ -774,7 +775,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
| 774 | if (lp->hw.status(dev) & RESETflag) | 775 | if (lp->hw.status(dev) & RESETflag) |
| 775 | lp->hw.command(dev, CFLAGScmd | RESETclear); | 776 | lp->hw.command(dev, CFLAGScmd | RESETclear); |
| 776 | lp->hw.intmask(dev, 0); | 777 | lp->hw.intmask(dev, 0); |
| 777 | spin_unlock(&lp->lock); | 778 | spin_unlock_irqrestore(&lp->lock, flags); |
| 778 | return retval; | 779 | return retval; |
| 779 | } | 780 | } |
| 780 | 781 | ||
| @@ -998,7 +999,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
| 998 | udelay(1); | 999 | udelay(1); |
| 999 | lp->hw.intmask(dev, lp->intmask); | 1000 | lp->hw.intmask(dev, lp->intmask); |
| 1000 | 1001 | ||
| 1001 | spin_unlock(&lp->lock); | 1002 | spin_unlock_irqrestore(&lp->lock, flags); |
| 1002 | return retval; | 1003 | return retval; |
| 1003 | } | 1004 | } |
| 1004 | EXPORT_SYMBOL(arcnet_interrupt); | 1005 | EXPORT_SYMBOL(arcnet_interrupt); |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index 2056878fb087..4fa2e46b48d3 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
| @@ -212,7 +212,7 @@ static int ack_tx(struct net_device *dev, int acked) | |||
| 212 | ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */ | 212 | ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */ |
| 213 | ackpkt->soft.cap.mes.ack = acked; | 213 | ackpkt->soft.cap.mes.ack = acked; |
| 214 | 214 | ||
| 215 | arc_printk(D_PROTO, dev, "Ackknowledge for cap packet %x.\n", | 215 | arc_printk(D_PROTO, dev, "Acknowledge for cap packet %x.\n", |
| 216 | *((int *)&ackpkt->soft.cap.cookie[0])); | 216 | *((int *)&ackpkt->soft.cap.cookie[0])); |
| 217 | 217 | ||
| 218 | ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); | 218 | ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); |
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c index 239de38fbd6a..47f80b83dcf4 100644 --- a/drivers/net/arcnet/com20020-pci.c +++ b/drivers/net/arcnet/com20020-pci.c | |||
| @@ -135,6 +135,7 @@ static int com20020pci_probe(struct pci_dev *pdev, | |||
| 135 | for (i = 0; i < ci->devcount; i++) { | 135 | for (i = 0; i < ci->devcount; i++) { |
| 136 | struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i]; | 136 | struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i]; |
| 137 | struct com20020_dev *card; | 137 | struct com20020_dev *card; |
| 138 | int dev_id_mask = 0xf; | ||
| 138 | 139 | ||
| 139 | dev = alloc_arcdev(device); | 140 | dev = alloc_arcdev(device); |
| 140 | if (!dev) { | 141 | if (!dev) { |
| @@ -166,6 +167,7 @@ static int com20020pci_probe(struct pci_dev *pdev, | |||
| 166 | arcnet_outb(0x00, ioaddr, COM20020_REG_W_COMMAND); | 167 | arcnet_outb(0x00, ioaddr, COM20020_REG_W_COMMAND); |
| 167 | arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT); | 168 | arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT); |
| 168 | 169 | ||
| 170 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
| 169 | dev->base_addr = ioaddr; | 171 | dev->base_addr = ioaddr; |
| 170 | dev->dev_addr[0] = node; | 172 | dev->dev_addr[0] = node; |
| 171 | dev->irq = pdev->irq; | 173 | dev->irq = pdev->irq; |
| @@ -179,8 +181,8 @@ static int com20020pci_probe(struct pci_dev *pdev, | |||
| 179 | 181 | ||
| 180 | /* Get the dev_id from the PLX rotary coder */ | 182 | /* Get the dev_id from the PLX rotary coder */ |
| 181 | if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15)) | 183 | if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15)) |
| 182 | dev->dev_id = 0xc; | 184 | dev_id_mask = 0x3; |
| 183 | dev->dev_id ^= inb(priv->misc + ci->rotary) >> 4; | 185 | dev->dev_id = (inb(priv->misc + ci->rotary) >> 4) & dev_id_mask; |
| 184 | 186 | ||
| 185 | snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i); | 187 | snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i); |
| 186 | 188 | ||
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c index 13d9ad4b3f5c..78043a9c5981 100644 --- a/drivers/net/arcnet/com20020.c +++ b/drivers/net/arcnet/com20020.c | |||
| @@ -246,8 +246,6 @@ int com20020_found(struct net_device *dev, int shared) | |||
| 246 | return -ENODEV; | 246 | return -ENODEV; |
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | dev->base_addr = ioaddr; | ||
| 250 | |||
| 251 | arc_printk(D_NORMAL, dev, "%s: station %02Xh found at %03lXh, IRQ %d.\n", | 249 | arc_printk(D_NORMAL, dev, "%s: station %02Xh found at %03lXh, IRQ %d.\n", |
| 252 | lp->card_name, dev->dev_addr[0], dev->base_addr, dev->irq); | 250 | lp->card_name, dev->dev_addr[0], dev->base_addr, dev->irq); |
| 253 | 251 | ||
