diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-10-25 21:48:18 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-25 21:48:18 -0400 |
commit | 6253195b671b98a4e5da5d39c2df9f8f257bcea1 (patch) | |
tree | 3b7ca1d8ef5d9c50a77abf1d1cf5b2b5aa243284 /drivers | |
parent | 15893fb565921507da80e500d85bb2575989bb57 (diff) | |
parent | 60339fad5c68c9c533cd14e67194ff8f727c41d9 (diff) |
Merge branch 'sh/stable-updates'
Conflicts:
arch/sh/kernel/dwarf.c
Diffstat (limited to 'drivers')
40 files changed, 376 insertions, 229 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index b1a257746a19..a06f5d6375a8 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -575,7 +575,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
575 | { PCI_VDEVICE(ATI, 0x4395), board_ahci_sb700 }, /* ATI SB700/800 */ | 575 | { PCI_VDEVICE(ATI, 0x4395), board_ahci_sb700 }, /* ATI SB700/800 */ |
576 | 576 | ||
577 | /* AMD */ | 577 | /* AMD */ |
578 | { PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD SB900 */ | 578 | { PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */ |
579 | /* AMD is using RAID class only for ahci controllers */ | 579 | /* AMD is using RAID class only for ahci controllers */ |
580 | { PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 580 | { PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
581 | PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci }, | 581 | PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci }, |
@@ -605,6 +605,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
605 | { PCI_VDEVICE(NVIDIA, 0x0559), board_ahci_yesncq }, /* MCP67 */ | 605 | { PCI_VDEVICE(NVIDIA, 0x0559), board_ahci_yesncq }, /* MCP67 */ |
606 | { PCI_VDEVICE(NVIDIA, 0x055a), board_ahci_yesncq }, /* MCP67 */ | 606 | { PCI_VDEVICE(NVIDIA, 0x055a), board_ahci_yesncq }, /* MCP67 */ |
607 | { PCI_VDEVICE(NVIDIA, 0x055b), board_ahci_yesncq }, /* MCP67 */ | 607 | { PCI_VDEVICE(NVIDIA, 0x055b), board_ahci_yesncq }, /* MCP67 */ |
608 | { PCI_VDEVICE(NVIDIA, 0x0580), board_ahci_yesncq }, /* Linux ID */ | ||
608 | { PCI_VDEVICE(NVIDIA, 0x07f0), board_ahci_yesncq }, /* MCP73 */ | 609 | { PCI_VDEVICE(NVIDIA, 0x07f0), board_ahci_yesncq }, /* MCP73 */ |
609 | { PCI_VDEVICE(NVIDIA, 0x07f1), board_ahci_yesncq }, /* MCP73 */ | 610 | { PCI_VDEVICE(NVIDIA, 0x07f1), board_ahci_yesncq }, /* MCP73 */ |
610 | { PCI_VDEVICE(NVIDIA, 0x07f2), board_ahci_yesncq }, /* MCP73 */ | 611 | { PCI_VDEVICE(NVIDIA, 0x07f2), board_ahci_yesncq }, /* MCP73 */ |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index b525a0981348..d7f0f1b1ae3e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -5028,12 +5028,14 @@ void ata_qc_complete(struct ata_queued_cmd *qc) | |||
5028 | qc->flags |= ATA_QCFLAG_FAILED; | 5028 | qc->flags |= ATA_QCFLAG_FAILED; |
5029 | 5029 | ||
5030 | if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { | 5030 | if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { |
5031 | if (!ata_tag_internal(qc->tag)) { | 5031 | /* always fill result TF for failed qc */ |
5032 | /* always fill result TF for failed qc */ | 5032 | fill_result_tf(qc); |
5033 | fill_result_tf(qc); | 5033 | |
5034 | if (!ata_tag_internal(qc->tag)) | ||
5034 | ata_qc_schedule_eh(qc); | 5035 | ata_qc_schedule_eh(qc); |
5035 | return; | 5036 | else |
5036 | } | 5037 | __ata_qc_complete(qc); |
5038 | return; | ||
5037 | } | 5039 | } |
5038 | 5040 | ||
5039 | WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); | 5041 | WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 0a97822da211..bba2ae5df1c2 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2981,12 +2981,14 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link, | |||
2981 | * device detection messages backwards. | 2981 | * device detection messages backwards. |
2982 | */ | 2982 | */ |
2983 | ata_for_each_dev(dev, link, ALL) { | 2983 | ata_for_each_dev(dev, link, ALL) { |
2984 | if (!(new_mask & (1 << dev->devno)) || | 2984 | if (!(new_mask & (1 << dev->devno))) |
2985 | dev->class == ATA_DEV_PMP) | ||
2986 | continue; | 2985 | continue; |
2987 | 2986 | ||
2988 | dev->class = ehc->classes[dev->devno]; | 2987 | dev->class = ehc->classes[dev->devno]; |
2989 | 2988 | ||
2989 | if (dev->class == ATA_DEV_PMP) | ||
2990 | continue; | ||
2991 | |||
2990 | ehc->i.flags |= ATA_EHI_PRINTINFO; | 2992 | ehc->i.flags |= ATA_EHI_PRINTINFO; |
2991 | rc = ata_dev_configure(dev); | 2993 | rc = ata_dev_configure(dev); |
2992 | ehc->i.flags &= ~ATA_EHI_PRINTINFO; | 2994 | ehc->i.flags &= ~ATA_EHI_PRINTINFO; |
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c index aa4b3f6ae771..ae4454d4e955 100644 --- a/drivers/ata/pata_atiixp.c +++ b/drivers/ata/pata_atiixp.c | |||
@@ -246,7 +246,7 @@ static const struct pci_device_id atiixp[] = { | |||
246 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), }, | 246 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), }, |
247 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), }, | 247 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), }, |
248 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP700_IDE), }, | 248 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP700_IDE), }, |
249 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_SB900_IDE), }, | 249 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_HUDSON2_IDE), }, |
250 | 250 | ||
251 | { }, | 251 | { }, |
252 | }; | 252 | }; |
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c index f49814d6fd2e..3bbed8322ecf 100644 --- a/drivers/ata/pata_sc1200.c +++ b/drivers/ata/pata_sc1200.c | |||
@@ -235,8 +235,7 @@ static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
235 | .udma_mask = ATA_UDMA2, | 235 | .udma_mask = ATA_UDMA2, |
236 | .port_ops = &sc1200_port_ops | 236 | .port_ops = &sc1200_port_ops |
237 | }; | 237 | }; |
238 | /* Can't enable port 2 yet, see top comments */ | 238 | const struct ata_port_info *ppi[] = { &info, NULL }; |
239 | const struct ata_port_info *ppi[] = { &info, }; | ||
240 | 239 | ||
241 | return ata_pci_sff_init_one(dev, ppi, &sc1200_sht, NULL); | 240 | return ata_pci_sff_init_one(dev, ppi, &sc1200_sht, NULL); |
242 | } | 241 | } |
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 45657cacec43..88984b803d6d 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -111,7 +111,7 @@ static const struct via_isa_bridge { | |||
111 | { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 111 | { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
112 | { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA }, | 112 | { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA }, |
113 | { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES }, | 113 | { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES }, |
114 | { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES }, | 114 | { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0xff, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES }, |
115 | { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 115 | { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
116 | { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 116 | { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
117 | { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 117 | { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 17f9ff9067a2..6f5093b7c8c5 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -1382,6 +1382,25 @@ static int mv_qc_defer(struct ata_queued_cmd *qc) | |||
1382 | */ | 1382 | */ |
1383 | if (pp->pp_flags & MV_PP_FLAG_DELAYED_EH) | 1383 | if (pp->pp_flags & MV_PP_FLAG_DELAYED_EH) |
1384 | return ATA_DEFER_PORT; | 1384 | return ATA_DEFER_PORT; |
1385 | |||
1386 | /* PIO commands need exclusive link: no other commands [DMA or PIO] | ||
1387 | * can run concurrently. | ||
1388 | * set excl_link when we want to send a PIO command in DMA mode | ||
1389 | * or a non-NCQ command in NCQ mode. | ||
1390 | * When we receive a command from that link, and there are no | ||
1391 | * outstanding commands, mark a flag to clear excl_link and let | ||
1392 | * the command go through. | ||
1393 | */ | ||
1394 | if (unlikely(ap->excl_link)) { | ||
1395 | if (link == ap->excl_link) { | ||
1396 | if (ap->nr_active_links) | ||
1397 | return ATA_DEFER_PORT; | ||
1398 | qc->flags |= ATA_QCFLAG_CLEAR_EXCL; | ||
1399 | return 0; | ||
1400 | } else | ||
1401 | return ATA_DEFER_PORT; | ||
1402 | } | ||
1403 | |||
1385 | /* | 1404 | /* |
1386 | * If the port is completely idle, then allow the new qc. | 1405 | * If the port is completely idle, then allow the new qc. |
1387 | */ | 1406 | */ |
@@ -1395,8 +1414,14 @@ static int mv_qc_defer(struct ata_queued_cmd *qc) | |||
1395 | * doesn't allow it. | 1414 | * doesn't allow it. |
1396 | */ | 1415 | */ |
1397 | if ((pp->pp_flags & MV_PP_FLAG_EDMA_EN) && | 1416 | if ((pp->pp_flags & MV_PP_FLAG_EDMA_EN) && |
1398 | (pp->pp_flags & MV_PP_FLAG_NCQ_EN) && ata_is_ncq(qc->tf.protocol)) | 1417 | (pp->pp_flags & MV_PP_FLAG_NCQ_EN)) { |
1399 | return 0; | 1418 | if (ata_is_ncq(qc->tf.protocol)) |
1419 | return 0; | ||
1420 | else { | ||
1421 | ap->excl_link = link; | ||
1422 | return ATA_DEFER_PORT; | ||
1423 | } | ||
1424 | } | ||
1400 | 1425 | ||
1401 | return ATA_DEFER_PORT; | 1426 | return ATA_DEFER_PORT; |
1402 | } | 1427 | } |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 86a40582999c..1eb4e020eb5c 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -1594,9 +1594,21 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class, | |||
1594 | !ata_dev_enabled(link->device)) | 1594 | !ata_dev_enabled(link->device)) |
1595 | sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, | 1595 | sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, |
1596 | NULL, NULL); | 1596 | NULL, NULL); |
1597 | else if (!(ehc->i.flags & ATA_EHI_QUIET)) | 1597 | else { |
1598 | ata_link_printk(link, KERN_INFO, | 1598 | const unsigned long *timing = sata_ehc_deb_timing(ehc); |
1599 | "nv: skipping hardreset on occupied port\n"); | 1599 | int rc; |
1600 | |||
1601 | if (!(ehc->i.flags & ATA_EHI_QUIET)) | ||
1602 | ata_link_printk(link, KERN_INFO, "nv: skipping " | ||
1603 | "hardreset on occupied port\n"); | ||
1604 | |||
1605 | /* make sure the link is online */ | ||
1606 | rc = sata_link_resume(link, timing, deadline); | ||
1607 | /* whine about phy resume failure but proceed */ | ||
1608 | if (rc && rc != -EOPNOTSUPP) | ||
1609 | ata_link_printk(link, KERN_WARNING, "failed to resume " | ||
1610 | "link (errno=%d)\n", rc); | ||
1611 | } | ||
1600 | 1612 | ||
1601 | /* device signature acquisition is unreliable */ | 1613 | /* device signature acquisition is unreliable */ |
1602 | return -EAGAIN; | 1614 | return -EAGAIN; |
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 43f19389647a..51042f0ba7e1 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
@@ -3,7 +3,6 @@ | |||
3 | #include <linux/blkdev.h> | 3 | #include <linux/blkdev.h> |
4 | #include <linux/hdreg.h> | 4 | #include <linux/hdreg.h> |
5 | #include <linux/virtio.h> | 5 | #include <linux/virtio.h> |
6 | #include <linux/virtio_ids.h> | ||
7 | #include <linux/virtio_blk.h> | 6 | #include <linux/virtio_blk.h> |
8 | #include <linux/scatterlist.h> | 7 | #include <linux/scatterlist.h> |
9 | 8 | ||
@@ -183,34 +182,6 @@ static void do_virtblk_request(struct request_queue *q) | |||
183 | vblk->vq->vq_ops->kick(vblk->vq); | 182 | vblk->vq->vq_ops->kick(vblk->vq); |
184 | } | 183 | } |
185 | 184 | ||
186 | /* return ATA identify data | ||
187 | */ | ||
188 | static int virtblk_identify(struct gendisk *disk, void *argp) | ||
189 | { | ||
190 | struct virtio_blk *vblk = disk->private_data; | ||
191 | void *opaque; | ||
192 | int err = -ENOMEM; | ||
193 | |||
194 | opaque = kmalloc(VIRTIO_BLK_ID_BYTES, GFP_KERNEL); | ||
195 | if (!opaque) | ||
196 | goto out; | ||
197 | |||
198 | err = virtio_config_buf(vblk->vdev, VIRTIO_BLK_F_IDENTIFY, | ||
199 | offsetof(struct virtio_blk_config, identify), opaque, | ||
200 | VIRTIO_BLK_ID_BYTES); | ||
201 | |||
202 | if (err) | ||
203 | goto out_kfree; | ||
204 | |||
205 | if (copy_to_user(argp, opaque, VIRTIO_BLK_ID_BYTES)) | ||
206 | err = -EFAULT; | ||
207 | |||
208 | out_kfree: | ||
209 | kfree(opaque); | ||
210 | out: | ||
211 | return err; | ||
212 | } | ||
213 | |||
214 | static void virtblk_prepare_flush(struct request_queue *q, struct request *req) | 185 | static void virtblk_prepare_flush(struct request_queue *q, struct request *req) |
215 | { | 186 | { |
216 | req->cmd_type = REQ_TYPE_LINUX_BLOCK; | 187 | req->cmd_type = REQ_TYPE_LINUX_BLOCK; |
@@ -222,10 +193,6 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode, | |||
222 | { | 193 | { |
223 | struct gendisk *disk = bdev->bd_disk; | 194 | struct gendisk *disk = bdev->bd_disk; |
224 | struct virtio_blk *vblk = disk->private_data; | 195 | struct virtio_blk *vblk = disk->private_data; |
225 | void __user *argp = (void __user *)data; | ||
226 | |||
227 | if (cmd == HDIO_GET_IDENTITY) | ||
228 | return virtblk_identify(disk, argp); | ||
229 | 196 | ||
230 | /* | 197 | /* |
231 | * Only allow the generic SCSI ioctls if the host can support it. | 198 | * Only allow the generic SCSI ioctls if the host can support it. |
@@ -233,7 +200,8 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode, | |||
233 | if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI)) | 200 | if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI)) |
234 | return -ENOTTY; | 201 | return -ENOTTY; |
235 | 202 | ||
236 | return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp); | 203 | return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, |
204 | (void __user *)data); | ||
237 | } | 205 | } |
238 | 206 | ||
239 | /* We provide getgeo only to please some old bootloader/partitioning tools */ | 207 | /* We provide getgeo only to please some old bootloader/partitioning tools */ |
@@ -332,7 +300,6 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) | |||
332 | } | 300 | } |
333 | 301 | ||
334 | vblk->disk->queue->queuedata = vblk; | 302 | vblk->disk->queue->queuedata = vblk; |
335 | queue_flag_set_unlocked(QUEUE_FLAG_VIRT, vblk->disk->queue); | ||
336 | 303 | ||
337 | if (index < 26) { | 304 | if (index < 26) { |
338 | sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26); | 305 | sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26); |
@@ -445,7 +412,7 @@ static struct virtio_device_id id_table[] = { | |||
445 | static unsigned int features[] = { | 412 | static unsigned int features[] = { |
446 | VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, | 413 | VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, |
447 | VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, | 414 | VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, |
448 | VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY, VIRTIO_BLK_F_FLUSH | 415 | VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_FLUSH |
449 | }; | 416 | }; |
450 | 417 | ||
451 | /* | 418 | /* |
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index 962968f05b94..915157fcff98 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/scatterlist.h> | 21 | #include <linux/scatterlist.h> |
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <linux/virtio.h> | 23 | #include <linux/virtio.h> |
24 | #include <linux/virtio_ids.h> | ||
25 | #include <linux/virtio_rng.h> | 24 | #include <linux/virtio_rng.h> |
26 | 25 | ||
27 | /* The host will fill any buffer we give it with sweet, sweet randomness. We | 26 | /* The host will fill any buffer we give it with sweet, sweet randomness. We |
@@ -117,7 +116,7 @@ static int virtrng_probe(struct virtio_device *vdev) | |||
117 | return 0; | 116 | return 0; |
118 | } | 117 | } |
119 | 118 | ||
120 | static void virtrng_remove(struct virtio_device *vdev) | 119 | static void __devexit virtrng_remove(struct virtio_device *vdev) |
121 | { | 120 | { |
122 | vdev->config->reset(vdev); | 121 | vdev->config->reset(vdev); |
123 | hwrng_unregister(&virtio_hwrng); | 122 | hwrng_unregister(&virtio_hwrng); |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 0d328b59568d..a035ae39a359 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/err.h> | 31 | #include <linux/err.h> |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/virtio.h> | 33 | #include <linux/virtio.h> |
34 | #include <linux/virtio_ids.h> | ||
35 | #include <linux/virtio_console.h> | 34 | #include <linux/virtio_console.h> |
36 | #include "hvc_console.h" | 35 | #include "hvc_console.h" |
37 | 36 | ||
diff --git a/drivers/crypto/padlock-sha.c b/drivers/crypto/padlock-sha.c index 76cb6b345e7b..0af80577dc7b 100644 --- a/drivers/crypto/padlock-sha.c +++ b/drivers/crypto/padlock-sha.c | |||
@@ -24,6 +24,12 @@ | |||
24 | #include <asm/i387.h> | 24 | #include <asm/i387.h> |
25 | #include "padlock.h" | 25 | #include "padlock.h" |
26 | 26 | ||
27 | #ifdef CONFIG_64BIT | ||
28 | #define STACK_ALIGN 16 | ||
29 | #else | ||
30 | #define STACK_ALIGN 4 | ||
31 | #endif | ||
32 | |||
27 | struct padlock_sha_desc { | 33 | struct padlock_sha_desc { |
28 | struct shash_desc fallback; | 34 | struct shash_desc fallback; |
29 | }; | 35 | }; |
@@ -64,7 +70,9 @@ static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in, | |||
64 | /* We can't store directly to *out as it may be unaligned. */ | 70 | /* We can't store directly to *out as it may be unaligned. */ |
65 | /* BTW Don't reduce the buffer size below 128 Bytes! | 71 | /* BTW Don't reduce the buffer size below 128 Bytes! |
66 | * PadLock microcode needs it that big. */ | 72 | * PadLock microcode needs it that big. */ |
67 | char result[128] __attribute__ ((aligned(PADLOCK_ALIGNMENT))); | 73 | char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] __attribute__ |
74 | ((aligned(STACK_ALIGN))); | ||
75 | char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT); | ||
68 | struct padlock_sha_desc *dctx = shash_desc_ctx(desc); | 76 | struct padlock_sha_desc *dctx = shash_desc_ctx(desc); |
69 | struct sha1_state state; | 77 | struct sha1_state state; |
70 | unsigned int space; | 78 | unsigned int space; |
@@ -128,7 +136,9 @@ static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in, | |||
128 | /* We can't store directly to *out as it may be unaligned. */ | 136 | /* We can't store directly to *out as it may be unaligned. */ |
129 | /* BTW Don't reduce the buffer size below 128 Bytes! | 137 | /* BTW Don't reduce the buffer size below 128 Bytes! |
130 | * PadLock microcode needs it that big. */ | 138 | * PadLock microcode needs it that big. */ |
131 | char result[128] __attribute__ ((aligned(PADLOCK_ALIGNMENT))); | 139 | char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] __attribute__ |
140 | ((aligned(STACK_ALIGN))); | ||
141 | char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT); | ||
132 | struct padlock_sha_desc *dctx = shash_desc_ctx(desc); | 142 | struct padlock_sha_desc *dctx = shash_desc_ctx(desc); |
133 | struct sha256_state state; | 143 | struct sha256_state state; |
134 | unsigned int space; | 144 | unsigned int space; |
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 4f4ac82382f7..d4560d9d5a83 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -1122,7 +1122,7 @@ static void k8_read_dram_base_limit(struct amd64_pvt *pvt, int dram) | |||
1122 | debugf0("Reading K8_DRAM_BASE_LOW failed\n"); | 1122 | debugf0("Reading K8_DRAM_BASE_LOW failed\n"); |
1123 | 1123 | ||
1124 | /* Extract parts into separate data entries */ | 1124 | /* Extract parts into separate data entries */ |
1125 | pvt->dram_base[dram] = ((u64) low & 0xFFFF0000) << 24; | 1125 | pvt->dram_base[dram] = ((u64) low & 0xFFFF0000) << 8; |
1126 | pvt->dram_IntlvEn[dram] = (low >> 8) & 0x7; | 1126 | pvt->dram_IntlvEn[dram] = (low >> 8) & 0x7; |
1127 | pvt->dram_rw_en[dram] = (low & 0x3); | 1127 | pvt->dram_rw_en[dram] = (low & 0x3); |
1128 | 1128 | ||
@@ -1135,7 +1135,7 @@ static void k8_read_dram_base_limit(struct amd64_pvt *pvt, int dram) | |||
1135 | * Extract parts into separate data entries. Limit is the HIGHEST memory | 1135 | * Extract parts into separate data entries. Limit is the HIGHEST memory |
1136 | * location of the region, so lower 24 bits need to be all ones | 1136 | * location of the region, so lower 24 bits need to be all ones |
1137 | */ | 1137 | */ |
1138 | pvt->dram_limit[dram] = (((u64) low & 0xFFFF0000) << 24) | 0x00FFFFFF; | 1138 | pvt->dram_limit[dram] = (((u64) low & 0xFFFF0000) << 8) | 0x00FFFFFF; |
1139 | pvt->dram_IntlvSel[dram] = (low >> 8) & 0x7; | 1139 | pvt->dram_IntlvSel[dram] = (low >> 8) & 0x7; |
1140 | pvt->dram_DstNode[dram] = (low & 0x7); | 1140 | pvt->dram_DstNode[dram] = (low & 0x7); |
1141 | } | 1141 | } |
@@ -1369,7 +1369,7 @@ static void f10_read_dram_base_limit(struct amd64_pvt *pvt, int dram) | |||
1369 | pvt->dram_IntlvEn[dram] = (low_base >> 8) & 0x7; | 1369 | pvt->dram_IntlvEn[dram] = (low_base >> 8) & 0x7; |
1370 | 1370 | ||
1371 | pvt->dram_base[dram] = (((u64)high_base & 0x000000FF) << 40) | | 1371 | pvt->dram_base[dram] = (((u64)high_base & 0x000000FF) << 40) | |
1372 | (((u64)low_base & 0xFFFF0000) << 24); | 1372 | (((u64)low_base & 0xFFFF0000) << 8); |
1373 | 1373 | ||
1374 | low_offset = K8_DRAM_LIMIT_LOW + (dram << 3); | 1374 | low_offset = K8_DRAM_LIMIT_LOW + (dram << 3); |
1375 | high_offset = F10_DRAM_LIMIT_HIGH + (dram << 3); | 1375 | high_offset = F10_DRAM_LIMIT_HIGH + (dram << 3); |
@@ -1391,7 +1391,7 @@ static void f10_read_dram_base_limit(struct amd64_pvt *pvt, int dram) | |||
1391 | * memory location of the region, so low 24 bits need to be all ones. | 1391 | * memory location of the region, so low 24 bits need to be all ones. |
1392 | */ | 1392 | */ |
1393 | pvt->dram_limit[dram] = (((u64)high_limit & 0x000000FF) << 40) | | 1393 | pvt->dram_limit[dram] = (((u64)high_limit & 0x000000FF) << 40) | |
1394 | (((u64) low_limit & 0xFFFF0000) << 24) | | 1394 | (((u64) low_limit & 0xFFFF0000) << 8) | |
1395 | 0x00FFFFFF; | 1395 | 0x00FFFFFF; |
1396 | } | 1396 | } |
1397 | 1397 | ||
diff --git a/drivers/ide/atiixp.c b/drivers/ide/atiixp.c index 6396c3ad3252..837322b10a4c 100644 --- a/drivers/ide/atiixp.c +++ b/drivers/ide/atiixp.c | |||
@@ -177,7 +177,7 @@ static const struct pci_device_id atiixp_pci_tbl[] = { | |||
177 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), 0 }, | 177 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), 0 }, |
178 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), 1 }, | 178 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), 1 }, |
179 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP700_IDE), 0 }, | 179 | { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP700_IDE), 0 }, |
180 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_SB900_IDE), 0 }, | 180 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_HUDSON2_IDE), 0 }, |
181 | { 0, }, | 181 | { 0, }, |
182 | }; | 182 | }; |
183 | MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); | 183 | MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); |
diff --git a/drivers/input/input.c b/drivers/input/input.c index c6f88ebb40c7..cc763c96fada 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -782,10 +782,29 @@ static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait) | |||
782 | return 0; | 782 | return 0; |
783 | } | 783 | } |
784 | 784 | ||
785 | union input_seq_state { | ||
786 | struct { | ||
787 | unsigned short pos; | ||
788 | bool mutex_acquired; | ||
789 | }; | ||
790 | void *p; | ||
791 | }; | ||
792 | |||
785 | static void *input_devices_seq_start(struct seq_file *seq, loff_t *pos) | 793 | static void *input_devices_seq_start(struct seq_file *seq, loff_t *pos) |
786 | { | 794 | { |
787 | if (mutex_lock_interruptible(&input_mutex)) | 795 | union input_seq_state *state = (union input_seq_state *)&seq->private; |
788 | return NULL; | 796 | int error; |
797 | |||
798 | /* We need to fit into seq->private pointer */ | ||
799 | BUILD_BUG_ON(sizeof(union input_seq_state) != sizeof(seq->private)); | ||
800 | |||
801 | error = mutex_lock_interruptible(&input_mutex); | ||
802 | if (error) { | ||
803 | state->mutex_acquired = false; | ||
804 | return ERR_PTR(error); | ||
805 | } | ||
806 | |||
807 | state->mutex_acquired = true; | ||
789 | 808 | ||
790 | return seq_list_start(&input_dev_list, *pos); | 809 | return seq_list_start(&input_dev_list, *pos); |
791 | } | 810 | } |
@@ -795,9 +814,12 @@ static void *input_devices_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
795 | return seq_list_next(v, &input_dev_list, pos); | 814 | return seq_list_next(v, &input_dev_list, pos); |
796 | } | 815 | } |
797 | 816 | ||
798 | static void input_devices_seq_stop(struct seq_file *seq, void *v) | 817 | static void input_seq_stop(struct seq_file *seq, void *v) |
799 | { | 818 | { |
800 | mutex_unlock(&input_mutex); | 819 | union input_seq_state *state = (union input_seq_state *)&seq->private; |
820 | |||
821 | if (state->mutex_acquired) | ||
822 | mutex_unlock(&input_mutex); | ||
801 | } | 823 | } |
802 | 824 | ||
803 | static void input_seq_print_bitmap(struct seq_file *seq, const char *name, | 825 | static void input_seq_print_bitmap(struct seq_file *seq, const char *name, |
@@ -861,7 +883,7 @@ static int input_devices_seq_show(struct seq_file *seq, void *v) | |||
861 | static const struct seq_operations input_devices_seq_ops = { | 883 | static const struct seq_operations input_devices_seq_ops = { |
862 | .start = input_devices_seq_start, | 884 | .start = input_devices_seq_start, |
863 | .next = input_devices_seq_next, | 885 | .next = input_devices_seq_next, |
864 | .stop = input_devices_seq_stop, | 886 | .stop = input_seq_stop, |
865 | .show = input_devices_seq_show, | 887 | .show = input_devices_seq_show, |
866 | }; | 888 | }; |
867 | 889 | ||
@@ -881,40 +903,49 @@ static const struct file_operations input_devices_fileops = { | |||
881 | 903 | ||
882 | static void *input_handlers_seq_start(struct seq_file *seq, loff_t *pos) | 904 | static void *input_handlers_seq_start(struct seq_file *seq, loff_t *pos) |
883 | { | 905 | { |
884 | if (mutex_lock_interruptible(&input_mutex)) | 906 | union input_seq_state *state = (union input_seq_state *)&seq->private; |
885 | return NULL; | 907 | int error; |
908 | |||
909 | /* We need to fit into seq->private pointer */ | ||
910 | BUILD_BUG_ON(sizeof(union input_seq_state) != sizeof(seq->private)); | ||
911 | |||
912 | error = mutex_lock_interruptible(&input_mutex); | ||
913 | if (error) { | ||
914 | state->mutex_acquired = false; | ||
915 | return ERR_PTR(error); | ||
916 | } | ||
917 | |||
918 | state->mutex_acquired = true; | ||
919 | state->pos = *pos; | ||
886 | 920 | ||
887 | seq->private = (void *)(unsigned long)*pos; | ||
888 | return seq_list_start(&input_handler_list, *pos); | 921 | return seq_list_start(&input_handler_list, *pos); |
889 | } | 922 | } |
890 | 923 | ||
891 | static void *input_handlers_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 924 | static void *input_handlers_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
892 | { | 925 | { |
893 | seq->private = (void *)(unsigned long)(*pos + 1); | 926 | union input_seq_state *state = (union input_seq_state *)&seq->private; |
894 | return seq_list_next(v, &input_handler_list, pos); | ||
895 | } | ||
896 | 927 | ||
897 | static void input_handlers_seq_stop(struct seq_file *seq, void *v) | 928 | state->pos = *pos + 1; |
898 | { | 929 | return seq_list_next(v, &input_handler_list, pos); |
899 | mutex_unlock(&input_mutex); | ||
900 | } | 930 | } |
901 | 931 | ||
902 | static int input_handlers_seq_show(struct seq_file *seq, void *v) | 932 | static int input_handlers_seq_show(struct seq_file *seq, void *v) |
903 | { | 933 | { |
904 | struct input_handler *handler = container_of(v, struct input_handler, node); | 934 | struct input_handler *handler = container_of(v, struct input_handler, node); |
935 | union input_seq_state *state = (union input_seq_state *)&seq->private; | ||
905 | 936 | ||
906 | seq_printf(seq, "N: Number=%ld Name=%s", | 937 | seq_printf(seq, "N: Number=%u Name=%s", state->pos, handler->name); |
907 | (unsigned long)seq->private, handler->name); | ||
908 | if (handler->fops) | 938 | if (handler->fops) |
909 | seq_printf(seq, " Minor=%d", handler->minor); | 939 | seq_printf(seq, " Minor=%d", handler->minor); |
910 | seq_putc(seq, '\n'); | 940 | seq_putc(seq, '\n'); |
911 | 941 | ||
912 | return 0; | 942 | return 0; |
913 | } | 943 | } |
944 | |||
914 | static const struct seq_operations input_handlers_seq_ops = { | 945 | static const struct seq_operations input_handlers_seq_ops = { |
915 | .start = input_handlers_seq_start, | 946 | .start = input_handlers_seq_start, |
916 | .next = input_handlers_seq_next, | 947 | .next = input_handlers_seq_next, |
917 | .stop = input_handlers_seq_stop, | 948 | .stop = input_seq_stop, |
918 | .show = input_handlers_seq_show, | 949 | .show = input_handlers_seq_show, |
919 | }; | 950 | }; |
920 | 951 | ||
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 4709e15af607..a6512372c7a3 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -574,11 +574,22 @@ static void atkbd_event_work(struct work_struct *work) | |||
574 | 574 | ||
575 | mutex_lock(&atkbd->event_mutex); | 575 | mutex_lock(&atkbd->event_mutex); |
576 | 576 | ||
577 | if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) | 577 | if (!atkbd->enabled) { |
578 | atkbd_set_leds(atkbd); | 578 | /* |
579 | * Serio ports are resumed asynchronously so while driver core | ||
580 | * thinks that device is already fully operational in reality | ||
581 | * it may not be ready yet. In this case we need to keep | ||
582 | * rescheduling till reconnect completes. | ||
583 | */ | ||
584 | schedule_delayed_work(&atkbd->event_work, | ||
585 | msecs_to_jiffies(100)); | ||
586 | } else { | ||
587 | if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) | ||
588 | atkbd_set_leds(atkbd); | ||
579 | 589 | ||
580 | if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) | 590 | if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) |
581 | atkbd_set_repeat_rate(atkbd); | 591 | atkbd_set_repeat_rate(atkbd); |
592 | } | ||
582 | 593 | ||
583 | mutex_unlock(&atkbd->event_mutex); | 594 | mutex_unlock(&atkbd->event_mutex); |
584 | } | 595 | } |
@@ -770,6 +781,30 @@ static int atkbd_select_set(struct atkbd *atkbd, int target_set, int allow_extra | |||
770 | return 3; | 781 | return 3; |
771 | } | 782 | } |
772 | 783 | ||
784 | static int atkbd_reset_state(struct atkbd *atkbd) | ||
785 | { | ||
786 | struct ps2dev *ps2dev = &atkbd->ps2dev; | ||
787 | unsigned char param[1]; | ||
788 | |||
789 | /* | ||
790 | * Set the LEDs to a predefined state (all off). | ||
791 | */ | ||
792 | |||
793 | param[0] = 0; | ||
794 | if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) | ||
795 | return -1; | ||
796 | |||
797 | /* | ||
798 | * Set autorepeat to fastest possible. | ||
799 | */ | ||
800 | |||
801 | param[0] = 0; | ||
802 | if (ps2_command(ps2dev, param, ATKBD_CMD_SETREP)) | ||
803 | return -1; | ||
804 | |||
805 | return 0; | ||
806 | } | ||
807 | |||
773 | static int atkbd_activate(struct atkbd *atkbd) | 808 | static int atkbd_activate(struct atkbd *atkbd) |
774 | { | 809 | { |
775 | struct ps2dev *ps2dev = &atkbd->ps2dev; | 810 | struct ps2dev *ps2dev = &atkbd->ps2dev; |
@@ -852,29 +887,6 @@ static unsigned int atkbd_hp_forced_release_keys[] = { | |||
852 | }; | 887 | }; |
853 | 888 | ||
854 | /* | 889 | /* |
855 | * Inventec system with broken key release on volume keys | ||
856 | */ | ||
857 | static unsigned int atkbd_inventec_forced_release_keys[] = { | ||
858 | 0xae, 0xb0, -1U | ||
859 | }; | ||
860 | |||
861 | /* | ||
862 | * Perform fixup for HP Pavilion ZV6100 laptop that doesn't generate release | ||
863 | * for its volume buttons | ||
864 | */ | ||
865 | static unsigned int atkbd_hp_zv6100_forced_release_keys[] = { | ||
866 | 0xae, 0xb0, -1U | ||
867 | }; | ||
868 | |||
869 | /* | ||
870 | * Perform fixup for HP (Compaq) Presario R4000 R4100 R4200 that don't generate | ||
871 | * release for their volume buttons | ||
872 | */ | ||
873 | static unsigned int atkbd_hp_r4000_forced_release_keys[] = { | ||
874 | 0xae, 0xb0, -1U | ||
875 | }; | ||
876 | |||
877 | /* | ||
878 | * Samsung NC10,NC20 with Fn+F? key release not working | 890 | * Samsung NC10,NC20 with Fn+F? key release not working |
879 | */ | 891 | */ |
880 | static unsigned int atkbd_samsung_forced_release_keys[] = { | 892 | static unsigned int atkbd_samsung_forced_release_keys[] = { |
@@ -882,14 +894,6 @@ static unsigned int atkbd_samsung_forced_release_keys[] = { | |||
882 | }; | 894 | }; |
883 | 895 | ||
884 | /* | 896 | /* |
885 | * The volume up and volume down special keys on a Fujitsu Amilo PA 1510 laptop | ||
886 | * do not generate release events so we have to do it ourselves. | ||
887 | */ | ||
888 | static unsigned int atkbd_amilo_pa1510_forced_release_keys[] = { | ||
889 | 0xb0, 0xae, -1U | ||
890 | }; | ||
891 | |||
892 | /* | ||
893 | * Amilo Pi 3525 key release for Fn+Volume keys not working | 897 | * Amilo Pi 3525 key release for Fn+Volume keys not working |
894 | */ | 898 | */ |
895 | static unsigned int atkbd_amilo_pi3525_forced_release_keys[] = { | 899 | static unsigned int atkbd_amilo_pi3525_forced_release_keys[] = { |
@@ -911,6 +915,14 @@ static unsigned int atkdb_soltech_ta12_forced_release_keys[] = { | |||
911 | }; | 915 | }; |
912 | 916 | ||
913 | /* | 917 | /* |
918 | * Many notebooks don't send key release event for volume up/down | ||
919 | * keys, with key list below common among them | ||
920 | */ | ||
921 | static unsigned int atkbd_volume_forced_release_keys[] = { | ||
922 | 0xae, 0xb0, -1U | ||
923 | }; | ||
924 | |||
925 | /* | ||
914 | * atkbd_set_keycode_table() initializes keyboard's keycode table | 926 | * atkbd_set_keycode_table() initializes keyboard's keycode table |
915 | * according to the selected scancode set | 927 | * according to the selected scancode set |
916 | */ | 928 | */ |
@@ -1087,6 +1099,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) | |||
1087 | } | 1099 | } |
1088 | 1100 | ||
1089 | atkbd->set = atkbd_select_set(atkbd, atkbd_set, atkbd_extra); | 1101 | atkbd->set = atkbd_select_set(atkbd, atkbd_set, atkbd_extra); |
1102 | atkbd_reset_state(atkbd); | ||
1090 | atkbd_activate(atkbd); | 1103 | atkbd_activate(atkbd); |
1091 | 1104 | ||
1092 | } else { | 1105 | } else { |
@@ -1267,6 +1280,7 @@ static ssize_t atkbd_set_extra(struct atkbd *atkbd, const char *buf, size_t coun | |||
1267 | 1280 | ||
1268 | atkbd->dev = new_dev; | 1281 | atkbd->dev = new_dev; |
1269 | atkbd->set = atkbd_select_set(atkbd, atkbd->set, value); | 1282 | atkbd->set = atkbd_select_set(atkbd, atkbd->set, value); |
1283 | atkbd_reset_state(atkbd); | ||
1270 | atkbd_activate(atkbd); | 1284 | atkbd_activate(atkbd); |
1271 | atkbd_set_keycode_table(atkbd); | 1285 | atkbd_set_keycode_table(atkbd); |
1272 | atkbd_set_device_attrs(atkbd); | 1286 | atkbd_set_device_attrs(atkbd); |
@@ -1548,7 +1562,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1548 | DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion ZV6100"), | 1562 | DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion ZV6100"), |
1549 | }, | 1563 | }, |
1550 | .callback = atkbd_setup_forced_release, | 1564 | .callback = atkbd_setup_forced_release, |
1551 | .driver_data = atkbd_hp_zv6100_forced_release_keys, | 1565 | .driver_data = atkbd_volume_forced_release_keys, |
1552 | }, | 1566 | }, |
1553 | { | 1567 | { |
1554 | .ident = "HP Presario R4000", | 1568 | .ident = "HP Presario R4000", |
@@ -1557,7 +1571,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1557 | DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4000"), | 1571 | DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4000"), |
1558 | }, | 1572 | }, |
1559 | .callback = atkbd_setup_forced_release, | 1573 | .callback = atkbd_setup_forced_release, |
1560 | .driver_data = atkbd_hp_r4000_forced_release_keys, | 1574 | .driver_data = atkbd_volume_forced_release_keys, |
1561 | }, | 1575 | }, |
1562 | { | 1576 | { |
1563 | .ident = "HP Presario R4100", | 1577 | .ident = "HP Presario R4100", |
@@ -1566,7 +1580,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1566 | DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4100"), | 1580 | DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4100"), |
1567 | }, | 1581 | }, |
1568 | .callback = atkbd_setup_forced_release, | 1582 | .callback = atkbd_setup_forced_release, |
1569 | .driver_data = atkbd_hp_r4000_forced_release_keys, | 1583 | .driver_data = atkbd_volume_forced_release_keys, |
1570 | }, | 1584 | }, |
1571 | { | 1585 | { |
1572 | .ident = "HP Presario R4200", | 1586 | .ident = "HP Presario R4200", |
@@ -1575,7 +1589,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1575 | DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4200"), | 1589 | DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4200"), |
1576 | }, | 1590 | }, |
1577 | .callback = atkbd_setup_forced_release, | 1591 | .callback = atkbd_setup_forced_release, |
1578 | .driver_data = atkbd_hp_r4000_forced_release_keys, | 1592 | .driver_data = atkbd_volume_forced_release_keys, |
1579 | }, | 1593 | }, |
1580 | { | 1594 | { |
1581 | .ident = "Inventec Symphony", | 1595 | .ident = "Inventec Symphony", |
@@ -1584,7 +1598,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1584 | DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"), | 1598 | DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"), |
1585 | }, | 1599 | }, |
1586 | .callback = atkbd_setup_forced_release, | 1600 | .callback = atkbd_setup_forced_release, |
1587 | .driver_data = atkbd_inventec_forced_release_keys, | 1601 | .driver_data = atkbd_volume_forced_release_keys, |
1588 | }, | 1602 | }, |
1589 | { | 1603 | { |
1590 | .ident = "Samsung NC10", | 1604 | .ident = "Samsung NC10", |
@@ -1620,7 +1634,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1620 | DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 1510"), | 1634 | DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 1510"), |
1621 | }, | 1635 | }, |
1622 | .callback = atkbd_setup_forced_release, | 1636 | .callback = atkbd_setup_forced_release, |
1623 | .driver_data = atkbd_amilo_pa1510_forced_release_keys, | 1637 | .driver_data = atkbd_volume_forced_release_keys, |
1624 | }, | 1638 | }, |
1625 | { | 1639 | { |
1626 | .ident = "Fujitsu Amilo Pi 3525", | 1640 | .ident = "Fujitsu Amilo Pi 3525", |
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index 216a559f55ea..ea821b546969 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c | |||
@@ -209,7 +209,7 @@ static inline int hp_sdc_rtc_read_rt(struct timeval *res) { | |||
209 | 209 | ||
210 | /* Read the i8042 fast handshake timer */ | 210 | /* Read the i8042 fast handshake timer */ |
211 | static inline int hp_sdc_rtc_read_fhs(struct timeval *res) { | 211 | static inline int hp_sdc_rtc_read_fhs(struct timeval *res) { |
212 | uint64_t raw; | 212 | int64_t raw; |
213 | unsigned int tenms; | 213 | unsigned int tenms; |
214 | 214 | ||
215 | raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_FHS, 2); | 215 | raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_FHS, 2); |
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c index de745d751162..ab5dc5f5fd83 100644 --- a/drivers/input/mouse/logips2pp.c +++ b/drivers/input/mouse/logips2pp.c | |||
@@ -219,7 +219,7 @@ static const struct ps2pp_info *get_model_info(unsigned char model) | |||
219 | PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | | 219 | PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | |
220 | PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL }, | 220 | PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL }, |
221 | { 72, PS2PP_KIND_TRACKMAN, 0 }, /* T-CH11: TrackMan Marble */ | 221 | { 72, PS2PP_KIND_TRACKMAN, 0 }, /* T-CH11: TrackMan Marble */ |
222 | { 73, 0, PS2PP_SIDE_BTN }, | 222 | { 73, PS2PP_KIND_TRACKMAN, PS2PP_SIDE_BTN }, /* TrackMan FX */ |
223 | { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 223 | { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
224 | { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 224 | { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
225 | { 79, PS2PP_KIND_TRACKMAN, PS2PP_WHEEL }, /* TrackMan with wheel */ | 225 | { 79, PS2PP_KIND_TRACKMAN, PS2PP_WHEEL }, /* TrackMan with wheel */ |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index b66ff1ac7dea..f4a61252bcc9 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -652,6 +652,16 @@ static const struct dmi_system_id toshiba_dmi_table[] = { | |||
652 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 652 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
653 | DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"), | 653 | DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"), |
654 | }, | 654 | }, |
655 | |||
656 | }, | ||
657 | { | ||
658 | .ident = "Toshiba Portege M300", | ||
659 | .matches = { | ||
660 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
661 | DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"), | ||
662 | DMI_MATCH(DMI_PRODUCT_VERSION, "Version 1.0"), | ||
663 | }, | ||
664 | |||
655 | }, | 665 | }, |
656 | { } | 666 | { } |
657 | }; | 667 | }; |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index a39bc4eb902b..a537925f7651 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -327,6 +327,17 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { | |||
327 | }, | 327 | }, |
328 | }, | 328 | }, |
329 | { | 329 | { |
330 | /* | ||
331 | * Reset and GET ID commands issued via KBD port are | ||
332 | * sometimes being delivered to AUX3. | ||
333 | */ | ||
334 | .ident = "Sony Vaio FZ-240E", | ||
335 | .matches = { | ||
336 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
337 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"), | ||
338 | }, | ||
339 | }, | ||
340 | { | ||
330 | .ident = "Amoi M636/A737", | 341 | .ident = "Amoi M636/A737", |
331 | .matches = { | 342 | .matches = { |
332 | DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."), | 343 | DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."), |
@@ -661,7 +672,7 @@ static void i8042_pnp_exit(void) | |||
661 | static int __init i8042_pnp_init(void) | 672 | static int __init i8042_pnp_init(void) |
662 | { | 673 | { |
663 | char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 }; | 674 | char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 }; |
664 | int pnp_data_busted = false; | 675 | bool pnp_data_busted = false; |
665 | int err; | 676 | int err; |
666 | 677 | ||
667 | #ifdef CONFIG_X86 | 678 | #ifdef CONFIG_X86 |
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index 556acff3952f..7dbe652efb5a 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c | |||
@@ -138,16 +138,6 @@ int dm_exception_store_type_unregister(struct dm_exception_store_type *type) | |||
138 | } | 138 | } |
139 | EXPORT_SYMBOL(dm_exception_store_type_unregister); | 139 | EXPORT_SYMBOL(dm_exception_store_type_unregister); |
140 | 140 | ||
141 | /* | ||
142 | * Round a number up to the nearest 'size' boundary. size must | ||
143 | * be a power of 2. | ||
144 | */ | ||
145 | static ulong round_up(ulong n, ulong size) | ||
146 | { | ||
147 | size--; | ||
148 | return (n + size) & ~size; | ||
149 | } | ||
150 | |||
151 | static int set_chunk_size(struct dm_exception_store *store, | 141 | static int set_chunk_size(struct dm_exception_store *store, |
152 | const char *chunk_size_arg, char **error) | 142 | const char *chunk_size_arg, char **error) |
153 | { | 143 | { |
@@ -155,7 +145,8 @@ static int set_chunk_size(struct dm_exception_store *store, | |||
155 | char *value; | 145 | char *value; |
156 | 146 | ||
157 | chunk_size_ulong = simple_strtoul(chunk_size_arg, &value, 10); | 147 | chunk_size_ulong = simple_strtoul(chunk_size_arg, &value, 10); |
158 | if (*chunk_size_arg == '\0' || *value != '\0') { | 148 | if (*chunk_size_arg == '\0' || *value != '\0' || |
149 | chunk_size_ulong > UINT_MAX) { | ||
159 | *error = "Invalid chunk size"; | 150 | *error = "Invalid chunk size"; |
160 | return -EINVAL; | 151 | return -EINVAL; |
161 | } | 152 | } |
@@ -165,40 +156,35 @@ static int set_chunk_size(struct dm_exception_store *store, | |||
165 | return 0; | 156 | return 0; |
166 | } | 157 | } |
167 | 158 | ||
168 | /* | 159 | return dm_exception_store_set_chunk_size(store, |
169 | * Chunk size must be multiple of page size. Silently | 160 | (unsigned) chunk_size_ulong, |
170 | * round up if it's not. | ||
171 | */ | ||
172 | chunk_size_ulong = round_up(chunk_size_ulong, PAGE_SIZE >> 9); | ||
173 | |||
174 | return dm_exception_store_set_chunk_size(store, chunk_size_ulong, | ||
175 | error); | 161 | error); |
176 | } | 162 | } |
177 | 163 | ||
178 | int dm_exception_store_set_chunk_size(struct dm_exception_store *store, | 164 | int dm_exception_store_set_chunk_size(struct dm_exception_store *store, |
179 | unsigned long chunk_size_ulong, | 165 | unsigned chunk_size, |
180 | char **error) | 166 | char **error) |
181 | { | 167 | { |
182 | /* Check chunk_size is a power of 2 */ | 168 | /* Check chunk_size is a power of 2 */ |
183 | if (!is_power_of_2(chunk_size_ulong)) { | 169 | if (!is_power_of_2(chunk_size)) { |
184 | *error = "Chunk size is not a power of 2"; | 170 | *error = "Chunk size is not a power of 2"; |
185 | return -EINVAL; | 171 | return -EINVAL; |
186 | } | 172 | } |
187 | 173 | ||
188 | /* Validate the chunk size against the device block size */ | 174 | /* Validate the chunk size against the device block size */ |
189 | if (chunk_size_ulong % (bdev_logical_block_size(store->cow->bdev) >> 9)) { | 175 | if (chunk_size % (bdev_logical_block_size(store->cow->bdev) >> 9)) { |
190 | *error = "Chunk size is not a multiple of device blocksize"; | 176 | *error = "Chunk size is not a multiple of device blocksize"; |
191 | return -EINVAL; | 177 | return -EINVAL; |
192 | } | 178 | } |
193 | 179 | ||
194 | if (chunk_size_ulong > INT_MAX >> SECTOR_SHIFT) { | 180 | if (chunk_size > INT_MAX >> SECTOR_SHIFT) { |
195 | *error = "Chunk size is too high"; | 181 | *error = "Chunk size is too high"; |
196 | return -EINVAL; | 182 | return -EINVAL; |
197 | } | 183 | } |
198 | 184 | ||
199 | store->chunk_size = chunk_size_ulong; | 185 | store->chunk_size = chunk_size; |
200 | store->chunk_mask = chunk_size_ulong - 1; | 186 | store->chunk_mask = chunk_size - 1; |
201 | store->chunk_shift = ffs(chunk_size_ulong) - 1; | 187 | store->chunk_shift = ffs(chunk_size) - 1; |
202 | 188 | ||
203 | return 0; | 189 | return 0; |
204 | } | 190 | } |
@@ -251,7 +237,7 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, | |||
251 | 237 | ||
252 | r = set_chunk_size(tmp_store, argv[2], &ti->error); | 238 | r = set_chunk_size(tmp_store, argv[2], &ti->error); |
253 | if (r) | 239 | if (r) |
254 | goto bad_cow; | 240 | goto bad_ctr; |
255 | 241 | ||
256 | r = type->ctr(tmp_store, 0, NULL); | 242 | r = type->ctr(tmp_store, 0, NULL); |
257 | if (r) { | 243 | if (r) { |
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h index 812c71872ba0..8a223a48802c 100644 --- a/drivers/md/dm-exception-store.h +++ b/drivers/md/dm-exception-store.h | |||
@@ -101,9 +101,9 @@ struct dm_exception_store { | |||
101 | struct dm_dev *cow; | 101 | struct dm_dev *cow; |
102 | 102 | ||
103 | /* Size of data blocks saved - must be a power of 2 */ | 103 | /* Size of data blocks saved - must be a power of 2 */ |
104 | chunk_t chunk_size; | 104 | unsigned chunk_size; |
105 | chunk_t chunk_mask; | 105 | unsigned chunk_mask; |
106 | chunk_t chunk_shift; | 106 | unsigned chunk_shift; |
107 | 107 | ||
108 | void *context; | 108 | void *context; |
109 | }; | 109 | }; |
@@ -169,7 +169,7 @@ int dm_exception_store_type_register(struct dm_exception_store_type *type); | |||
169 | int dm_exception_store_type_unregister(struct dm_exception_store_type *type); | 169 | int dm_exception_store_type_unregister(struct dm_exception_store_type *type); |
170 | 170 | ||
171 | int dm_exception_store_set_chunk_size(struct dm_exception_store *store, | 171 | int dm_exception_store_set_chunk_size(struct dm_exception_store *store, |
172 | unsigned long chunk_size_ulong, | 172 | unsigned chunk_size, |
173 | char **error); | 173 | char **error); |
174 | 174 | ||
175 | int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, | 175 | int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, |
diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c index 652bd33109e3..7ac2c1450d10 100644 --- a/drivers/md/dm-log-userspace-base.c +++ b/drivers/md/dm-log-userspace-base.c | |||
@@ -156,7 +156,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti, | |||
156 | } | 156 | } |
157 | 157 | ||
158 | /* The ptr value is sufficient for local unique id */ | 158 | /* The ptr value is sufficient for local unique id */ |
159 | lc->luid = (uint64_t)lc; | 159 | lc->luid = (unsigned long)lc; |
160 | 160 | ||
161 | lc->ti = ti; | 161 | lc->ti = ti; |
162 | 162 | ||
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index d5b2e08750d5..0c746420c008 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c | |||
@@ -284,12 +284,13 @@ static int read_header(struct pstore *ps, int *new_snapshot) | |||
284 | { | 284 | { |
285 | int r; | 285 | int r; |
286 | struct disk_header *dh; | 286 | struct disk_header *dh; |
287 | chunk_t chunk_size; | 287 | unsigned chunk_size; |
288 | int chunk_size_supplied = 1; | 288 | int chunk_size_supplied = 1; |
289 | char *chunk_err; | 289 | char *chunk_err; |
290 | 290 | ||
291 | /* | 291 | /* |
292 | * Use default chunk size (or hardsect_size, if larger) if none supplied | 292 | * Use default chunk size (or logical_block_size, if larger) |
293 | * if none supplied | ||
293 | */ | 294 | */ |
294 | if (!ps->store->chunk_size) { | 295 | if (!ps->store->chunk_size) { |
295 | ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, | 296 | ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, |
@@ -334,10 +335,9 @@ static int read_header(struct pstore *ps, int *new_snapshot) | |||
334 | return 0; | 335 | return 0; |
335 | 336 | ||
336 | if (chunk_size_supplied) | 337 | if (chunk_size_supplied) |
337 | DMWARN("chunk size %llu in device metadata overrides " | 338 | DMWARN("chunk size %u in device metadata overrides " |
338 | "table chunk size of %llu.", | 339 | "table chunk size of %u.", |
339 | (unsigned long long)chunk_size, | 340 | chunk_size, ps->store->chunk_size); |
340 | (unsigned long long)ps->store->chunk_size); | ||
341 | 341 | ||
342 | /* We had a bogus chunk_size. Fix stuff up. */ | 342 | /* We had a bogus chunk_size. Fix stuff up. */ |
343 | free_area(ps); | 343 | free_area(ps); |
@@ -345,8 +345,8 @@ static int read_header(struct pstore *ps, int *new_snapshot) | |||
345 | r = dm_exception_store_set_chunk_size(ps->store, chunk_size, | 345 | r = dm_exception_store_set_chunk_size(ps->store, chunk_size, |
346 | &chunk_err); | 346 | &chunk_err); |
347 | if (r) { | 347 | if (r) { |
348 | DMERR("invalid on-disk chunk size %llu: %s.", | 348 | DMERR("invalid on-disk chunk size %u: %s.", |
349 | (unsigned long long)chunk_size, chunk_err); | 349 | chunk_size, chunk_err); |
350 | return r; | 350 | return r; |
351 | } | 351 | } |
352 | 352 | ||
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 57f1bf7f3b7a..3a3ba46e6d4b 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -296,6 +296,7 @@ static void __insert_origin(struct origin *o) | |||
296 | */ | 296 | */ |
297 | static int register_snapshot(struct dm_snapshot *snap) | 297 | static int register_snapshot(struct dm_snapshot *snap) |
298 | { | 298 | { |
299 | struct dm_snapshot *l; | ||
299 | struct origin *o, *new_o; | 300 | struct origin *o, *new_o; |
300 | struct block_device *bdev = snap->origin->bdev; | 301 | struct block_device *bdev = snap->origin->bdev; |
301 | 302 | ||
@@ -319,7 +320,11 @@ static int register_snapshot(struct dm_snapshot *snap) | |||
319 | __insert_origin(o); | 320 | __insert_origin(o); |
320 | } | 321 | } |
321 | 322 | ||
322 | list_add_tail(&snap->list, &o->snapshots); | 323 | /* Sort the list according to chunk size, largest-first smallest-last */ |
324 | list_for_each_entry(l, &o->snapshots, list) | ||
325 | if (l->store->chunk_size < snap->store->chunk_size) | ||
326 | break; | ||
327 | list_add_tail(&snap->list, &l->list); | ||
323 | 328 | ||
324 | up_write(&_origins_lock); | 329 | up_write(&_origins_lock); |
325 | return 0; | 330 | return 0; |
@@ -668,6 +673,11 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
668 | bio_list_init(&s->queued_bios); | 673 | bio_list_init(&s->queued_bios); |
669 | INIT_WORK(&s->queued_bios_work, flush_queued_bios); | 674 | INIT_WORK(&s->queued_bios_work, flush_queued_bios); |
670 | 675 | ||
676 | if (!s->store->chunk_size) { | ||
677 | ti->error = "Chunk size not set"; | ||
678 | goto bad_load_and_register; | ||
679 | } | ||
680 | |||
671 | /* Add snapshot to the list of snapshots for this origin */ | 681 | /* Add snapshot to the list of snapshots for this origin */ |
672 | /* Exceptions aren't triggered till snapshot_resume() is called */ | 682 | /* Exceptions aren't triggered till snapshot_resume() is called */ |
673 | if (register_snapshot(s)) { | 683 | if (register_snapshot(s)) { |
@@ -951,7 +961,7 @@ static void start_copy(struct dm_snap_pending_exception *pe) | |||
951 | 961 | ||
952 | src.bdev = bdev; | 962 | src.bdev = bdev; |
953 | src.sector = chunk_to_sector(s->store, pe->e.old_chunk); | 963 | src.sector = chunk_to_sector(s->store, pe->e.old_chunk); |
954 | src.count = min(s->store->chunk_size, dev_size - src.sector); | 964 | src.count = min((sector_t)s->store->chunk_size, dev_size - src.sector); |
955 | 965 | ||
956 | dest.bdev = s->store->cow->bdev; | 966 | dest.bdev = s->store->cow->bdev; |
957 | dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); | 967 | dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); |
@@ -1142,6 +1152,8 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, | |||
1142 | unsigned sz = 0; | 1152 | unsigned sz = 0; |
1143 | struct dm_snapshot *snap = ti->private; | 1153 | struct dm_snapshot *snap = ti->private; |
1144 | 1154 | ||
1155 | down_write(&snap->lock); | ||
1156 | |||
1145 | switch (type) { | 1157 | switch (type) { |
1146 | case STATUSTYPE_INFO: | 1158 | case STATUSTYPE_INFO: |
1147 | if (!snap->valid) | 1159 | if (!snap->valid) |
@@ -1173,6 +1185,8 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, | |||
1173 | break; | 1185 | break; |
1174 | } | 1186 | } |
1175 | 1187 | ||
1188 | up_write(&snap->lock); | ||
1189 | |||
1176 | return 0; | 1190 | return 0; |
1177 | } | 1191 | } |
1178 | 1192 | ||
@@ -1388,7 +1402,7 @@ static void origin_resume(struct dm_target *ti) | |||
1388 | struct dm_dev *dev = ti->private; | 1402 | struct dm_dev *dev = ti->private; |
1389 | struct dm_snapshot *snap; | 1403 | struct dm_snapshot *snap; |
1390 | struct origin *o; | 1404 | struct origin *o; |
1391 | chunk_t chunk_size = 0; | 1405 | unsigned chunk_size = 0; |
1392 | 1406 | ||
1393 | down_read(&_origins_lock); | 1407 | down_read(&_origins_lock); |
1394 | o = __lookup_origin(dev->bdev); | 1408 | o = __lookup_origin(dev->bdev); |
@@ -1465,7 +1479,7 @@ static int __init dm_snapshot_init(void) | |||
1465 | r = dm_register_target(&snapshot_target); | 1479 | r = dm_register_target(&snapshot_target); |
1466 | if (r) { | 1480 | if (r) { |
1467 | DMERR("snapshot target register failed %d", r); | 1481 | DMERR("snapshot target register failed %d", r); |
1468 | return r; | 1482 | goto bad_register_snapshot_target; |
1469 | } | 1483 | } |
1470 | 1484 | ||
1471 | r = dm_register_target(&origin_target); | 1485 | r = dm_register_target(&origin_target); |
@@ -1522,6 +1536,9 @@ bad2: | |||
1522 | dm_unregister_target(&origin_target); | 1536 | dm_unregister_target(&origin_target); |
1523 | bad1: | 1537 | bad1: |
1524 | dm_unregister_target(&snapshot_target); | 1538 | dm_unregister_target(&snapshot_target); |
1539 | |||
1540 | bad_register_snapshot_target: | ||
1541 | dm_exception_store_exit(); | ||
1525 | return r; | 1542 | return r; |
1526 | } | 1543 | } |
1527 | 1544 | ||
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 376f1ab48a24..724efc63904d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -47,6 +47,7 @@ struct dm_io { | |||
47 | atomic_t io_count; | 47 | atomic_t io_count; |
48 | struct bio *bio; | 48 | struct bio *bio; |
49 | unsigned long start_time; | 49 | unsigned long start_time; |
50 | spinlock_t endio_lock; | ||
50 | }; | 51 | }; |
51 | 52 | ||
52 | /* | 53 | /* |
@@ -578,8 +579,12 @@ static void dec_pending(struct dm_io *io, int error) | |||
578 | struct mapped_device *md = io->md; | 579 | struct mapped_device *md = io->md; |
579 | 580 | ||
580 | /* Push-back supersedes any I/O errors */ | 581 | /* Push-back supersedes any I/O errors */ |
581 | if (error && !(io->error > 0 && __noflush_suspending(md))) | 582 | if (unlikely(error)) { |
582 | io->error = error; | 583 | spin_lock_irqsave(&io->endio_lock, flags); |
584 | if (!(io->error > 0 && __noflush_suspending(md))) | ||
585 | io->error = error; | ||
586 | spin_unlock_irqrestore(&io->endio_lock, flags); | ||
587 | } | ||
583 | 588 | ||
584 | if (atomic_dec_and_test(&io->io_count)) { | 589 | if (atomic_dec_and_test(&io->io_count)) { |
585 | if (io->error == DM_ENDIO_REQUEUE) { | 590 | if (io->error == DM_ENDIO_REQUEUE) { |
@@ -1226,6 +1231,7 @@ static void __split_and_process_bio(struct mapped_device *md, struct bio *bio) | |||
1226 | atomic_set(&ci.io->io_count, 1); | 1231 | atomic_set(&ci.io->io_count, 1); |
1227 | ci.io->bio = bio; | 1232 | ci.io->bio = bio; |
1228 | ci.io->md = md; | 1233 | ci.io->md = md; |
1234 | spin_lock_init(&ci.io->endio_lock); | ||
1229 | ci.sector = bio->bi_sector; | 1235 | ci.sector = bio->bi_sector; |
1230 | ci.sector_count = bio_sectors(bio); | 1236 | ci.sector_count = bio_sectors(bio); |
1231 | if (unlikely(bio_empty_barrier(bio))) | 1237 | if (unlikely(bio_empty_barrier(bio))) |
@@ -1822,6 +1828,7 @@ static struct mapped_device *alloc_dev(int minor) | |||
1822 | bad_bdev: | 1828 | bad_bdev: |
1823 | destroy_workqueue(md->wq); | 1829 | destroy_workqueue(md->wq); |
1824 | bad_thread: | 1830 | bad_thread: |
1831 | del_gendisk(md->disk); | ||
1825 | put_disk(md->disk); | 1832 | put_disk(md->disk); |
1826 | bad_disk: | 1833 | bad_disk: |
1827 | blk_cleanup_queue(md->queue); | 1834 | blk_cleanup_queue(md->queue); |
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c index e556d42cc45a..63924e0c7ea9 100644 --- a/drivers/mmc/host/at91_mci.c +++ b/drivers/mmc/host/at91_mci.c | |||
@@ -72,7 +72,6 @@ | |||
72 | #include <asm/irq.h> | 72 | #include <asm/irq.h> |
73 | #include <asm/gpio.h> | 73 | #include <asm/gpio.h> |
74 | 74 | ||
75 | #include <asm/mach/mmc.h> | ||
76 | #include <mach/board.h> | 75 | #include <mach/board.h> |
77 | #include <mach/cpu.h> | 76 | #include <mach/cpu.h> |
78 | #include <mach/at91_mci.h> | 77 | #include <mach/at91_mci.h> |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 89876ade5e33..28a0eda92680 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -243,15 +243,26 @@ static int be_POST_stage_get(struct be_adapter *adapter, u16 *stage) | |||
243 | 243 | ||
244 | int be_cmd_POST(struct be_adapter *adapter) | 244 | int be_cmd_POST(struct be_adapter *adapter) |
245 | { | 245 | { |
246 | u16 stage, error; | 246 | u16 stage; |
247 | int status, timeout = 0; | ||
247 | 248 | ||
248 | error = be_POST_stage_get(adapter, &stage); | 249 | do { |
249 | if (error || stage != POST_STAGE_ARMFW_RDY) { | 250 | status = be_POST_stage_get(adapter, &stage); |
250 | dev_err(&adapter->pdev->dev, "POST failed.\n"); | 251 | if (status) { |
251 | return -1; | 252 | dev_err(&adapter->pdev->dev, "POST error; stage=0x%x\n", |
252 | } | 253 | stage); |
254 | return -1; | ||
255 | } else if (stage != POST_STAGE_ARMFW_RDY) { | ||
256 | set_current_state(TASK_INTERRUPTIBLE); | ||
257 | schedule_timeout(2 * HZ); | ||
258 | timeout += 2; | ||
259 | } else { | ||
260 | return 0; | ||
261 | } | ||
262 | } while (timeout < 20); | ||
253 | 263 | ||
254 | return 0; | 264 | dev_err(&adapter->pdev->dev, "POST timeout; stage=0x%x\n", stage); |
265 | return -1; | ||
255 | } | 266 | } |
256 | 267 | ||
257 | static inline void *embedded_payload(struct be_mcc_wrb *wrb) | 268 | static inline void *embedded_payload(struct be_mcc_wrb *wrb) |
@@ -729,8 +740,8 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, | |||
729 | /* Create an rx filtering policy configuration on an i/f | 740 | /* Create an rx filtering policy configuration on an i/f |
730 | * Uses mbox | 741 | * Uses mbox |
731 | */ | 742 | */ |
732 | int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac, | 743 | int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, |
733 | bool pmac_invalid, u32 *if_handle, u32 *pmac_id) | 744 | u8 *mac, bool pmac_invalid, u32 *if_handle, u32 *pmac_id) |
734 | { | 745 | { |
735 | struct be_mcc_wrb *wrb; | 746 | struct be_mcc_wrb *wrb; |
736 | struct be_cmd_req_if_create *req; | 747 | struct be_cmd_req_if_create *req; |
@@ -746,8 +757,8 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac, | |||
746 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | 757 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, |
747 | OPCODE_COMMON_NTWK_INTERFACE_CREATE, sizeof(*req)); | 758 | OPCODE_COMMON_NTWK_INTERFACE_CREATE, sizeof(*req)); |
748 | 759 | ||
749 | req->capability_flags = cpu_to_le32(flags); | 760 | req->capability_flags = cpu_to_le32(cap_flags); |
750 | req->enable_flags = cpu_to_le32(flags); | 761 | req->enable_flags = cpu_to_le32(en_flags); |
751 | req->pmac_invalid = pmac_invalid; | 762 | req->pmac_invalid = pmac_invalid; |
752 | if (!pmac_invalid) | 763 | if (!pmac_invalid) |
753 | memcpy(req->mac_addr, mac, ETH_ALEN); | 764 | memcpy(req->mac_addr, mac, ETH_ALEN); |
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index a86f917f85f4..49953787e41c 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h | |||
@@ -720,8 +720,9 @@ extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, | |||
720 | extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, | 720 | extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, |
721 | u32 if_id, u32 *pmac_id); | 721 | u32 if_id, u32 *pmac_id); |
722 | extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id); | 722 | extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id); |
723 | extern int be_cmd_if_create(struct be_adapter *adapter, u32 if_flags, u8 *mac, | 723 | extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, |
724 | bool pmac_invalid, u32 *if_handle, u32 *pmac_id); | 724 | u32 en_flags, u8 *mac, bool pmac_invalid, |
725 | u32 *if_handle, u32 *pmac_id); | ||
725 | extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle); | 726 | extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle); |
726 | extern int be_cmd_eq_create(struct be_adapter *adapter, | 727 | extern int be_cmd_eq_create(struct be_adapter *adapter, |
727 | struct be_queue_info *eq, int eq_delay); | 728 | struct be_queue_info *eq, int eq_delay); |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 6d5e81f7046f..1f941f027718 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1620,19 +1620,22 @@ static int be_open(struct net_device *netdev) | |||
1620 | static int be_setup(struct be_adapter *adapter) | 1620 | static int be_setup(struct be_adapter *adapter) |
1621 | { | 1621 | { |
1622 | struct net_device *netdev = adapter->netdev; | 1622 | struct net_device *netdev = adapter->netdev; |
1623 | u32 if_flags; | 1623 | u32 cap_flags, en_flags; |
1624 | int status; | 1624 | int status; |
1625 | 1625 | ||
1626 | if_flags = BE_IF_FLAGS_BROADCAST | BE_IF_FLAGS_PROMISCUOUS | | 1626 | cap_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | |
1627 | BE_IF_FLAGS_MCAST_PROMISCUOUS | BE_IF_FLAGS_UNTAGGED | | 1627 | BE_IF_FLAGS_MCAST_PROMISCUOUS | |
1628 | BE_IF_FLAGS_PASS_L3L4_ERRORS; | 1628 | BE_IF_FLAGS_PROMISCUOUS | |
1629 | status = be_cmd_if_create(adapter, if_flags, netdev->dev_addr, | 1629 | BE_IF_FLAGS_PASS_L3L4_ERRORS; |
1630 | false/* pmac_invalid */, &adapter->if_handle, | 1630 | en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | |
1631 | &adapter->pmac_id); | 1631 | BE_IF_FLAGS_PASS_L3L4_ERRORS; |
1632 | |||
1633 | status = be_cmd_if_create(adapter, cap_flags, en_flags, | ||
1634 | netdev->dev_addr, false/* pmac_invalid */, | ||
1635 | &adapter->if_handle, &adapter->pmac_id); | ||
1632 | if (status != 0) | 1636 | if (status != 0) |
1633 | goto do_none; | 1637 | goto do_none; |
1634 | 1638 | ||
1635 | |||
1636 | status = be_tx_queues_create(adapter); | 1639 | status = be_tx_queues_create(adapter); |
1637 | if (status != 0) | 1640 | if (status != 0) |
1638 | goto if_destroy; | 1641 | goto if_destroy; |
@@ -2055,6 +2058,10 @@ static int be_hw_up(struct be_adapter *adapter) | |||
2055 | if (status) | 2058 | if (status) |
2056 | return status; | 2059 | return status; |
2057 | 2060 | ||
2061 | status = be_cmd_reset_function(adapter); | ||
2062 | if (status) | ||
2063 | return status; | ||
2064 | |||
2058 | status = be_cmd_get_fw_ver(adapter, adapter->fw_ver); | 2065 | status = be_cmd_get_fw_ver(adapter, adapter->fw_ver); |
2059 | if (status) | 2066 | if (status) |
2060 | return status; | 2067 | return status; |
@@ -2108,10 +2115,6 @@ static int __devinit be_probe(struct pci_dev *pdev, | |||
2108 | if (status) | 2115 | if (status) |
2109 | goto free_netdev; | 2116 | goto free_netdev; |
2110 | 2117 | ||
2111 | status = be_cmd_reset_function(adapter); | ||
2112 | if (status) | ||
2113 | goto ctrl_clean; | ||
2114 | |||
2115 | status = be_stats_init(adapter); | 2118 | status = be_stats_init(adapter); |
2116 | if (status) | 2119 | if (status) |
2117 | goto ctrl_clean; | 2120 | goto ctrl_clean; |
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 9c950bb5e90c..f7d9ac8324cb 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c | |||
@@ -223,24 +223,25 @@ struct ethoc_bd { | |||
223 | u32 addr; | 223 | u32 addr; |
224 | }; | 224 | }; |
225 | 225 | ||
226 | static u32 ethoc_read(struct ethoc *dev, loff_t offset) | 226 | static inline u32 ethoc_read(struct ethoc *dev, loff_t offset) |
227 | { | 227 | { |
228 | return ioread32(dev->iobase + offset); | 228 | return ioread32(dev->iobase + offset); |
229 | } | 229 | } |
230 | 230 | ||
231 | static void ethoc_write(struct ethoc *dev, loff_t offset, u32 data) | 231 | static inline void ethoc_write(struct ethoc *dev, loff_t offset, u32 data) |
232 | { | 232 | { |
233 | iowrite32(data, dev->iobase + offset); | 233 | iowrite32(data, dev->iobase + offset); |
234 | } | 234 | } |
235 | 235 | ||
236 | static void ethoc_read_bd(struct ethoc *dev, int index, struct ethoc_bd *bd) | 236 | static inline void ethoc_read_bd(struct ethoc *dev, int index, |
237 | struct ethoc_bd *bd) | ||
237 | { | 238 | { |
238 | loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); | 239 | loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); |
239 | bd->stat = ethoc_read(dev, offset + 0); | 240 | bd->stat = ethoc_read(dev, offset + 0); |
240 | bd->addr = ethoc_read(dev, offset + 4); | 241 | bd->addr = ethoc_read(dev, offset + 4); |
241 | } | 242 | } |
242 | 243 | ||
243 | static void ethoc_write_bd(struct ethoc *dev, int index, | 244 | static inline void ethoc_write_bd(struct ethoc *dev, int index, |
244 | const struct ethoc_bd *bd) | 245 | const struct ethoc_bd *bd) |
245 | { | 246 | { |
246 | loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); | 247 | loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); |
@@ -248,33 +249,33 @@ static void ethoc_write_bd(struct ethoc *dev, int index, | |||
248 | ethoc_write(dev, offset + 4, bd->addr); | 249 | ethoc_write(dev, offset + 4, bd->addr); |
249 | } | 250 | } |
250 | 251 | ||
251 | static void ethoc_enable_irq(struct ethoc *dev, u32 mask) | 252 | static inline void ethoc_enable_irq(struct ethoc *dev, u32 mask) |
252 | { | 253 | { |
253 | u32 imask = ethoc_read(dev, INT_MASK); | 254 | u32 imask = ethoc_read(dev, INT_MASK); |
254 | imask |= mask; | 255 | imask |= mask; |
255 | ethoc_write(dev, INT_MASK, imask); | 256 | ethoc_write(dev, INT_MASK, imask); |
256 | } | 257 | } |
257 | 258 | ||
258 | static void ethoc_disable_irq(struct ethoc *dev, u32 mask) | 259 | static inline void ethoc_disable_irq(struct ethoc *dev, u32 mask) |
259 | { | 260 | { |
260 | u32 imask = ethoc_read(dev, INT_MASK); | 261 | u32 imask = ethoc_read(dev, INT_MASK); |
261 | imask &= ~mask; | 262 | imask &= ~mask; |
262 | ethoc_write(dev, INT_MASK, imask); | 263 | ethoc_write(dev, INT_MASK, imask); |
263 | } | 264 | } |
264 | 265 | ||
265 | static void ethoc_ack_irq(struct ethoc *dev, u32 mask) | 266 | static inline void ethoc_ack_irq(struct ethoc *dev, u32 mask) |
266 | { | 267 | { |
267 | ethoc_write(dev, INT_SOURCE, mask); | 268 | ethoc_write(dev, INT_SOURCE, mask); |
268 | } | 269 | } |
269 | 270 | ||
270 | static void ethoc_enable_rx_and_tx(struct ethoc *dev) | 271 | static inline void ethoc_enable_rx_and_tx(struct ethoc *dev) |
271 | { | 272 | { |
272 | u32 mode = ethoc_read(dev, MODER); | 273 | u32 mode = ethoc_read(dev, MODER); |
273 | mode |= MODER_RXEN | MODER_TXEN; | 274 | mode |= MODER_RXEN | MODER_TXEN; |
274 | ethoc_write(dev, MODER, mode); | 275 | ethoc_write(dev, MODER, mode); |
275 | } | 276 | } |
276 | 277 | ||
277 | static void ethoc_disable_rx_and_tx(struct ethoc *dev) | 278 | static inline void ethoc_disable_rx_and_tx(struct ethoc *dev) |
278 | { | 279 | { |
279 | u32 mode = ethoc_read(dev, MODER); | 280 | u32 mode = ethoc_read(dev, MODER); |
280 | mode &= ~(MODER_RXEN | MODER_TXEN); | 281 | mode &= ~(MODER_RXEN | MODER_TXEN); |
@@ -508,7 +509,7 @@ static irqreturn_t ethoc_interrupt(int irq, void *dev_id) | |||
508 | return IRQ_NONE; | 509 | return IRQ_NONE; |
509 | } | 510 | } |
510 | 511 | ||
511 | ethoc_ack_irq(priv, INT_MASK_ALL); | 512 | ethoc_ack_irq(priv, pending); |
512 | 513 | ||
513 | if (pending & INT_MASK_BUSY) { | 514 | if (pending & INT_MASK_BUSY) { |
514 | dev_err(&dev->dev, "packet dropped\n"); | 515 | dev_err(&dev->dev, "packet dropped\n"); |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 29234380e6c6..16a1d58419d9 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -1654,7 +1654,7 @@ static const struct net_device_ops fec_netdev_ops = { | |||
1654 | * | 1654 | * |
1655 | * index is only used in legacy code | 1655 | * index is only used in legacy code |
1656 | */ | 1656 | */ |
1657 | int __init fec_enet_init(struct net_device *dev, int index) | 1657 | static int fec_enet_init(struct net_device *dev, int index) |
1658 | { | 1658 | { |
1659 | struct fec_enet_private *fep = netdev_priv(dev); | 1659 | struct fec_enet_private *fep = netdev_priv(dev); |
1660 | struct bufdesc *cbd_base; | 1660 | struct bufdesc *cbd_base; |
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c index 237835864357..a23f739d222f 100644 --- a/drivers/net/ks8851.c +++ b/drivers/net/ks8851.c | |||
@@ -171,6 +171,36 @@ static void ks8851_wrreg16(struct ks8851_net *ks, unsigned reg, unsigned val) | |||
171 | } | 171 | } |
172 | 172 | ||
173 | /** | 173 | /** |
174 | * ks8851_wrreg8 - write 8bit register value to chip | ||
175 | * @ks: The chip state | ||
176 | * @reg: The register address | ||
177 | * @val: The value to write | ||
178 | * | ||
179 | * Issue a write to put the value @val into the register specified in @reg. | ||
180 | */ | ||
181 | static void ks8851_wrreg8(struct ks8851_net *ks, unsigned reg, unsigned val) | ||
182 | { | ||
183 | struct spi_transfer *xfer = &ks->spi_xfer1; | ||
184 | struct spi_message *msg = &ks->spi_msg1; | ||
185 | __le16 txb[2]; | ||
186 | int ret; | ||
187 | int bit; | ||
188 | |||
189 | bit = 1 << (reg & 3); | ||
190 | |||
191 | txb[0] = cpu_to_le16(MK_OP(bit, reg) | KS_SPIOP_WR); | ||
192 | txb[1] = val; | ||
193 | |||
194 | xfer->tx_buf = txb; | ||
195 | xfer->rx_buf = NULL; | ||
196 | xfer->len = 3; | ||
197 | |||
198 | ret = spi_sync(ks->spidev, msg); | ||
199 | if (ret < 0) | ||
200 | ks_err(ks, "spi_sync() failed\n"); | ||
201 | } | ||
202 | |||
203 | /** | ||
174 | * ks8851_rx_1msg - select whether to use one or two messages for spi read | 204 | * ks8851_rx_1msg - select whether to use one or two messages for spi read |
175 | * @ks: The device structure | 205 | * @ks: The device structure |
176 | * | 206 | * |
@@ -322,13 +352,12 @@ static void ks8851_soft_reset(struct ks8851_net *ks, unsigned op) | |||
322 | static int ks8851_write_mac_addr(struct net_device *dev) | 352 | static int ks8851_write_mac_addr(struct net_device *dev) |
323 | { | 353 | { |
324 | struct ks8851_net *ks = netdev_priv(dev); | 354 | struct ks8851_net *ks = netdev_priv(dev); |
325 | u16 *mcp = (u16 *)dev->dev_addr; | 355 | int i; |
326 | 356 | ||
327 | mutex_lock(&ks->lock); | 357 | mutex_lock(&ks->lock); |
328 | 358 | ||
329 | ks8851_wrreg16(ks, KS_MARL, mcp[0]); | 359 | for (i = 0; i < ETH_ALEN; i++) |
330 | ks8851_wrreg16(ks, KS_MARM, mcp[1]); | 360 | ks8851_wrreg8(ks, KS_MAR(i), dev->dev_addr[i]); |
331 | ks8851_wrreg16(ks, KS_MARH, mcp[2]); | ||
332 | 361 | ||
333 | mutex_unlock(&ks->lock); | 362 | mutex_unlock(&ks->lock); |
334 | 363 | ||
@@ -951,7 +980,7 @@ static void ks8851_set_rx_mode(struct net_device *dev) | |||
951 | mcptr = mcptr->next; | 980 | mcptr = mcptr->next; |
952 | } | 981 | } |
953 | 982 | ||
954 | rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXAE | RXCR1_RXPAFMA; | 983 | rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXPAFMA; |
955 | } else { | 984 | } else { |
956 | /* just accept broadcast / unicast */ | 985 | /* just accept broadcast / unicast */ |
957 | rxctrl.rxcr1 = RXCR1_RXPAFMA; | 986 | rxctrl.rxcr1 = RXCR1_RXPAFMA; |
@@ -1239,6 +1268,9 @@ static int __devinit ks8851_probe(struct spi_device *spi) | |||
1239 | ndev->netdev_ops = &ks8851_netdev_ops; | 1268 | ndev->netdev_ops = &ks8851_netdev_ops; |
1240 | ndev->irq = spi->irq; | 1269 | ndev->irq = spi->irq; |
1241 | 1270 | ||
1271 | /* issue a global soft reset to reset the device. */ | ||
1272 | ks8851_soft_reset(ks, GRR_GSR); | ||
1273 | |||
1242 | /* simple check for a valid chip being connected to the bus */ | 1274 | /* simple check for a valid chip being connected to the bus */ |
1243 | 1275 | ||
1244 | if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) { | 1276 | if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) { |
diff --git a/drivers/net/ks8851.h b/drivers/net/ks8851.h index 85abe147afbf..f52c312cc356 100644 --- a/drivers/net/ks8851.h +++ b/drivers/net/ks8851.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define CCR_32PIN (1 << 0) | 16 | #define CCR_32PIN (1 << 0) |
17 | 17 | ||
18 | /* MAC address registers */ | 18 | /* MAC address registers */ |
19 | #define KS_MAR(_m) 0x15 - (_m) | ||
19 | #define KS_MARL 0x10 | 20 | #define KS_MARL 0x10 |
20 | #define KS_MARM 0x12 | 21 | #define KS_MARM 0x12 |
21 | #define KS_MARH 0x14 | 22 | #define KS_MARH 0x14 |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index f9364d0678f2..d6c7ac68f6ea 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -3545,7 +3545,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, | |||
3545 | rp->rcr_index = index; | 3545 | rp->rcr_index = index; |
3546 | 3546 | ||
3547 | skb_reserve(skb, NET_IP_ALIGN); | 3547 | skb_reserve(skb, NET_IP_ALIGN); |
3548 | __pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX)); | 3548 | __pskb_pull_tail(skb, min(len, VLAN_ETH_HLEN)); |
3549 | 3549 | ||
3550 | rp->rx_packets++; | 3550 | rp->rx_packets++; |
3551 | rp->rx_bytes += skb->len; | 3551 | rp->rx_bytes += skb->len; |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8d009760277c..3709d6af9abf 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/ethtool.h> | 22 | #include <linux/ethtool.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/virtio.h> | 24 | #include <linux/virtio.h> |
25 | #include <linux/virtio_ids.h> | ||
26 | #include <linux/virtio_net.h> | 25 | #include <linux/virtio_net.h> |
27 | #include <linux/scatterlist.h> | 26 | #include <linux/scatterlist.h> |
28 | #include <linux/if_vlan.h> | 27 | #include <linux/if_vlan.h> |
@@ -454,7 +453,7 @@ static unsigned int free_old_xmit_skbs(struct virtnet_info *vi) | |||
454 | vi->dev->stats.tx_bytes += skb->len; | 453 | vi->dev->stats.tx_bytes += skb->len; |
455 | vi->dev->stats.tx_packets++; | 454 | vi->dev->stats.tx_packets++; |
456 | tot_sgs += skb_vnet_hdr(skb)->num_sg; | 455 | tot_sgs += skb_vnet_hdr(skb)->num_sg; |
457 | kfree_skb(skb); | 456 | dev_kfree_skb_any(skb); |
458 | } | 457 | } |
459 | return tot_sgs; | 458 | return tot_sgs; |
460 | } | 459 | } |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index 6a16f76f277e..004353a46af0 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -481,7 +481,8 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx, | |||
481 | } | 481 | } |
482 | rq->uncommitted[ring_idx] += num_allocated; | 482 | rq->uncommitted[ring_idx] += num_allocated; |
483 | 483 | ||
484 | dprintk(KERN_ERR "alloc_rx_buf: %d allocated, next2fill %u, next2comp " | 484 | dev_dbg(&adapter->netdev->dev, |
485 | "alloc_rx_buf: %d allocated, next2fill %u, next2comp " | ||
485 | "%u, uncommited %u\n", num_allocated, ring->next2fill, | 486 | "%u, uncommited %u\n", num_allocated, ring->next2fill, |
486 | ring->next2comp, rq->uncommitted[ring_idx]); | 487 | ring->next2comp, rq->uncommitted[ring_idx]); |
487 | 488 | ||
@@ -539,7 +540,8 @@ vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx, | |||
539 | tbi = tq->buf_info + tq->tx_ring.next2fill; | 540 | tbi = tq->buf_info + tq->tx_ring.next2fill; |
540 | tbi->map_type = VMXNET3_MAP_NONE; | 541 | tbi->map_type = VMXNET3_MAP_NONE; |
541 | 542 | ||
542 | dprintk(KERN_ERR "txd[%u]: 0x%Lx 0x%x 0x%x\n", | 543 | dev_dbg(&adapter->netdev->dev, |
544 | "txd[%u]: 0x%Lx 0x%x 0x%x\n", | ||
543 | tq->tx_ring.next2fill, ctx->sop_txd->txd.addr, | 545 | tq->tx_ring.next2fill, ctx->sop_txd->txd.addr, |
544 | ctx->sop_txd->dword[2], ctx->sop_txd->dword[3]); | 546 | ctx->sop_txd->dword[2], ctx->sop_txd->dword[3]); |
545 | vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); | 547 | vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); |
@@ -572,7 +574,8 @@ vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx, | |||
572 | gdesc->dword[2] = dw2 | buf_size; | 574 | gdesc->dword[2] = dw2 | buf_size; |
573 | gdesc->dword[3] = 0; | 575 | gdesc->dword[3] = 0; |
574 | 576 | ||
575 | dprintk(KERN_ERR "txd[%u]: 0x%Lx 0x%x 0x%x\n", | 577 | dev_dbg(&adapter->netdev->dev, |
578 | "txd[%u]: 0x%Lx 0x%x 0x%x\n", | ||
576 | tq->tx_ring.next2fill, gdesc->txd.addr, | 579 | tq->tx_ring.next2fill, gdesc->txd.addr, |
577 | gdesc->dword[2], gdesc->dword[3]); | 580 | gdesc->dword[2], gdesc->dword[3]); |
578 | vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); | 581 | vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); |
@@ -600,7 +603,8 @@ vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx, | |||
600 | gdesc->dword[2] = dw2 | frag->size; | 603 | gdesc->dword[2] = dw2 | frag->size; |
601 | gdesc->dword[3] = 0; | 604 | gdesc->dword[3] = 0; |
602 | 605 | ||
603 | dprintk(KERN_ERR "txd[%u]: 0x%llu %u %u\n", | 606 | dev_dbg(&adapter->netdev->dev, |
607 | "txd[%u]: 0x%llu %u %u\n", | ||
604 | tq->tx_ring.next2fill, gdesc->txd.addr, | 608 | tq->tx_ring.next2fill, gdesc->txd.addr, |
605 | gdesc->dword[2], gdesc->dword[3]); | 609 | gdesc->dword[2], gdesc->dword[3]); |
606 | vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); | 610 | vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); |
@@ -697,7 +701,8 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, | |||
697 | tdd = tq->data_ring.base + tq->tx_ring.next2fill; | 701 | tdd = tq->data_ring.base + tq->tx_ring.next2fill; |
698 | 702 | ||
699 | memcpy(tdd->data, skb->data, ctx->copy_size); | 703 | memcpy(tdd->data, skb->data, ctx->copy_size); |
700 | dprintk(KERN_ERR "copy %u bytes to dataRing[%u]\n", | 704 | dev_dbg(&adapter->netdev->dev, |
705 | "copy %u bytes to dataRing[%u]\n", | ||
701 | ctx->copy_size, tq->tx_ring.next2fill); | 706 | ctx->copy_size, tq->tx_ring.next2fill); |
702 | return 1; | 707 | return 1; |
703 | 708 | ||
@@ -808,7 +813,8 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, | |||
808 | 813 | ||
809 | if (count > vmxnet3_cmd_ring_desc_avail(&tq->tx_ring)) { | 814 | if (count > vmxnet3_cmd_ring_desc_avail(&tq->tx_ring)) { |
810 | tq->stats.tx_ring_full++; | 815 | tq->stats.tx_ring_full++; |
811 | dprintk(KERN_ERR "tx queue stopped on %s, next2comp %u" | 816 | dev_dbg(&adapter->netdev->dev, |
817 | "tx queue stopped on %s, next2comp %u" | ||
812 | " next2fill %u\n", adapter->netdev->name, | 818 | " next2fill %u\n", adapter->netdev->name, |
813 | tq->tx_ring.next2comp, tq->tx_ring.next2fill); | 819 | tq->tx_ring.next2comp, tq->tx_ring.next2fill); |
814 | 820 | ||
@@ -853,7 +859,8 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, | |||
853 | 859 | ||
854 | /* finally flips the GEN bit of the SOP desc */ | 860 | /* finally flips the GEN bit of the SOP desc */ |
855 | gdesc->dword[2] ^= VMXNET3_TXD_GEN; | 861 | gdesc->dword[2] ^= VMXNET3_TXD_GEN; |
856 | dprintk(KERN_ERR "txd[%u]: SOP 0x%Lx 0x%x 0x%x\n", | 862 | dev_dbg(&adapter->netdev->dev, |
863 | "txd[%u]: SOP 0x%Lx 0x%x 0x%x\n", | ||
857 | (u32)((union Vmxnet3_GenericDesc *)ctx.sop_txd - | 864 | (u32)((union Vmxnet3_GenericDesc *)ctx.sop_txd - |
858 | tq->tx_ring.base), gdesc->txd.addr, gdesc->dword[2], | 865 | tq->tx_ring.base), gdesc->txd.addr, gdesc->dword[2], |
859 | gdesc->dword[3]); | 866 | gdesc->dword[3]); |
@@ -990,7 +997,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
990 | if (unlikely(rcd->len == 0)) { | 997 | if (unlikely(rcd->len == 0)) { |
991 | /* Pretend the rx buffer is skipped. */ | 998 | /* Pretend the rx buffer is skipped. */ |
992 | BUG_ON(!(rcd->sop && rcd->eop)); | 999 | BUG_ON(!(rcd->sop && rcd->eop)); |
993 | dprintk(KERN_ERR "rxRing[%u][%u] 0 length\n", | 1000 | dev_dbg(&adapter->netdev->dev, |
1001 | "rxRing[%u][%u] 0 length\n", | ||
994 | ring_idx, idx); | 1002 | ring_idx, idx); |
995 | goto rcd_done; | 1003 | goto rcd_done; |
996 | } | 1004 | } |
@@ -1683,7 +1691,8 @@ vmxnet3_activate_dev(struct vmxnet3_adapter *adapter) | |||
1683 | int err; | 1691 | int err; |
1684 | u32 ret; | 1692 | u32 ret; |
1685 | 1693 | ||
1686 | dprintk(KERN_ERR "%s: skb_buf_size %d, rx_buf_per_pkt %d, ring sizes" | 1694 | dev_dbg(&adapter->netdev->dev, |
1695 | "%s: skb_buf_size %d, rx_buf_per_pkt %d, ring sizes" | ||
1687 | " %u %u %u\n", adapter->netdev->name, adapter->skb_buf_size, | 1696 | " %u %u %u\n", adapter->netdev->name, adapter->skb_buf_size, |
1688 | adapter->rx_buf_per_pkt, adapter->tx_queue.tx_ring.size, | 1697 | adapter->rx_buf_per_pkt, adapter->tx_queue.tx_ring.size, |
1689 | adapter->rx_queue.rx_ring[0].size, | 1698 | adapter->rx_queue.rx_ring[0].size, |
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h index 6bb91576e999..3c0d70d58111 100644 --- a/drivers/net/vmxnet3/vmxnet3_int.h +++ b/drivers/net/vmxnet3/vmxnet3_int.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/ethtool.h> | 31 | #include <linux/ethtool.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/device.h> | ||
33 | #include <linux/netdevice.h> | 34 | #include <linux/netdevice.h> |
34 | #include <linux/pci.h> | 35 | #include <linux/pci.h> |
35 | #include <linux/ethtool.h> | 36 | #include <linux/ethtool.h> |
@@ -59,7 +60,6 @@ | |||
59 | #include <linux/if_vlan.h> | 60 | #include <linux/if_vlan.h> |
60 | #include <linux/if_arp.h> | 61 | #include <linux/if_arp.h> |
61 | #include <linux/inetdevice.h> | 62 | #include <linux/inetdevice.h> |
62 | #include <linux/dst.h> | ||
63 | 63 | ||
64 | #include "vmxnet3_defs.h" | 64 | #include "vmxnet3_defs.h" |
65 | 65 | ||
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a790b1771f9f..245d2cdb4765 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1009,7 +1009,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, | |||
1009 | 1009 | ||
1010 | static void __devinit quirk_amd_ide_mode(struct pci_dev *pdev) | 1010 | static void __devinit quirk_amd_ide_mode(struct pci_dev *pdev) |
1011 | { | 1011 | { |
1012 | /* set SBX00 SATA in IDE mode to AHCI mode */ | 1012 | /* set SBX00/Hudson-2 SATA in IDE mode to AHCI mode */ |
1013 | u8 tmp; | 1013 | u8 tmp; |
1014 | 1014 | ||
1015 | pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); | 1015 | pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); |
@@ -1028,8 +1028,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk | |||
1028 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); | 1028 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); |
1029 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); | 1029 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); |
1030 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); | 1030 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); |
1031 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SATA_IDE, quirk_amd_ide_mode); | 1031 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); |
1032 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SATA_IDE, quirk_amd_ide_mode); | 1032 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); |
1033 | 1033 | ||
1034 | /* | 1034 | /* |
1035 | * Serverworks CSB5 IDE does not fully support native mode | 1035 | * Serverworks CSB5 IDE does not fully support native mode |
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 200c22f55130..9dd588042880 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -19,7 +19,6 @@ | |||
19 | */ | 19 | */ |
20 | //#define DEBUG | 20 | //#define DEBUG |
21 | #include <linux/virtio.h> | 21 | #include <linux/virtio.h> |
22 | #include <linux/virtio_ids.h> | ||
23 | #include <linux/virtio_balloon.h> | 22 | #include <linux/virtio_balloon.h> |
24 | #include <linux/swap.h> | 23 | #include <linux/swap.h> |
25 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
@@ -248,7 +247,7 @@ out: | |||
248 | return err; | 247 | return err; |
249 | } | 248 | } |
250 | 249 | ||
251 | static void virtballoon_remove(struct virtio_device *vdev) | 250 | static void __devexit virtballoon_remove(struct virtio_device *vdev) |
252 | { | 251 | { |
253 | struct virtio_balloon *vb = vdev->priv; | 252 | struct virtio_balloon *vb = vdev->priv; |
254 | 253 | ||