diff options
Diffstat (limited to 'drivers')
186 files changed, 1535 insertions, 890 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 071c1dfb93f3..350d52a8f781 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -68,7 +68,7 @@ MODULE_AUTHOR("Bruno Ducrot"); | |||
68 | MODULE_DESCRIPTION("ACPI Video Driver"); | 68 | MODULE_DESCRIPTION("ACPI Video Driver"); |
69 | MODULE_LICENSE("GPL"); | 69 | MODULE_LICENSE("GPL"); |
70 | 70 | ||
71 | static bool brightness_switch_enabled; | 71 | static bool brightness_switch_enabled = 1; |
72 | module_param(brightness_switch_enabled, bool, 0644); | 72 | module_param(brightness_switch_enabled, bool, 0644); |
73 | 73 | ||
74 | /* | 74 | /* |
@@ -581,6 +581,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
581 | }, | 581 | }, |
582 | { | 582 | { |
583 | .callback = video_set_use_native_backlight, | 583 | .callback = video_set_use_native_backlight, |
584 | .ident = "HP ProBook 4540s", | ||
585 | .matches = { | ||
586 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
587 | DMI_MATCH(DMI_PRODUCT_VERSION, "HP ProBook 4540s"), | ||
588 | }, | ||
589 | }, | ||
590 | { | ||
591 | .callback = video_set_use_native_backlight, | ||
584 | .ident = "HP ProBook 2013 models", | 592 | .ident = "HP ProBook 2013 models", |
585 | .matches = { | 593 | .matches = { |
586 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | 594 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index dae5607e1115..4cd52a4541a9 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -456,6 +456,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
456 | 456 | ||
457 | /* Promise */ | 457 | /* Promise */ |
458 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ | 458 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ |
459 | { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */ | ||
459 | 460 | ||
460 | /* Asmedia */ | 461 | /* Asmedia */ |
461 | { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ | 462 | { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 18d97d5c7d90..677c0c1b03bd 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4787,6 +4787,10 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words) | |||
4787 | * ata_qc_new - Request an available ATA command, for queueing | 4787 | * ata_qc_new - Request an available ATA command, for queueing |
4788 | * @ap: target port | 4788 | * @ap: target port |
4789 | * | 4789 | * |
4790 | * Some ATA host controllers may implement a queue depth which is less | ||
4791 | * than ATA_MAX_QUEUE. So we shouldn't allocate a tag which is beyond | ||
4792 | * the hardware limitation. | ||
4793 | * | ||
4790 | * LOCKING: | 4794 | * LOCKING: |
4791 | * None. | 4795 | * None. |
4792 | */ | 4796 | */ |
@@ -4794,14 +4798,15 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words) | |||
4794 | static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) | 4798 | static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) |
4795 | { | 4799 | { |
4796 | struct ata_queued_cmd *qc = NULL; | 4800 | struct ata_queued_cmd *qc = NULL; |
4801 | unsigned int max_queue = ap->host->n_tags; | ||
4797 | unsigned int i, tag; | 4802 | unsigned int i, tag; |
4798 | 4803 | ||
4799 | /* no command while frozen */ | 4804 | /* no command while frozen */ |
4800 | if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) | 4805 | if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) |
4801 | return NULL; | 4806 | return NULL; |
4802 | 4807 | ||
4803 | for (i = 0; i < ATA_MAX_QUEUE; i++) { | 4808 | for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { |
4804 | tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE; | 4809 | tag = tag < max_queue ? tag : 0; |
4805 | 4810 | ||
4806 | /* the last tag is reserved for internal command. */ | 4811 | /* the last tag is reserved for internal command. */ |
4807 | if (tag == ATA_TAG_INTERNAL) | 4812 | if (tag == ATA_TAG_INTERNAL) |
@@ -6088,6 +6093,7 @@ void ata_host_init(struct ata_host *host, struct device *dev, | |||
6088 | { | 6093 | { |
6089 | spin_lock_init(&host->lock); | 6094 | spin_lock_init(&host->lock); |
6090 | mutex_init(&host->eh_mutex); | 6095 | mutex_init(&host->eh_mutex); |
6096 | host->n_tags = ATA_MAX_QUEUE - 1; | ||
6091 | host->dev = dev; | 6097 | host->dev = dev; |
6092 | host->ops = ops; | 6098 | host->ops = ops; |
6093 | } | 6099 | } |
@@ -6169,6 +6175,8 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) | |||
6169 | { | 6175 | { |
6170 | int i, rc; | 6176 | int i, rc; |
6171 | 6177 | ||
6178 | host->n_tags = clamp(sht->can_queue, 1, ATA_MAX_QUEUE - 1); | ||
6179 | |||
6172 | /* host must have been started */ | 6180 | /* host must have been started */ |
6173 | if (!(host->flags & ATA_HOST_STARTED)) { | 6181 | if (!(host->flags & ATA_HOST_STARTED)) { |
6174 | dev_err(host->dev, "BUG: trying to register unstarted host\n"); | 6182 | dev_err(host->dev, "BUG: trying to register unstarted host\n"); |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 6760fc4e85b8..dad83df555c4 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1811,7 +1811,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, | |||
1811 | case ATA_DEV_ATA: | 1811 | case ATA_DEV_ATA: |
1812 | if (err & ATA_ICRC) | 1812 | if (err & ATA_ICRC) |
1813 | qc->err_mask |= AC_ERR_ATA_BUS; | 1813 | qc->err_mask |= AC_ERR_ATA_BUS; |
1814 | if (err & ATA_UNC) | 1814 | if (err & (ATA_UNC | ATA_AMNF)) |
1815 | qc->err_mask |= AC_ERR_MEDIA; | 1815 | qc->err_mask |= AC_ERR_MEDIA; |
1816 | if (err & ATA_IDNF) | 1816 | if (err & ATA_IDNF) |
1817 | qc->err_mask |= AC_ERR_INVALID; | 1817 | qc->err_mask |= AC_ERR_INVALID; |
@@ -2556,11 +2556,12 @@ static void ata_eh_link_report(struct ata_link *link) | |||
2556 | } | 2556 | } |
2557 | 2557 | ||
2558 | if (cmd->command != ATA_CMD_PACKET && | 2558 | if (cmd->command != ATA_CMD_PACKET && |
2559 | (res->feature & (ATA_ICRC | ATA_UNC | ATA_IDNF | | 2559 | (res->feature & (ATA_ICRC | ATA_UNC | ATA_AMNF | |
2560 | ATA_ABORTED))) | 2560 | ATA_IDNF | ATA_ABORTED))) |
2561 | ata_dev_err(qc->dev, "error: { %s%s%s%s}\n", | 2561 | ata_dev_err(qc->dev, "error: { %s%s%s%s%s}\n", |
2562 | res->feature & ATA_ICRC ? "ICRC " : "", | 2562 | res->feature & ATA_ICRC ? "ICRC " : "", |
2563 | res->feature & ATA_UNC ? "UNC " : "", | 2563 | res->feature & ATA_UNC ? "UNC " : "", |
2564 | res->feature & ATA_AMNF ? "AMNF " : "", | ||
2564 | res->feature & ATA_IDNF ? "IDNF " : "", | 2565 | res->feature & ATA_IDNF ? "IDNF " : "", |
2565 | res->feature & ATA_ABORTED ? "ABRT " : ""); | 2566 | res->feature & ATA_ABORTED ? "ABRT " : ""); |
2566 | #endif | 2567 | #endif |
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c index 6ad5c072ce34..4d37c5415fc7 100644 --- a/drivers/ata/pata_ep93xx.c +++ b/drivers/ata/pata_ep93xx.c | |||
@@ -915,7 +915,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev) | |||
915 | struct ep93xx_pata_data *drv_data; | 915 | struct ep93xx_pata_data *drv_data; |
916 | struct ata_host *host; | 916 | struct ata_host *host; |
917 | struct ata_port *ap; | 917 | struct ata_port *ap; |
918 | unsigned int irq; | 918 | int irq; |
919 | struct resource *mem_res; | 919 | struct resource *mem_res; |
920 | void __iomem *ide_base; | 920 | void __iomem *ide_base; |
921 | int err; | 921 | int err; |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9e9227e1762d..eee48c49f5de 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -89,8 +89,13 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) | |||
89 | return dev->archdata.irqs[num]; | 89 | return dev->archdata.irqs[num]; |
90 | #else | 90 | #else |
91 | struct resource *r; | 91 | struct resource *r; |
92 | if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) | 92 | if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) { |
93 | return of_irq_get(dev->dev.of_node, num); | 93 | int ret; |
94 | |||
95 | ret = of_irq_get(dev->dev.of_node, num); | ||
96 | if (ret >= 0 || ret == -EPROBE_DEFER) | ||
97 | return ret; | ||
98 | } | ||
94 | 99 | ||
95 | r = platform_get_resource(dev, IORESOURCE_IRQ, num); | 100 | r = platform_get_resource(dev, IORESOURCE_IRQ, num); |
96 | 101 | ||
@@ -133,8 +138,13 @@ int platform_get_irq_byname(struct platform_device *dev, const char *name) | |||
133 | { | 138 | { |
134 | struct resource *r; | 139 | struct resource *r; |
135 | 140 | ||
136 | if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) | 141 | if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) { |
137 | return of_irq_get_byname(dev->dev.of_node, name); | 142 | int ret; |
143 | |||
144 | ret = of_irq_get_byname(dev->dev.of_node, name); | ||
145 | if (ret >= 0 || ret == -EPROBE_DEFER) | ||
146 | return ret; | ||
147 | } | ||
138 | 148 | ||
139 | r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); | 149 | r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); |
140 | return r ? r->start : -ENXIO; | 150 | return r ? r->start : -ENXIO; |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 1b35c45c92b7..3f2e16738080 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -544,6 +544,12 @@ void conn_try_outdate_peer_async(struct drbd_connection *connection) | |||
544 | struct task_struct *opa; | 544 | struct task_struct *opa; |
545 | 545 | ||
546 | kref_get(&connection->kref); | 546 | kref_get(&connection->kref); |
547 | /* We may just have force_sig()'ed this thread | ||
548 | * to get it out of some blocking network function. | ||
549 | * Clear signals; otherwise kthread_run(), which internally uses | ||
550 | * wait_on_completion_killable(), will mistake our pending signal | ||
551 | * for a new fatal signal and fail. */ | ||
552 | flush_signals(current); | ||
547 | opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h"); | 553 | opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h"); |
548 | if (IS_ERR(opa)) { | 554 | if (IS_ERR(opa)) { |
549 | drbd_err(connection, "out of mem, failed to invoke fence-peer helper\n"); | 555 | drbd_err(connection, "out of mem, failed to invoke fence-peer helper\n"); |
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 089e72cd37be..36e54be402df 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c | |||
@@ -622,11 +622,18 @@ static void zram_reset_device(struct zram *zram, bool reset_capacity) | |||
622 | memset(&zram->stats, 0, sizeof(zram->stats)); | 622 | memset(&zram->stats, 0, sizeof(zram->stats)); |
623 | 623 | ||
624 | zram->disksize = 0; | 624 | zram->disksize = 0; |
625 | if (reset_capacity) { | 625 | if (reset_capacity) |
626 | set_capacity(zram->disk, 0); | 626 | set_capacity(zram->disk, 0); |
627 | revalidate_disk(zram->disk); | 627 | |
628 | } | ||
629 | up_write(&zram->init_lock); | 628 | up_write(&zram->init_lock); |
629 | |||
630 | /* | ||
631 | * Revalidate disk out of the init_lock to avoid lockdep splat. | ||
632 | * It's okay because disk's capacity is protected by init_lock | ||
633 | * so that revalidate_disk always sees up-to-date capacity. | ||
634 | */ | ||
635 | if (reset_capacity) | ||
636 | revalidate_disk(zram->disk); | ||
630 | } | 637 | } |
631 | 638 | ||
632 | static ssize_t disksize_store(struct device *dev, | 639 | static ssize_t disksize_store(struct device *dev, |
@@ -666,8 +673,15 @@ static ssize_t disksize_store(struct device *dev, | |||
666 | zram->comp = comp; | 673 | zram->comp = comp; |
667 | zram->disksize = disksize; | 674 | zram->disksize = disksize; |
668 | set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT); | 675 | set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT); |
669 | revalidate_disk(zram->disk); | ||
670 | up_write(&zram->init_lock); | 676 | up_write(&zram->init_lock); |
677 | |||
678 | /* | ||
679 | * Revalidate disk out of the init_lock to avoid lockdep splat. | ||
680 | * It's okay because disk's capacity is protected by init_lock | ||
681 | * so that revalidate_disk always sees up-to-date capacity. | ||
682 | */ | ||
683 | revalidate_disk(zram->disk); | ||
684 | |||
671 | return len; | 685 | return len; |
672 | 686 | ||
673 | out_destroy_comp: | 687 | out_destroy_comp: |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index f98380648cb3..f50dffc0374f 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
@@ -90,7 +90,6 @@ static const struct usb_device_id ath3k_table[] = { | |||
90 | { USB_DEVICE(0x0b05, 0x17d0) }, | 90 | { USB_DEVICE(0x0b05, 0x17d0) }, |
91 | { USB_DEVICE(0x0CF3, 0x0036) }, | 91 | { USB_DEVICE(0x0CF3, 0x0036) }, |
92 | { USB_DEVICE(0x0CF3, 0x3004) }, | 92 | { USB_DEVICE(0x0CF3, 0x3004) }, |
93 | { USB_DEVICE(0x0CF3, 0x3005) }, | ||
94 | { USB_DEVICE(0x0CF3, 0x3008) }, | 93 | { USB_DEVICE(0x0CF3, 0x3008) }, |
95 | { USB_DEVICE(0x0CF3, 0x311D) }, | 94 | { USB_DEVICE(0x0CF3, 0x311D) }, |
96 | { USB_DEVICE(0x0CF3, 0x311E) }, | 95 | { USB_DEVICE(0x0CF3, 0x311E) }, |
@@ -140,7 +139,6 @@ static const struct usb_device_id ath3k_blist_tbl[] = { | |||
140 | { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, | 139 | { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, |
141 | { USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 }, | 140 | { USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 }, |
142 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, | 141 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, |
143 | { USB_DEVICE(0x0cf3, 0x3005), .driver_info = BTUSB_ATH3012 }, | ||
144 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, | 142 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, |
145 | { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, | 143 | { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, |
146 | { USB_DEVICE(0x0cf3, 0x311E), .driver_info = BTUSB_ATH3012 }, | 144 | { USB_DEVICE(0x0cf3, 0x311E), .driver_info = BTUSB_ATH3012 }, |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index a1c80b0c7663..6250fc2fb93a 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -162,7 +162,6 @@ static const struct usb_device_id blacklist_table[] = { | |||
162 | { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, | 162 | { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, |
163 | { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, | 163 | { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, |
164 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, | 164 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, |
165 | { USB_DEVICE(0x0cf3, 0x3005), .driver_info = BTUSB_ATH3012 }, | ||
166 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, | 165 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, |
167 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, | 166 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, |
168 | { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 }, | 167 | { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 }, |
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index 04680ead9275..fede8ca7147c 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c | |||
@@ -406,6 +406,7 @@ static int h5_rx_3wire_hdr(struct hci_uart *hu, unsigned char c) | |||
406 | H5_HDR_PKT_TYPE(hdr) != HCI_3WIRE_LINK_PKT) { | 406 | H5_HDR_PKT_TYPE(hdr) != HCI_3WIRE_LINK_PKT) { |
407 | BT_ERR("Non-link packet received in non-active state"); | 407 | BT_ERR("Non-link packet received in non-active state"); |
408 | h5_reset_rx(h5); | 408 | h5_reset_rx(h5); |
409 | return 0; | ||
409 | } | 410 | } |
410 | 411 | ||
411 | h5->rx_func = h5_rx_payload; | 412 | h5->rx_func = h5_rx_payload; |
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 334601cc81cf..c4419ea1ab07 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c | |||
@@ -55,16 +55,41 @@ static DEFINE_MUTEX(rng_mutex); | |||
55 | static int data_avail; | 55 | static int data_avail; |
56 | static u8 *rng_buffer; | 56 | static u8 *rng_buffer; |
57 | 57 | ||
58 | static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, | ||
59 | int wait); | ||
60 | |||
58 | static size_t rng_buffer_size(void) | 61 | static size_t rng_buffer_size(void) |
59 | { | 62 | { |
60 | return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; | 63 | return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; |
61 | } | 64 | } |
62 | 65 | ||
66 | static void add_early_randomness(struct hwrng *rng) | ||
67 | { | ||
68 | unsigned char bytes[16]; | ||
69 | int bytes_read; | ||
70 | |||
71 | /* | ||
72 | * Currently only virtio-rng cannot return data during device | ||
73 | * probe, and that's handled in virtio-rng.c itself. If there | ||
74 | * are more such devices, this call to rng_get_data can be | ||
75 | * made conditional here instead of doing it per-device. | ||
76 | */ | ||
77 | bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); | ||
78 | if (bytes_read > 0) | ||
79 | add_device_randomness(bytes, bytes_read); | ||
80 | } | ||
81 | |||
63 | static inline int hwrng_init(struct hwrng *rng) | 82 | static inline int hwrng_init(struct hwrng *rng) |
64 | { | 83 | { |
65 | if (!rng->init) | 84 | if (rng->init) { |
66 | return 0; | 85 | int ret; |
67 | return rng->init(rng); | 86 | |
87 | ret = rng->init(rng); | ||
88 | if (ret) | ||
89 | return ret; | ||
90 | } | ||
91 | add_early_randomness(rng); | ||
92 | return 0; | ||
68 | } | 93 | } |
69 | 94 | ||
70 | static inline void hwrng_cleanup(struct hwrng *rng) | 95 | static inline void hwrng_cleanup(struct hwrng *rng) |
@@ -304,8 +329,6 @@ int hwrng_register(struct hwrng *rng) | |||
304 | { | 329 | { |
305 | int err = -EINVAL; | 330 | int err = -EINVAL; |
306 | struct hwrng *old_rng, *tmp; | 331 | struct hwrng *old_rng, *tmp; |
307 | unsigned char bytes[16]; | ||
308 | int bytes_read; | ||
309 | 332 | ||
310 | if (rng->name == NULL || | 333 | if (rng->name == NULL || |
311 | (rng->data_read == NULL && rng->read == NULL)) | 334 | (rng->data_read == NULL && rng->read == NULL)) |
@@ -347,9 +370,17 @@ int hwrng_register(struct hwrng *rng) | |||
347 | INIT_LIST_HEAD(&rng->list); | 370 | INIT_LIST_HEAD(&rng->list); |
348 | list_add_tail(&rng->list, &rng_list); | 371 | list_add_tail(&rng->list, &rng_list); |
349 | 372 | ||
350 | bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); | 373 | if (old_rng && !rng->init) { |
351 | if (bytes_read > 0) | 374 | /* |
352 | add_device_randomness(bytes, bytes_read); | 375 | * Use a new device's input to add some randomness to |
376 | * the system. If this rng device isn't going to be | ||
377 | * used right away, its init function hasn't been | ||
378 | * called yet; so only use the randomness from devices | ||
379 | * that don't need an init callback. | ||
380 | */ | ||
381 | add_early_randomness(rng); | ||
382 | } | ||
383 | |||
353 | out_unlock: | 384 | out_unlock: |
354 | mutex_unlock(&rng_mutex); | 385 | mutex_unlock(&rng_mutex); |
355 | out: | 386 | out: |
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index f3e71501de54..e9b15bc18b4d 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
@@ -38,6 +38,8 @@ struct virtrng_info { | |||
38 | int index; | 38 | int index; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | static bool probe_done; | ||
42 | |||
41 | static void random_recv_done(struct virtqueue *vq) | 43 | static void random_recv_done(struct virtqueue *vq) |
42 | { | 44 | { |
43 | struct virtrng_info *vi = vq->vdev->priv; | 45 | struct virtrng_info *vi = vq->vdev->priv; |
@@ -67,6 +69,13 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) | |||
67 | int ret; | 69 | int ret; |
68 | struct virtrng_info *vi = (struct virtrng_info *)rng->priv; | 70 | struct virtrng_info *vi = (struct virtrng_info *)rng->priv; |
69 | 71 | ||
72 | /* | ||
73 | * Don't ask host for data till we're setup. This call can | ||
74 | * happen during hwrng_register(), after commit d9e7972619. | ||
75 | */ | ||
76 | if (unlikely(!probe_done)) | ||
77 | return 0; | ||
78 | |||
70 | if (!vi->busy) { | 79 | if (!vi->busy) { |
71 | vi->busy = true; | 80 | vi->busy = true; |
72 | init_completion(&vi->have_data); | 81 | init_completion(&vi->have_data); |
@@ -137,6 +146,7 @@ static int probe_common(struct virtio_device *vdev) | |||
137 | return err; | 146 | return err; |
138 | } | 147 | } |
139 | 148 | ||
149 | probe_done = true; | ||
140 | return 0; | 150 | return 0; |
141 | } | 151 | } |
142 | 152 | ||
diff --git a/drivers/char/random.c b/drivers/char/random.c index 0a7ac0a7b252..71529e196b84 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -641,7 +641,7 @@ retry: | |||
641 | } while (unlikely(entropy_count < pool_size-2 && pnfrac)); | 641 | } while (unlikely(entropy_count < pool_size-2 && pnfrac)); |
642 | } | 642 | } |
643 | 643 | ||
644 | if (entropy_count < 0) { | 644 | if (unlikely(entropy_count < 0)) { |
645 | pr_warn("random: negative entropy/overflow: pool %s count %d\n", | 645 | pr_warn("random: negative entropy/overflow: pool %s count %d\n", |
646 | r->name, entropy_count); | 646 | r->name, entropy_count); |
647 | WARN_ON(1); | 647 | WARN_ON(1); |
@@ -981,7 +981,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min, | |||
981 | int reserved) | 981 | int reserved) |
982 | { | 982 | { |
983 | int entropy_count, orig; | 983 | int entropy_count, orig; |
984 | size_t ibytes; | 984 | size_t ibytes, nfrac; |
985 | 985 | ||
986 | BUG_ON(r->entropy_count > r->poolinfo->poolfracbits); | 986 | BUG_ON(r->entropy_count > r->poolinfo->poolfracbits); |
987 | 987 | ||
@@ -999,7 +999,17 @@ retry: | |||
999 | } | 999 | } |
1000 | if (ibytes < min) | 1000 | if (ibytes < min) |
1001 | ibytes = 0; | 1001 | ibytes = 0; |
1002 | if ((entropy_count -= ibytes << (ENTROPY_SHIFT + 3)) < 0) | 1002 | |
1003 | if (unlikely(entropy_count < 0)) { | ||
1004 | pr_warn("random: negative entropy count: pool %s count %d\n", | ||
1005 | r->name, entropy_count); | ||
1006 | WARN_ON(1); | ||
1007 | entropy_count = 0; | ||
1008 | } | ||
1009 | nfrac = ibytes << (ENTROPY_SHIFT + 3); | ||
1010 | if ((size_t) entropy_count > nfrac) | ||
1011 | entropy_count -= nfrac; | ||
1012 | else | ||
1003 | entropy_count = 0; | 1013 | entropy_count = 0; |
1004 | 1014 | ||
1005 | if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig) | 1015 | if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig) |
@@ -1376,6 +1386,7 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) | |||
1376 | "with %d bits of entropy available\n", | 1386 | "with %d bits of entropy available\n", |
1377 | current->comm, nonblocking_pool.entropy_total); | 1387 | current->comm, nonblocking_pool.entropy_total); |
1378 | 1388 | ||
1389 | nbytes = min_t(size_t, nbytes, INT_MAX >> (ENTROPY_SHIFT + 3)); | ||
1379 | ret = extract_entropy_user(&nonblocking_pool, buf, nbytes); | 1390 | ret = extract_entropy_user(&nonblocking_pool, buf, nbytes); |
1380 | 1391 | ||
1381 | trace_urandom_read(8 * nbytes, ENTROPY_BITS(&nonblocking_pool), | 1392 | trace_urandom_read(8 * nbytes, ENTROPY_BITS(&nonblocking_pool), |
diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c index e1581335937d..cb8e6f14e880 100644 --- a/drivers/clk/ti/clk-7xx.c +++ b/drivers/clk/ti/clk-7xx.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/clkdev.h> | 16 | #include <linux/clkdev.h> |
17 | #include <linux/clk/ti.h> | 17 | #include <linux/clk/ti.h> |
18 | 18 | ||
19 | #define DRA7_DPLL_ABE_DEFFREQ 361267200 | 19 | #define DRA7_DPLL_ABE_DEFFREQ 180633600 |
20 | #define DRA7_DPLL_GMAC_DEFFREQ 1000000000 | 20 | #define DRA7_DPLL_GMAC_DEFFREQ 1000000000 |
21 | 21 | ||
22 | 22 | ||
@@ -322,6 +322,11 @@ int __init dra7xx_dt_clk_init(void) | |||
322 | if (rc) | 322 | if (rc) |
323 | pr_err("%s: failed to configure ABE DPLL!\n", __func__); | 323 | pr_err("%s: failed to configure ABE DPLL!\n", __func__); |
324 | 324 | ||
325 | dpll_ck = clk_get_sys(NULL, "dpll_abe_m2x2_ck"); | ||
326 | rc = clk_set_rate(dpll_ck, DRA7_DPLL_ABE_DEFFREQ * 2); | ||
327 | if (rc) | ||
328 | pr_err("%s: failed to configure ABE DPLL m2x2!\n", __func__); | ||
329 | |||
325 | dpll_ck = clk_get_sys(NULL, "dpll_gmac_ck"); | 330 | dpll_ck = clk_get_sys(NULL, "dpll_gmac_ck"); |
326 | rc = clk_set_rate(dpll_ck, DRA7_DPLL_GMAC_DEFFREQ); | 331 | rc = clk_set_rate(dpll_ck, DRA7_DPLL_GMAC_DEFFREQ); |
327 | if (rc) | 332 | if (rc) |
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index ebac67115009..7364a538e056 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm | |||
@@ -104,6 +104,7 @@ config ARM_IMX6Q_CPUFREQ | |||
104 | tristate "Freescale i.MX6 cpufreq support" | 104 | tristate "Freescale i.MX6 cpufreq support" |
105 | depends on ARCH_MXC | 105 | depends on ARCH_MXC |
106 | depends on REGULATOR_ANATOP | 106 | depends on REGULATOR_ANATOP |
107 | select PM_OPP | ||
107 | help | 108 | help |
108 | This adds cpufreq driver support for Freescale i.MX6 series SoCs. | 109 | This adds cpufreq driver support for Freescale i.MX6 series SoCs. |
109 | 110 | ||
@@ -118,7 +119,7 @@ config ARM_INTEGRATOR | |||
118 | If in doubt, say Y. | 119 | If in doubt, say Y. |
119 | 120 | ||
120 | config ARM_KIRKWOOD_CPUFREQ | 121 | config ARM_KIRKWOOD_CPUFREQ |
121 | def_bool MACH_KIRKWOOD | 122 | def_bool ARCH_KIRKWOOD || MACH_KIRKWOOD |
122 | help | 123 | help |
123 | This adds the CPUFreq driver for Marvell Kirkwood | 124 | This adds the CPUFreq driver for Marvell Kirkwood |
124 | SoCs. | 125 | SoCs. |
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index ee1ae303a07c..86beda9f950b 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c | |||
@@ -152,11 +152,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
152 | goto out_put_reg; | 152 | goto out_put_reg; |
153 | } | 153 | } |
154 | 154 | ||
155 | ret = of_init_opp_table(cpu_dev); | 155 | /* OPPs might be populated at runtime, don't check for error here */ |
156 | if (ret) { | 156 | of_init_opp_table(cpu_dev); |
157 | pr_err("failed to init OPP table: %d\n", ret); | ||
158 | goto out_put_clk; | ||
159 | } | ||
160 | 157 | ||
161 | ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); | 158 | ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); |
162 | if (ret) { | 159 | if (ret) { |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 62259d27f03e..6f024852c6fb 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1153,10 +1153,12 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) | |||
1153 | * the creation of a brand new one. So we need to perform this update | 1153 | * the creation of a brand new one. So we need to perform this update |
1154 | * by invoking update_policy_cpu(). | 1154 | * by invoking update_policy_cpu(). |
1155 | */ | 1155 | */ |
1156 | if (recover_policy && cpu != policy->cpu) | 1156 | if (recover_policy && cpu != policy->cpu) { |
1157 | update_policy_cpu(policy, cpu); | 1157 | update_policy_cpu(policy, cpu); |
1158 | else | 1158 | WARN_ON(kobject_move(&policy->kobj, &dev->kobj)); |
1159 | } else { | ||
1159 | policy->cpu = cpu; | 1160 | policy->cpu = cpu; |
1161 | } | ||
1160 | 1162 | ||
1161 | cpumask_copy(policy->cpus, cpumask_of(cpu)); | 1163 | cpumask_copy(policy->cpus, cpumask_of(cpu)); |
1162 | 1164 | ||
diff --git a/drivers/cpufreq/sa1110-cpufreq.c b/drivers/cpufreq/sa1110-cpufreq.c index 546376719d8f..b5befc211172 100644 --- a/drivers/cpufreq/sa1110-cpufreq.c +++ b/drivers/cpufreq/sa1110-cpufreq.c | |||
@@ -349,7 +349,7 @@ static int __init sa1110_clk_init(void) | |||
349 | name = "K4S641632D"; | 349 | name = "K4S641632D"; |
350 | if (machine_is_h3100()) | 350 | if (machine_is_h3100()) |
351 | name = "KM416S4030CT"; | 351 | name = "KM416S4030CT"; |
352 | if (machine_is_jornada720()) | 352 | if (machine_is_jornada720() || machine_is_h3600()) |
353 | name = "K4S281632B-1H"; | 353 | name = "K4S281632B-1H"; |
354 | if (machine_is_nanoengine()) | 354 | if (machine_is_nanoengine()) |
355 | name = "MT48LC8M16A2TG-75"; | 355 | name = "MT48LC8M16A2TG-75"; |
diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig index 4199849e3758..145974f9662b 100644 --- a/drivers/firewire/Kconfig +++ b/drivers/firewire/Kconfig | |||
@@ -1,4 +1,5 @@ | |||
1 | menu "IEEE 1394 (FireWire) support" | 1 | menu "IEEE 1394 (FireWire) support" |
2 | depends on HAS_DMA | ||
2 | depends on PCI || COMPILE_TEST | 3 | depends on PCI || COMPILE_TEST |
3 | # firewire-core does not depend on PCI but is | 4 | # firewire-core does not depend on PCI but is |
4 | # not useful without PCI controller driver | 5 | # not useful without PCI controller driver |
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 57985410f12f..a66a3217f1d9 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -336,10 +336,10 @@ static const struct { | |||
336 | QUIRK_CYCLE_TIMER | QUIRK_IR_WAKE}, | 336 | QUIRK_CYCLE_TIMER | QUIRK_IR_WAKE}, |
337 | 337 | ||
338 | {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT6315, 0, | 338 | {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT6315, 0, |
339 | QUIRK_CYCLE_TIMER | QUIRK_NO_MSI}, | 339 | QUIRK_CYCLE_TIMER /* FIXME: necessary? */ | QUIRK_NO_MSI}, |
340 | 340 | ||
341 | {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT6315, PCI_ANY_ID, | 341 | {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT6315, PCI_ANY_ID, |
342 | 0}, | 342 | QUIRK_NO_MSI}, |
343 | 343 | ||
344 | {PCI_VENDOR_ID_VIA, PCI_ANY_ID, PCI_ANY_ID, | 344 | {PCI_VENDOR_ID_VIA, PCI_ANY_ID, PCI_ANY_ID, |
345 | QUIRK_CYCLE_TIMER | QUIRK_NO_MSI}, | 345 | QUIRK_CYCLE_TIMER | QUIRK_NO_MSI}, |
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index eff1a2f22f09..dc79346689e6 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c | |||
@@ -346,6 +346,7 @@ static __initdata struct { | |||
346 | 346 | ||
347 | struct param_info { | 347 | struct param_info { |
348 | int verbose; | 348 | int verbose; |
349 | int found; | ||
349 | void *params; | 350 | void *params; |
350 | }; | 351 | }; |
351 | 352 | ||
@@ -362,16 +363,12 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, | |||
362 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) | 363 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) |
363 | return 0; | 364 | return 0; |
364 | 365 | ||
365 | pr_info("Getting parameters from FDT:\n"); | ||
366 | |||
367 | for (i = 0; i < ARRAY_SIZE(dt_params); i++) { | 366 | for (i = 0; i < ARRAY_SIZE(dt_params); i++) { |
368 | prop = of_get_flat_dt_prop(node, dt_params[i].propname, &len); | 367 | prop = of_get_flat_dt_prop(node, dt_params[i].propname, &len); |
369 | if (!prop) { | 368 | if (!prop) |
370 | pr_err("Can't find %s in device tree!\n", | ||
371 | dt_params[i].name); | ||
372 | return 0; | 369 | return 0; |
373 | } | ||
374 | dest = info->params + dt_params[i].offset; | 370 | dest = info->params + dt_params[i].offset; |
371 | info->found++; | ||
375 | 372 | ||
376 | val = of_read_number(prop, len / sizeof(u32)); | 373 | val = of_read_number(prop, len / sizeof(u32)); |
377 | 374 | ||
@@ -390,10 +387,21 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, | |||
390 | int __init efi_get_fdt_params(struct efi_fdt_params *params, int verbose) | 387 | int __init efi_get_fdt_params(struct efi_fdt_params *params, int verbose) |
391 | { | 388 | { |
392 | struct param_info info; | 389 | struct param_info info; |
390 | int ret; | ||
391 | |||
392 | pr_info("Getting EFI parameters from FDT:\n"); | ||
393 | 393 | ||
394 | info.verbose = verbose; | 394 | info.verbose = verbose; |
395 | info.found = 0; | ||
395 | info.params = params; | 396 | info.params = params; |
396 | 397 | ||
397 | return of_scan_flat_dt(fdt_find_uefi_params, &info); | 398 | ret = of_scan_flat_dt(fdt_find_uefi_params, &info); |
399 | if (!info.found) | ||
400 | pr_info("UEFI not found.\n"); | ||
401 | else if (!ret) | ||
402 | pr_err("Can't find '%s' in device tree!\n", | ||
403 | dt_params[info.found].name); | ||
404 | |||
405 | return ret; | ||
398 | } | 406 | } |
399 | #endif /* CONFIG_EFI_PARAMS_FROM_FDT */ | 407 | #endif /* CONFIG_EFI_PARAMS_FROM_FDT */ |
diff --git a/drivers/firmware/efi/fdt.c b/drivers/firmware/efi/fdt.c index 82d774161cc9..507a3df46a5d 100644 --- a/drivers/firmware/efi/fdt.c +++ b/drivers/firmware/efi/fdt.c | |||
@@ -23,16 +23,6 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, | |||
23 | u32 fdt_val32; | 23 | u32 fdt_val32; |
24 | u64 fdt_val64; | 24 | u64 fdt_val64; |
25 | 25 | ||
26 | /* | ||
27 | * Copy definition of linux_banner here. Since this code is | ||
28 | * built as part of the decompressor for ARM v7, pulling | ||
29 | * in version.c where linux_banner is defined for the | ||
30 | * kernel brings other kernel dependencies with it. | ||
31 | */ | ||
32 | const char linux_banner[] = | ||
33 | "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" | ||
34 | LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; | ||
35 | |||
36 | /* Do some checks on provided FDT, if it exists*/ | 26 | /* Do some checks on provided FDT, if it exists*/ |
37 | if (orig_fdt) { | 27 | if (orig_fdt) { |
38 | if (fdt_check_header(orig_fdt)) { | 28 | if (fdt_check_header(orig_fdt)) { |
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c index fe7c0e211f9a..57adbc90fdad 100644 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c | |||
@@ -900,8 +900,6 @@ static int mcp23s08_probe(struct spi_device *spi) | |||
900 | if (spi_present_mask & (1 << addr)) | 900 | if (spi_present_mask & (1 << addr)) |
901 | chips++; | 901 | chips++; |
902 | } | 902 | } |
903 | if (!chips) | ||
904 | return -ENODEV; | ||
905 | } else { | 903 | } else { |
906 | type = spi_get_device_id(spi)->driver_data; | 904 | type = spi_get_device_id(spi)->driver_data; |
907 | pdata = dev_get_platdata(&spi->dev); | 905 | pdata = dev_get_platdata(&spi->dev); |
@@ -940,10 +938,6 @@ static int mcp23s08_probe(struct spi_device *spi) | |||
940 | if (!(spi_present_mask & (1 << addr))) | 938 | if (!(spi_present_mask & (1 << addr))) |
941 | continue; | 939 | continue; |
942 | chips--; | 940 | chips--; |
943 | if (chips < 0) { | ||
944 | dev_err(&spi->dev, "FATAL: invalid negative chip id\n"); | ||
945 | goto fail; | ||
946 | } | ||
947 | data->mcp[addr] = &data->chip[chips]; | 941 | data->mcp[addr] = &data->chip[chips]; |
948 | status = mcp23s08_probe_one(data->mcp[addr], &spi->dev, spi, | 942 | status = mcp23s08_probe_one(data->mcp[addr], &spi->dev, spi, |
949 | 0x40 | (addr << 1), type, base, | 943 | 0x40 | (addr << 1), type, base, |
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 0c9f803fc1ac..b6ae89ea8811 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
@@ -284,6 +284,7 @@ static int gpio_rcar_irq_domain_map(struct irq_domain *h, unsigned int irq, | |||
284 | 284 | ||
285 | static struct irq_domain_ops gpio_rcar_irq_domain_ops = { | 285 | static struct irq_domain_ops gpio_rcar_irq_domain_ops = { |
286 | .map = gpio_rcar_irq_domain_map, | 286 | .map = gpio_rcar_irq_domain_map, |
287 | .xlate = irq_domain_xlate_twocell, | ||
287 | }; | 288 | }; |
288 | 289 | ||
289 | struct gpio_rcar_info { | 290 | struct gpio_rcar_info { |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f36126383d26..d893e4da5dce 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1616,22 +1616,6 @@ out: | |||
1616 | return ret; | 1616 | return ret; |
1617 | } | 1617 | } |
1618 | 1618 | ||
1619 | void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv) | ||
1620 | { | ||
1621 | struct i915_vma *vma; | ||
1622 | |||
1623 | /* | ||
1624 | * Only the global gtt is relevant for gtt memory mappings, so restrict | ||
1625 | * list traversal to objects bound into the global address space. Note | ||
1626 | * that the active list should be empty, but better safe than sorry. | ||
1627 | */ | ||
1628 | WARN_ON(!list_empty(&dev_priv->gtt.base.active_list)); | ||
1629 | list_for_each_entry(vma, &dev_priv->gtt.base.active_list, mm_list) | ||
1630 | i915_gem_release_mmap(vma->obj); | ||
1631 | list_for_each_entry(vma, &dev_priv->gtt.base.inactive_list, mm_list) | ||
1632 | i915_gem_release_mmap(vma->obj); | ||
1633 | } | ||
1634 | |||
1635 | /** | 1619 | /** |
1636 | * i915_gem_release_mmap - remove physical page mappings | 1620 | * i915_gem_release_mmap - remove physical page mappings |
1637 | * @obj: obj in question | 1621 | * @obj: obj in question |
@@ -1657,6 +1641,15 @@ i915_gem_release_mmap(struct drm_i915_gem_object *obj) | |||
1657 | obj->fault_mappable = false; | 1641 | obj->fault_mappable = false; |
1658 | } | 1642 | } |
1659 | 1643 | ||
1644 | void | ||
1645 | i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv) | ||
1646 | { | ||
1647 | struct drm_i915_gem_object *obj; | ||
1648 | |||
1649 | list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) | ||
1650 | i915_gem_release_mmap(obj); | ||
1651 | } | ||
1652 | |||
1660 | uint32_t | 1653 | uint32_t |
1661 | i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, int tiling_mode) | 1654 | i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, int tiling_mode) |
1662 | { | 1655 | { |
diff --git a/drivers/gpu/drm/i915/i915_gem_render_state.c b/drivers/gpu/drm/i915/i915_gem_render_state.c index 3521f998a178..34894b573064 100644 --- a/drivers/gpu/drm/i915/i915_gem_render_state.c +++ b/drivers/gpu/drm/i915/i915_gem_render_state.c | |||
@@ -31,7 +31,7 @@ | |||
31 | struct i915_render_state { | 31 | struct i915_render_state { |
32 | struct drm_i915_gem_object *obj; | 32 | struct drm_i915_gem_object *obj; |
33 | unsigned long ggtt_offset; | 33 | unsigned long ggtt_offset; |
34 | void *batch; | 34 | u32 *batch; |
35 | u32 size; | 35 | u32 size; |
36 | u32 len; | 36 | u32 len; |
37 | }; | 37 | }; |
@@ -80,7 +80,7 @@ free: | |||
80 | 80 | ||
81 | static void render_state_free(struct i915_render_state *so) | 81 | static void render_state_free(struct i915_render_state *so) |
82 | { | 82 | { |
83 | kunmap(so->batch); | 83 | kunmap(kmap_to_page(so->batch)); |
84 | i915_gem_object_ggtt_unpin(so->obj); | 84 | i915_gem_object_ggtt_unpin(so->obj); |
85 | drm_gem_object_unreference(&so->obj->base); | 85 | drm_gem_object_unreference(&so->obj->base); |
86 | kfree(so); | 86 | kfree(so); |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 267f069765ad..c05c84f3f091 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -2845,7 +2845,7 @@ static int semaphore_passed(struct intel_engine_cs *ring) | |||
2845 | { | 2845 | { |
2846 | struct drm_i915_private *dev_priv = ring->dev->dev_private; | 2846 | struct drm_i915_private *dev_priv = ring->dev->dev_private; |
2847 | struct intel_engine_cs *signaller; | 2847 | struct intel_engine_cs *signaller; |
2848 | u32 seqno, ctl; | 2848 | u32 seqno; |
2849 | 2849 | ||
2850 | ring->hangcheck.deadlock++; | 2850 | ring->hangcheck.deadlock++; |
2851 | 2851 | ||
@@ -2857,15 +2857,12 @@ static int semaphore_passed(struct intel_engine_cs *ring) | |||
2857 | if (signaller->hangcheck.deadlock >= I915_NUM_RINGS) | 2857 | if (signaller->hangcheck.deadlock >= I915_NUM_RINGS) |
2858 | return -1; | 2858 | return -1; |
2859 | 2859 | ||
2860 | /* cursory check for an unkickable deadlock */ | ||
2861 | ctl = I915_READ_CTL(signaller); | ||
2862 | if (ctl & RING_WAIT_SEMAPHORE && semaphore_passed(signaller) < 0) | ||
2863 | return -1; | ||
2864 | |||
2865 | if (i915_seqno_passed(signaller->get_seqno(signaller, false), seqno)) | 2860 | if (i915_seqno_passed(signaller->get_seqno(signaller, false), seqno)) |
2866 | return 1; | 2861 | return 1; |
2867 | 2862 | ||
2868 | if (signaller->hangcheck.deadlock) | 2863 | /* cursory check for an unkickable deadlock */ |
2864 | if (I915_READ_CTL(signaller) & RING_WAIT_SEMAPHORE && | ||
2865 | semaphore_passed(signaller) < 0) | ||
2869 | return -1; | 2866 | return -1; |
2870 | 2867 | ||
2871 | return 0; | 2868 | return 0; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e27e7804c0b9..f0be855ddf45 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -11673,6 +11673,9 @@ static struct intel_quirk intel_quirks[] = { | |||
11673 | 11673 | ||
11674 | /* Toshiba CB35 Chromebook (Celeron 2955U) */ | 11674 | /* Toshiba CB35 Chromebook (Celeron 2955U) */ |
11675 | { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present }, | 11675 | { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present }, |
11676 | |||
11677 | /* HP Chromebook 14 (Celeron 2955U) */ | ||
11678 | { 0x0a06, 0x103c, 0x21ed, quirk_backlight_present }, | ||
11676 | }; | 11679 | }; |
11677 | 11680 | ||
11678 | static void intel_init_quirks(struct drm_device *dev) | 11681 | static void intel_init_quirks(struct drm_device *dev) |
@@ -11911,6 +11914,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) | |||
11911 | * ... */ | 11914 | * ... */ |
11912 | plane = crtc->plane; | 11915 | plane = crtc->plane; |
11913 | crtc->plane = !plane; | 11916 | crtc->plane = !plane; |
11917 | crtc->primary_enabled = true; | ||
11914 | dev_priv->display.crtc_disable(&crtc->base); | 11918 | dev_priv->display.crtc_disable(&crtc->base); |
11915 | crtc->plane = plane; | 11919 | crtc->plane = plane; |
11916 | 11920 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 075170d1844f..8a1a4fbc06ac 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -906,8 +906,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, | |||
906 | mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock, | 906 | mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock, |
907 | bpp); | 907 | bpp); |
908 | 908 | ||
909 | for (lane_count = min_lane_count; lane_count <= max_lane_count; lane_count <<= 1) { | 909 | for (clock = min_clock; clock <= max_clock; clock++) { |
910 | for (clock = min_clock; clock <= max_clock; clock++) { | 910 | for (lane_count = min_lane_count; lane_count <= max_lane_count; lane_count <<= 1) { |
911 | link_clock = drm_dp_bw_code_to_link_rate(bws[clock]); | 911 | link_clock = drm_dp_bw_code_to_link_rate(bws[clock]); |
912 | link_avail = intel_dp_max_data_rate(link_clock, | 912 | link_avail = intel_dp_max_data_rate(link_clock, |
913 | lane_count); | 913 | lane_count); |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 23126023aeba..5e5a72fca5fb 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -111,6 +111,13 @@ static void intel_lvds_get_config(struct intel_encoder *encoder, | |||
111 | 111 | ||
112 | pipe_config->adjusted_mode.flags |= flags; | 112 | pipe_config->adjusted_mode.flags |= flags; |
113 | 113 | ||
114 | /* gen2/3 store dither state in pfit control, needs to match */ | ||
115 | if (INTEL_INFO(dev)->gen < 4) { | ||
116 | tmp = I915_READ(PFIT_CONTROL); | ||
117 | |||
118 | pipe_config->gmch_pfit.control |= tmp & PANEL_8TO6_DITHER_ENABLE; | ||
119 | } | ||
120 | |||
114 | dotclock = pipe_config->port_clock; | 121 | dotclock = pipe_config->port_clock; |
115 | 122 | ||
116 | if (HAS_PCH_SPLIT(dev_priv->dev)) | 123 | if (HAS_PCH_SPLIT(dev_priv->dev)) |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 628cd8938274..12b02fe1d0ae 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -361,16 +361,16 @@ void intel_gmch_panel_fitting(struct intel_crtc *intel_crtc, | |||
361 | pfit_control |= ((intel_crtc->pipe << PFIT_PIPE_SHIFT) | | 361 | pfit_control |= ((intel_crtc->pipe << PFIT_PIPE_SHIFT) | |
362 | PFIT_FILTER_FUZZY); | 362 | PFIT_FILTER_FUZZY); |
363 | 363 | ||
364 | /* Make sure pre-965 set dither correctly for 18bpp panels. */ | ||
365 | if (INTEL_INFO(dev)->gen < 4 && pipe_config->pipe_bpp == 18) | ||
366 | pfit_control |= PANEL_8TO6_DITHER_ENABLE; | ||
367 | |||
368 | out: | 364 | out: |
369 | if ((pfit_control & PFIT_ENABLE) == 0) { | 365 | if ((pfit_control & PFIT_ENABLE) == 0) { |
370 | pfit_control = 0; | 366 | pfit_control = 0; |
371 | pfit_pgm_ratios = 0; | 367 | pfit_pgm_ratios = 0; |
372 | } | 368 | } |
373 | 369 | ||
370 | /* Make sure pre-965 set dither correctly for 18bpp panels. */ | ||
371 | if (INTEL_INFO(dev)->gen < 4 && pipe_config->pipe_bpp == 18) | ||
372 | pfit_control |= PANEL_8TO6_DITHER_ENABLE; | ||
373 | |||
374 | pipe_config->gmch_pfit.control = pfit_control; | 374 | pipe_config->gmch_pfit.control = pfit_control; |
375 | pipe_config->gmch_pfit.pgm_ratios = pfit_pgm_ratios; | 375 | pipe_config->gmch_pfit.pgm_ratios = pfit_pgm_ratios; |
376 | pipe_config->gmch_pfit.lvds_border_bits = border; | 376 | pipe_config->gmch_pfit.lvds_border_bits = border; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c index cfde9eb44ad0..6212537b90c5 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c | |||
@@ -192,11 +192,11 @@ alarm_timer_callback(struct nouveau_alarm *alarm) | |||
192 | nouveau_therm_threshold_hyst_polling(therm, &sensor->thrs_shutdown, | 192 | nouveau_therm_threshold_hyst_polling(therm, &sensor->thrs_shutdown, |
193 | NOUVEAU_THERM_THRS_SHUTDOWN); | 193 | NOUVEAU_THERM_THRS_SHUTDOWN); |
194 | 194 | ||
195 | spin_unlock_irqrestore(&priv->sensor.alarm_program_lock, flags); | ||
196 | |||
195 | /* schedule the next poll in one second */ | 197 | /* schedule the next poll in one second */ |
196 | if (therm->temp_get(therm) >= 0 && list_empty(&alarm->head)) | 198 | if (therm->temp_get(therm) >= 0 && list_empty(&alarm->head)) |
197 | ptimer->alarm(ptimer, 1000 * 1000 * 1000, alarm); | 199 | ptimer->alarm(ptimer, 1000000000ULL, alarm); |
198 | |||
199 | spin_unlock_irqrestore(&priv->sensor.alarm_program_lock, flags); | ||
200 | } | 200 | } |
201 | 201 | ||
202 | void | 202 | void |
diff --git a/drivers/gpu/drm/qxl/qxl_irq.c b/drivers/gpu/drm/qxl/qxl_irq.c index 34d6a85e9023..0bf1e20c6e44 100644 --- a/drivers/gpu/drm/qxl/qxl_irq.c +++ b/drivers/gpu/drm/qxl/qxl_irq.c | |||
@@ -33,6 +33,9 @@ irqreturn_t qxl_irq_handler(int irq, void *arg) | |||
33 | 33 | ||
34 | pending = xchg(&qdev->ram_header->int_pending, 0); | 34 | pending = xchg(&qdev->ram_header->int_pending, 0); |
35 | 35 | ||
36 | if (!pending) | ||
37 | return IRQ_NONE; | ||
38 | |||
36 | atomic_inc(&qdev->irq_received); | 39 | atomic_inc(&qdev->irq_received); |
37 | 40 | ||
38 | if (pending & QXL_INTERRUPT_DISPLAY) { | 41 | if (pending & QXL_INTERRUPT_DISPLAY) { |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index a03c73411a56..30d242b25078 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -1414,8 +1414,8 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, | |||
1414 | tmp &= ~EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN; | 1414 | tmp &= ~EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN; |
1415 | WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp); | 1415 | WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp); |
1416 | 1416 | ||
1417 | /* set pageflip to happen anywhere in vblank interval */ | 1417 | /* set pageflip to happen only at start of vblank interval (front porch) */ |
1418 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0); | 1418 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 3); |
1419 | 1419 | ||
1420 | if (!atomic && fb && fb != crtc->primary->fb) { | 1420 | if (!atomic && fb && fb != crtc->primary->fb) { |
1421 | radeon_fb = to_radeon_framebuffer(fb); | 1421 | radeon_fb = to_radeon_framebuffer(fb); |
@@ -1614,8 +1614,8 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
1614 | tmp &= ~AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN; | 1614 | tmp &= ~AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN; |
1615 | WREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp); | 1615 | WREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp); |
1616 | 1616 | ||
1617 | /* set pageflip to happen anywhere in vblank interval */ | 1617 | /* set pageflip to happen only at start of vblank interval (front porch) */ |
1618 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0); | 1618 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 3); |
1619 | 1619 | ||
1620 | if (!atomic && fb && fb != crtc->primary->fb) { | 1620 | if (!atomic && fb && fb != crtc->primary->fb) { |
1621 | radeon_fb = to_radeon_framebuffer(fb); | 1621 | radeon_fb = to_radeon_framebuffer(fb); |
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 2b2908440644..7d68203a3737 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
@@ -183,7 +183,6 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, | |||
183 | struct backlight_properties props; | 183 | struct backlight_properties props; |
184 | struct radeon_backlight_privdata *pdata; | 184 | struct radeon_backlight_privdata *pdata; |
185 | struct radeon_encoder_atom_dig *dig; | 185 | struct radeon_encoder_atom_dig *dig; |
186 | u8 backlight_level; | ||
187 | char bl_name[16]; | 186 | char bl_name[16]; |
188 | 187 | ||
189 | /* Mac laptops with multiple GPUs use the gmux driver for backlight | 188 | /* Mac laptops with multiple GPUs use the gmux driver for backlight |
@@ -222,12 +221,17 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, | |||
222 | 221 | ||
223 | pdata->encoder = radeon_encoder; | 222 | pdata->encoder = radeon_encoder; |
224 | 223 | ||
225 | backlight_level = radeon_atom_get_backlight_level_from_reg(rdev); | ||
226 | |||
227 | dig = radeon_encoder->enc_priv; | 224 | dig = radeon_encoder->enc_priv; |
228 | dig->bl_dev = bd; | 225 | dig->bl_dev = bd; |
229 | 226 | ||
230 | bd->props.brightness = radeon_atom_backlight_get_brightness(bd); | 227 | bd->props.brightness = radeon_atom_backlight_get_brightness(bd); |
228 | /* Set a reasonable default here if the level is 0 otherwise | ||
229 | * fbdev will attempt to turn the backlight on after console | ||
230 | * unblanking and it will try and restore 0 which turns the backlight | ||
231 | * off again. | ||
232 | */ | ||
233 | if (bd->props.brightness == 0) | ||
234 | bd->props.brightness = RADEON_MAX_BL_LEVEL; | ||
231 | bd->props.power = FB_BLANK_UNBLANK; | 235 | bd->props.power = FB_BLANK_UNBLANK; |
232 | backlight_update_status(bd); | 236 | backlight_update_status(bd); |
233 | 237 | ||
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index 0b2471107137..c0ea66192fe0 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
@@ -2291,6 +2291,7 @@ static void cik_tiling_mode_table_init(struct radeon_device *rdev) | |||
2291 | gb_tile_moden = 0; | 2291 | gb_tile_moden = 0; |
2292 | break; | 2292 | break; |
2293 | } | 2293 | } |
2294 | rdev->config.cik.macrotile_mode_array[reg_offset] = gb_tile_moden; | ||
2294 | WREG32(GB_MACROTILE_MODE0 + (reg_offset * 4), gb_tile_moden); | 2295 | WREG32(GB_MACROTILE_MODE0 + (reg_offset * 4), gb_tile_moden); |
2295 | } | 2296 | } |
2296 | } else if (num_pipe_configs == 8) { | 2297 | } else if (num_pipe_configs == 8) { |
@@ -7376,6 +7377,7 @@ static inline u32 cik_get_ih_wptr(struct radeon_device *rdev) | |||
7376 | tmp = RREG32(IH_RB_CNTL); | 7377 | tmp = RREG32(IH_RB_CNTL); |
7377 | tmp |= IH_WPTR_OVERFLOW_CLEAR; | 7378 | tmp |= IH_WPTR_OVERFLOW_CLEAR; |
7378 | WREG32(IH_RB_CNTL, tmp); | 7379 | WREG32(IH_RB_CNTL, tmp); |
7380 | wptr &= ~RB_OVERFLOW; | ||
7379 | } | 7381 | } |
7380 | return (wptr & rdev->ih.ptr_mask); | 7382 | return (wptr & rdev->ih.ptr_mask); |
7381 | } | 7383 | } |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index f7ece0ff431b..15e4f28015e1 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -2642,8 +2642,9 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s | |||
2642 | for (i = 0; i < rdev->num_crtc; i++) { | 2642 | for (i = 0; i < rdev->num_crtc; i++) { |
2643 | if (save->crtc_enabled[i]) { | 2643 | if (save->crtc_enabled[i]) { |
2644 | tmp = RREG32(EVERGREEN_MASTER_UPDATE_MODE + crtc_offsets[i]); | 2644 | tmp = RREG32(EVERGREEN_MASTER_UPDATE_MODE + crtc_offsets[i]); |
2645 | if ((tmp & 0x3) != 0) { | 2645 | if ((tmp & 0x7) != 3) { |
2646 | tmp &= ~0x3; | 2646 | tmp &= ~0x7; |
2647 | tmp |= 0x3; | ||
2647 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + crtc_offsets[i], tmp); | 2648 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + crtc_offsets[i], tmp); |
2648 | } | 2649 | } |
2649 | tmp = RREG32(EVERGREEN_GRPH_UPDATE + crtc_offsets[i]); | 2650 | tmp = RREG32(EVERGREEN_GRPH_UPDATE + crtc_offsets[i]); |
@@ -4755,6 +4756,7 @@ static u32 evergreen_get_ih_wptr(struct radeon_device *rdev) | |||
4755 | tmp = RREG32(IH_RB_CNTL); | 4756 | tmp = RREG32(IH_RB_CNTL); |
4756 | tmp |= IH_WPTR_OVERFLOW_CLEAR; | 4757 | tmp |= IH_WPTR_OVERFLOW_CLEAR; |
4757 | WREG32(IH_RB_CNTL, tmp); | 4758 | WREG32(IH_RB_CNTL, tmp); |
4759 | wptr &= ~RB_OVERFLOW; | ||
4758 | } | 4760 | } |
4759 | return (wptr & rdev->ih.ptr_mask); | 4761 | return (wptr & rdev->ih.ptr_mask); |
4760 | } | 4762 | } |
diff --git a/drivers/gpu/drm/radeon/evergreen_reg.h b/drivers/gpu/drm/radeon/evergreen_reg.h index 333d143fca2c..23bff590fb6e 100644 --- a/drivers/gpu/drm/radeon/evergreen_reg.h +++ b/drivers/gpu/drm/radeon/evergreen_reg.h | |||
@@ -239,7 +239,6 @@ | |||
239 | # define EVERGREEN_CRTC_V_BLANK (1 << 0) | 239 | # define EVERGREEN_CRTC_V_BLANK (1 << 0) |
240 | #define EVERGREEN_CRTC_STATUS_POSITION 0x6e90 | 240 | #define EVERGREEN_CRTC_STATUS_POSITION 0x6e90 |
241 | #define EVERGREEN_CRTC_STATUS_HV_COUNT 0x6ea0 | 241 | #define EVERGREEN_CRTC_STATUS_HV_COUNT 0x6ea0 |
242 | #define EVERGREEN_MASTER_UPDATE_MODE 0x6ef8 | ||
243 | #define EVERGREEN_CRTC_UPDATE_LOCK 0x6ed4 | 242 | #define EVERGREEN_CRTC_UPDATE_LOCK 0x6ed4 |
244 | #define EVERGREEN_MASTER_UPDATE_LOCK 0x6ef4 | 243 | #define EVERGREEN_MASTER_UPDATE_LOCK 0x6ef4 |
245 | #define EVERGREEN_MASTER_UPDATE_MODE 0x6ef8 | 244 | #define EVERGREEN_MASTER_UPDATE_MODE 0x6ef8 |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index c66952d4b00c..3c69f58e46ef 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -3795,6 +3795,7 @@ static u32 r600_get_ih_wptr(struct radeon_device *rdev) | |||
3795 | tmp = RREG32(IH_RB_CNTL); | 3795 | tmp = RREG32(IH_RB_CNTL); |
3796 | tmp |= IH_WPTR_OVERFLOW_CLEAR; | 3796 | tmp |= IH_WPTR_OVERFLOW_CLEAR; |
3797 | WREG32(IH_RB_CNTL, tmp); | 3797 | WREG32(IH_RB_CNTL, tmp); |
3798 | wptr &= ~RB_OVERFLOW; | ||
3798 | } | 3799 | } |
3799 | return (wptr & rdev->ih.ptr_mask); | 3800 | return (wptr & rdev->ih.ptr_mask); |
3800 | } | 3801 | } |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 29d9cc04c04e..60c47f829122 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -449,6 +449,7 @@ struct radeon_bo_va { | |||
449 | 449 | ||
450 | /* protected by vm mutex */ | 450 | /* protected by vm mutex */ |
451 | struct list_head vm_list; | 451 | struct list_head vm_list; |
452 | struct list_head vm_status; | ||
452 | 453 | ||
453 | /* constant after initialization */ | 454 | /* constant after initialization */ |
454 | struct radeon_vm *vm; | 455 | struct radeon_vm *vm; |
@@ -684,10 +685,9 @@ struct radeon_flip_work { | |||
684 | struct work_struct unpin_work; | 685 | struct work_struct unpin_work; |
685 | struct radeon_device *rdev; | 686 | struct radeon_device *rdev; |
686 | int crtc_id; | 687 | int crtc_id; |
687 | struct drm_framebuffer *fb; | 688 | uint64_t base; |
688 | struct drm_pending_vblank_event *event; | 689 | struct drm_pending_vblank_event *event; |
689 | struct radeon_bo *old_rbo; | 690 | struct radeon_bo *old_rbo; |
690 | struct radeon_bo *new_rbo; | ||
691 | struct radeon_fence *fence; | 691 | struct radeon_fence *fence; |
692 | }; | 692 | }; |
693 | 693 | ||
@@ -868,6 +868,9 @@ struct radeon_vm { | |||
868 | struct list_head va; | 868 | struct list_head va; |
869 | unsigned id; | 869 | unsigned id; |
870 | 870 | ||
871 | /* BOs freed, but not yet updated in the PT */ | ||
872 | struct list_head freed; | ||
873 | |||
871 | /* contains the page directory */ | 874 | /* contains the page directory */ |
872 | struct radeon_bo *page_directory; | 875 | struct radeon_bo *page_directory; |
873 | uint64_t pd_gpu_addr; | 876 | uint64_t pd_gpu_addr; |
@@ -876,6 +879,8 @@ struct radeon_vm { | |||
876 | /* array of page tables, one for each page directory entry */ | 879 | /* array of page tables, one for each page directory entry */ |
877 | struct radeon_vm_pt *page_tables; | 880 | struct radeon_vm_pt *page_tables; |
878 | 881 | ||
882 | struct radeon_bo_va *ib_bo_va; | ||
883 | |||
879 | struct mutex mutex; | 884 | struct mutex mutex; |
880 | /* last fence for cs using this vm */ | 885 | /* last fence for cs using this vm */ |
881 | struct radeon_fence *fence; | 886 | struct radeon_fence *fence; |
@@ -2833,9 +2838,10 @@ void radeon_vm_fence(struct radeon_device *rdev, | |||
2833 | uint64_t radeon_vm_map_gart(struct radeon_device *rdev, uint64_t addr); | 2838 | uint64_t radeon_vm_map_gart(struct radeon_device *rdev, uint64_t addr); |
2834 | int radeon_vm_update_page_directory(struct radeon_device *rdev, | 2839 | int radeon_vm_update_page_directory(struct radeon_device *rdev, |
2835 | struct radeon_vm *vm); | 2840 | struct radeon_vm *vm); |
2841 | int radeon_vm_clear_freed(struct radeon_device *rdev, | ||
2842 | struct radeon_vm *vm); | ||
2836 | int radeon_vm_bo_update(struct radeon_device *rdev, | 2843 | int radeon_vm_bo_update(struct radeon_device *rdev, |
2837 | struct radeon_vm *vm, | 2844 | struct radeon_bo_va *bo_va, |
2838 | struct radeon_bo *bo, | ||
2839 | struct ttm_mem_reg *mem); | 2845 | struct ttm_mem_reg *mem); |
2840 | void radeon_vm_bo_invalidate(struct radeon_device *rdev, | 2846 | void radeon_vm_bo_invalidate(struct radeon_device *rdev, |
2841 | struct radeon_bo *bo); | 2847 | struct radeon_bo *bo); |
@@ -2848,8 +2854,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, | |||
2848 | struct radeon_bo_va *bo_va, | 2854 | struct radeon_bo_va *bo_va, |
2849 | uint64_t offset, | 2855 | uint64_t offset, |
2850 | uint32_t flags); | 2856 | uint32_t flags); |
2851 | int radeon_vm_bo_rmv(struct radeon_device *rdev, | 2857 | void radeon_vm_bo_rmv(struct radeon_device *rdev, |
2852 | struct radeon_bo_va *bo_va); | 2858 | struct radeon_bo_va *bo_va); |
2853 | 2859 | ||
2854 | /* audio */ | 2860 | /* audio */ |
2855 | void r600_audio_update_hdmi(struct work_struct *work); | 2861 | void r600_audio_update_hdmi(struct work_struct *work); |
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 71a143461478..ae763f60c8a0 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
@@ -461,13 +461,23 @@ static int radeon_bo_vm_update_pte(struct radeon_cs_parser *p, | |||
461 | struct radeon_vm *vm) | 461 | struct radeon_vm *vm) |
462 | { | 462 | { |
463 | struct radeon_device *rdev = p->rdev; | 463 | struct radeon_device *rdev = p->rdev; |
464 | struct radeon_bo_va *bo_va; | ||
464 | int i, r; | 465 | int i, r; |
465 | 466 | ||
466 | r = radeon_vm_update_page_directory(rdev, vm); | 467 | r = radeon_vm_update_page_directory(rdev, vm); |
467 | if (r) | 468 | if (r) |
468 | return r; | 469 | return r; |
469 | 470 | ||
470 | r = radeon_vm_bo_update(rdev, vm, rdev->ring_tmp_bo.bo, | 471 | r = radeon_vm_clear_freed(rdev, vm); |
472 | if (r) | ||
473 | return r; | ||
474 | |||
475 | if (vm->ib_bo_va == NULL) { | ||
476 | DRM_ERROR("Tmp BO not in VM!\n"); | ||
477 | return -EINVAL; | ||
478 | } | ||
479 | |||
480 | r = radeon_vm_bo_update(rdev, vm->ib_bo_va, | ||
471 | &rdev->ring_tmp_bo.bo->tbo.mem); | 481 | &rdev->ring_tmp_bo.bo->tbo.mem); |
472 | if (r) | 482 | if (r) |
473 | return r; | 483 | return r; |
@@ -480,7 +490,13 @@ static int radeon_bo_vm_update_pte(struct radeon_cs_parser *p, | |||
480 | continue; | 490 | continue; |
481 | 491 | ||
482 | bo = p->relocs[i].robj; | 492 | bo = p->relocs[i].robj; |
483 | r = radeon_vm_bo_update(rdev, vm, bo, &bo->tbo.mem); | 493 | bo_va = radeon_vm_bo_find(vm, bo); |
494 | if (bo_va == NULL) { | ||
495 | dev_err(rdev->dev, "bo %p not in vm %p\n", bo, vm); | ||
496 | return -EINVAL; | ||
497 | } | ||
498 | |||
499 | r = radeon_vm_bo_update(rdev, bo_va, &bo->tbo.mem); | ||
484 | if (r) | 500 | if (r) |
485 | return r; | 501 | return r; |
486 | } | 502 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 03686fab842d..697add2cd4e3 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -1056,36 +1056,36 @@ static void radeon_check_arguments(struct radeon_device *rdev) | |||
1056 | if (!radeon_check_pot_argument(radeon_vm_size)) { | 1056 | if (!radeon_check_pot_argument(radeon_vm_size)) { |
1057 | dev_warn(rdev->dev, "VM size (%d) must be a power of 2\n", | 1057 | dev_warn(rdev->dev, "VM size (%d) must be a power of 2\n", |
1058 | radeon_vm_size); | 1058 | radeon_vm_size); |
1059 | radeon_vm_size = 4096; | 1059 | radeon_vm_size = 4; |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | if (radeon_vm_size < 4) { | 1062 | if (radeon_vm_size < 1) { |
1063 | dev_warn(rdev->dev, "VM size (%d) to small, min is 4MB\n", | 1063 | dev_warn(rdev->dev, "VM size (%d) to small, min is 1GB\n", |
1064 | radeon_vm_size); | 1064 | radeon_vm_size); |
1065 | radeon_vm_size = 4096; | 1065 | radeon_vm_size = 4; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | /* | 1068 | /* |
1069 | * Max GPUVM size for Cayman, SI and CI are 40 bits. | 1069 | * Max GPUVM size for Cayman, SI and CI are 40 bits. |
1070 | */ | 1070 | */ |
1071 | if (radeon_vm_size > 1024*1024) { | 1071 | if (radeon_vm_size > 1024) { |
1072 | dev_warn(rdev->dev, "VM size (%d) to large, max is 1TB\n", | 1072 | dev_warn(rdev->dev, "VM size (%d) too large, max is 1TB\n", |
1073 | radeon_vm_size); | 1073 | radeon_vm_size); |
1074 | radeon_vm_size = 4096; | 1074 | radeon_vm_size = 4; |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | /* defines number of bits in page table versus page directory, | 1077 | /* defines number of bits in page table versus page directory, |
1078 | * a page is 4KB so we have 12 bits offset, minimum 9 bits in the | 1078 | * a page is 4KB so we have 12 bits offset, minimum 9 bits in the |
1079 | * page table and the remaining bits are in the page directory */ | 1079 | * page table and the remaining bits are in the page directory */ |
1080 | if (radeon_vm_block_size < 9) { | 1080 | if (radeon_vm_block_size < 9) { |
1081 | dev_warn(rdev->dev, "VM page table size (%d) to small\n", | 1081 | dev_warn(rdev->dev, "VM page table size (%d) too small\n", |
1082 | radeon_vm_block_size); | 1082 | radeon_vm_block_size); |
1083 | radeon_vm_block_size = 9; | 1083 | radeon_vm_block_size = 9; |
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | if (radeon_vm_block_size > 24 || | 1086 | if (radeon_vm_block_size > 24 || |
1087 | radeon_vm_size < (1ull << radeon_vm_block_size)) { | 1087 | (radeon_vm_size * 1024) < (1ull << radeon_vm_block_size)) { |
1088 | dev_warn(rdev->dev, "VM page table size (%d) to large\n", | 1088 | dev_warn(rdev->dev, "VM page table size (%d) too large\n", |
1089 | radeon_vm_block_size); | 1089 | radeon_vm_block_size); |
1090 | radeon_vm_block_size = 9; | 1090 | radeon_vm_block_size = 9; |
1091 | } | 1091 | } |
@@ -1238,7 +1238,7 @@ int radeon_device_init(struct radeon_device *rdev, | |||
1238 | /* Adjust VM size here. | 1238 | /* Adjust VM size here. |
1239 | * Max GPUVM size for cayman+ is 40 bits. | 1239 | * Max GPUVM size for cayman+ is 40 bits. |
1240 | */ | 1240 | */ |
1241 | rdev->vm_manager.max_pfn = radeon_vm_size << 8; | 1241 | rdev->vm_manager.max_pfn = radeon_vm_size << 18; |
1242 | 1242 | ||
1243 | /* Set asic functions */ | 1243 | /* Set asic functions */ |
1244 | r = radeon_asic_init(rdev); | 1244 | r = radeon_asic_init(rdev); |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 13896edcf0b6..bf25061c8ac4 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -366,7 +366,6 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) | |||
366 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); | 366 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); |
367 | 367 | ||
368 | drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); | 368 | drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); |
369 | radeon_fence_unref(&work->fence); | ||
370 | radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id); | 369 | radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id); |
371 | queue_work(radeon_crtc->flip_queue, &work->unpin_work); | 370 | queue_work(radeon_crtc->flip_queue, &work->unpin_work); |
372 | } | 371 | } |
@@ -386,51 +385,108 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
386 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[work->crtc_id]; | 385 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[work->crtc_id]; |
387 | 386 | ||
388 | struct drm_crtc *crtc = &radeon_crtc->base; | 387 | struct drm_crtc *crtc = &radeon_crtc->base; |
389 | struct drm_framebuffer *fb = work->fb; | ||
390 | |||
391 | uint32_t tiling_flags, pitch_pixels; | ||
392 | uint64_t base; | ||
393 | |||
394 | unsigned long flags; | 388 | unsigned long flags; |
395 | int r; | 389 | int r; |
396 | 390 | ||
397 | down_read(&rdev->exclusive_lock); | 391 | down_read(&rdev->exclusive_lock); |
398 | while (work->fence) { | 392 | if (work->fence) { |
399 | r = radeon_fence_wait(work->fence, false); | 393 | r = radeon_fence_wait(work->fence, false); |
400 | if (r == -EDEADLK) { | 394 | if (r == -EDEADLK) { |
401 | up_read(&rdev->exclusive_lock); | 395 | up_read(&rdev->exclusive_lock); |
402 | r = radeon_gpu_reset(rdev); | 396 | r = radeon_gpu_reset(rdev); |
403 | down_read(&rdev->exclusive_lock); | 397 | down_read(&rdev->exclusive_lock); |
404 | } | 398 | } |
399 | if (r) | ||
400 | DRM_ERROR("failed to wait on page flip fence (%d)!\n", r); | ||
405 | 401 | ||
406 | if (r) { | 402 | /* We continue with the page flip even if we failed to wait on |
407 | DRM_ERROR("failed to wait on page flip fence (%d)!\n", | 403 | * the fence, otherwise the DRM core and userspace will be |
408 | r); | 404 | * confused about which BO the CRTC is scanning out |
409 | goto cleanup; | 405 | */ |
410 | } else | 406 | |
411 | radeon_fence_unref(&work->fence); | 407 | radeon_fence_unref(&work->fence); |
412 | } | 408 | } |
413 | 409 | ||
410 | /* We borrow the event spin lock for protecting flip_status */ | ||
411 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | ||
412 | |||
413 | /* set the proper interrupt */ | ||
414 | radeon_irq_kms_pflip_irq_get(rdev, radeon_crtc->crtc_id); | ||
415 | |||
416 | /* do the flip (mmio) */ | ||
417 | radeon_page_flip(rdev, radeon_crtc->crtc_id, work->base); | ||
418 | |||
419 | radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED; | ||
420 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
421 | up_read(&rdev->exclusive_lock); | ||
422 | } | ||
423 | |||
424 | static int radeon_crtc_page_flip(struct drm_crtc *crtc, | ||
425 | struct drm_framebuffer *fb, | ||
426 | struct drm_pending_vblank_event *event, | ||
427 | uint32_t page_flip_flags) | ||
428 | { | ||
429 | struct drm_device *dev = crtc->dev; | ||
430 | struct radeon_device *rdev = dev->dev_private; | ||
431 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | ||
432 | struct radeon_framebuffer *old_radeon_fb; | ||
433 | struct radeon_framebuffer *new_radeon_fb; | ||
434 | struct drm_gem_object *obj; | ||
435 | struct radeon_flip_work *work; | ||
436 | struct radeon_bo *new_rbo; | ||
437 | uint32_t tiling_flags, pitch_pixels; | ||
438 | uint64_t base; | ||
439 | unsigned long flags; | ||
440 | int r; | ||
441 | |||
442 | work = kzalloc(sizeof *work, GFP_KERNEL); | ||
443 | if (work == NULL) | ||
444 | return -ENOMEM; | ||
445 | |||
446 | INIT_WORK(&work->flip_work, radeon_flip_work_func); | ||
447 | INIT_WORK(&work->unpin_work, radeon_unpin_work_func); | ||
448 | |||
449 | work->rdev = rdev; | ||
450 | work->crtc_id = radeon_crtc->crtc_id; | ||
451 | work->event = event; | ||
452 | |||
453 | /* schedule unpin of the old buffer */ | ||
454 | old_radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | ||
455 | obj = old_radeon_fb->obj; | ||
456 | |||
457 | /* take a reference to the old object */ | ||
458 | drm_gem_object_reference(obj); | ||
459 | work->old_rbo = gem_to_radeon_bo(obj); | ||
460 | |||
461 | new_radeon_fb = to_radeon_framebuffer(fb); | ||
462 | obj = new_radeon_fb->obj; | ||
463 | new_rbo = gem_to_radeon_bo(obj); | ||
464 | |||
465 | spin_lock(&new_rbo->tbo.bdev->fence_lock); | ||
466 | if (new_rbo->tbo.sync_obj) | ||
467 | work->fence = radeon_fence_ref(new_rbo->tbo.sync_obj); | ||
468 | spin_unlock(&new_rbo->tbo.bdev->fence_lock); | ||
469 | |||
414 | /* pin the new buffer */ | 470 | /* pin the new buffer */ |
415 | DRM_DEBUG_DRIVER("flip-ioctl() cur_fbo = %p, cur_bbo = %p\n", | 471 | DRM_DEBUG_DRIVER("flip-ioctl() cur_rbo = %p, new_rbo = %p\n", |
416 | work->old_rbo, work->new_rbo); | 472 | work->old_rbo, new_rbo); |
417 | 473 | ||
418 | r = radeon_bo_reserve(work->new_rbo, false); | 474 | r = radeon_bo_reserve(new_rbo, false); |
419 | if (unlikely(r != 0)) { | 475 | if (unlikely(r != 0)) { |
420 | DRM_ERROR("failed to reserve new rbo buffer before flip\n"); | 476 | DRM_ERROR("failed to reserve new rbo buffer before flip\n"); |
421 | goto cleanup; | 477 | goto cleanup; |
422 | } | 478 | } |
423 | /* Only 27 bit offset for legacy CRTC */ | 479 | /* Only 27 bit offset for legacy CRTC */ |
424 | r = radeon_bo_pin_restricted(work->new_rbo, RADEON_GEM_DOMAIN_VRAM, | 480 | r = radeon_bo_pin_restricted(new_rbo, RADEON_GEM_DOMAIN_VRAM, |
425 | ASIC_IS_AVIVO(rdev) ? 0 : 1 << 27, &base); | 481 | ASIC_IS_AVIVO(rdev) ? 0 : 1 << 27, &base); |
426 | if (unlikely(r != 0)) { | 482 | if (unlikely(r != 0)) { |
427 | radeon_bo_unreserve(work->new_rbo); | 483 | radeon_bo_unreserve(new_rbo); |
428 | r = -EINVAL; | 484 | r = -EINVAL; |
429 | DRM_ERROR("failed to pin new rbo buffer before flip\n"); | 485 | DRM_ERROR("failed to pin new rbo buffer before flip\n"); |
430 | goto cleanup; | 486 | goto cleanup; |
431 | } | 487 | } |
432 | radeon_bo_get_tiling_flags(work->new_rbo, &tiling_flags, NULL); | 488 | radeon_bo_get_tiling_flags(new_rbo, &tiling_flags, NULL); |
433 | radeon_bo_unreserve(work->new_rbo); | 489 | radeon_bo_unreserve(new_rbo); |
434 | 490 | ||
435 | if (!ASIC_IS_AVIVO(rdev)) { | 491 | if (!ASIC_IS_AVIVO(rdev)) { |
436 | /* crtc offset is from display base addr not FB location */ | 492 | /* crtc offset is from display base addr not FB location */ |
@@ -467,6 +523,7 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
467 | } | 523 | } |
468 | base &= ~7; | 524 | base &= ~7; |
469 | } | 525 | } |
526 | work->base = base; | ||
470 | 527 | ||
471 | r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id); | 528 | r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id); |
472 | if (r) { | 529 | if (r) { |
@@ -477,100 +534,42 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
477 | /* We borrow the event spin lock for protecting flip_work */ | 534 | /* We borrow the event spin lock for protecting flip_work */ |
478 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | 535 | spin_lock_irqsave(&crtc->dev->event_lock, flags); |
479 | 536 | ||
480 | /* set the proper interrupt */ | 537 | if (radeon_crtc->flip_status != RADEON_FLIP_NONE) { |
481 | radeon_irq_kms_pflip_irq_get(rdev, radeon_crtc->crtc_id); | 538 | DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); |
539 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
540 | r = -EBUSY; | ||
541 | goto vblank_cleanup; | ||
542 | } | ||
543 | radeon_crtc->flip_status = RADEON_FLIP_PENDING; | ||
544 | radeon_crtc->flip_work = work; | ||
482 | 545 | ||
483 | /* do the flip (mmio) */ | 546 | /* update crtc fb */ |
484 | radeon_page_flip(rdev, radeon_crtc->crtc_id, base); | 547 | crtc->primary->fb = fb; |
485 | 548 | ||
486 | radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED; | ||
487 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | 549 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); |
488 | up_read(&rdev->exclusive_lock); | ||
489 | 550 | ||
490 | return; | 551 | queue_work(radeon_crtc->flip_queue, &work->flip_work); |
552 | return 0; | ||
553 | |||
554 | vblank_cleanup: | ||
555 | drm_vblank_put(crtc->dev, radeon_crtc->crtc_id); | ||
491 | 556 | ||
492 | pflip_cleanup: | 557 | pflip_cleanup: |
493 | if (unlikely(radeon_bo_reserve(work->new_rbo, false) != 0)) { | 558 | if (unlikely(radeon_bo_reserve(new_rbo, false) != 0)) { |
494 | DRM_ERROR("failed to reserve new rbo in error path\n"); | 559 | DRM_ERROR("failed to reserve new rbo in error path\n"); |
495 | goto cleanup; | 560 | goto cleanup; |
496 | } | 561 | } |
497 | if (unlikely(radeon_bo_unpin(work->new_rbo) != 0)) { | 562 | if (unlikely(radeon_bo_unpin(new_rbo) != 0)) { |
498 | DRM_ERROR("failed to unpin new rbo in error path\n"); | 563 | DRM_ERROR("failed to unpin new rbo in error path\n"); |
499 | } | 564 | } |
500 | radeon_bo_unreserve(work->new_rbo); | 565 | radeon_bo_unreserve(new_rbo); |
501 | 566 | ||
502 | cleanup: | 567 | cleanup: |
503 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); | 568 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); |
504 | radeon_fence_unref(&work->fence); | 569 | radeon_fence_unref(&work->fence); |
505 | kfree(work); | 570 | kfree(work); |
506 | up_read(&rdev->exclusive_lock); | ||
507 | } | ||
508 | |||
509 | static int radeon_crtc_page_flip(struct drm_crtc *crtc, | ||
510 | struct drm_framebuffer *fb, | ||
511 | struct drm_pending_vblank_event *event, | ||
512 | uint32_t page_flip_flags) | ||
513 | { | ||
514 | struct drm_device *dev = crtc->dev; | ||
515 | struct radeon_device *rdev = dev->dev_private; | ||
516 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | ||
517 | struct radeon_framebuffer *old_radeon_fb; | ||
518 | struct radeon_framebuffer *new_radeon_fb; | ||
519 | struct drm_gem_object *obj; | ||
520 | struct radeon_flip_work *work; | ||
521 | unsigned long flags; | ||
522 | |||
523 | work = kzalloc(sizeof *work, GFP_KERNEL); | ||
524 | if (work == NULL) | ||
525 | return -ENOMEM; | ||
526 | |||
527 | INIT_WORK(&work->flip_work, radeon_flip_work_func); | ||
528 | INIT_WORK(&work->unpin_work, radeon_unpin_work_func); | ||
529 | |||
530 | work->rdev = rdev; | ||
531 | work->crtc_id = radeon_crtc->crtc_id; | ||
532 | work->fb = fb; | ||
533 | work->event = event; | ||
534 | |||
535 | /* schedule unpin of the old buffer */ | ||
536 | old_radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | ||
537 | obj = old_radeon_fb->obj; | ||
538 | |||
539 | /* take a reference to the old object */ | ||
540 | drm_gem_object_reference(obj); | ||
541 | work->old_rbo = gem_to_radeon_bo(obj); | ||
542 | |||
543 | new_radeon_fb = to_radeon_framebuffer(fb); | ||
544 | obj = new_radeon_fb->obj; | ||
545 | work->new_rbo = gem_to_radeon_bo(obj); | ||
546 | |||
547 | spin_lock(&work->new_rbo->tbo.bdev->fence_lock); | ||
548 | if (work->new_rbo->tbo.sync_obj) | ||
549 | work->fence = radeon_fence_ref(work->new_rbo->tbo.sync_obj); | ||
550 | spin_unlock(&work->new_rbo->tbo.bdev->fence_lock); | ||
551 | |||
552 | /* We borrow the event spin lock for protecting flip_work */ | ||
553 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | ||
554 | 571 | ||
555 | if (radeon_crtc->flip_status != RADEON_FLIP_NONE) { | 572 | return r; |
556 | DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); | ||
557 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
558 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); | ||
559 | radeon_fence_unref(&work->fence); | ||
560 | kfree(work); | ||
561 | return -EBUSY; | ||
562 | } | ||
563 | radeon_crtc->flip_status = RADEON_FLIP_PENDING; | ||
564 | radeon_crtc->flip_work = work; | ||
565 | |||
566 | /* update crtc fb */ | ||
567 | crtc->primary->fb = fb; | ||
568 | |||
569 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
570 | |||
571 | queue_work(radeon_crtc->flip_queue, &work->flip_work); | ||
572 | |||
573 | return 0; | ||
574 | } | 573 | } |
575 | 574 | ||
576 | static int | 575 | static int |
@@ -830,6 +829,10 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector) | |||
830 | struct radeon_device *rdev = dev->dev_private; | 829 | struct radeon_device *rdev = dev->dev_private; |
831 | int ret = 0; | 830 | int ret = 0; |
832 | 831 | ||
832 | /* don't leak the edid if we already fetched it in detect() */ | ||
833 | if (radeon_connector->edid) | ||
834 | goto got_edid; | ||
835 | |||
833 | /* on hw with routers, select right port */ | 836 | /* on hw with routers, select right port */ |
834 | if (radeon_connector->router.ddc_valid) | 837 | if (radeon_connector->router.ddc_valid) |
835 | radeon_router_select_ddc_port(radeon_connector); | 838 | radeon_router_select_ddc_port(radeon_connector); |
@@ -868,6 +871,7 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector) | |||
868 | radeon_connector->edid = radeon_bios_get_hardcoded_edid(rdev); | 871 | radeon_connector->edid = radeon_bios_get_hardcoded_edid(rdev); |
869 | } | 872 | } |
870 | if (radeon_connector->edid) { | 873 | if (radeon_connector->edid) { |
874 | got_edid: | ||
871 | drm_mode_connector_update_edid_property(&radeon_connector->base, radeon_connector->edid); | 875 | drm_mode_connector_update_edid_property(&radeon_connector->base, radeon_connector->edid); |
872 | ret = drm_add_edid_modes(&radeon_connector->base, radeon_connector->edid); | 876 | ret = drm_add_edid_modes(&radeon_connector->base, radeon_connector->edid); |
873 | drm_edid_to_eld(&radeon_connector->base, radeon_connector->edid); | 877 | drm_edid_to_eld(&radeon_connector->base, radeon_connector->edid); |
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index cb1421369e3a..e9e361084249 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -173,7 +173,7 @@ int radeon_dpm = -1; | |||
173 | int radeon_aspm = -1; | 173 | int radeon_aspm = -1; |
174 | int radeon_runtime_pm = -1; | 174 | int radeon_runtime_pm = -1; |
175 | int radeon_hard_reset = 0; | 175 | int radeon_hard_reset = 0; |
176 | int radeon_vm_size = 4096; | 176 | int radeon_vm_size = 4; |
177 | int radeon_vm_block_size = 9; | 177 | int radeon_vm_block_size = 9; |
178 | int radeon_deep_color = 0; | 178 | int radeon_deep_color = 0; |
179 | 179 | ||
@@ -243,7 +243,7 @@ module_param_named(runpm, radeon_runtime_pm, int, 0444); | |||
243 | MODULE_PARM_DESC(hard_reset, "PCI config reset (1 = force enable, 0 = disable (default))"); | 243 | MODULE_PARM_DESC(hard_reset, "PCI config reset (1 = force enable, 0 = disable (default))"); |
244 | module_param_named(hard_reset, radeon_hard_reset, int, 0444); | 244 | module_param_named(hard_reset, radeon_hard_reset, int, 0444); |
245 | 245 | ||
246 | MODULE_PARM_DESC(vm_size, "VM address space size in megabytes (default 4GB)"); | 246 | MODULE_PARM_DESC(vm_size, "VM address space size in gigabytes (default 4GB)"); |
247 | module_param_named(vm_size, radeon_vm_size, int, 0444); | 247 | module_param_named(vm_size, radeon_vm_size, int, 0444); |
248 | 248 | ||
249 | MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default 9)"); | 249 | MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default 9)"); |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 35d931881b4b..d25ae6acfd5a 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -579,7 +579,7 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) | |||
579 | /* new gpu have virtual address space support */ | 579 | /* new gpu have virtual address space support */ |
580 | if (rdev->family >= CHIP_CAYMAN) { | 580 | if (rdev->family >= CHIP_CAYMAN) { |
581 | struct radeon_fpriv *fpriv; | 581 | struct radeon_fpriv *fpriv; |
582 | struct radeon_bo_va *bo_va; | 582 | struct radeon_vm *vm; |
583 | int r; | 583 | int r; |
584 | 584 | ||
585 | fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); | 585 | fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); |
@@ -587,7 +587,8 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) | |||
587 | return -ENOMEM; | 587 | return -ENOMEM; |
588 | } | 588 | } |
589 | 589 | ||
590 | r = radeon_vm_init(rdev, &fpriv->vm); | 590 | vm = &fpriv->vm; |
591 | r = radeon_vm_init(rdev, vm); | ||
591 | if (r) { | 592 | if (r) { |
592 | kfree(fpriv); | 593 | kfree(fpriv); |
593 | return r; | 594 | return r; |
@@ -596,22 +597,23 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) | |||
596 | if (rdev->accel_working) { | 597 | if (rdev->accel_working) { |
597 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); | 598 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); |
598 | if (r) { | 599 | if (r) { |
599 | radeon_vm_fini(rdev, &fpriv->vm); | 600 | radeon_vm_fini(rdev, vm); |
600 | kfree(fpriv); | 601 | kfree(fpriv); |
601 | return r; | 602 | return r; |
602 | } | 603 | } |
603 | 604 | ||
604 | /* map the ib pool buffer read only into | 605 | /* map the ib pool buffer read only into |
605 | * virtual address space */ | 606 | * virtual address space */ |
606 | bo_va = radeon_vm_bo_add(rdev, &fpriv->vm, | 607 | vm->ib_bo_va = radeon_vm_bo_add(rdev, vm, |
607 | rdev->ring_tmp_bo.bo); | 608 | rdev->ring_tmp_bo.bo); |
608 | r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET, | 609 | r = radeon_vm_bo_set_addr(rdev, vm->ib_bo_va, |
610 | RADEON_VA_IB_OFFSET, | ||
609 | RADEON_VM_PAGE_READABLE | | 611 | RADEON_VM_PAGE_READABLE | |
610 | RADEON_VM_PAGE_SNOOPED); | 612 | RADEON_VM_PAGE_SNOOPED); |
611 | 613 | ||
612 | radeon_bo_unreserve(rdev->ring_tmp_bo.bo); | 614 | radeon_bo_unreserve(rdev->ring_tmp_bo.bo); |
613 | if (r) { | 615 | if (r) { |
614 | radeon_vm_fini(rdev, &fpriv->vm); | 616 | radeon_vm_fini(rdev, vm); |
615 | kfree(fpriv); | 617 | kfree(fpriv); |
616 | return r; | 618 | return r; |
617 | } | 619 | } |
@@ -640,21 +642,19 @@ void radeon_driver_postclose_kms(struct drm_device *dev, | |||
640 | /* new gpu have virtual address space support */ | 642 | /* new gpu have virtual address space support */ |
641 | if (rdev->family >= CHIP_CAYMAN && file_priv->driver_priv) { | 643 | if (rdev->family >= CHIP_CAYMAN && file_priv->driver_priv) { |
642 | struct radeon_fpriv *fpriv = file_priv->driver_priv; | 644 | struct radeon_fpriv *fpriv = file_priv->driver_priv; |
643 | struct radeon_bo_va *bo_va; | 645 | struct radeon_vm *vm = &fpriv->vm; |
644 | int r; | 646 | int r; |
645 | 647 | ||
646 | if (rdev->accel_working) { | 648 | if (rdev->accel_working) { |
647 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); | 649 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); |
648 | if (!r) { | 650 | if (!r) { |
649 | bo_va = radeon_vm_bo_find(&fpriv->vm, | 651 | if (vm->ib_bo_va) |
650 | rdev->ring_tmp_bo.bo); | 652 | radeon_vm_bo_rmv(rdev, vm->ib_bo_va); |
651 | if (bo_va) | ||
652 | radeon_vm_bo_rmv(rdev, bo_va); | ||
653 | radeon_bo_unreserve(rdev->ring_tmp_bo.bo); | 653 | radeon_bo_unreserve(rdev->ring_tmp_bo.bo); |
654 | } | 654 | } |
655 | } | 655 | } |
656 | 656 | ||
657 | radeon_vm_fini(rdev, &fpriv->vm); | 657 | radeon_vm_fini(rdev, vm); |
658 | kfree(fpriv); | 658 | kfree(fpriv); |
659 | file_priv->driver_priv = NULL; | 659 | file_priv->driver_priv = NULL; |
660 | } | 660 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index eecff6bbd341..725d3669014f 100644 --- a/drivers/gpu/drm/radeon/radeon_vm.c +++ b/drivers/gpu/drm/radeon/radeon_vm.c | |||
@@ -332,6 +332,7 @@ struct radeon_bo_va *radeon_vm_bo_add(struct radeon_device *rdev, | |||
332 | bo_va->ref_count = 1; | 332 | bo_va->ref_count = 1; |
333 | INIT_LIST_HEAD(&bo_va->bo_list); | 333 | INIT_LIST_HEAD(&bo_va->bo_list); |
334 | INIT_LIST_HEAD(&bo_va->vm_list); | 334 | INIT_LIST_HEAD(&bo_va->vm_list); |
335 | INIT_LIST_HEAD(&bo_va->vm_status); | ||
335 | 336 | ||
336 | mutex_lock(&vm->mutex); | 337 | mutex_lock(&vm->mutex); |
337 | list_add(&bo_va->vm_list, &vm->va); | 338 | list_add(&bo_va->vm_list, &vm->va); |
@@ -468,6 +469,19 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, | |||
468 | head = &tmp->vm_list; | 469 | head = &tmp->vm_list; |
469 | } | 470 | } |
470 | 471 | ||
472 | if (bo_va->soffset) { | ||
473 | /* add a clone of the bo_va to clear the old address */ | ||
474 | tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL); | ||
475 | if (!tmp) { | ||
476 | mutex_unlock(&vm->mutex); | ||
477 | return -ENOMEM; | ||
478 | } | ||
479 | tmp->soffset = bo_va->soffset; | ||
480 | tmp->eoffset = bo_va->eoffset; | ||
481 | tmp->vm = vm; | ||
482 | list_add(&tmp->vm_status, &vm->freed); | ||
483 | } | ||
484 | |||
471 | bo_va->soffset = soffset; | 485 | bo_va->soffset = soffset; |
472 | bo_va->eoffset = eoffset; | 486 | bo_va->eoffset = eoffset; |
473 | bo_va->flags = flags; | 487 | bo_va->flags = flags; |
@@ -823,25 +837,19 @@ static void radeon_vm_update_ptes(struct radeon_device *rdev, | |||
823 | * Object have to be reserved and mutex must be locked! | 837 | * Object have to be reserved and mutex must be locked! |
824 | */ | 838 | */ |
825 | int radeon_vm_bo_update(struct radeon_device *rdev, | 839 | int radeon_vm_bo_update(struct radeon_device *rdev, |
826 | struct radeon_vm *vm, | 840 | struct radeon_bo_va *bo_va, |
827 | struct radeon_bo *bo, | ||
828 | struct ttm_mem_reg *mem) | 841 | struct ttm_mem_reg *mem) |
829 | { | 842 | { |
843 | struct radeon_vm *vm = bo_va->vm; | ||
830 | struct radeon_ib ib; | 844 | struct radeon_ib ib; |
831 | struct radeon_bo_va *bo_va; | ||
832 | unsigned nptes, ndw; | 845 | unsigned nptes, ndw; |
833 | uint64_t addr; | 846 | uint64_t addr; |
834 | int r; | 847 | int r; |
835 | 848 | ||
836 | bo_va = radeon_vm_bo_find(vm, bo); | ||
837 | if (bo_va == NULL) { | ||
838 | dev_err(rdev->dev, "bo %p not in vm %p\n", bo, vm); | ||
839 | return -EINVAL; | ||
840 | } | ||
841 | 849 | ||
842 | if (!bo_va->soffset) { | 850 | if (!bo_va->soffset) { |
843 | dev_err(rdev->dev, "bo %p don't has a mapping in vm %p\n", | 851 | dev_err(rdev->dev, "bo %p don't has a mapping in vm %p\n", |
844 | bo, vm); | 852 | bo_va->bo, vm); |
845 | return -EINVAL; | 853 | return -EINVAL; |
846 | } | 854 | } |
847 | 855 | ||
@@ -868,7 +876,7 @@ int radeon_vm_bo_update(struct radeon_device *rdev, | |||
868 | 876 | ||
869 | trace_radeon_vm_bo_update(bo_va); | 877 | trace_radeon_vm_bo_update(bo_va); |
870 | 878 | ||
871 | nptes = radeon_bo_ngpu_pages(bo); | 879 | nptes = (bo_va->eoffset - bo_va->soffset) / RADEON_GPU_PAGE_SIZE; |
872 | 880 | ||
873 | /* padding, etc. */ | 881 | /* padding, etc. */ |
874 | ndw = 64; | 882 | ndw = 64; |
@@ -911,33 +919,61 @@ int radeon_vm_bo_update(struct radeon_device *rdev, | |||
911 | } | 919 | } |
912 | 920 | ||
913 | /** | 921 | /** |
922 | * radeon_vm_clear_freed - clear freed BOs in the PT | ||
923 | * | ||
924 | * @rdev: radeon_device pointer | ||
925 | * @vm: requested vm | ||
926 | * | ||
927 | * Make sure all freed BOs are cleared in the PT. | ||
928 | * Returns 0 for success. | ||
929 | * | ||
930 | * PTs have to be reserved and mutex must be locked! | ||
931 | */ | ||
932 | int radeon_vm_clear_freed(struct radeon_device *rdev, | ||
933 | struct radeon_vm *vm) | ||
934 | { | ||
935 | struct radeon_bo_va *bo_va, *tmp; | ||
936 | int r; | ||
937 | |||
938 | list_for_each_entry_safe(bo_va, tmp, &vm->freed, vm_status) { | ||
939 | list_del(&bo_va->vm_status); | ||
940 | r = radeon_vm_bo_update(rdev, bo_va, NULL); | ||
941 | kfree(bo_va); | ||
942 | if (r) | ||
943 | return r; | ||
944 | } | ||
945 | return 0; | ||
946 | |||
947 | } | ||
948 | |||
949 | /** | ||
914 | * radeon_vm_bo_rmv - remove a bo to a specific vm | 950 | * radeon_vm_bo_rmv - remove a bo to a specific vm |
915 | * | 951 | * |
916 | * @rdev: radeon_device pointer | 952 | * @rdev: radeon_device pointer |
917 | * @bo_va: requested bo_va | 953 | * @bo_va: requested bo_va |
918 | * | 954 | * |
919 | * Remove @bo_va->bo from the requested vm (cayman+). | 955 | * Remove @bo_va->bo from the requested vm (cayman+). |
920 | * Remove @bo_va->bo from the list of bos associated with the bo_va->vm and | ||
921 | * remove the ptes for @bo_va in the page table. | ||
922 | * Returns 0 for success. | ||
923 | * | 956 | * |
924 | * Object have to be reserved! | 957 | * Object have to be reserved! |
925 | */ | 958 | */ |
926 | int radeon_vm_bo_rmv(struct radeon_device *rdev, | 959 | void radeon_vm_bo_rmv(struct radeon_device *rdev, |
927 | struct radeon_bo_va *bo_va) | 960 | struct radeon_bo_va *bo_va) |
928 | { | 961 | { |
929 | int r = 0; | 962 | struct radeon_vm *vm = bo_va->vm; |
930 | 963 | ||
931 | mutex_lock(&bo_va->vm->mutex); | 964 | list_del(&bo_va->bo_list); |
932 | if (bo_va->soffset) | ||
933 | r = radeon_vm_bo_update(rdev, bo_va->vm, bo_va->bo, NULL); | ||
934 | 965 | ||
966 | mutex_lock(&vm->mutex); | ||
935 | list_del(&bo_va->vm_list); | 967 | list_del(&bo_va->vm_list); |
936 | mutex_unlock(&bo_va->vm->mutex); | ||
937 | list_del(&bo_va->bo_list); | ||
938 | 968 | ||
939 | kfree(bo_va); | 969 | if (bo_va->soffset) { |
940 | return r; | 970 | bo_va->bo = NULL; |
971 | list_add(&bo_va->vm_status, &vm->freed); | ||
972 | } else { | ||
973 | kfree(bo_va); | ||
974 | } | ||
975 | |||
976 | mutex_unlock(&vm->mutex); | ||
941 | } | 977 | } |
942 | 978 | ||
943 | /** | 979 | /** |
@@ -975,11 +1011,13 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm) | |||
975 | int r; | 1011 | int r; |
976 | 1012 | ||
977 | vm->id = 0; | 1013 | vm->id = 0; |
1014 | vm->ib_bo_va = NULL; | ||
978 | vm->fence = NULL; | 1015 | vm->fence = NULL; |
979 | vm->last_flush = NULL; | 1016 | vm->last_flush = NULL; |
980 | vm->last_id_use = NULL; | 1017 | vm->last_id_use = NULL; |
981 | mutex_init(&vm->mutex); | 1018 | mutex_init(&vm->mutex); |
982 | INIT_LIST_HEAD(&vm->va); | 1019 | INIT_LIST_HEAD(&vm->va); |
1020 | INIT_LIST_HEAD(&vm->freed); | ||
983 | 1021 | ||
984 | pd_size = radeon_vm_directory_size(rdev); | 1022 | pd_size = radeon_vm_directory_size(rdev); |
985 | pd_entries = radeon_vm_num_pdes(rdev); | 1023 | pd_entries = radeon_vm_num_pdes(rdev); |
@@ -1034,7 +1072,8 @@ void radeon_vm_fini(struct radeon_device *rdev, struct radeon_vm *vm) | |||
1034 | kfree(bo_va); | 1072 | kfree(bo_va); |
1035 | } | 1073 | } |
1036 | } | 1074 | } |
1037 | 1075 | list_for_each_entry_safe(bo_va, tmp, &vm->freed, vm_status) | |
1076 | kfree(bo_va); | ||
1038 | 1077 | ||
1039 | for (i = 0; i < radeon_vm_num_pdes(rdev); i++) | 1078 | for (i = 0; i < radeon_vm_num_pdes(rdev); i++) |
1040 | radeon_bo_unref(&vm->page_tables[i].bo); | 1079 | radeon_bo_unref(&vm->page_tables[i].bo); |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 237dd29d9f1c..3e21e869015f 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
@@ -406,8 +406,9 @@ void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save) | |||
406 | for (i = 0; i < rdev->num_crtc; i++) { | 406 | for (i = 0; i < rdev->num_crtc; i++) { |
407 | if (save->crtc_enabled[i]) { | 407 | if (save->crtc_enabled[i]) { |
408 | tmp = RREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + crtc_offsets[i]); | 408 | tmp = RREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + crtc_offsets[i]); |
409 | if ((tmp & 0x3) != 0) { | 409 | if ((tmp & 0x7) != 3) { |
410 | tmp &= ~0x3; | 410 | tmp &= ~0x7; |
411 | tmp |= 0x3; | ||
411 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + crtc_offsets[i], tmp); | 412 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + crtc_offsets[i], tmp); |
412 | } | 413 | } |
413 | tmp = RREG32(AVIVO_D1GRPH_UPDATE + crtc_offsets[i]); | 414 | tmp = RREG32(AVIVO_D1GRPH_UPDATE + crtc_offsets[i]); |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index eba0225259a4..9e854fd016da 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -6103,6 +6103,7 @@ static inline u32 si_get_ih_wptr(struct radeon_device *rdev) | |||
6103 | tmp = RREG32(IH_RB_CNTL); | 6103 | tmp = RREG32(IH_RB_CNTL); |
6104 | tmp |= IH_WPTR_OVERFLOW_CLEAR; | 6104 | tmp |= IH_WPTR_OVERFLOW_CLEAR; |
6105 | WREG32(IH_RB_CNTL, tmp); | 6105 | WREG32(IH_RB_CNTL, tmp); |
6106 | wptr &= ~RB_OVERFLOW; | ||
6106 | } | 6107 | } |
6107 | return (wptr & rdev->ih.ptr_mask); | 6108 | return (wptr & rdev->ih.ptr_mask); |
6108 | } | 6109 | } |
diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index 20da6ff183df..32e50be9c4ac 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c | |||
@@ -1874,15 +1874,16 @@ int trinity_dpm_init(struct radeon_device *rdev) | |||
1874 | for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) | 1874 | for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) |
1875 | pi->at[i] = TRINITY_AT_DFLT; | 1875 | pi->at[i] = TRINITY_AT_DFLT; |
1876 | 1876 | ||
1877 | /* There are stability issues reported on latops with | 1877 | /* There are stability issues reported on with |
1878 | * bapm installed when switching between AC and battery | 1878 | * bapm enabled when switching between AC and battery |
1879 | * power. At the same time, some desktop boards hang | 1879 | * power. At the same time, some MSI boards hang |
1880 | * if it's not enabled and dpm is enabled. | 1880 | * if it's not enabled and dpm is enabled. Just enable |
1881 | * it for MSI boards right now. | ||
1881 | */ | 1882 | */ |
1882 | if (rdev->flags & RADEON_IS_MOBILITY) | 1883 | if (rdev->pdev->subsystem_vendor == 0x1462) |
1883 | pi->enable_bapm = false; | ||
1884 | else | ||
1885 | pi->enable_bapm = true; | 1884 | pi->enable_bapm = true; |
1885 | else | ||
1886 | pi->enable_bapm = false; | ||
1886 | pi->enable_nbps_policy = true; | 1887 | pi->enable_nbps_policy = true; |
1887 | pi->enable_sclk_ds = true; | 1888 | pi->enable_sclk_ds = true; |
1888 | pi->enable_gfx_power_gating = true; | 1889 | pi->enable_gfx_power_gating = true; |
diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c index eaaa3d843b80..23b2ce294c4c 100644 --- a/drivers/hv/hv_fcopy.c +++ b/drivers/hv/hv_fcopy.c | |||
@@ -246,8 +246,8 @@ void hv_fcopy_onchannelcallback(void *context) | |||
246 | /* | 246 | /* |
247 | * Send the information to the user-level daemon. | 247 | * Send the information to the user-level daemon. |
248 | */ | 248 | */ |
249 | fcopy_send_data(); | ||
250 | schedule_delayed_work(&fcopy_work, 5*HZ); | 249 | schedule_delayed_work(&fcopy_work, 5*HZ); |
250 | fcopy_send_data(); | ||
251 | return; | 251 | return; |
252 | } | 252 | } |
253 | icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE; | 253 | icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE; |
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c index 0f4dea5ccf17..9ee3913850d6 100644 --- a/drivers/hwmon/adt7470.c +++ b/drivers/hwmon/adt7470.c | |||
@@ -515,7 +515,7 @@ static ssize_t set_temp_min(struct device *dev, | |||
515 | return -EINVAL; | 515 | return -EINVAL; |
516 | 516 | ||
517 | temp = DIV_ROUND_CLOSEST(temp, 1000); | 517 | temp = DIV_ROUND_CLOSEST(temp, 1000); |
518 | temp = clamp_val(temp, 0, 255); | 518 | temp = clamp_val(temp, -128, 127); |
519 | 519 | ||
520 | mutex_lock(&data->lock); | 520 | mutex_lock(&data->lock); |
521 | data->temp_min[attr->index] = temp; | 521 | data->temp_min[attr->index] = temp; |
@@ -549,7 +549,7 @@ static ssize_t set_temp_max(struct device *dev, | |||
549 | return -EINVAL; | 549 | return -EINVAL; |
550 | 550 | ||
551 | temp = DIV_ROUND_CLOSEST(temp, 1000); | 551 | temp = DIV_ROUND_CLOSEST(temp, 1000); |
552 | temp = clamp_val(temp, 0, 255); | 552 | temp = clamp_val(temp, -128, 127); |
553 | 553 | ||
554 | mutex_lock(&data->lock); | 554 | mutex_lock(&data->lock); |
555 | data->temp_max[attr->index] = temp; | 555 | data->temp_max[attr->index] = temp; |
@@ -826,7 +826,7 @@ static ssize_t set_pwm_tmin(struct device *dev, | |||
826 | return -EINVAL; | 826 | return -EINVAL; |
827 | 827 | ||
828 | temp = DIV_ROUND_CLOSEST(temp, 1000); | 828 | temp = DIV_ROUND_CLOSEST(temp, 1000); |
829 | temp = clamp_val(temp, 0, 255); | 829 | temp = clamp_val(temp, -128, 127); |
830 | 830 | ||
831 | mutex_lock(&data->lock); | 831 | mutex_lock(&data->lock); |
832 | data->pwm_tmin[attr->index] = temp; | 832 | data->pwm_tmin[attr->index] = temp; |
diff --git a/drivers/hwmon/da9052-hwmon.c b/drivers/hwmon/da9052-hwmon.c index afd31042b452..d14ab3c45daa 100644 --- a/drivers/hwmon/da9052-hwmon.c +++ b/drivers/hwmon/da9052-hwmon.c | |||
@@ -194,7 +194,7 @@ static ssize_t da9052_hwmon_show_name(struct device *dev, | |||
194 | struct device_attribute *devattr, | 194 | struct device_attribute *devattr, |
195 | char *buf) | 195 | char *buf) |
196 | { | 196 | { |
197 | return sprintf(buf, "da9052-hwmon\n"); | 197 | return sprintf(buf, "da9052\n"); |
198 | } | 198 | } |
199 | 199 | ||
200 | static ssize_t show_label(struct device *dev, | 200 | static ssize_t show_label(struct device *dev, |
diff --git a/drivers/hwmon/da9055-hwmon.c b/drivers/hwmon/da9055-hwmon.c index 73b3865f1207..35eb7738d711 100644 --- a/drivers/hwmon/da9055-hwmon.c +++ b/drivers/hwmon/da9055-hwmon.c | |||
@@ -204,7 +204,7 @@ static ssize_t da9055_hwmon_show_name(struct device *dev, | |||
204 | struct device_attribute *devattr, | 204 | struct device_attribute *devattr, |
205 | char *buf) | 205 | char *buf) |
206 | { | 206 | { |
207 | return sprintf(buf, "da9055-hwmon\n"); | 207 | return sprintf(buf, "da9055\n"); |
208 | } | 208 | } |
209 | 209 | ||
210 | static ssize_t show_label(struct device *dev, | 210 | static ssize_t show_label(struct device *dev, |
diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c index efee4c59239f..34b9a601ad07 100644 --- a/drivers/hwmon/smsc47m192.c +++ b/drivers/hwmon/smsc47m192.c | |||
@@ -86,7 +86,7 @@ static inline u8 IN_TO_REG(unsigned long val, int n) | |||
86 | */ | 86 | */ |
87 | static inline s8 TEMP_TO_REG(int val) | 87 | static inline s8 TEMP_TO_REG(int val) |
88 | { | 88 | { |
89 | return clamp_val(SCALE(val, 1, 1000), -128000, 127000); | 89 | return SCALE(clamp_val(val, -128000, 127000), 1, 1000); |
90 | } | 90 | } |
91 | 91 | ||
92 | static inline int TEMP_FROM_REG(s8 val) | 92 | static inline int TEMP_FROM_REG(s8 val) |
@@ -384,6 +384,8 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, | |||
384 | err = kstrtoul(buf, 10, &val); | 384 | err = kstrtoul(buf, 10, &val); |
385 | if (err) | 385 | if (err) |
386 | return err; | 386 | return err; |
387 | if (val > 255) | ||
388 | return -EINVAL; | ||
387 | 389 | ||
388 | data->vrm = val; | 390 | data->vrm = val; |
389 | return count; | 391 | return count; |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 8fb46aab2d87..a04c49f2a011 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -416,6 +416,7 @@ config BLK_DEV_CY82C693 | |||
416 | 416 | ||
417 | config BLK_DEV_CS5520 | 417 | config BLK_DEV_CS5520 |
418 | tristate "Cyrix CS5510/20 MediaGX chipset support (VERY EXPERIMENTAL)" | 418 | tristate "Cyrix CS5510/20 MediaGX chipset support (VERY EXPERIMENTAL)" |
419 | depends on X86_32 || COMPILE_TEST | ||
419 | select BLK_DEV_IDEDMA_PCI | 420 | select BLK_DEV_IDEDMA_PCI |
420 | help | 421 | help |
421 | Include support for PIO tuning and virtual DMA on the Cyrix MediaGX | 422 | Include support for PIO tuning and virtual DMA on the Cyrix MediaGX |
@@ -426,6 +427,7 @@ config BLK_DEV_CS5520 | |||
426 | 427 | ||
427 | config BLK_DEV_CS5530 | 428 | config BLK_DEV_CS5530 |
428 | tristate "Cyrix/National Semiconductor CS5530 MediaGX chipset support" | 429 | tristate "Cyrix/National Semiconductor CS5530 MediaGX chipset support" |
430 | depends on X86_32 || COMPILE_TEST | ||
429 | select BLK_DEV_IDEDMA_PCI | 431 | select BLK_DEV_IDEDMA_PCI |
430 | help | 432 | help |
431 | Include support for UDMA on the Cyrix MediaGX 5530 chipset. This | 433 | Include support for UDMA on the Cyrix MediaGX 5530 chipset. This |
@@ -435,7 +437,7 @@ config BLK_DEV_CS5530 | |||
435 | 437 | ||
436 | config BLK_DEV_CS5535 | 438 | config BLK_DEV_CS5535 |
437 | tristate "AMD CS5535 chipset support" | 439 | tristate "AMD CS5535 chipset support" |
438 | depends on X86 && !X86_64 | 440 | depends on X86_32 |
439 | select BLK_DEV_IDEDMA_PCI | 441 | select BLK_DEV_IDEDMA_PCI |
440 | help | 442 | help |
441 | Include support for UDMA on the NSC/AMD CS5535 companion chipset. | 443 | Include support for UDMA on the NSC/AMD CS5535 companion chipset. |
@@ -486,6 +488,7 @@ config BLK_DEV_JMICRON | |||
486 | 488 | ||
487 | config BLK_DEV_SC1200 | 489 | config BLK_DEV_SC1200 |
488 | tristate "National SCx200 chipset support" | 490 | tristate "National SCx200 chipset support" |
491 | depends on X86_32 || COMPILE_TEST | ||
489 | select BLK_DEV_IDEDMA_PCI | 492 | select BLK_DEV_IDEDMA_PCI |
490 | help | 493 | help |
491 | This driver adds support for the on-board IDE controller on the | 494 | This driver adds support for the on-board IDE controller on the |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 2a744a91370e..a3d3b1733c49 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -853,8 +853,9 @@ static int init_irq (ide_hwif_t *hwif) | |||
853 | if (irq_handler == NULL) | 853 | if (irq_handler == NULL) |
854 | irq_handler = ide_intr; | 854 | irq_handler = ide_intr; |
855 | 855 | ||
856 | if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif)) | 856 | if (!host->get_lock) |
857 | goto out_up; | 857 | if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif)) |
858 | goto out_up; | ||
858 | 859 | ||
859 | #if !defined(__mc68000__) | 860 | #if !defined(__mc68000__) |
860 | printk(KERN_INFO "%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name, | 861 | printk(KERN_INFO "%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name, |
@@ -1533,7 +1534,8 @@ static void ide_unregister(ide_hwif_t *hwif) | |||
1533 | 1534 | ||
1534 | ide_proc_unregister_port(hwif); | 1535 | ide_proc_unregister_port(hwif); |
1535 | 1536 | ||
1536 | free_irq(hwif->irq, hwif); | 1537 | if (!hwif->host->get_lock) |
1538 | free_irq(hwif->irq, hwif); | ||
1537 | 1539 | ||
1538 | device_unregister(hwif->portdev); | 1540 | device_unregister(hwif->portdev); |
1539 | device_unregister(&hwif->gendev); | 1541 | device_unregister(&hwif->gendev); |
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index a7e68c81f89d..a077cc86421b 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c | |||
@@ -68,13 +68,13 @@ | |||
68 | /* Defaults values */ | 68 | /* Defaults values */ |
69 | #define BMA180_DEF_PMODE 0 | 69 | #define BMA180_DEF_PMODE 0 |
70 | #define BMA180_DEF_BW 20 | 70 | #define BMA180_DEF_BW 20 |
71 | #define BMA180_DEF_SCALE 250 | 71 | #define BMA180_DEF_SCALE 2452 |
72 | 72 | ||
73 | /* Available values for sysfs */ | 73 | /* Available values for sysfs */ |
74 | #define BMA180_FLP_FREQ_AVAILABLE \ | 74 | #define BMA180_FLP_FREQ_AVAILABLE \ |
75 | "10 20 40 75 150 300" | 75 | "10 20 40 75 150 300" |
76 | #define BMA180_SCALE_AVAILABLE \ | 76 | #define BMA180_SCALE_AVAILABLE \ |
77 | "0.000130 0.000190 0.000250 0.000380 0.000500 0.000990 0.001980" | 77 | "0.001275 0.001863 0.002452 0.003727 0.004903 0.009709 0.019417" |
78 | 78 | ||
79 | struct bma180_data { | 79 | struct bma180_data { |
80 | struct i2c_client *client; | 80 | struct i2c_client *client; |
@@ -94,7 +94,7 @@ enum bma180_axis { | |||
94 | }; | 94 | }; |
95 | 95 | ||
96 | static int bw_table[] = { 10, 20, 40, 75, 150, 300 }; /* Hz */ | 96 | static int bw_table[] = { 10, 20, 40, 75, 150, 300 }; /* Hz */ |
97 | static int scale_table[] = { 130, 190, 250, 380, 500, 990, 1980 }; | 97 | static int scale_table[] = { 1275, 1863, 2452, 3727, 4903, 9709, 19417 }; |
98 | 98 | ||
99 | static int bma180_get_acc_reg(struct bma180_data *data, enum bma180_axis axis) | 99 | static int bma180_get_acc_reg(struct bma180_data *data, enum bma180_axis axis) |
100 | { | 100 | { |
@@ -376,6 +376,8 @@ static int bma180_write_raw(struct iio_dev *indio_dev, | |||
376 | mutex_unlock(&data->mutex); | 376 | mutex_unlock(&data->mutex); |
377 | return ret; | 377 | return ret; |
378 | case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: | 378 | case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: |
379 | if (val2) | ||
380 | return -EINVAL; | ||
379 | mutex_lock(&data->mutex); | 381 | mutex_lock(&data->mutex); |
380 | ret = bma180_set_bw(data, val); | 382 | ret = bma180_set_bw(data, val); |
381 | mutex_unlock(&data->mutex); | 383 | mutex_unlock(&data->mutex); |
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 17aeea170566..2a5fa9a436e5 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c | |||
@@ -111,8 +111,14 @@ static const int mma8452_samp_freq[8][2] = { | |||
111 | {6, 250000}, {1, 560000} | 111 | {6, 250000}, {1, 560000} |
112 | }; | 112 | }; |
113 | 113 | ||
114 | /* | ||
115 | * Hardware has fullscale of -2G, -4G, -8G corresponding to raw value -2048 | ||
116 | * The userspace interface uses m/s^2 and we declare micro units | ||
117 | * So scale factor is given by: | ||
118 | * g * N * 1000000 / 2048 for N = 2, 4, 8 and g=9.80665 | ||
119 | */ | ||
114 | static const int mma8452_scales[3][2] = { | 120 | static const int mma8452_scales[3][2] = { |
115 | {0, 977}, {0, 1953}, {0, 3906} | 121 | {0, 9577}, {0, 19154}, {0, 38307} |
116 | }; | 122 | }; |
117 | 123 | ||
118 | static ssize_t mma8452_show_samp_freq_avail(struct device *dev, | 124 | static ssize_t mma8452_show_samp_freq_avail(struct device *dev, |
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 36b1ae92e239..9f1a14009901 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c | |||
@@ -966,7 +966,7 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev, | |||
966 | 966 | ||
967 | /* Now we have the two masks, work from least sig and build up sizes */ | 967 | /* Now we have the two masks, work from least sig and build up sizes */ |
968 | for_each_set_bit(out_ind, | 968 | for_each_set_bit(out_ind, |
969 | indio_dev->active_scan_mask, | 969 | buffer->scan_mask, |
970 | indio_dev->masklength) { | 970 | indio_dev->masklength) { |
971 | in_ind = find_next_bit(indio_dev->active_scan_mask, | 971 | in_ind = find_next_bit(indio_dev->active_scan_mask, |
972 | indio_dev->masklength, | 972 | indio_dev->masklength, |
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index 258a973a1fb8..bfbf4d419f41 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c | |||
@@ -345,6 +345,9 @@ static int iio_device_add_event(struct iio_dev *indio_dev, | |||
345 | &indio_dev->event_interface->dev_attr_list); | 345 | &indio_dev->event_interface->dev_attr_list); |
346 | kfree(postfix); | 346 | kfree(postfix); |
347 | 347 | ||
348 | if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE)) | ||
349 | continue; | ||
350 | |||
348 | if (ret) | 351 | if (ret) |
349 | return ret; | 352 | return ret; |
350 | 353 | ||
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 5e153f6d4b48..768a0fb67dd6 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -432,8 +432,17 @@ static void arp_failure_discard(void *handle, struct sk_buff *skb) | |||
432 | */ | 432 | */ |
433 | static void act_open_req_arp_failure(void *handle, struct sk_buff *skb) | 433 | static void act_open_req_arp_failure(void *handle, struct sk_buff *skb) |
434 | { | 434 | { |
435 | struct c4iw_ep *ep = handle; | ||
436 | |||
435 | printk(KERN_ERR MOD "ARP failure duing connect\n"); | 437 | printk(KERN_ERR MOD "ARP failure duing connect\n"); |
436 | kfree_skb(skb); | 438 | kfree_skb(skb); |
439 | connect_reply_upcall(ep, -EHOSTUNREACH); | ||
440 | state_set(&ep->com, DEAD); | ||
441 | remove_handle(ep->com.dev, &ep->com.dev->atid_idr, ep->atid); | ||
442 | cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); | ||
443 | dst_release(ep->dst); | ||
444 | cxgb4_l2t_release(ep->l2t); | ||
445 | c4iw_put_ep(&ep->com); | ||
437 | } | 446 | } |
438 | 447 | ||
439 | /* | 448 | /* |
@@ -658,7 +667,7 @@ static int send_connect(struct c4iw_ep *ep) | |||
658 | opt2 |= T5_OPT_2_VALID; | 667 | opt2 |= T5_OPT_2_VALID; |
659 | opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); | 668 | opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); |
660 | } | 669 | } |
661 | t4_set_arp_err_handler(skb, NULL, act_open_req_arp_failure); | 670 | t4_set_arp_err_handler(skb, ep, act_open_req_arp_failure); |
662 | 671 | ||
663 | if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { | 672 | if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { |
664 | if (ep->com.remote_addr.ss_family == AF_INET) { | 673 | if (ep->com.remote_addr.ss_family == AF_INET) { |
@@ -2180,7 +2189,6 @@ static void reject_cr(struct c4iw_dev *dev, u32 hwtid, struct sk_buff *skb) | |||
2180 | PDBG("%s c4iw_dev %p tid %u\n", __func__, dev, hwtid); | 2189 | PDBG("%s c4iw_dev %p tid %u\n", __func__, dev, hwtid); |
2181 | BUG_ON(skb_cloned(skb)); | 2190 | BUG_ON(skb_cloned(skb)); |
2182 | skb_trim(skb, sizeof(struct cpl_tid_release)); | 2191 | skb_trim(skb, sizeof(struct cpl_tid_release)); |
2183 | skb_get(skb); | ||
2184 | release_tid(&dev->rdev, hwtid, skb); | 2192 | release_tid(&dev->rdev, hwtid, skb); |
2185 | return; | 2193 | return; |
2186 | } | 2194 | } |
@@ -3917,7 +3925,7 @@ int __init c4iw_cm_init(void) | |||
3917 | return 0; | 3925 | return 0; |
3918 | } | 3926 | } |
3919 | 3927 | ||
3920 | void __exit c4iw_cm_term(void) | 3928 | void c4iw_cm_term(void) |
3921 | { | 3929 | { |
3922 | WARN_ON(!list_empty(&timeout_list)); | 3930 | WARN_ON(!list_empty(&timeout_list)); |
3923 | flush_workqueue(workq); | 3931 | flush_workqueue(workq); |
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index dd93aadc996e..7db82b24302b 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c | |||
@@ -696,6 +696,7 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) | |||
696 | pr_err(MOD "error allocating status page\n"); | 696 | pr_err(MOD "error allocating status page\n"); |
697 | goto err4; | 697 | goto err4; |
698 | } | 698 | } |
699 | rdev->status_page->db_off = 0; | ||
699 | return 0; | 700 | return 0; |
700 | err4: | 701 | err4: |
701 | c4iw_rqtpool_destroy(rdev); | 702 | c4iw_rqtpool_destroy(rdev); |
@@ -729,7 +730,6 @@ static void c4iw_dealloc(struct uld_ctx *ctx) | |||
729 | if (ctx->dev->rdev.oc_mw_kva) | 730 | if (ctx->dev->rdev.oc_mw_kva) |
730 | iounmap(ctx->dev->rdev.oc_mw_kva); | 731 | iounmap(ctx->dev->rdev.oc_mw_kva); |
731 | ib_dealloc_device(&ctx->dev->ibdev); | 732 | ib_dealloc_device(&ctx->dev->ibdev); |
732 | iwpm_exit(RDMA_NL_C4IW); | ||
733 | ctx->dev = NULL; | 733 | ctx->dev = NULL; |
734 | } | 734 | } |
735 | 735 | ||
@@ -826,12 +826,6 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) | |||
826 | setup_debugfs(devp); | 826 | setup_debugfs(devp); |
827 | } | 827 | } |
828 | 828 | ||
829 | ret = iwpm_init(RDMA_NL_C4IW); | ||
830 | if (ret) { | ||
831 | pr_err("port mapper initialization failed with %d\n", ret); | ||
832 | ib_dealloc_device(&devp->ibdev); | ||
833 | return ERR_PTR(ret); | ||
834 | } | ||
835 | 829 | ||
836 | return devp; | 830 | return devp; |
837 | } | 831 | } |
@@ -1332,6 +1326,15 @@ static int __init c4iw_init_module(void) | |||
1332 | pr_err("%s[%u]: Failed to add netlink callback\n" | 1326 | pr_err("%s[%u]: Failed to add netlink callback\n" |
1333 | , __func__, __LINE__); | 1327 | , __func__, __LINE__); |
1334 | 1328 | ||
1329 | err = iwpm_init(RDMA_NL_C4IW); | ||
1330 | if (err) { | ||
1331 | pr_err("port mapper initialization failed with %d\n", err); | ||
1332 | ibnl_remove_client(RDMA_NL_C4IW); | ||
1333 | c4iw_cm_term(); | ||
1334 | debugfs_remove_recursive(c4iw_debugfs_root); | ||
1335 | return err; | ||
1336 | } | ||
1337 | |||
1335 | cxgb4_register_uld(CXGB4_ULD_RDMA, &c4iw_uld_info); | 1338 | cxgb4_register_uld(CXGB4_ULD_RDMA, &c4iw_uld_info); |
1336 | 1339 | ||
1337 | return 0; | 1340 | return 0; |
@@ -1349,6 +1352,7 @@ static void __exit c4iw_exit_module(void) | |||
1349 | } | 1352 | } |
1350 | mutex_unlock(&dev_mutex); | 1353 | mutex_unlock(&dev_mutex); |
1351 | cxgb4_unregister_uld(CXGB4_ULD_RDMA); | 1354 | cxgb4_unregister_uld(CXGB4_ULD_RDMA); |
1355 | iwpm_exit(RDMA_NL_C4IW); | ||
1352 | ibnl_remove_client(RDMA_NL_C4IW); | 1356 | ibnl_remove_client(RDMA_NL_C4IW); |
1353 | c4iw_cm_term(); | 1357 | c4iw_cm_term(); |
1354 | debugfs_remove_recursive(c4iw_debugfs_root); | 1358 | debugfs_remove_recursive(c4iw_debugfs_root); |
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h index 125bc5d1e175..361fff7a0742 100644 --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h | |||
@@ -908,7 +908,7 @@ int c4iw_destroy_ctrl_qp(struct c4iw_rdev *rdev); | |||
908 | int c4iw_register_device(struct c4iw_dev *dev); | 908 | int c4iw_register_device(struct c4iw_dev *dev); |
909 | void c4iw_unregister_device(struct c4iw_dev *dev); | 909 | void c4iw_unregister_device(struct c4iw_dev *dev); |
910 | int __init c4iw_cm_init(void); | 910 | int __init c4iw_cm_init(void); |
911 | void __exit c4iw_cm_term(void); | 911 | void c4iw_cm_term(void); |
912 | void c4iw_release_dev_ucontext(struct c4iw_rdev *rdev, | 912 | void c4iw_release_dev_ucontext(struct c4iw_rdev *rdev, |
913 | struct c4iw_dev_ucontext *uctx); | 913 | struct c4iw_dev_ucontext *uctx); |
914 | void c4iw_init_dev_ucontext(struct c4iw_rdev *rdev, | 914 | void c4iw_init_dev_ucontext(struct c4iw_rdev *rdev, |
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index d13ddf1c0033..bbbcf389272c 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
@@ -675,7 +675,7 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, | |||
675 | int err; | 675 | int err; |
676 | 676 | ||
677 | uuari = &dev->mdev.priv.uuari; | 677 | uuari = &dev->mdev.priv.uuari; |
678 | if (init_attr->create_flags & ~IB_QP_CREATE_SIGNATURE_EN) | 678 | if (init_attr->create_flags & ~(IB_QP_CREATE_SIGNATURE_EN | IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK)) |
679 | return -EINVAL; | 679 | return -EINVAL; |
680 | 680 | ||
681 | if (init_attr->qp_type == MLX5_IB_QPT_REG_UMR) | 681 | if (init_attr->qp_type == MLX5_IB_QPT_REG_UMR) |
diff --git a/drivers/input/input.c b/drivers/input/input.c index 1c4c0db05550..29ca0bb4f561 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -257,9 +257,10 @@ static int input_handle_abs_event(struct input_dev *dev, | |||
257 | } | 257 | } |
258 | 258 | ||
259 | static int input_get_disposition(struct input_dev *dev, | 259 | static int input_get_disposition(struct input_dev *dev, |
260 | unsigned int type, unsigned int code, int value) | 260 | unsigned int type, unsigned int code, int *pval) |
261 | { | 261 | { |
262 | int disposition = INPUT_IGNORE_EVENT; | 262 | int disposition = INPUT_IGNORE_EVENT; |
263 | int value = *pval; | ||
263 | 264 | ||
264 | switch (type) { | 265 | switch (type) { |
265 | 266 | ||
@@ -357,6 +358,7 @@ static int input_get_disposition(struct input_dev *dev, | |||
357 | break; | 358 | break; |
358 | } | 359 | } |
359 | 360 | ||
361 | *pval = value; | ||
360 | return disposition; | 362 | return disposition; |
361 | } | 363 | } |
362 | 364 | ||
@@ -365,7 +367,7 @@ static void input_handle_event(struct input_dev *dev, | |||
365 | { | 367 | { |
366 | int disposition; | 368 | int disposition; |
367 | 369 | ||
368 | disposition = input_get_disposition(dev, type, code, value); | 370 | disposition = input_get_disposition(dev, type, code, &value); |
369 | 371 | ||
370 | if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event) | 372 | if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event) |
371 | dev->event(dev, type, code, value); | 373 | dev->event(dev, type, code, value); |
diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c index 758b48731415..de7be4f03d91 100644 --- a/drivers/input/keyboard/st-keyscan.c +++ b/drivers/input/keyboard/st-keyscan.c | |||
@@ -215,6 +215,7 @@ static int keyscan_probe(struct platform_device *pdev) | |||
215 | return 0; | 215 | return 0; |
216 | } | 216 | } |
217 | 217 | ||
218 | #ifdef CONFIG_PM_SLEEP | ||
218 | static int keyscan_suspend(struct device *dev) | 219 | static int keyscan_suspend(struct device *dev) |
219 | { | 220 | { |
220 | struct platform_device *pdev = to_platform_device(dev); | 221 | struct platform_device *pdev = to_platform_device(dev); |
@@ -249,6 +250,7 @@ static int keyscan_resume(struct device *dev) | |||
249 | mutex_unlock(&input->mutex); | 250 | mutex_unlock(&input->mutex); |
250 | return retval; | 251 | return retval; |
251 | } | 252 | } |
253 | #endif | ||
252 | 254 | ||
253 | static SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops, keyscan_suspend, keyscan_resume); | 255 | static SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops, keyscan_suspend, keyscan_resume); |
254 | 256 | ||
diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c index e4104f9b2e6d..fed5102e1802 100644 --- a/drivers/input/misc/sirfsoc-onkey.c +++ b/drivers/input/misc/sirfsoc-onkey.c | |||
@@ -213,7 +213,7 @@ static struct platform_driver sirfsoc_pwrc_driver = { | |||
213 | 213 | ||
214 | module_platform_driver(sirfsoc_pwrc_driver); | 214 | module_platform_driver(sirfsoc_pwrc_driver); |
215 | 215 | ||
216 | MODULE_LICENSE("GPLv2"); | 216 | MODULE_LICENSE("GPL v2"); |
217 | MODULE_AUTHOR("Binghua Duan <Binghua.Duan@csr.com>, Xianglong Du <Xianglong.Du@csr.com>"); | 217 | MODULE_AUTHOR("Binghua Duan <Binghua.Duan@csr.com>, Xianglong Du <Xianglong.Du@csr.com>"); |
218 | MODULE_DESCRIPTION("CSR Prima2 PWRC Driver"); | 218 | MODULE_DESCRIPTION("CSR Prima2 PWRC Driver"); |
219 | MODULE_ALIAS("platform:sirfsoc-pwrc"); | 219 | MODULE_ALIAS("platform:sirfsoc-pwrc"); |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index ec772d962f06..ef9e0b8a9aa7 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -132,7 +132,8 @@ static const struct min_max_quirk min_max_pnpid_table[] = { | |||
132 | 1232, 5710, 1156, 4696 | 132 | 1232, 5710, 1156, 4696 |
133 | }, | 133 | }, |
134 | { | 134 | { |
135 | (const char * const []){"LEN0034", "LEN0036", "LEN2004", NULL}, | 135 | (const char * const []){"LEN0034", "LEN0036", "LEN2002", |
136 | "LEN2004", NULL}, | ||
136 | 1024, 5112, 2024, 4832 | 137 | 1024, 5112, 2024, 4832 |
137 | }, | 138 | }, |
138 | { | 139 | { |
@@ -168,7 +169,7 @@ static const char * const topbuttonpad_pnp_ids[] = { | |||
168 | "LEN0049", | 169 | "LEN0049", |
169 | "LEN2000", | 170 | "LEN2000", |
170 | "LEN2001", /* Edge E431 */ | 171 | "LEN2001", /* Edge E431 */ |
171 | "LEN2002", | 172 | "LEN2002", /* Edge E531 */ |
172 | "LEN2003", | 173 | "LEN2003", |
173 | "LEN2004", /* L440 */ | 174 | "LEN2004", /* L440 */ |
174 | "LEN2005", | 175 | "LEN2005", |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 381b20d4c561..136b7b204f56 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -402,6 +402,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { | |||
402 | }, | 402 | }, |
403 | }, | 403 | }, |
404 | { | 404 | { |
405 | /* Acer Aspire 5710 */ | ||
406 | .matches = { | ||
407 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
408 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"), | ||
409 | }, | ||
410 | }, | ||
411 | { | ||
405 | /* Gericom Bellagio */ | 412 | /* Gericom Bellagio */ |
406 | .matches = { | 413 | .matches = { |
407 | DMI_MATCH(DMI_SYS_VENDOR, "Gericom"), | 414 | DMI_MATCH(DMI_SYS_VENDOR, "Gericom"), |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 977d05cd9e2e..e73cf2c71f35 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -1217,9 +1217,9 @@ static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) | |||
1217 | * a=(pi*r^2)/C. | 1217 | * a=(pi*r^2)/C. |
1218 | */ | 1218 | */ |
1219 | int a = data[5]; | 1219 | int a = data[5]; |
1220 | int x_res = input_abs_get_res(input, ABS_X); | 1220 | int x_res = input_abs_get_res(input, ABS_MT_POSITION_X); |
1221 | int y_res = input_abs_get_res(input, ABS_Y); | 1221 | int y_res = input_abs_get_res(input, ABS_MT_POSITION_Y); |
1222 | width = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE); | 1222 | width = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE); |
1223 | height = width * y_res / x_res; | 1223 | height = width * y_res / x_res; |
1224 | } | 1224 | } |
1225 | 1225 | ||
@@ -1587,7 +1587,7 @@ static void wacom_abs_set_axis(struct input_dev *input_dev, | |||
1587 | input_abs_set_res(input_dev, ABS_X, features->x_resolution); | 1587 | input_abs_set_res(input_dev, ABS_X, features->x_resolution); |
1588 | input_abs_set_res(input_dev, ABS_Y, features->y_resolution); | 1588 | input_abs_set_res(input_dev, ABS_Y, features->y_resolution); |
1589 | } else { | 1589 | } else { |
1590 | if (features->touch_max <= 2) { | 1590 | if (features->touch_max == 1) { |
1591 | input_set_abs_params(input_dev, ABS_X, 0, | 1591 | input_set_abs_params(input_dev, ABS_X, 0, |
1592 | features->x_max, features->x_fuzz, 0); | 1592 | features->x_max, features->x_fuzz, 0); |
1593 | input_set_abs_params(input_dev, ABS_Y, 0, | 1593 | input_set_abs_params(input_dev, ABS_Y, 0, |
@@ -1815,14 +1815,8 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1815 | case MTTPC: | 1815 | case MTTPC: |
1816 | case MTTPC_B: | 1816 | case MTTPC_B: |
1817 | case TABLETPC2FG: | 1817 | case TABLETPC2FG: |
1818 | if (features->device_type == BTN_TOOL_FINGER) { | 1818 | if (features->device_type == BTN_TOOL_FINGER && features->touch_max > 1) |
1819 | unsigned int flags = INPUT_MT_DIRECT; | 1819 | input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_DIRECT); |
1820 | |||
1821 | if (wacom_wac->features.type == TABLETPC2FG) | ||
1822 | flags = 0; | ||
1823 | |||
1824 | input_mt_init_slots(input_dev, features->touch_max, flags); | ||
1825 | } | ||
1826 | /* fall through */ | 1820 | /* fall through */ |
1827 | 1821 | ||
1828 | case TABLETPC: | 1822 | case TABLETPC: |
@@ -1883,10 +1877,6 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1883 | __set_bit(BTN_RIGHT, input_dev->keybit); | 1877 | __set_bit(BTN_RIGHT, input_dev->keybit); |
1884 | 1878 | ||
1885 | if (features->touch_max) { | 1879 | if (features->touch_max) { |
1886 | /* touch interface */ | ||
1887 | unsigned int flags = INPUT_MT_POINTER; | ||
1888 | |||
1889 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | ||
1890 | if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { | 1880 | if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { |
1891 | input_set_abs_params(input_dev, | 1881 | input_set_abs_params(input_dev, |
1892 | ABS_MT_TOUCH_MAJOR, | 1882 | ABS_MT_TOUCH_MAJOR, |
@@ -1894,12 +1884,8 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1894 | input_set_abs_params(input_dev, | 1884 | input_set_abs_params(input_dev, |
1895 | ABS_MT_TOUCH_MINOR, | 1885 | ABS_MT_TOUCH_MINOR, |
1896 | 0, features->y_max, 0, 0); | 1886 | 0, features->y_max, 0, 0); |
1897 | } else { | ||
1898 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); | ||
1899 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); | ||
1900 | flags = 0; | ||
1901 | } | 1887 | } |
1902 | input_mt_init_slots(input_dev, features->touch_max, flags); | 1888 | input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_POINTER); |
1903 | } else { | 1889 | } else { |
1904 | /* buttons/keys only interface */ | 1890 | /* buttons/keys only interface */ |
1905 | __clear_bit(ABS_X, input_dev->absbit); | 1891 | __clear_bit(ABS_X, input_dev->absbit); |
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index 4e793a17361f..2ce649520fe0 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c | |||
@@ -359,9 +359,12 @@ static int titsc_parse_dt(struct platform_device *pdev, | |||
359 | */ | 359 | */ |
360 | err = of_property_read_u32(node, "ti,coordinate-readouts", | 360 | err = of_property_read_u32(node, "ti,coordinate-readouts", |
361 | &ts_dev->coordinate_readouts); | 361 | &ts_dev->coordinate_readouts); |
362 | if (err < 0) | 362 | if (err < 0) { |
363 | dev_warn(&pdev->dev, "please use 'ti,coordinate-readouts' instead\n"); | ||
363 | err = of_property_read_u32(node, "ti,coordiante-readouts", | 364 | err = of_property_read_u32(node, "ti,coordiante-readouts", |
364 | &ts_dev->coordinate_readouts); | 365 | &ts_dev->coordinate_readouts); |
366 | } | ||
367 | |||
365 | if (err < 0) | 368 | if (err < 0) |
366 | return err; | 369 | return err; |
367 | 370 | ||
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index b99dd88e31b9..bb446d742a2d 100644 --- a/drivers/iommu/fsl_pamu.c +++ b/drivers/iommu/fsl_pamu.c | |||
@@ -170,10 +170,10 @@ int pamu_disable_liodn(int liodn) | |||
170 | static unsigned int map_addrspace_size_to_wse(phys_addr_t addrspace_size) | 170 | static unsigned int map_addrspace_size_to_wse(phys_addr_t addrspace_size) |
171 | { | 171 | { |
172 | /* Bug if not a power of 2 */ | 172 | /* Bug if not a power of 2 */ |
173 | BUG_ON(!is_power_of_2(addrspace_size)); | 173 | BUG_ON((addrspace_size & (addrspace_size - 1))); |
174 | 174 | ||
175 | /* window size is 2^(WSE+1) bytes */ | 175 | /* window size is 2^(WSE+1) bytes */ |
176 | return __ffs(addrspace_size) - 1; | 176 | return fls64(addrspace_size) - 2; |
177 | } | 177 | } |
178 | 178 | ||
179 | /* Derive the PAACE window count encoding for the subwindow count */ | 179 | /* Derive the PAACE window count encoding for the subwindow count */ |
@@ -351,7 +351,7 @@ int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size, | |||
351 | struct paace *ppaace; | 351 | struct paace *ppaace; |
352 | unsigned long fspi; | 352 | unsigned long fspi; |
353 | 353 | ||
354 | if (!is_power_of_2(win_size) || win_size < PAMU_PAGE_SIZE) { | 354 | if ((win_size & (win_size - 1)) || win_size < PAMU_PAGE_SIZE) { |
355 | pr_debug("window size too small or not a power of two %llx\n", win_size); | 355 | pr_debug("window size too small or not a power of two %llx\n", win_size); |
356 | return -EINVAL; | 356 | return -EINVAL; |
357 | } | 357 | } |
@@ -464,7 +464,7 @@ int pamu_config_spaace(int liodn, u32 subwin_cnt, u32 subwin, | |||
464 | return -ENOENT; | 464 | return -ENOENT; |
465 | } | 465 | } |
466 | 466 | ||
467 | if (!is_power_of_2(subwin_size) || subwin_size < PAMU_PAGE_SIZE) { | 467 | if ((subwin_size & (subwin_size - 1)) || subwin_size < PAMU_PAGE_SIZE) { |
468 | pr_debug("subwindow size out of range, or not a power of 2\n"); | 468 | pr_debug("subwindow size out of range, or not a power of 2\n"); |
469 | return -EINVAL; | 469 | return -EINVAL; |
470 | } | 470 | } |
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 93072ba44b1d..af47648301a9 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c | |||
@@ -301,7 +301,7 @@ static int check_size(u64 size, dma_addr_t iova) | |||
301 | * Size must be a power of two and at least be equal | 301 | * Size must be a power of two and at least be equal |
302 | * to PAMU page size. | 302 | * to PAMU page size. |
303 | */ | 303 | */ |
304 | if (!is_power_of_2(size) || size < PAMU_PAGE_SIZE) { | 304 | if ((size & (size - 1)) || size < PAMU_PAGE_SIZE) { |
305 | pr_debug("%s: size too small or not a power of two\n", __func__); | 305 | pr_debug("%s: size too small or not a power of two\n", __func__); |
306 | return -EINVAL; | 306 | return -EINVAL; |
307 | } | 307 | } |
@@ -335,11 +335,6 @@ static struct fsl_dma_domain *iommu_alloc_dma_domain(void) | |||
335 | return domain; | 335 | return domain; |
336 | } | 336 | } |
337 | 337 | ||
338 | static inline struct device_domain_info *find_domain(struct device *dev) | ||
339 | { | ||
340 | return dev->archdata.iommu_domain; | ||
341 | } | ||
342 | |||
343 | static void remove_device_ref(struct device_domain_info *info, u32 win_cnt) | 338 | static void remove_device_ref(struct device_domain_info *info, u32 win_cnt) |
344 | { | 339 | { |
345 | unsigned long flags; | 340 | unsigned long flags; |
@@ -380,7 +375,7 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d | |||
380 | * Check here if the device is already attached to domain or not. | 375 | * Check here if the device is already attached to domain or not. |
381 | * If the device is already attached to a domain detach it. | 376 | * If the device is already attached to a domain detach it. |
382 | */ | 377 | */ |
383 | old_domain_info = find_domain(dev); | 378 | old_domain_info = dev->archdata.iommu_domain; |
384 | if (old_domain_info && old_domain_info->domain != dma_domain) { | 379 | if (old_domain_info && old_domain_info->domain != dma_domain) { |
385 | spin_unlock_irqrestore(&device_domain_lock, flags); | 380 | spin_unlock_irqrestore(&device_domain_lock, flags); |
386 | detach_device(dev, old_domain_info->domain); | 381 | detach_device(dev, old_domain_info->domain); |
@@ -399,7 +394,7 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d | |||
399 | * the info for the first LIODN as all | 394 | * the info for the first LIODN as all |
400 | * LIODNs share the same domain | 395 | * LIODNs share the same domain |
401 | */ | 396 | */ |
402 | if (!old_domain_info) | 397 | if (!dev->archdata.iommu_domain) |
403 | dev->archdata.iommu_domain = info; | 398 | dev->archdata.iommu_domain = info; |
404 | spin_unlock_irqrestore(&device_domain_lock, flags); | 399 | spin_unlock_irqrestore(&device_domain_lock, flags); |
405 | 400 | ||
@@ -1042,12 +1037,15 @@ root_bus: | |||
1042 | group = get_shared_pci_device_group(pdev); | 1037 | group = get_shared_pci_device_group(pdev); |
1043 | } | 1038 | } |
1044 | 1039 | ||
1040 | if (!group) | ||
1041 | group = ERR_PTR(-ENODEV); | ||
1042 | |||
1045 | return group; | 1043 | return group; |
1046 | } | 1044 | } |
1047 | 1045 | ||
1048 | static int fsl_pamu_add_device(struct device *dev) | 1046 | static int fsl_pamu_add_device(struct device *dev) |
1049 | { | 1047 | { |
1050 | struct iommu_group *group = NULL; | 1048 | struct iommu_group *group = ERR_PTR(-ENODEV); |
1051 | struct pci_dev *pdev; | 1049 | struct pci_dev *pdev; |
1052 | const u32 *prop; | 1050 | const u32 *prop; |
1053 | int ret, len; | 1051 | int ret, len; |
@@ -1070,7 +1068,7 @@ static int fsl_pamu_add_device(struct device *dev) | |||
1070 | group = get_device_iommu_group(dev); | 1068 | group = get_device_iommu_group(dev); |
1071 | } | 1069 | } |
1072 | 1070 | ||
1073 | if (!group || IS_ERR(group)) | 1071 | if (IS_ERR(group)) |
1074 | return PTR_ERR(group); | 1072 | return PTR_ERR(group); |
1075 | 1073 | ||
1076 | ret = iommu_group_add_device(group, dev); | 1074 | ret = iommu_group_add_device(group, dev); |
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 7e11c9d6ae8c..7c131cf7cc13 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/irqchip/chained_irq.h> | 42 | #include <linux/irqchip/chained_irq.h> |
43 | #include <linux/irqchip/arm-gic.h> | 43 | #include <linux/irqchip/arm-gic.h> |
44 | 44 | ||
45 | #include <asm/cputype.h> | ||
45 | #include <asm/irq.h> | 46 | #include <asm/irq.h> |
46 | #include <asm/exception.h> | 47 | #include <asm/exception.h> |
47 | #include <asm/smp_plat.h> | 48 | #include <asm/smp_plat.h> |
@@ -954,7 +955,9 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start, | |||
954 | } | 955 | } |
955 | 956 | ||
956 | for_each_possible_cpu(cpu) { | 957 | for_each_possible_cpu(cpu) { |
957 | unsigned long offset = percpu_offset * cpu_logical_map(cpu); | 958 | u32 mpidr = cpu_logical_map(cpu); |
959 | u32 core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0); | ||
960 | unsigned long offset = percpu_offset * core_id; | ||
958 | *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset; | 961 | *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset; |
959 | *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset; | 962 | *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset; |
960 | } | 963 | } |
@@ -1071,8 +1074,10 @@ gic_of_init(struct device_node *node, struct device_node *parent) | |||
1071 | gic_cnt++; | 1074 | gic_cnt++; |
1072 | return 0; | 1075 | return 0; |
1073 | } | 1076 | } |
1077 | IRQCHIP_DECLARE(gic_400, "arm,gic-400", gic_of_init); | ||
1074 | IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init); | 1078 | IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init); |
1075 | IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init); | 1079 | IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init); |
1080 | IRQCHIP_DECLARE(cortex_a7_gic, "arm,cortex-a7-gic", gic_of_init); | ||
1076 | IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init); | 1081 | IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init); |
1077 | IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init); | 1082 | IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init); |
1078 | 1083 | ||
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index c44950d3eb7b..b7ae0a0dd5b6 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c | |||
@@ -2400,6 +2400,7 @@ allocerr: | |||
2400 | error: | 2400 | error: |
2401 | freeurbs(cs); | 2401 | freeurbs(cs); |
2402 | usb_set_intfdata(interface, NULL); | 2402 | usb_set_intfdata(interface, NULL); |
2403 | usb_put_dev(udev); | ||
2403 | gigaset_freecs(cs); | 2404 | gigaset_freecs(cs); |
2404 | return rc; | 2405 | return rc; |
2405 | } | 2406 | } |
diff --git a/drivers/isdn/hisax/l3ni1.c b/drivers/isdn/hisax/l3ni1.c index 0df6691d045c..8dc791bfaa6f 100644 --- a/drivers/isdn/hisax/l3ni1.c +++ b/drivers/isdn/hisax/l3ni1.c | |||
@@ -2059,13 +2059,17 @@ static int l3ni1_cmd_global(struct PStack *st, isdn_ctrl *ic) | |||
2059 | memcpy(p, ic->parm.ni1_io.data, ic->parm.ni1_io.datalen); /* copy data */ | 2059 | memcpy(p, ic->parm.ni1_io.data, ic->parm.ni1_io.datalen); /* copy data */ |
2060 | l = (p - temp) + ic->parm.ni1_io.datalen; /* total length */ | 2060 | l = (p - temp) + ic->parm.ni1_io.datalen; /* total length */ |
2061 | 2061 | ||
2062 | if (ic->parm.ni1_io.timeout > 0) | 2062 | if (ic->parm.ni1_io.timeout > 0) { |
2063 | if (!(pc = ni1_new_l3_process(st, -1))) | 2063 | pc = ni1_new_l3_process(st, -1); |
2064 | { free_invoke_id(st, id); | 2064 | if (!pc) { |
2065 | free_invoke_id(st, id); | ||
2065 | return (-2); | 2066 | return (-2); |
2066 | } | 2067 | } |
2067 | pc->prot.ni1.ll_id = ic->parm.ni1_io.ll_id; /* remember id */ | 2068 | /* remember id */ |
2068 | pc->prot.ni1.proc = ic->parm.ni1_io.proc; /* and procedure */ | 2069 | pc->prot.ni1.ll_id = ic->parm.ni1_io.ll_id; |
2070 | /* and procedure */ | ||
2071 | pc->prot.ni1.proc = ic->parm.ni1_io.proc; | ||
2072 | } | ||
2069 | 2073 | ||
2070 | if (!(skb = l3_alloc_skb(l))) | 2074 | if (!(skb = l3_alloc_skb(l))) |
2071 | { free_invoke_id(st, id); | 2075 | { free_invoke_id(st, id); |
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index 61ac63237446..62f0688d45a5 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c | |||
@@ -442,7 +442,7 @@ static int get_filter(void __user *arg, struct sock_filter **p) | |||
442 | { | 442 | { |
443 | struct sock_fprog uprog; | 443 | struct sock_fprog uprog; |
444 | struct sock_filter *code = NULL; | 444 | struct sock_filter *code = NULL; |
445 | int len, err; | 445 | int len; |
446 | 446 | ||
447 | if (copy_from_user(&uprog, arg, sizeof(uprog))) | 447 | if (copy_from_user(&uprog, arg, sizeof(uprog))) |
448 | return -EFAULT; | 448 | return -EFAULT; |
@@ -458,12 +458,6 @@ static int get_filter(void __user *arg, struct sock_filter **p) | |||
458 | if (IS_ERR(code)) | 458 | if (IS_ERR(code)) |
459 | return PTR_ERR(code); | 459 | return PTR_ERR(code); |
460 | 460 | ||
461 | err = sk_chk_filter(code, uprog.len); | ||
462 | if (err) { | ||
463 | kfree(code); | ||
464 | return err; | ||
465 | } | ||
466 | |||
467 | *p = code; | 461 | *p = code; |
468 | return uprog.len; | 462 | return uprog.len; |
469 | } | 463 | } |
@@ -644,9 +638,15 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) | |||
644 | fprog.len = len; | 638 | fprog.len = len; |
645 | fprog.filter = code; | 639 | fprog.filter = code; |
646 | 640 | ||
647 | if (is->pass_filter) | 641 | if (is->pass_filter) { |
648 | sk_unattached_filter_destroy(is->pass_filter); | 642 | sk_unattached_filter_destroy(is->pass_filter); |
649 | err = sk_unattached_filter_create(&is->pass_filter, &fprog); | 643 | is->pass_filter = NULL; |
644 | } | ||
645 | if (fprog.filter != NULL) | ||
646 | err = sk_unattached_filter_create(&is->pass_filter, | ||
647 | &fprog); | ||
648 | else | ||
649 | err = 0; | ||
650 | kfree(code); | 650 | kfree(code); |
651 | 651 | ||
652 | return err; | 652 | return err; |
@@ -663,9 +663,15 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) | |||
663 | fprog.len = len; | 663 | fprog.len = len; |
664 | fprog.filter = code; | 664 | fprog.filter = code; |
665 | 665 | ||
666 | if (is->active_filter) | 666 | if (is->active_filter) { |
667 | sk_unattached_filter_destroy(is->active_filter); | 667 | sk_unattached_filter_destroy(is->active_filter); |
668 | err = sk_unattached_filter_create(&is->active_filter, &fprog); | 668 | is->active_filter = NULL; |
669 | } | ||
670 | if (fprog.filter != NULL) | ||
671 | err = sk_unattached_filter_create(&is->active_filter, | ||
672 | &fprog); | ||
673 | else | ||
674 | err = 0; | ||
669 | kfree(code); | 675 | kfree(code); |
670 | 676 | ||
671 | return err; | 677 | return err; |
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 4e84095833db..d724459860d9 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c | |||
@@ -1541,7 +1541,7 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign | |||
1541 | BUG_ON(block_size < 1 << SECTOR_SHIFT || | 1541 | BUG_ON(block_size < 1 << SECTOR_SHIFT || |
1542 | (block_size & (block_size - 1))); | 1542 | (block_size & (block_size - 1))); |
1543 | 1543 | ||
1544 | c = kmalloc(sizeof(*c), GFP_KERNEL); | 1544 | c = kzalloc(sizeof(*c), GFP_KERNEL); |
1545 | if (!c) { | 1545 | if (!c) { |
1546 | r = -ENOMEM; | 1546 | r = -ENOMEM; |
1547 | goto bad_client; | 1547 | goto bad_client; |
diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index 4ead4ba60656..d2899e7eb3aa 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c | |||
@@ -425,6 +425,15 @@ static int __open_metadata(struct dm_cache_metadata *cmd) | |||
425 | 425 | ||
426 | disk_super = dm_block_data(sblock); | 426 | disk_super = dm_block_data(sblock); |
427 | 427 | ||
428 | /* Verify the data block size hasn't changed */ | ||
429 | if (le32_to_cpu(disk_super->data_block_size) != cmd->data_block_size) { | ||
430 | DMERR("changing the data block size (from %u to %llu) is not supported", | ||
431 | le32_to_cpu(disk_super->data_block_size), | ||
432 | (unsigned long long)cmd->data_block_size); | ||
433 | r = -EINVAL; | ||
434 | goto bad; | ||
435 | } | ||
436 | |||
428 | r = __check_incompat_features(disk_super, cmd); | 437 | r = __check_incompat_features(disk_super, cmd); |
429 | if (r < 0) | 438 | if (r < 0) |
430 | goto bad; | 439 | goto bad; |
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 5f054c44b485..2c63326638b6 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -231,7 +231,7 @@ struct cache { | |||
231 | /* | 231 | /* |
232 | * cache_size entries, dirty if set | 232 | * cache_size entries, dirty if set |
233 | */ | 233 | */ |
234 | dm_cblock_t nr_dirty; | 234 | atomic_t nr_dirty; |
235 | unsigned long *dirty_bitset; | 235 | unsigned long *dirty_bitset; |
236 | 236 | ||
237 | /* | 237 | /* |
@@ -492,7 +492,7 @@ static bool is_dirty(struct cache *cache, dm_cblock_t b) | |||
492 | static void set_dirty(struct cache *cache, dm_oblock_t oblock, dm_cblock_t cblock) | 492 | static void set_dirty(struct cache *cache, dm_oblock_t oblock, dm_cblock_t cblock) |
493 | { | 493 | { |
494 | if (!test_and_set_bit(from_cblock(cblock), cache->dirty_bitset)) { | 494 | if (!test_and_set_bit(from_cblock(cblock), cache->dirty_bitset)) { |
495 | cache->nr_dirty = to_cblock(from_cblock(cache->nr_dirty) + 1); | 495 | atomic_inc(&cache->nr_dirty); |
496 | policy_set_dirty(cache->policy, oblock); | 496 | policy_set_dirty(cache->policy, oblock); |
497 | } | 497 | } |
498 | } | 498 | } |
@@ -501,8 +501,7 @@ static void clear_dirty(struct cache *cache, dm_oblock_t oblock, dm_cblock_t cbl | |||
501 | { | 501 | { |
502 | if (test_and_clear_bit(from_cblock(cblock), cache->dirty_bitset)) { | 502 | if (test_and_clear_bit(from_cblock(cblock), cache->dirty_bitset)) { |
503 | policy_clear_dirty(cache->policy, oblock); | 503 | policy_clear_dirty(cache->policy, oblock); |
504 | cache->nr_dirty = to_cblock(from_cblock(cache->nr_dirty) - 1); | 504 | if (atomic_dec_return(&cache->nr_dirty) == 0) |
505 | if (!from_cblock(cache->nr_dirty)) | ||
506 | dm_table_event(cache->ti->table); | 505 | dm_table_event(cache->ti->table); |
507 | } | 506 | } |
508 | } | 507 | } |
@@ -2269,7 +2268,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) | |||
2269 | atomic_set(&cache->quiescing_ack, 0); | 2268 | atomic_set(&cache->quiescing_ack, 0); |
2270 | 2269 | ||
2271 | r = -ENOMEM; | 2270 | r = -ENOMEM; |
2272 | cache->nr_dirty = 0; | 2271 | atomic_set(&cache->nr_dirty, 0); |
2273 | cache->dirty_bitset = alloc_bitset(from_cblock(cache->cache_size)); | 2272 | cache->dirty_bitset = alloc_bitset(from_cblock(cache->cache_size)); |
2274 | if (!cache->dirty_bitset) { | 2273 | if (!cache->dirty_bitset) { |
2275 | *error = "could not allocate dirty bitset"; | 2274 | *error = "could not allocate dirty bitset"; |
@@ -2808,7 +2807,7 @@ static void cache_status(struct dm_target *ti, status_type_t type, | |||
2808 | 2807 | ||
2809 | residency = policy_residency(cache->policy); | 2808 | residency = policy_residency(cache->policy); |
2810 | 2809 | ||
2811 | DMEMIT("%u %llu/%llu %u %llu/%llu %u %u %u %u %u %u %llu ", | 2810 | DMEMIT("%u %llu/%llu %u %llu/%llu %u %u %u %u %u %u %lu ", |
2812 | (unsigned)(DM_CACHE_METADATA_BLOCK_SIZE >> SECTOR_SHIFT), | 2811 | (unsigned)(DM_CACHE_METADATA_BLOCK_SIZE >> SECTOR_SHIFT), |
2813 | (unsigned long long)(nr_blocks_metadata - nr_free_blocks_metadata), | 2812 | (unsigned long long)(nr_blocks_metadata - nr_free_blocks_metadata), |
2814 | (unsigned long long)nr_blocks_metadata, | 2813 | (unsigned long long)nr_blocks_metadata, |
@@ -2821,7 +2820,7 @@ static void cache_status(struct dm_target *ti, status_type_t type, | |||
2821 | (unsigned) atomic_read(&cache->stats.write_miss), | 2820 | (unsigned) atomic_read(&cache->stats.write_miss), |
2822 | (unsigned) atomic_read(&cache->stats.demotion), | 2821 | (unsigned) atomic_read(&cache->stats.demotion), |
2823 | (unsigned) atomic_read(&cache->stats.promotion), | 2822 | (unsigned) atomic_read(&cache->stats.promotion), |
2824 | (unsigned long long) from_cblock(cache->nr_dirty)); | 2823 | (unsigned long) atomic_read(&cache->nr_dirty)); |
2825 | 2824 | ||
2826 | if (writethrough_mode(&cache->features)) | 2825 | if (writethrough_mode(&cache->features)) |
2827 | DMEMIT("1 writethrough "); | 2826 | DMEMIT("1 writethrough "); |
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index b086a945edcb..e9d33ad59df5 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
@@ -613,6 +613,15 @@ static int __open_metadata(struct dm_pool_metadata *pmd) | |||
613 | 613 | ||
614 | disk_super = dm_block_data(sblock); | 614 | disk_super = dm_block_data(sblock); |
615 | 615 | ||
616 | /* Verify the data block size hasn't changed */ | ||
617 | if (le32_to_cpu(disk_super->data_block_size) != pmd->data_block_size) { | ||
618 | DMERR("changing the data block size (from %u to %llu) is not supported", | ||
619 | le32_to_cpu(disk_super->data_block_size), | ||
620 | (unsigned long long)pmd->data_block_size); | ||
621 | r = -EINVAL; | ||
622 | goto bad_unlock_sblock; | ||
623 | } | ||
624 | |||
616 | r = __check_incompat_features(disk_super, pmd); | 625 | r = __check_incompat_features(disk_super, pmd); |
617 | if (r < 0) | 626 | if (r < 0) |
618 | goto bad_unlock_sblock; | 627 | goto bad_unlock_sblock; |
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index 8637d2ed7623..2e3cdcfa0a67 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c | |||
@@ -60,7 +60,7 @@ static int si2168_cmd_execute(struct si2168 *s, struct si2168_cmd *cmd) | |||
60 | jiffies_to_msecs(jiffies) - | 60 | jiffies_to_msecs(jiffies) - |
61 | (jiffies_to_msecs(timeout) - TIMEOUT)); | 61 | (jiffies_to_msecs(timeout) - TIMEOUT)); |
62 | 62 | ||
63 | if (!(cmd->args[0] >> 7) & 0x01) { | 63 | if (!((cmd->args[0] >> 7) & 0x01)) { |
64 | ret = -ETIMEDOUT; | 64 | ret = -ETIMEDOUT; |
65 | goto err_mutex_unlock; | 65 | goto err_mutex_unlock; |
66 | } | 66 | } |
@@ -485,20 +485,6 @@ static int si2168_init(struct dvb_frontend *fe) | |||
485 | if (ret) | 485 | if (ret) |
486 | goto err; | 486 | goto err; |
487 | 487 | ||
488 | cmd.args[0] = 0x05; | ||
489 | cmd.args[1] = 0x00; | ||
490 | cmd.args[2] = 0xaa; | ||
491 | cmd.args[3] = 0x4d; | ||
492 | cmd.args[4] = 0x56; | ||
493 | cmd.args[5] = 0x40; | ||
494 | cmd.args[6] = 0x00; | ||
495 | cmd.args[7] = 0x00; | ||
496 | cmd.wlen = 8; | ||
497 | cmd.rlen = 1; | ||
498 | ret = si2168_cmd_execute(s, &cmd); | ||
499 | if (ret) | ||
500 | goto err; | ||
501 | |||
502 | /* cold state - try to download firmware */ | 488 | /* cold state - try to download firmware */ |
503 | dev_info(&s->client->dev, "%s: found a '%s' in cold state\n", | 489 | dev_info(&s->client->dev, "%s: found a '%s' in cold state\n", |
504 | KBUILD_MODNAME, si2168_ops.info.name); | 490 | KBUILD_MODNAME, si2168_ops.info.name); |
diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h index 2a343e896f40..53f7f06ae343 100644 --- a/drivers/media/dvb-frontends/si2168_priv.h +++ b/drivers/media/dvb-frontends/si2168_priv.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/firmware.h> | 22 | #include <linux/firmware.h> |
23 | #include <linux/i2c-mux.h> | 23 | #include <linux/i2c-mux.h> |
24 | 24 | ||
25 | #define SI2168_FIRMWARE "dvb-demod-si2168-01.fw" | 25 | #define SI2168_FIRMWARE "dvb-demod-si2168-02.fw" |
26 | 26 | ||
27 | /* state struct */ | 27 | /* state struct */ |
28 | struct si2168 { | 28 | struct si2168 { |
diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c index 522fe00f5eee..9619be5d4827 100644 --- a/drivers/media/dvb-frontends/tda10071.c +++ b/drivers/media/dvb-frontends/tda10071.c | |||
@@ -668,6 +668,7 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) | |||
668 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 668 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
669 | int ret, i; | 669 | int ret, i; |
670 | u8 mode, rolloff, pilot, inversion, div; | 670 | u8 mode, rolloff, pilot, inversion, div; |
671 | fe_modulation_t modulation; | ||
671 | 672 | ||
672 | dev_dbg(&priv->i2c->dev, | 673 | dev_dbg(&priv->i2c->dev, |
673 | "%s: delivery_system=%d modulation=%d frequency=%d symbol_rate=%d inversion=%d pilot=%d rolloff=%d\n", | 674 | "%s: delivery_system=%d modulation=%d frequency=%d symbol_rate=%d inversion=%d pilot=%d rolloff=%d\n", |
@@ -702,10 +703,13 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) | |||
702 | 703 | ||
703 | switch (c->delivery_system) { | 704 | switch (c->delivery_system) { |
704 | case SYS_DVBS: | 705 | case SYS_DVBS: |
706 | modulation = QPSK; | ||
705 | rolloff = 0; | 707 | rolloff = 0; |
706 | pilot = 2; | 708 | pilot = 2; |
707 | break; | 709 | break; |
708 | case SYS_DVBS2: | 710 | case SYS_DVBS2: |
711 | modulation = c->modulation; | ||
712 | |||
709 | switch (c->rolloff) { | 713 | switch (c->rolloff) { |
710 | case ROLLOFF_20: | 714 | case ROLLOFF_20: |
711 | rolloff = 2; | 715 | rolloff = 2; |
@@ -750,7 +754,7 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) | |||
750 | 754 | ||
751 | for (i = 0, mode = 0xff; i < ARRAY_SIZE(TDA10071_MODCOD); i++) { | 755 | for (i = 0, mode = 0xff; i < ARRAY_SIZE(TDA10071_MODCOD); i++) { |
752 | if (c->delivery_system == TDA10071_MODCOD[i].delivery_system && | 756 | if (c->delivery_system == TDA10071_MODCOD[i].delivery_system && |
753 | c->modulation == TDA10071_MODCOD[i].modulation && | 757 | modulation == TDA10071_MODCOD[i].modulation && |
754 | c->fec_inner == TDA10071_MODCOD[i].fec) { | 758 | c->fec_inner == TDA10071_MODCOD[i].fec) { |
755 | mode = TDA10071_MODCOD[i].val; | 759 | mode = TDA10071_MODCOD[i].val; |
756 | dev_dbg(&priv->i2c->dev, "%s: mode found=%02x\n", | 760 | dev_dbg(&priv->i2c->dev, "%s: mode found=%02x\n", |
@@ -834,10 +838,10 @@ static int tda10071_get_frontend(struct dvb_frontend *fe) | |||
834 | 838 | ||
835 | switch ((buf[1] >> 0) & 0x01) { | 839 | switch ((buf[1] >> 0) & 0x01) { |
836 | case 0: | 840 | case 0: |
837 | c->inversion = INVERSION_OFF; | 841 | c->inversion = INVERSION_ON; |
838 | break; | 842 | break; |
839 | case 1: | 843 | case 1: |
840 | c->inversion = INVERSION_ON; | 844 | c->inversion = INVERSION_OFF; |
841 | break; | 845 | break; |
842 | } | 846 | } |
843 | 847 | ||
@@ -856,7 +860,7 @@ static int tda10071_get_frontend(struct dvb_frontend *fe) | |||
856 | if (ret) | 860 | if (ret) |
857 | goto error; | 861 | goto error; |
858 | 862 | ||
859 | c->symbol_rate = (buf[0] << 16) | (buf[1] << 8) | (buf[2] << 0); | 863 | c->symbol_rate = ((buf[0] << 16) | (buf[1] << 8) | (buf[2] << 0)) * 1000; |
860 | 864 | ||
861 | return ret; | 865 | return ret; |
862 | error: | 866 | error: |
diff --git a/drivers/media/dvb-frontends/tda10071_priv.h b/drivers/media/dvb-frontends/tda10071_priv.h index 4baf14bfb65a..420486192736 100644 --- a/drivers/media/dvb-frontends/tda10071_priv.h +++ b/drivers/media/dvb-frontends/tda10071_priv.h | |||
@@ -55,6 +55,7 @@ static struct tda10071_modcod { | |||
55 | { SYS_DVBS2, QPSK, FEC_8_9, 0x0a }, | 55 | { SYS_DVBS2, QPSK, FEC_8_9, 0x0a }, |
56 | { SYS_DVBS2, QPSK, FEC_9_10, 0x0b }, | 56 | { SYS_DVBS2, QPSK, FEC_9_10, 0x0b }, |
57 | /* 8PSK */ | 57 | /* 8PSK */ |
58 | { SYS_DVBS2, PSK_8, FEC_AUTO, 0x00 }, | ||
58 | { SYS_DVBS2, PSK_8, FEC_3_5, 0x0c }, | 59 | { SYS_DVBS2, PSK_8, FEC_3_5, 0x0c }, |
59 | { SYS_DVBS2, PSK_8, FEC_2_3, 0x0d }, | 60 | { SYS_DVBS2, PSK_8, FEC_2_3, 0x0d }, |
60 | { SYS_DVBS2, PSK_8, FEC_3_4, 0x0e }, | 61 | { SYS_DVBS2, PSK_8, FEC_3_4, 0x0e }, |
diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c index e65c760e4e8b..0006d6bf8c18 100644 --- a/drivers/media/pci/saa7134/saa7134-empress.c +++ b/drivers/media/pci/saa7134/saa7134-empress.c | |||
@@ -179,7 +179,7 @@ static const struct v4l2_file_operations ts_fops = | |||
179 | .read = vb2_fop_read, | 179 | .read = vb2_fop_read, |
180 | .poll = vb2_fop_poll, | 180 | .poll = vb2_fop_poll, |
181 | .mmap = vb2_fop_mmap, | 181 | .mmap = vb2_fop_mmap, |
182 | .ioctl = video_ioctl2, | 182 | .unlocked_ioctl = video_ioctl2, |
183 | }; | 183 | }; |
184 | 184 | ||
185 | static const struct v4l2_ioctl_ops ts_ioctl_ops = { | 185 | static const struct v4l2_ioctl_ops ts_ioctl_ops = { |
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index a7ed16497903..1e4ec697fb10 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c | |||
@@ -269,6 +269,7 @@ err: | |||
269 | list_del(&buf->list); | 269 | list_del(&buf->list); |
270 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); | 270 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); |
271 | } | 271 | } |
272 | spin_unlock_irqrestore(&common->irqlock, flags); | ||
272 | 273 | ||
273 | return ret; | 274 | return ret; |
274 | } | 275 | } |
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 5bb085b19bcb..b431b58f39e3 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c | |||
@@ -233,6 +233,7 @@ err: | |||
233 | list_del(&buf->list); | 233 | list_del(&buf->list); |
234 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); | 234 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); |
235 | } | 235 | } |
236 | spin_unlock_irqrestore(&common->irqlock, flags); | ||
236 | 237 | ||
237 | return ret; | 238 | return ret; |
238 | } | 239 | } |
diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 271a752cee54..fa4cc7b880aa 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c | |||
@@ -57,7 +57,7 @@ static int si2157_cmd_execute(struct si2157 *s, struct si2157_cmd *cmd) | |||
57 | jiffies_to_msecs(jiffies) - | 57 | jiffies_to_msecs(jiffies) - |
58 | (jiffies_to_msecs(timeout) - TIMEOUT)); | 58 | (jiffies_to_msecs(timeout) - TIMEOUT)); |
59 | 59 | ||
60 | if (!(buf[0] >> 7) & 0x01) { | 60 | if (!((buf[0] >> 7) & 0x01)) { |
61 | ret = -ETIMEDOUT; | 61 | ret = -ETIMEDOUT; |
62 | goto err_mutex_unlock; | 62 | goto err_mutex_unlock; |
63 | } else { | 63 | } else { |
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 021e4d35e4d7..7b9b75f60774 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c | |||
@@ -704,15 +704,41 @@ static int af9035_read_config(struct dvb_usb_device *d) | |||
704 | if (ret < 0) | 704 | if (ret < 0) |
705 | goto err; | 705 | goto err; |
706 | 706 | ||
707 | if (tmp == 0x00) | 707 | dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n", |
708 | dev_dbg(&d->udev->dev, | 708 | __func__, i, tmp); |
709 | "%s: [%d]tuner not set, using default\n", | 709 | |
710 | __func__, i); | 710 | /* tuner sanity check */ |
711 | else | 711 | if (state->chip_type == 0x9135) { |
712 | if (state->chip_version == 0x02) { | ||
713 | /* IT9135 BX (v2) */ | ||
714 | switch (tmp) { | ||
715 | case AF9033_TUNER_IT9135_60: | ||
716 | case AF9033_TUNER_IT9135_61: | ||
717 | case AF9033_TUNER_IT9135_62: | ||
718 | state->af9033_config[i].tuner = tmp; | ||
719 | break; | ||
720 | } | ||
721 | } else { | ||
722 | /* IT9135 AX (v1) */ | ||
723 | switch (tmp) { | ||
724 | case AF9033_TUNER_IT9135_38: | ||
725 | case AF9033_TUNER_IT9135_51: | ||
726 | case AF9033_TUNER_IT9135_52: | ||
727 | state->af9033_config[i].tuner = tmp; | ||
728 | break; | ||
729 | } | ||
730 | } | ||
731 | } else { | ||
732 | /* AF9035 */ | ||
712 | state->af9033_config[i].tuner = tmp; | 733 | state->af9033_config[i].tuner = tmp; |
734 | } | ||
713 | 735 | ||
714 | dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n", | 736 | if (state->af9033_config[i].tuner != tmp) { |
715 | __func__, i, state->af9033_config[i].tuner); | 737 | dev_info(&d->udev->dev, |
738 | "%s: [%d] overriding tuner from %02x to %02x\n", | ||
739 | KBUILD_MODNAME, i, tmp, | ||
740 | state->af9033_config[i].tuner); | ||
741 | } | ||
716 | 742 | ||
717 | switch (state->af9033_config[i].tuner) { | 743 | switch (state->af9033_config[i].tuner) { |
718 | case AF9033_TUNER_TUA9001: | 744 | case AF9033_TUNER_TUA9001: |
diff --git a/drivers/media/usb/gspca/pac7302.c b/drivers/media/usb/gspca/pac7302.c index 2fd1c5e31a0f..339adce7c7a5 100644 --- a/drivers/media/usb/gspca/pac7302.c +++ b/drivers/media/usb/gspca/pac7302.c | |||
@@ -928,6 +928,7 @@ static const struct usb_device_id device_table[] = { | |||
928 | {USB_DEVICE(0x093a, 0x2620)}, | 928 | {USB_DEVICE(0x093a, 0x2620)}, |
929 | {USB_DEVICE(0x093a, 0x2621)}, | 929 | {USB_DEVICE(0x093a, 0x2621)}, |
930 | {USB_DEVICE(0x093a, 0x2622), .driver_info = FL_VFLIP}, | 930 | {USB_DEVICE(0x093a, 0x2622), .driver_info = FL_VFLIP}, |
931 | {USB_DEVICE(0x093a, 0x2623), .driver_info = FL_VFLIP}, | ||
931 | {USB_DEVICE(0x093a, 0x2624), .driver_info = FL_VFLIP}, | 932 | {USB_DEVICE(0x093a, 0x2624), .driver_info = FL_VFLIP}, |
932 | {USB_DEVICE(0x093a, 0x2625)}, | 933 | {USB_DEVICE(0x093a, 0x2625)}, |
933 | {USB_DEVICE(0x093a, 0x2626)}, | 934 | {USB_DEVICE(0x093a, 0x2626)}, |
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 0500c4175d5f..6bce01a674f9 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c | |||
@@ -82,7 +82,7 @@ static void hdpvr_read_bulk_callback(struct urb *urb) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | /*=========================================================================*/ | 84 | /*=========================================================================*/ |
85 | /* bufffer bits */ | 85 | /* buffer bits */ |
86 | 86 | ||
87 | /* function expects dev->io_mutex to be hold by caller */ | 87 | /* function expects dev->io_mutex to be hold by caller */ |
88 | int hdpvr_cancel_queue(struct hdpvr_device *dev) | 88 | int hdpvr_cancel_queue(struct hdpvr_device *dev) |
@@ -926,7 +926,7 @@ static int hdpvr_s_ctrl(struct v4l2_ctrl *ctrl) | |||
926 | case V4L2_CID_MPEG_AUDIO_ENCODING: | 926 | case V4L2_CID_MPEG_AUDIO_ENCODING: |
927 | if (dev->flags & HDPVR_FLAG_AC3_CAP) { | 927 | if (dev->flags & HDPVR_FLAG_AC3_CAP) { |
928 | opt->audio_codec = ctrl->val; | 928 | opt->audio_codec = ctrl->val; |
929 | return hdpvr_set_audio(dev, opt->audio_input, | 929 | return hdpvr_set_audio(dev, opt->audio_input + 1, |
930 | opt->audio_codec); | 930 | opt->audio_codec); |
931 | } | 931 | } |
932 | return 0; | 932 | return 0; |
@@ -1198,7 +1198,7 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent, | |||
1198 | v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, | 1198 | v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, |
1199 | V4L2_CID_MPEG_AUDIO_ENCODING, | 1199 | V4L2_CID_MPEG_AUDIO_ENCODING, |
1200 | ac3 ? V4L2_MPEG_AUDIO_ENCODING_AC3 : V4L2_MPEG_AUDIO_ENCODING_AAC, | 1200 | ac3 ? V4L2_MPEG_AUDIO_ENCODING_AC3 : V4L2_MPEG_AUDIO_ENCODING_AAC, |
1201 | 0x7, V4L2_MPEG_AUDIO_ENCODING_AAC); | 1201 | 0x7, ac3 ? dev->options.audio_codec : V4L2_MPEG_AUDIO_ENCODING_AAC); |
1202 | v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, | 1202 | v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, |
1203 | V4L2_CID_MPEG_VIDEO_ENCODING, | 1203 | V4L2_CID_MPEG_VIDEO_ENCODING, |
1204 | V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 0x3, | 1204 | V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 0x3, |
diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index 4ae54caadd03..ce1c9f5d9dee 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c | |||
@@ -610,10 +610,10 @@ struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait) | |||
610 | aspect.denominator = 9; | 610 | aspect.denominator = 9; |
611 | } else if (ratio == 34) { | 611 | } else if (ratio == 34) { |
612 | aspect.numerator = 4; | 612 | aspect.numerator = 4; |
613 | aspect.numerator = 3; | 613 | aspect.denominator = 3; |
614 | } else if (ratio == 68) { | 614 | } else if (ratio == 68) { |
615 | aspect.numerator = 15; | 615 | aspect.numerator = 15; |
616 | aspect.numerator = 9; | 616 | aspect.denominator = 9; |
617 | } else { | 617 | } else { |
618 | aspect.numerator = hor_landscape + 99; | 618 | aspect.numerator = hor_landscape + 99; |
619 | aspect.denominator = 100; | 619 | aspect.denominator = 100; |
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index e4ec355704a6..a7543ba3e190 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -52,6 +52,11 @@ | |||
52 | /* Atmel chips */ | 52 | /* Atmel chips */ |
53 | #define AT49BV640D 0x02de | 53 | #define AT49BV640D 0x02de |
54 | #define AT49BV640DT 0x02db | 54 | #define AT49BV640DT 0x02db |
55 | /* Sharp chips */ | ||
56 | #define LH28F640BFHE_PTTL90 0x00b0 | ||
57 | #define LH28F640BFHE_PBTL90 0x00b1 | ||
58 | #define LH28F640BFHE_PTTL70A 0x00b2 | ||
59 | #define LH28F640BFHE_PBTL70A 0x00b3 | ||
55 | 60 | ||
56 | static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); | 61 | static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); |
57 | static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); | 62 | static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); |
@@ -258,6 +263,36 @@ static void fixup_st_m28w320cb(struct mtd_info *mtd) | |||
258 | (cfi->cfiq->EraseRegionInfo[1] & 0xffff0000) | 0x3e; | 263 | (cfi->cfiq->EraseRegionInfo[1] & 0xffff0000) | 0x3e; |
259 | }; | 264 | }; |
260 | 265 | ||
266 | static int is_LH28F640BF(struct cfi_private *cfi) | ||
267 | { | ||
268 | /* Sharp LH28F640BF Family */ | ||
269 | if (cfi->mfr == CFI_MFR_SHARP && ( | ||
270 | cfi->id == LH28F640BFHE_PTTL90 || cfi->id == LH28F640BFHE_PBTL90 || | ||
271 | cfi->id == LH28F640BFHE_PTTL70A || cfi->id == LH28F640BFHE_PBTL70A)) | ||
272 | return 1; | ||
273 | return 0; | ||
274 | } | ||
275 | |||
276 | static void fixup_LH28F640BF(struct mtd_info *mtd) | ||
277 | { | ||
278 | struct map_info *map = mtd->priv; | ||
279 | struct cfi_private *cfi = map->fldrv_priv; | ||
280 | struct cfi_pri_intelext *extp = cfi->cmdset_priv; | ||
281 | |||
282 | /* Reset the Partition Configuration Register on LH28F640BF | ||
283 | * to a single partition (PCR = 0x000): PCR is embedded into A0-A15. */ | ||
284 | if (is_LH28F640BF(cfi)) { | ||
285 | printk(KERN_INFO "Reset Partition Config. Register: 1 Partition of 4 planes\n"); | ||
286 | map_write(map, CMD(0x60), 0); | ||
287 | map_write(map, CMD(0x04), 0); | ||
288 | |||
289 | /* We have set one single partition thus | ||
290 | * Simultaneous Operations are not allowed */ | ||
291 | printk(KERN_INFO "cfi_cmdset_0001: Simultaneous Operations disabled\n"); | ||
292 | extp->FeatureSupport &= ~512; | ||
293 | } | ||
294 | } | ||
295 | |||
261 | static void fixup_use_point(struct mtd_info *mtd) | 296 | static void fixup_use_point(struct mtd_info *mtd) |
262 | { | 297 | { |
263 | struct map_info *map = mtd->priv; | 298 | struct map_info *map = mtd->priv; |
@@ -309,6 +344,8 @@ static struct cfi_fixup cfi_fixup_table[] = { | |||
309 | { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct }, | 344 | { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct }, |
310 | { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb }, | 345 | { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb }, |
311 | { CFI_MFR_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock }, | 346 | { CFI_MFR_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock }, |
347 | { CFI_MFR_SHARP, CFI_ID_ANY, fixup_unlock_powerup_lock }, | ||
348 | { CFI_MFR_SHARP, CFI_ID_ANY, fixup_LH28F640BF }, | ||
312 | { 0, 0, NULL } | 349 | { 0, 0, NULL } |
313 | }; | 350 | }; |
314 | 351 | ||
@@ -1649,6 +1686,12 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, | |||
1649 | initial_adr = adr; | 1686 | initial_adr = adr; |
1650 | cmd_adr = adr & ~(wbufsize-1); | 1687 | cmd_adr = adr & ~(wbufsize-1); |
1651 | 1688 | ||
1689 | /* Sharp LH28F640BF chips need the first address for the | ||
1690 | * Page Buffer Program command. See Table 5 of | ||
1691 | * LH28F320BF, LH28F640BF, LH28F128BF Series (Appendix FUM00701) */ | ||
1692 | if (is_LH28F640BF(cfi)) | ||
1693 | cmd_adr = adr; | ||
1694 | |||
1652 | /* Let's determine this according to the interleave only once */ | 1695 | /* Let's determine this according to the interleave only once */ |
1653 | write_cmd = (cfi->cfiq->P_ID != P_ID_INTEL_PERFORMANCE) ? CMD(0xe8) : CMD(0xe9); | 1696 | write_cmd = (cfi->cfiq->P_ID != P_ID_INTEL_PERFORMANCE) ? CMD(0xe8) : CMD(0xe9); |
1654 | 1697 | ||
diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c index 7df86948e6d4..b4f61c7fc161 100644 --- a/drivers/mtd/devices/elm.c +++ b/drivers/mtd/devices/elm.c | |||
@@ -475,6 +475,7 @@ static int elm_context_save(struct elm_info *info) | |||
475 | ELM_SYNDROME_FRAGMENT_1 + offset); | 475 | ELM_SYNDROME_FRAGMENT_1 + offset); |
476 | regs->elm_syndrome_fragment_0[i] = elm_read_reg(info, | 476 | regs->elm_syndrome_fragment_0[i] = elm_read_reg(info, |
477 | ELM_SYNDROME_FRAGMENT_0 + offset); | 477 | ELM_SYNDROME_FRAGMENT_0 + offset); |
478 | break; | ||
478 | default: | 479 | default: |
479 | return -EINVAL; | 480 | return -EINVAL; |
480 | } | 481 | } |
@@ -520,6 +521,7 @@ static int elm_context_restore(struct elm_info *info) | |||
520 | regs->elm_syndrome_fragment_1[i]); | 521 | regs->elm_syndrome_fragment_1[i]); |
521 | elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset, | 522 | elm_write_reg(info, ELM_SYNDROME_FRAGMENT_0 + offset, |
522 | regs->elm_syndrome_fragment_0[i]); | 523 | regs->elm_syndrome_fragment_0[i]); |
524 | break; | ||
523 | default: | 525 | default: |
524 | return -EINVAL; | 526 | return -EINVAL; |
525 | } | 527 | } |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 41167e9e991e..4f3e80c68a26 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -4047,8 +4047,10 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
4047 | ecc->layout->oobavail += ecc->layout->oobfree[i].length; | 4047 | ecc->layout->oobavail += ecc->layout->oobfree[i].length; |
4048 | mtd->oobavail = ecc->layout->oobavail; | 4048 | mtd->oobavail = ecc->layout->oobavail; |
4049 | 4049 | ||
4050 | /* ECC sanity check: warn noisily if it's too weak */ | 4050 | /* ECC sanity check: warn if it's too weak */ |
4051 | WARN_ON(!nand_ecc_strength_good(mtd)); | 4051 | if (!nand_ecc_strength_good(mtd)) |
4052 | pr_warn("WARNING: %s: the ECC used on your system is too weak compared to the one required by the NAND chip\n", | ||
4053 | mtd->name); | ||
4052 | 4054 | ||
4053 | /* | 4055 | /* |
4054 | * Set the number of read / write steps for one page depending on ECC | 4056 | * Set the number of read / write steps for one page depending on ECC |
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index b04e7d059888..0431b46d9fd9 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c | |||
@@ -125,7 +125,7 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id, | |||
125 | parent = *p; | 125 | parent = *p; |
126 | av = rb_entry(parent, struct ubi_ainf_volume, rb); | 126 | av = rb_entry(parent, struct ubi_ainf_volume, rb); |
127 | 127 | ||
128 | if (vol_id < av->vol_id) | 128 | if (vol_id > av->vol_id) |
129 | p = &(*p)->rb_left; | 129 | p = &(*p)->rb_left; |
130 | else | 130 | else |
131 | p = &(*p)->rb_right; | 131 | p = &(*p)->rb_right; |
@@ -423,7 +423,7 @@ static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai, | |||
423 | pnum, err); | 423 | pnum, err); |
424 | ret = err > 0 ? UBI_BAD_FASTMAP : err; | 424 | ret = err > 0 ? UBI_BAD_FASTMAP : err; |
425 | goto out; | 425 | goto out; |
426 | } else if (ret == UBI_IO_BITFLIPS) | 426 | } else if (err == UBI_IO_BITFLIPS) |
427 | scrub = 1; | 427 | scrub = 1; |
428 | 428 | ||
429 | /* | 429 | /* |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 3a451b6cd3d5..701f86cd5993 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4068,7 +4068,7 @@ static int bond_check_params(struct bond_params *params) | |||
4068 | } | 4068 | } |
4069 | 4069 | ||
4070 | if (ad_select) { | 4070 | if (ad_select) { |
4071 | bond_opt_initstr(&newval, lacp_rate); | 4071 | bond_opt_initstr(&newval, ad_select); |
4072 | valptr = bond_opt_parse(bond_opt_get(BOND_OPT_AD_SELECT), | 4072 | valptr = bond_opt_parse(bond_opt_get(BOND_OPT_AD_SELECT), |
4073 | &newval); | 4073 | &newval); |
4074 | if (!valptr) { | 4074 | if (!valptr) { |
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index 824108cd9fd5..12430be6448a 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c | |||
@@ -287,7 +287,8 @@ static int c_can_plat_probe(struct platform_device *pdev) | |||
287 | break; | 287 | break; |
288 | } | 288 | } |
289 | 289 | ||
290 | priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res); | 290 | priv->raminit_ctrlreg = devm_ioremap(&pdev->dev, res->start, |
291 | resource_size(res)); | ||
291 | if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0) | 292 | if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0) |
292 | dev_info(&pdev->dev, "control memory is not used for raminit\n"); | 293 | dev_info(&pdev->dev, "control memory is not used for raminit\n"); |
293 | else | 294 | else |
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c index c83584a26713..5a1891faba8a 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c | |||
@@ -339,7 +339,8 @@ static int xgbe_probe(struct platform_device *pdev) | |||
339 | /* Calculate the number of Tx and Rx rings to be created */ | 339 | /* Calculate the number of Tx and Rx rings to be created */ |
340 | pdata->tx_ring_count = min_t(unsigned int, num_online_cpus(), | 340 | pdata->tx_ring_count = min_t(unsigned int, num_online_cpus(), |
341 | pdata->hw_feat.tx_ch_cnt); | 341 | pdata->hw_feat.tx_ch_cnt); |
342 | if (netif_set_real_num_tx_queues(netdev, pdata->tx_ring_count)) { | 342 | ret = netif_set_real_num_tx_queues(netdev, pdata->tx_ring_count); |
343 | if (ret) { | ||
343 | dev_err(dev, "error setting real tx queue count\n"); | 344 | dev_err(dev, "error setting real tx queue count\n"); |
344 | goto err_io; | 345 | goto err_io; |
345 | } | 346 | } |
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 141160ef249a..5776e503e4c5 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
@@ -654,13 +654,13 @@ static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget) | |||
654 | 654 | ||
655 | work_done = bcm_sysport_tx_reclaim(ring->priv, ring); | 655 | work_done = bcm_sysport_tx_reclaim(ring->priv, ring); |
656 | 656 | ||
657 | if (work_done < budget) { | 657 | if (work_done == 0) { |
658 | napi_complete(napi); | 658 | napi_complete(napi); |
659 | /* re-enable TX interrupt */ | 659 | /* re-enable TX interrupt */ |
660 | intrl2_1_mask_clear(ring->priv, BIT(ring->index)); | 660 | intrl2_1_mask_clear(ring->priv, BIT(ring->index)); |
661 | } | 661 | } |
662 | 662 | ||
663 | return work_done; | 663 | return 0; |
664 | } | 664 | } |
665 | 665 | ||
666 | static void bcm_sysport_tx_reclaim_all(struct bcm_sysport_priv *priv) | 666 | static void bcm_sysport_tx_reclaim_all(struct bcm_sysport_priv *priv) |
@@ -1254,28 +1254,17 @@ static inline void umac_enable_set(struct bcm_sysport_priv *priv, | |||
1254 | usleep_range(1000, 2000); | 1254 | usleep_range(1000, 2000); |
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | static inline int umac_reset(struct bcm_sysport_priv *priv) | 1257 | static inline void umac_reset(struct bcm_sysport_priv *priv) |
1258 | { | 1258 | { |
1259 | unsigned int timeout = 0; | ||
1260 | u32 reg; | 1259 | u32 reg; |
1261 | int ret = 0; | ||
1262 | |||
1263 | umac_writel(priv, 0, UMAC_CMD); | ||
1264 | while (timeout++ < 1000) { | ||
1265 | reg = umac_readl(priv, UMAC_CMD); | ||
1266 | if (!(reg & CMD_SW_RESET)) | ||
1267 | break; | ||
1268 | |||
1269 | udelay(1); | ||
1270 | } | ||
1271 | |||
1272 | if (timeout == 1000) { | ||
1273 | dev_err(&priv->pdev->dev, | ||
1274 | "timeout waiting for MAC to come out of reset\n"); | ||
1275 | ret = -ETIMEDOUT; | ||
1276 | } | ||
1277 | 1260 | ||
1278 | return ret; | 1261 | reg = umac_readl(priv, UMAC_CMD); |
1262 | reg |= CMD_SW_RESET; | ||
1263 | umac_writel(priv, reg, UMAC_CMD); | ||
1264 | udelay(10); | ||
1265 | reg = umac_readl(priv, UMAC_CMD); | ||
1266 | reg &= ~CMD_SW_RESET; | ||
1267 | umac_writel(priv, reg, UMAC_CMD); | ||
1279 | } | 1268 | } |
1280 | 1269 | ||
1281 | static void umac_set_hw_addr(struct bcm_sysport_priv *priv, | 1270 | static void umac_set_hw_addr(struct bcm_sysport_priv *priv, |
@@ -1303,11 +1292,7 @@ static int bcm_sysport_open(struct net_device *dev) | |||
1303 | int ret; | 1292 | int ret; |
1304 | 1293 | ||
1305 | /* Reset UniMAC */ | 1294 | /* Reset UniMAC */ |
1306 | ret = umac_reset(priv); | 1295 | umac_reset(priv); |
1307 | if (ret) { | ||
1308 | netdev_err(dev, "UniMAC reset failed\n"); | ||
1309 | return ret; | ||
1310 | } | ||
1311 | 1296 | ||
1312 | /* Flush TX and RX FIFOs at TOPCTRL level */ | 1297 | /* Flush TX and RX FIFOs at TOPCTRL level */ |
1313 | topctrl_flush(priv); | 1298 | topctrl_flush(priv); |
@@ -1589,12 +1574,6 @@ static int bcm_sysport_probe(struct platform_device *pdev) | |||
1589 | BUILD_BUG_ON(sizeof(struct bcm_tsb) != 8); | 1574 | BUILD_BUG_ON(sizeof(struct bcm_tsb) != 8); |
1590 | dev->needed_headroom += sizeof(struct bcm_tsb); | 1575 | dev->needed_headroom += sizeof(struct bcm_tsb); |
1591 | 1576 | ||
1592 | /* We are interfaced to a switch which handles the multicast | ||
1593 | * filtering for us, so we do not support programming any | ||
1594 | * multicast hash table in this Ethernet MAC. | ||
1595 | */ | ||
1596 | dev->flags &= ~IFF_MULTICAST; | ||
1597 | |||
1598 | /* libphy will adjust the link state accordingly */ | 1577 | /* libphy will adjust the link state accordingly */ |
1599 | netif_carrier_off(dev); | 1578 | netif_carrier_off(dev); |
1600 | 1579 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index 4cab09d3f807..8206a293e6b4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -346,6 +346,7 @@ struct sw_tx_bd { | |||
346 | u8 flags; | 346 | u8 flags; |
347 | /* Set on the first BD descriptor when there is a split BD */ | 347 | /* Set on the first BD descriptor when there is a split BD */ |
348 | #define BNX2X_TSO_SPLIT_BD (1<<0) | 348 | #define BNX2X_TSO_SPLIT_BD (1<<0) |
349 | #define BNX2X_HAS_SECOND_PBD (1<<1) | ||
349 | }; | 350 | }; |
350 | 351 | ||
351 | struct sw_rx_page { | 352 | struct sw_rx_page { |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 47c5814114e1..c43e7238de21 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -227,6 +227,12 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata, | |||
227 | --nbd; | 227 | --nbd; |
228 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); | 228 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); |
229 | 229 | ||
230 | if (tx_buf->flags & BNX2X_HAS_SECOND_PBD) { | ||
231 | /* Skip second parse bd... */ | ||
232 | --nbd; | ||
233 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); | ||
234 | } | ||
235 | |||
230 | /* TSO headers+data bds share a common mapping. See bnx2x_tx_split() */ | 236 | /* TSO headers+data bds share a common mapping. See bnx2x_tx_split() */ |
231 | if (tx_buf->flags & BNX2X_TSO_SPLIT_BD) { | 237 | if (tx_buf->flags & BNX2X_TSO_SPLIT_BD) { |
232 | tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd; | 238 | tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd; |
@@ -797,7 +803,8 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
797 | 803 | ||
798 | return; | 804 | return; |
799 | } | 805 | } |
800 | bnx2x_frag_free(fp, new_data); | 806 | if (new_data) |
807 | bnx2x_frag_free(fp, new_data); | ||
801 | drop: | 808 | drop: |
802 | /* drop the packet and keep the buffer in the bin */ | 809 | /* drop the packet and keep the buffer in the bin */ |
803 | DP(NETIF_MSG_RX_STATUS, | 810 | DP(NETIF_MSG_RX_STATUS, |
@@ -3888,6 +3895,9 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3888 | /* set encapsulation flag in start BD */ | 3895 | /* set encapsulation flag in start BD */ |
3889 | SET_FLAG(tx_start_bd->general_data, | 3896 | SET_FLAG(tx_start_bd->general_data, |
3890 | ETH_TX_START_BD_TUNNEL_EXIST, 1); | 3897 | ETH_TX_START_BD_TUNNEL_EXIST, 1); |
3898 | |||
3899 | tx_buf->flags |= BNX2X_HAS_SECOND_PBD; | ||
3900 | |||
3891 | nbd++; | 3901 | nbd++; |
3892 | } else if (xmit_type & XMIT_CSUM) { | 3902 | } else if (xmit_type & XMIT_CSUM) { |
3893 | /* Set PBD in checksum offload case w/o encapsulation */ | 3903 | /* Set PBD in checksum offload case w/o encapsulation */ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index bd0600cf7266..25eddd90f482 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -379,6 +379,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
379 | break; | 379 | break; |
380 | case PORT_FIBRE: | 380 | case PORT_FIBRE: |
381 | case PORT_DA: | 381 | case PORT_DA: |
382 | case PORT_NONE: | ||
382 | if (!(bp->port.supported[0] & SUPPORTED_FIBRE || | 383 | if (!(bp->port.supported[0] & SUPPORTED_FIBRE || |
383 | bp->port.supported[1] & SUPPORTED_FIBRE)) { | 384 | bp->port.supported[1] & SUPPORTED_FIBRE)) { |
384 | DP(BNX2X_MSG_ETHTOOL, | 385 | DP(BNX2X_MSG_ETHTOOL, |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 2887034523e0..6a8b1453a1b9 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -12937,7 +12937,7 @@ static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev, int cnic_cnt) | |||
12937 | * without the default SB. | 12937 | * without the default SB. |
12938 | * For VFs there is no default SB, then we return (index+1). | 12938 | * For VFs there is no default SB, then we return (index+1). |
12939 | */ | 12939 | */ |
12940 | pci_read_config_word(pdev, pdev->msix_cap + PCI_MSI_FLAGS, &control); | 12940 | pci_read_config_word(pdev, pdev->msix_cap + PCI_MSIX_FLAGS, &control); |
12941 | 12941 | ||
12942 | index = control & PCI_MSIX_FLAGS_QSIZE; | 12942 | index = control & PCI_MSIX_FLAGS_QSIZE; |
12943 | 12943 | ||
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 5ba1cfbd60da..4e615debe472 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c | |||
@@ -1149,6 +1149,11 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1149 | goto out; | 1149 | goto out; |
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | if (skb_padto(skb, ETH_ZLEN)) { | ||
1153 | ret = NETDEV_TX_OK; | ||
1154 | goto out; | ||
1155 | } | ||
1156 | |||
1152 | /* set the SKB transmit checksum */ | 1157 | /* set the SKB transmit checksum */ |
1153 | if (priv->desc_64b_en) { | 1158 | if (priv->desc_64b_en) { |
1154 | ret = bcmgenet_put_tx_csum(dev, skb); | 1159 | ret = bcmgenet_put_tx_csum(dev, skb); |
@@ -1408,13 +1413,6 @@ static int bcmgenet_alloc_rx_buffers(struct bcmgenet_priv *priv) | |||
1408 | if (cb->skb) | 1413 | if (cb->skb) |
1409 | continue; | 1414 | continue; |
1410 | 1415 | ||
1411 | /* set the DMA descriptor length once and for all | ||
1412 | * it will only change if we support dynamically sizing | ||
1413 | * priv->rx_buf_len, but we do not | ||
1414 | */ | ||
1415 | dmadesc_set_length_status(priv, priv->rx_bd_assign_ptr, | ||
1416 | priv->rx_buf_len << DMA_BUFLENGTH_SHIFT); | ||
1417 | |||
1418 | ret = bcmgenet_rx_refill(priv, cb); | 1416 | ret = bcmgenet_rx_refill(priv, cb); |
1419 | if (ret) | 1417 | if (ret) |
1420 | break; | 1418 | break; |
@@ -2535,14 +2533,17 @@ static int bcmgenet_probe(struct platform_device *pdev) | |||
2535 | netif_set_real_num_tx_queues(priv->dev, priv->hw_params->tx_queues + 1); | 2533 | netif_set_real_num_tx_queues(priv->dev, priv->hw_params->tx_queues + 1); |
2536 | netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); | 2534 | netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); |
2537 | 2535 | ||
2538 | err = register_netdev(dev); | 2536 | /* libphy will determine the link state */ |
2539 | if (err) | 2537 | netif_carrier_off(dev); |
2540 | goto err_clk_disable; | ||
2541 | 2538 | ||
2542 | /* Turn off the main clock, WOL clock is handled separately */ | 2539 | /* Turn off the main clock, WOL clock is handled separately */ |
2543 | if (!IS_ERR(priv->clk)) | 2540 | if (!IS_ERR(priv->clk)) |
2544 | clk_disable_unprepare(priv->clk); | 2541 | clk_disable_unprepare(priv->clk); |
2545 | 2542 | ||
2543 | err = register_netdev(dev); | ||
2544 | if (err) | ||
2545 | goto err; | ||
2546 | |||
2546 | return err; | 2547 | return err; |
2547 | 2548 | ||
2548 | err_clk_disable: | 2549 | err_clk_disable: |
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h index 0f117105fed1..e23c993b1362 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h | |||
@@ -331,9 +331,9 @@ struct bcmgenet_mib_counters { | |||
331 | #define EXT_ENERGY_DET_MASK (1 << 12) | 331 | #define EXT_ENERGY_DET_MASK (1 << 12) |
332 | 332 | ||
333 | #define EXT_RGMII_OOB_CTRL 0x0C | 333 | #define EXT_RGMII_OOB_CTRL 0x0C |
334 | #define RGMII_MODE_EN (1 << 0) | ||
335 | #define RGMII_LINK (1 << 4) | 334 | #define RGMII_LINK (1 << 4) |
336 | #define OOB_DISABLE (1 << 5) | 335 | #define OOB_DISABLE (1 << 5) |
336 | #define RGMII_MODE_EN (1 << 6) | ||
337 | #define ID_MODE_DIS (1 << 16) | 337 | #define ID_MODE_DIS (1 << 16) |
338 | 338 | ||
339 | #define EXT_GPHY_CTRL 0x1C | 339 | #define EXT_GPHY_CTRL 0x1C |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 34a26e42f19d..1e187fb760f8 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -2902,7 +2902,7 @@ static int be_open(struct net_device *netdev) | |||
2902 | for_all_evt_queues(adapter, eqo, i) { | 2902 | for_all_evt_queues(adapter, eqo, i) { |
2903 | napi_enable(&eqo->napi); | 2903 | napi_enable(&eqo->napi); |
2904 | be_enable_busy_poll(eqo); | 2904 | be_enable_busy_poll(eqo); |
2905 | be_eq_notify(adapter, eqo->q.id, true, false, 0); | 2905 | be_eq_notify(adapter, eqo->q.id, true, true, 0); |
2906 | } | 2906 | } |
2907 | adapter->flags |= BE_FLAGS_NAPI_ENABLED; | 2907 | adapter->flags |= BE_FLAGS_NAPI_ENABLED; |
2908 | 2908 | ||
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index fab39e295441..36fc429298e3 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c | |||
@@ -2990,11 +2990,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) | |||
2990 | if (ug_info->rxExtendedFiltering) { | 2990 | if (ug_info->rxExtendedFiltering) { |
2991 | size += THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING; | 2991 | size += THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING; |
2992 | if (ug_info->largestexternallookupkeysize == | 2992 | if (ug_info->largestexternallookupkeysize == |
2993 | QE_FLTR_TABLE_LOOKUP_KEY_SIZE_8_BYTES) | 2993 | QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_8_BYTES) |
2994 | size += | 2994 | size += |
2995 | THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_8; | 2995 | THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_8; |
2996 | if (ug_info->largestexternallookupkeysize == | 2996 | if (ug_info->largestexternallookupkeysize == |
2997 | QE_FLTR_TABLE_LOOKUP_KEY_SIZE_16_BYTES) | 2997 | QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_16_BYTES) |
2998 | size += | 2998 | size += |
2999 | THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_16; | 2999 | THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_16; |
3000 | } | 3000 | } |
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index a2db388cc31e..ee74f9536b31 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c | |||
@@ -1481,6 +1481,13 @@ static s32 igb_init_hw_82575(struct e1000_hw *hw) | |||
1481 | s32 ret_val; | 1481 | s32 ret_val; |
1482 | u16 i, rar_count = mac->rar_entry_count; | 1482 | u16 i, rar_count = mac->rar_entry_count; |
1483 | 1483 | ||
1484 | if ((hw->mac.type >= e1000_i210) && | ||
1485 | !(igb_get_flash_presence_i210(hw))) { | ||
1486 | ret_val = igb_pll_workaround_i210(hw); | ||
1487 | if (ret_val) | ||
1488 | return ret_val; | ||
1489 | } | ||
1490 | |||
1484 | /* Initialize identification LED */ | 1491 | /* Initialize identification LED */ |
1485 | ret_val = igb_id_led_init(hw); | 1492 | ret_val = igb_id_led_init(hw); |
1486 | if (ret_val) { | 1493 | if (ret_val) { |
diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h index 2a8bb35c2df2..217f8138851b 100644 --- a/drivers/net/ethernet/intel/igb/e1000_defines.h +++ b/drivers/net/ethernet/intel/igb/e1000_defines.h | |||
@@ -46,14 +46,15 @@ | |||
46 | #define E1000_CTRL_EXT_SDP3_DIR 0x00000800 /* SDP3 Data direction */ | 46 | #define E1000_CTRL_EXT_SDP3_DIR 0x00000800 /* SDP3 Data direction */ |
47 | 47 | ||
48 | /* Physical Func Reset Done Indication */ | 48 | /* Physical Func Reset Done Indication */ |
49 | #define E1000_CTRL_EXT_PFRSTD 0x00004000 | 49 | #define E1000_CTRL_EXT_PFRSTD 0x00004000 |
50 | #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 | 50 | #define E1000_CTRL_EXT_SDLPE 0X00040000 /* SerDes Low Power Enable */ |
51 | #define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES 0x00C00000 | 51 | #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 |
52 | #define E1000_CTRL_EXT_LINK_MODE_1000BASE_KX 0x00400000 | 52 | #define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES 0x00C00000 |
53 | #define E1000_CTRL_EXT_LINK_MODE_SGMII 0x00800000 | 53 | #define E1000_CTRL_EXT_LINK_MODE_1000BASE_KX 0x00400000 |
54 | #define E1000_CTRL_EXT_LINK_MODE_GMII 0x00000000 | 54 | #define E1000_CTRL_EXT_LINK_MODE_SGMII 0x00800000 |
55 | #define E1000_CTRL_EXT_EIAME 0x01000000 | 55 | #define E1000_CTRL_EXT_LINK_MODE_GMII 0x00000000 |
56 | #define E1000_CTRL_EXT_IRCA 0x00000001 | 56 | #define E1000_CTRL_EXT_EIAME 0x01000000 |
57 | #define E1000_CTRL_EXT_IRCA 0x00000001 | ||
57 | /* Interrupt delay cancellation */ | 58 | /* Interrupt delay cancellation */ |
58 | /* Driver loaded bit for FW */ | 59 | /* Driver loaded bit for FW */ |
59 | #define E1000_CTRL_EXT_DRV_LOAD 0x10000000 | 60 | #define E1000_CTRL_EXT_DRV_LOAD 0x10000000 |
@@ -62,6 +63,7 @@ | |||
62 | /* packet buffer parity error detection enabled */ | 63 | /* packet buffer parity error detection enabled */ |
63 | /* descriptor FIFO parity error detection enable */ | 64 | /* descriptor FIFO parity error detection enable */ |
64 | #define E1000_CTRL_EXT_PBA_CLR 0x80000000 /* PBA Clear */ | 65 | #define E1000_CTRL_EXT_PBA_CLR 0x80000000 /* PBA Clear */ |
66 | #define E1000_CTRL_EXT_PHYPDEN 0x00100000 | ||
65 | #define E1000_I2CCMD_REG_ADDR_SHIFT 16 | 67 | #define E1000_I2CCMD_REG_ADDR_SHIFT 16 |
66 | #define E1000_I2CCMD_PHY_ADDR_SHIFT 24 | 68 | #define E1000_I2CCMD_PHY_ADDR_SHIFT 24 |
67 | #define E1000_I2CCMD_OPCODE_READ 0x08000000 | 69 | #define E1000_I2CCMD_OPCODE_READ 0x08000000 |
diff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h index 89925e405849..ce55ea5d750c 100644 --- a/drivers/net/ethernet/intel/igb/e1000_hw.h +++ b/drivers/net/ethernet/intel/igb/e1000_hw.h | |||
@@ -567,4 +567,7 @@ struct net_device *igb_get_hw_dev(struct e1000_hw *hw); | |||
567 | /* These functions must be implemented by drivers */ | 567 | /* These functions must be implemented by drivers */ |
568 | s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value); | 568 | s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value); |
569 | s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value); | 569 | s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value); |
570 | |||
571 | void igb_read_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value); | ||
572 | void igb_write_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value); | ||
570 | #endif /* _E1000_HW_H_ */ | 573 | #endif /* _E1000_HW_H_ */ |
diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e1000_i210.c index 337161f440dd..65d931669f81 100644 --- a/drivers/net/ethernet/intel/igb/e1000_i210.c +++ b/drivers/net/ethernet/intel/igb/e1000_i210.c | |||
@@ -834,3 +834,69 @@ s32 igb_init_nvm_params_i210(struct e1000_hw *hw) | |||
834 | } | 834 | } |
835 | return ret_val; | 835 | return ret_val; |
836 | } | 836 | } |
837 | |||
838 | /** | ||
839 | * igb_pll_workaround_i210 | ||
840 | * @hw: pointer to the HW structure | ||
841 | * | ||
842 | * Works around an errata in the PLL circuit where it occasionally | ||
843 | * provides the wrong clock frequency after power up. | ||
844 | **/ | ||
845 | s32 igb_pll_workaround_i210(struct e1000_hw *hw) | ||
846 | { | ||
847 | s32 ret_val; | ||
848 | u32 wuc, mdicnfg, ctrl, ctrl_ext, reg_val; | ||
849 | u16 nvm_word, phy_word, pci_word, tmp_nvm; | ||
850 | int i; | ||
851 | |||
852 | /* Get and set needed register values */ | ||
853 | wuc = rd32(E1000_WUC); | ||
854 | mdicnfg = rd32(E1000_MDICNFG); | ||
855 | reg_val = mdicnfg & ~E1000_MDICNFG_EXT_MDIO; | ||
856 | wr32(E1000_MDICNFG, reg_val); | ||
857 | |||
858 | /* Get data from NVM, or set default */ | ||
859 | ret_val = igb_read_invm_word_i210(hw, E1000_INVM_AUTOLOAD, | ||
860 | &nvm_word); | ||
861 | if (ret_val) | ||
862 | nvm_word = E1000_INVM_DEFAULT_AL; | ||
863 | tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL; | ||
864 | for (i = 0; i < E1000_MAX_PLL_TRIES; i++) { | ||
865 | /* check current state directly from internal PHY */ | ||
866 | igb_read_phy_reg_gs40g(hw, (E1000_PHY_PLL_FREQ_PAGE | | ||
867 | E1000_PHY_PLL_FREQ_REG), &phy_word); | ||
868 | if ((phy_word & E1000_PHY_PLL_UNCONF) | ||
869 | != E1000_PHY_PLL_UNCONF) { | ||
870 | ret_val = 0; | ||
871 | break; | ||
872 | } else { | ||
873 | ret_val = -E1000_ERR_PHY; | ||
874 | } | ||
875 | /* directly reset the internal PHY */ | ||
876 | ctrl = rd32(E1000_CTRL); | ||
877 | wr32(E1000_CTRL, ctrl|E1000_CTRL_PHY_RST); | ||
878 | |||
879 | ctrl_ext = rd32(E1000_CTRL_EXT); | ||
880 | ctrl_ext |= (E1000_CTRL_EXT_PHYPDEN | E1000_CTRL_EXT_SDLPE); | ||
881 | wr32(E1000_CTRL_EXT, ctrl_ext); | ||
882 | |||
883 | wr32(E1000_WUC, 0); | ||
884 | reg_val = (E1000_INVM_AUTOLOAD << 4) | (tmp_nvm << 16); | ||
885 | wr32(E1000_EEARBC_I210, reg_val); | ||
886 | |||
887 | igb_read_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word); | ||
888 | pci_word |= E1000_PCI_PMCSR_D3; | ||
889 | igb_write_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word); | ||
890 | usleep_range(1000, 2000); | ||
891 | pci_word &= ~E1000_PCI_PMCSR_D3; | ||
892 | igb_write_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word); | ||
893 | reg_val = (E1000_INVM_AUTOLOAD << 4) | (nvm_word << 16); | ||
894 | wr32(E1000_EEARBC_I210, reg_val); | ||
895 | |||
896 | /* restore WUC register */ | ||
897 | wr32(E1000_WUC, wuc); | ||
898 | } | ||
899 | /* restore MDICNFG setting */ | ||
900 | wr32(E1000_MDICNFG, mdicnfg); | ||
901 | return ret_val; | ||
902 | } | ||
diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.h b/drivers/net/ethernet/intel/igb/e1000_i210.h index 9f34976687ba..3442b6357d01 100644 --- a/drivers/net/ethernet/intel/igb/e1000_i210.h +++ b/drivers/net/ethernet/intel/igb/e1000_i210.h | |||
@@ -33,6 +33,7 @@ s32 igb_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data); | |||
33 | s32 igb_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data); | 33 | s32 igb_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data); |
34 | s32 igb_init_nvm_params_i210(struct e1000_hw *hw); | 34 | s32 igb_init_nvm_params_i210(struct e1000_hw *hw); |
35 | bool igb_get_flash_presence_i210(struct e1000_hw *hw); | 35 | bool igb_get_flash_presence_i210(struct e1000_hw *hw); |
36 | s32 igb_pll_workaround_i210(struct e1000_hw *hw); | ||
36 | 37 | ||
37 | #define E1000_STM_OPCODE 0xDB00 | 38 | #define E1000_STM_OPCODE 0xDB00 |
38 | #define E1000_EEPROM_FLASH_SIZE_WORD 0x11 | 39 | #define E1000_EEPROM_FLASH_SIZE_WORD 0x11 |
@@ -78,4 +79,15 @@ enum E1000_INVM_STRUCTURE_TYPE { | |||
78 | #define NVM_LED_1_CFG_DEFAULT_I211 0x0184 | 79 | #define NVM_LED_1_CFG_DEFAULT_I211 0x0184 |
79 | #define NVM_LED_0_2_CFG_DEFAULT_I211 0x200C | 80 | #define NVM_LED_0_2_CFG_DEFAULT_I211 0x200C |
80 | 81 | ||
82 | /* PLL Defines */ | ||
83 | #define E1000_PCI_PMCSR 0x44 | ||
84 | #define E1000_PCI_PMCSR_D3 0x03 | ||
85 | #define E1000_MAX_PLL_TRIES 5 | ||
86 | #define E1000_PHY_PLL_UNCONF 0xFF | ||
87 | #define E1000_PHY_PLL_FREQ_PAGE 0xFC0000 | ||
88 | #define E1000_PHY_PLL_FREQ_REG 0x000E | ||
89 | #define E1000_INVM_DEFAULT_AL 0x202F | ||
90 | #define E1000_INVM_AUTOLOAD 0x0A | ||
91 | #define E1000_INVM_PLL_WO_VAL 0x0010 | ||
92 | |||
81 | #endif | 93 | #endif |
diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h index 1cc4b1a7e597..f5ba4e4eafb9 100644 --- a/drivers/net/ethernet/intel/igb/e1000_regs.h +++ b/drivers/net/ethernet/intel/igb/e1000_regs.h | |||
@@ -66,6 +66,7 @@ | |||
66 | #define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */ | 66 | #define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */ |
67 | #define E1000_PBS 0x01008 /* Packet Buffer Size */ | 67 | #define E1000_PBS 0x01008 /* Packet Buffer Size */ |
68 | #define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */ | 68 | #define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */ |
69 | #define E1000_EEARBC_I210 0x12024 /* EEPROM Auto Read Bus Control */ | ||
69 | #define E1000_EEWR 0x0102C /* EEPROM Write Register - RW */ | 70 | #define E1000_EEWR 0x0102C /* EEPROM Write Register - RW */ |
70 | #define E1000_I2CCMD 0x01028 /* SFPI2C Command Register - RW */ | 71 | #define E1000_I2CCMD 0x01028 /* SFPI2C Command Register - RW */ |
71 | #define E1000_FRTIMER 0x01048 /* Free Running Timer - RW */ | 72 | #define E1000_FRTIMER 0x01048 /* Free Running Timer - RW */ |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index f145adbb55ac..a9537ba7a5a0 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -7215,6 +7215,20 @@ static int igb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
7215 | } | 7215 | } |
7216 | } | 7216 | } |
7217 | 7217 | ||
7218 | void igb_read_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value) | ||
7219 | { | ||
7220 | struct igb_adapter *adapter = hw->back; | ||
7221 | |||
7222 | pci_read_config_word(adapter->pdev, reg, value); | ||
7223 | } | ||
7224 | |||
7225 | void igb_write_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value) | ||
7226 | { | ||
7227 | struct igb_adapter *adapter = hw->back; | ||
7228 | |||
7229 | pci_write_config_word(adapter->pdev, reg, *value); | ||
7230 | } | ||
7231 | |||
7218 | s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value) | 7232 | s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value) |
7219 | { | 7233 | { |
7220 | struct igb_adapter *adapter = hw->back; | 7234 | struct igb_adapter *adapter = hw->back; |
@@ -7578,6 +7592,8 @@ static int igb_sriov_reinit(struct pci_dev *dev) | |||
7578 | 7592 | ||
7579 | if (netif_running(netdev)) | 7593 | if (netif_running(netdev)) |
7580 | igb_close(netdev); | 7594 | igb_close(netdev); |
7595 | else | ||
7596 | igb_reset(adapter); | ||
7581 | 7597 | ||
7582 | igb_clear_interrupt_scheme(adapter); | 7598 | igb_clear_interrupt_scheme(adapter); |
7583 | 7599 | ||
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 45beca17fa50..dadd9a5f6323 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -1207,7 +1207,7 @@ static u32 mvneta_txq_desc_csum(int l3_offs, int l3_proto, | |||
1207 | command = l3_offs << MVNETA_TX_L3_OFF_SHIFT; | 1207 | command = l3_offs << MVNETA_TX_L3_OFF_SHIFT; |
1208 | command |= ip_hdr_len << MVNETA_TX_IP_HLEN_SHIFT; | 1208 | command |= ip_hdr_len << MVNETA_TX_IP_HLEN_SHIFT; |
1209 | 1209 | ||
1210 | if (l3_proto == swab16(ETH_P_IP)) | 1210 | if (l3_proto == htons(ETH_P_IP)) |
1211 | command |= MVNETA_TXD_IP_CSUM; | 1211 | command |= MVNETA_TXD_IP_CSUM; |
1212 | else | 1212 | else |
1213 | command |= MVNETA_TX_L3_IP6; | 1213 | command |= MVNETA_TX_L3_IP6; |
@@ -2529,7 +2529,7 @@ static void mvneta_adjust_link(struct net_device *ndev) | |||
2529 | 2529 | ||
2530 | if (phydev->speed == SPEED_1000) | 2530 | if (phydev->speed == SPEED_1000) |
2531 | val |= MVNETA_GMAC_CONFIG_GMII_SPEED; | 2531 | val |= MVNETA_GMAC_CONFIG_GMII_SPEED; |
2532 | else | 2532 | else if (phydev->speed == SPEED_100) |
2533 | val |= MVNETA_GMAC_CONFIG_MII_SPEED; | 2533 | val |= MVNETA_GMAC_CONFIG_MII_SPEED; |
2534 | 2534 | ||
2535 | mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); | 2535 | mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/cq.c b/drivers/net/ethernet/mellanox/mlx4/cq.c index 80f725228f5b..56022d647837 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/cq.c | |||
@@ -294,8 +294,6 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, | |||
294 | init_completion(&cq->free); | 294 | init_completion(&cq->free); |
295 | 295 | ||
296 | cq->irq = priv->eq_table.eq[cq->vector].irq; | 296 | cq->irq = priv->eq_table.eq[cq->vector].irq; |
297 | cq->irq_affinity_change = false; | ||
298 | |||
299 | return 0; | 297 | return 0; |
300 | 298 | ||
301 | err_radix: | 299 | err_radix: |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c index 4b2130760eed..82322b1c8411 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c | |||
@@ -128,11 +128,16 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, | |||
128 | mlx4_warn(mdev, "Failed assigning an EQ to %s, falling back to legacy EQ's\n", | 128 | mlx4_warn(mdev, "Failed assigning an EQ to %s, falling back to legacy EQ's\n", |
129 | name); | 129 | name); |
130 | } | 130 | } |
131 | |||
131 | } | 132 | } |
132 | } else { | 133 | } else { |
133 | cq->vector = (cq->ring + 1 + priv->port) % | 134 | cq->vector = (cq->ring + 1 + priv->port) % |
134 | mdev->dev->caps.num_comp_vectors; | 135 | mdev->dev->caps.num_comp_vectors; |
135 | } | 136 | } |
137 | |||
138 | cq->irq_desc = | ||
139 | irq_to_desc(mlx4_eq_get_irq(mdev->dev, | ||
140 | cq->vector)); | ||
136 | } else { | 141 | } else { |
137 | /* For TX we use the same irq per | 142 | /* For TX we use the same irq per |
138 | ring we assigned for the RX */ | 143 | ring we assigned for the RX */ |
@@ -187,8 +192,6 @@ void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq **pcq) | |||
187 | mlx4_en_unmap_buffer(&cq->wqres.buf); | 192 | mlx4_en_unmap_buffer(&cq->wqres.buf); |
188 | mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size); | 193 | mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size); |
189 | if (priv->mdev->dev->caps.comp_pool && cq->vector) { | 194 | if (priv->mdev->dev->caps.comp_pool && cq->vector) { |
190 | if (!cq->is_tx) | ||
191 | irq_set_affinity_hint(cq->mcq.irq, NULL); | ||
192 | mlx4_release_eq(priv->mdev->dev, cq->vector); | 195 | mlx4_release_eq(priv->mdev->dev, cq->vector); |
193 | } | 196 | } |
194 | cq->vector = 0; | 197 | cq->vector = 0; |
@@ -204,6 +207,7 @@ void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) | |||
204 | if (!cq->is_tx) { | 207 | if (!cq->is_tx) { |
205 | napi_hash_del(&cq->napi); | 208 | napi_hash_del(&cq->napi); |
206 | synchronize_rcu(); | 209 | synchronize_rcu(); |
210 | irq_set_affinity_hint(cq->mcq.irq, NULL); | ||
207 | } | 211 | } |
208 | netif_napi_del(&cq->napi); | 212 | netif_napi_del(&cq->napi); |
209 | 213 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index fa1a069e14e6..68d763d2d030 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | |||
@@ -417,6 +417,8 @@ static int mlx4_en_get_coalesce(struct net_device *dev, | |||
417 | 417 | ||
418 | coal->tx_coalesce_usecs = priv->tx_usecs; | 418 | coal->tx_coalesce_usecs = priv->tx_usecs; |
419 | coal->tx_max_coalesced_frames = priv->tx_frames; | 419 | coal->tx_max_coalesced_frames = priv->tx_frames; |
420 | coal->tx_max_coalesced_frames_irq = priv->tx_work_limit; | ||
421 | |||
420 | coal->rx_coalesce_usecs = priv->rx_usecs; | 422 | coal->rx_coalesce_usecs = priv->rx_usecs; |
421 | coal->rx_max_coalesced_frames = priv->rx_frames; | 423 | coal->rx_max_coalesced_frames = priv->rx_frames; |
422 | 424 | ||
@@ -426,6 +428,7 @@ static int mlx4_en_get_coalesce(struct net_device *dev, | |||
426 | coal->rx_coalesce_usecs_high = priv->rx_usecs_high; | 428 | coal->rx_coalesce_usecs_high = priv->rx_usecs_high; |
427 | coal->rate_sample_interval = priv->sample_interval; | 429 | coal->rate_sample_interval = priv->sample_interval; |
428 | coal->use_adaptive_rx_coalesce = priv->adaptive_rx_coal; | 430 | coal->use_adaptive_rx_coalesce = priv->adaptive_rx_coal; |
431 | |||
429 | return 0; | 432 | return 0; |
430 | } | 433 | } |
431 | 434 | ||
@@ -434,6 +437,9 @@ static int mlx4_en_set_coalesce(struct net_device *dev, | |||
434 | { | 437 | { |
435 | struct mlx4_en_priv *priv = netdev_priv(dev); | 438 | struct mlx4_en_priv *priv = netdev_priv(dev); |
436 | 439 | ||
440 | if (!coal->tx_max_coalesced_frames_irq) | ||
441 | return -EINVAL; | ||
442 | |||
437 | priv->rx_frames = (coal->rx_max_coalesced_frames == | 443 | priv->rx_frames = (coal->rx_max_coalesced_frames == |
438 | MLX4_EN_AUTO_CONF) ? | 444 | MLX4_EN_AUTO_CONF) ? |
439 | MLX4_EN_RX_COAL_TARGET : | 445 | MLX4_EN_RX_COAL_TARGET : |
@@ -457,6 +463,7 @@ static int mlx4_en_set_coalesce(struct net_device *dev, | |||
457 | priv->rx_usecs_high = coal->rx_coalesce_usecs_high; | 463 | priv->rx_usecs_high = coal->rx_coalesce_usecs_high; |
458 | priv->sample_interval = coal->rate_sample_interval; | 464 | priv->sample_interval = coal->rate_sample_interval; |
459 | priv->adaptive_rx_coal = coal->use_adaptive_rx_coalesce; | 465 | priv->adaptive_rx_coal = coal->use_adaptive_rx_coalesce; |
466 | priv->tx_work_limit = coal->tx_max_coalesced_frames_irq; | ||
460 | 467 | ||
461 | return mlx4_en_moderation_update(priv); | 468 | return mlx4_en_moderation_update(priv); |
462 | } | 469 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 7d4fb7bf2593..7345c43b019e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -2336,7 +2336,7 @@ static void mlx4_en_add_vxlan_port(struct net_device *dev, | |||
2336 | struct mlx4_en_priv *priv = netdev_priv(dev); | 2336 | struct mlx4_en_priv *priv = netdev_priv(dev); |
2337 | __be16 current_port; | 2337 | __be16 current_port; |
2338 | 2338 | ||
2339 | if (!(priv->mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS)) | 2339 | if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) |
2340 | return; | 2340 | return; |
2341 | 2341 | ||
2342 | if (sa_family == AF_INET6) | 2342 | if (sa_family == AF_INET6) |
@@ -2473,6 +2473,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
2473 | MLX4_WQE_CTRL_SOLICITED); | 2473 | MLX4_WQE_CTRL_SOLICITED); |
2474 | priv->num_tx_rings_p_up = mdev->profile.num_tx_rings_p_up; | 2474 | priv->num_tx_rings_p_up = mdev->profile.num_tx_rings_p_up; |
2475 | priv->tx_ring_num = prof->tx_ring_num; | 2475 | priv->tx_ring_num = prof->tx_ring_num; |
2476 | priv->tx_work_limit = MLX4_EN_DEFAULT_TX_WORK; | ||
2476 | 2477 | ||
2477 | priv->tx_ring = kzalloc(sizeof(struct mlx4_en_tx_ring *) * MAX_TX_RINGS, | 2478 | priv->tx_ring = kzalloc(sizeof(struct mlx4_en_tx_ring *) * MAX_TX_RINGS, |
2478 | GFP_KERNEL); | 2479 | GFP_KERNEL); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index d2d415732d99..5535862f27cc 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/if_ether.h> | 40 | #include <linux/if_ether.h> |
41 | #include <linux/if_vlan.h> | 41 | #include <linux/if_vlan.h> |
42 | #include <linux/vmalloc.h> | 42 | #include <linux/vmalloc.h> |
43 | #include <linux/irq.h> | ||
43 | 44 | ||
44 | #include "mlx4_en.h" | 45 | #include "mlx4_en.h" |
45 | 46 | ||
@@ -782,6 +783,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
782 | PKT_HASH_TYPE_L3); | 783 | PKT_HASH_TYPE_L3); |
783 | 784 | ||
784 | skb_record_rx_queue(gro_skb, cq->ring); | 785 | skb_record_rx_queue(gro_skb, cq->ring); |
786 | skb_mark_napi_id(gro_skb, &cq->napi); | ||
785 | 787 | ||
786 | if (ring->hwtstamp_rx_filter == HWTSTAMP_FILTER_ALL) { | 788 | if (ring->hwtstamp_rx_filter == HWTSTAMP_FILTER_ALL) { |
787 | timestamp = mlx4_en_get_cqe_ts(cqe); | 789 | timestamp = mlx4_en_get_cqe_ts(cqe); |
@@ -896,16 +898,25 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget) | |||
896 | 898 | ||
897 | /* If we used up all the quota - we're probably not done yet... */ | 899 | /* If we used up all the quota - we're probably not done yet... */ |
898 | if (done == budget) { | 900 | if (done == budget) { |
901 | int cpu_curr; | ||
902 | const struct cpumask *aff; | ||
903 | |||
899 | INC_PERF_COUNTER(priv->pstats.napi_quota); | 904 | INC_PERF_COUNTER(priv->pstats.napi_quota); |
900 | if (unlikely(cq->mcq.irq_affinity_change)) { | 905 | |
901 | cq->mcq.irq_affinity_change = false; | 906 | cpu_curr = smp_processor_id(); |
907 | aff = irq_desc_get_irq_data(cq->irq_desc)->affinity; | ||
908 | |||
909 | if (unlikely(!cpumask_test_cpu(cpu_curr, aff))) { | ||
910 | /* Current cpu is not according to smp_irq_affinity - | ||
911 | * probably affinity changed. need to stop this NAPI | ||
912 | * poll, and restart it on the right CPU | ||
913 | */ | ||
902 | napi_complete(napi); | 914 | napi_complete(napi); |
903 | mlx4_en_arm_cq(priv, cq); | 915 | mlx4_en_arm_cq(priv, cq); |
904 | return 0; | 916 | return 0; |
905 | } | 917 | } |
906 | } else { | 918 | } else { |
907 | /* Done for now */ | 919 | /* Done for now */ |
908 | cq->mcq.irq_affinity_change = false; | ||
909 | napi_complete(napi); | 920 | napi_complete(napi); |
910 | mlx4_en_arm_cq(priv, cq); | 921 | mlx4_en_arm_cq(priv, cq); |
911 | } | 922 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c index 8be7483f8236..5045bab59633 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c | |||
@@ -351,9 +351,8 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring) | |||
351 | return cnt; | 351 | return cnt; |
352 | } | 352 | } |
353 | 353 | ||
354 | static int mlx4_en_process_tx_cq(struct net_device *dev, | 354 | static bool mlx4_en_process_tx_cq(struct net_device *dev, |
355 | struct mlx4_en_cq *cq, | 355 | struct mlx4_en_cq *cq) |
356 | int budget) | ||
357 | { | 356 | { |
358 | struct mlx4_en_priv *priv = netdev_priv(dev); | 357 | struct mlx4_en_priv *priv = netdev_priv(dev); |
359 | struct mlx4_cq *mcq = &cq->mcq; | 358 | struct mlx4_cq *mcq = &cq->mcq; |
@@ -372,9 +371,10 @@ static int mlx4_en_process_tx_cq(struct net_device *dev, | |||
372 | int factor = priv->cqe_factor; | 371 | int factor = priv->cqe_factor; |
373 | u64 timestamp = 0; | 372 | u64 timestamp = 0; |
374 | int done = 0; | 373 | int done = 0; |
374 | int budget = priv->tx_work_limit; | ||
375 | 375 | ||
376 | if (!priv->port_up) | 376 | if (!priv->port_up) |
377 | return 0; | 377 | return true; |
378 | 378 | ||
379 | index = cons_index & size_mask; | 379 | index = cons_index & size_mask; |
380 | cqe = &buf[(index << factor) + factor]; | 380 | cqe = &buf[(index << factor) + factor]; |
@@ -447,7 +447,7 @@ static int mlx4_en_process_tx_cq(struct net_device *dev, | |||
447 | netif_tx_wake_queue(ring->tx_queue); | 447 | netif_tx_wake_queue(ring->tx_queue); |
448 | ring->wake_queue++; | 448 | ring->wake_queue++; |
449 | } | 449 | } |
450 | return done; | 450 | return done < budget; |
451 | } | 451 | } |
452 | 452 | ||
453 | void mlx4_en_tx_irq(struct mlx4_cq *mcq) | 453 | void mlx4_en_tx_irq(struct mlx4_cq *mcq) |
@@ -467,24 +467,16 @@ int mlx4_en_poll_tx_cq(struct napi_struct *napi, int budget) | |||
467 | struct mlx4_en_cq *cq = container_of(napi, struct mlx4_en_cq, napi); | 467 | struct mlx4_en_cq *cq = container_of(napi, struct mlx4_en_cq, napi); |
468 | struct net_device *dev = cq->dev; | 468 | struct net_device *dev = cq->dev; |
469 | struct mlx4_en_priv *priv = netdev_priv(dev); | 469 | struct mlx4_en_priv *priv = netdev_priv(dev); |
470 | int done; | 470 | int clean_complete; |
471 | 471 | ||
472 | done = mlx4_en_process_tx_cq(dev, cq, budget); | 472 | clean_complete = mlx4_en_process_tx_cq(dev, cq); |
473 | if (!clean_complete) | ||
474 | return budget; | ||
473 | 475 | ||
474 | /* If we used up all the quota - we're probably not done yet... */ | 476 | napi_complete(napi); |
475 | if (done < budget) { | 477 | mlx4_en_arm_cq(priv, cq); |
476 | /* Done for now */ | 478 | |
477 | cq->mcq.irq_affinity_change = false; | 479 | return 0; |
478 | napi_complete(napi); | ||
479 | mlx4_en_arm_cq(priv, cq); | ||
480 | return done; | ||
481 | } else if (unlikely(cq->mcq.irq_affinity_change)) { | ||
482 | cq->mcq.irq_affinity_change = false; | ||
483 | napi_complete(napi); | ||
484 | mlx4_en_arm_cq(priv, cq); | ||
485 | return 0; | ||
486 | } | ||
487 | return budget; | ||
488 | } | 480 | } |
489 | 481 | ||
490 | static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv, | 482 | static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv, |
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index d954ec1eac17..2a004b347e1d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
@@ -53,11 +53,6 @@ enum { | |||
53 | MLX4_EQ_ENTRY_SIZE = 0x20 | 53 | MLX4_EQ_ENTRY_SIZE = 0x20 |
54 | }; | 54 | }; |
55 | 55 | ||
56 | struct mlx4_irq_notify { | ||
57 | void *arg; | ||
58 | struct irq_affinity_notify notify; | ||
59 | }; | ||
60 | |||
61 | #define MLX4_EQ_STATUS_OK ( 0 << 28) | 56 | #define MLX4_EQ_STATUS_OK ( 0 << 28) |
62 | #define MLX4_EQ_STATUS_WRITE_FAIL (10 << 28) | 57 | #define MLX4_EQ_STATUS_WRITE_FAIL (10 << 28) |
63 | #define MLX4_EQ_OWNER_SW ( 0 << 24) | 58 | #define MLX4_EQ_OWNER_SW ( 0 << 24) |
@@ -1088,57 +1083,6 @@ static void mlx4_unmap_clr_int(struct mlx4_dev *dev) | |||
1088 | iounmap(priv->clr_base); | 1083 | iounmap(priv->clr_base); |
1089 | } | 1084 | } |
1090 | 1085 | ||
1091 | static void mlx4_irq_notifier_notify(struct irq_affinity_notify *notify, | ||
1092 | const cpumask_t *mask) | ||
1093 | { | ||
1094 | struct mlx4_irq_notify *n = container_of(notify, | ||
1095 | struct mlx4_irq_notify, | ||
1096 | notify); | ||
1097 | struct mlx4_priv *priv = (struct mlx4_priv *)n->arg; | ||
1098 | struct radix_tree_iter iter; | ||
1099 | void **slot; | ||
1100 | |||
1101 | radix_tree_for_each_slot(slot, &priv->cq_table.tree, &iter, 0) { | ||
1102 | struct mlx4_cq *cq = (struct mlx4_cq *)(*slot); | ||
1103 | |||
1104 | if (cq->irq == notify->irq) | ||
1105 | cq->irq_affinity_change = true; | ||
1106 | } | ||
1107 | } | ||
1108 | |||
1109 | static void mlx4_release_irq_notifier(struct kref *ref) | ||
1110 | { | ||
1111 | struct mlx4_irq_notify *n = container_of(ref, struct mlx4_irq_notify, | ||
1112 | notify.kref); | ||
1113 | kfree(n); | ||
1114 | } | ||
1115 | |||
1116 | static void mlx4_assign_irq_notifier(struct mlx4_priv *priv, | ||
1117 | struct mlx4_dev *dev, int irq) | ||
1118 | { | ||
1119 | struct mlx4_irq_notify *irq_notifier = NULL; | ||
1120 | int err = 0; | ||
1121 | |||
1122 | irq_notifier = kzalloc(sizeof(*irq_notifier), GFP_KERNEL); | ||
1123 | if (!irq_notifier) { | ||
1124 | mlx4_warn(dev, "Failed to allocate irq notifier. irq %d\n", | ||
1125 | irq); | ||
1126 | return; | ||
1127 | } | ||
1128 | |||
1129 | irq_notifier->notify.irq = irq; | ||
1130 | irq_notifier->notify.notify = mlx4_irq_notifier_notify; | ||
1131 | irq_notifier->notify.release = mlx4_release_irq_notifier; | ||
1132 | irq_notifier->arg = priv; | ||
1133 | err = irq_set_affinity_notifier(irq, &irq_notifier->notify); | ||
1134 | if (err) { | ||
1135 | kfree(irq_notifier); | ||
1136 | irq_notifier = NULL; | ||
1137 | mlx4_warn(dev, "Failed to set irq notifier. irq %d\n", irq); | ||
1138 | } | ||
1139 | } | ||
1140 | |||
1141 | |||
1142 | int mlx4_alloc_eq_table(struct mlx4_dev *dev) | 1086 | int mlx4_alloc_eq_table(struct mlx4_dev *dev) |
1143 | { | 1087 | { |
1144 | struct mlx4_priv *priv = mlx4_priv(dev); | 1088 | struct mlx4_priv *priv = mlx4_priv(dev); |
@@ -1409,8 +1353,6 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap, | |||
1409 | continue; | 1353 | continue; |
1410 | /*we dont want to break here*/ | 1354 | /*we dont want to break here*/ |
1411 | } | 1355 | } |
1412 | mlx4_assign_irq_notifier(priv, dev, | ||
1413 | priv->eq_table.eq[vec].irq); | ||
1414 | 1356 | ||
1415 | eq_set_ci(&priv->eq_table.eq[vec], 1); | 1357 | eq_set_ci(&priv->eq_table.eq[vec], 1); |
1416 | } | 1358 | } |
@@ -1427,6 +1369,14 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap, | |||
1427 | } | 1369 | } |
1428 | EXPORT_SYMBOL(mlx4_assign_eq); | 1370 | EXPORT_SYMBOL(mlx4_assign_eq); |
1429 | 1371 | ||
1372 | int mlx4_eq_get_irq(struct mlx4_dev *dev, int vec) | ||
1373 | { | ||
1374 | struct mlx4_priv *priv = mlx4_priv(dev); | ||
1375 | |||
1376 | return priv->eq_table.eq[vec].irq; | ||
1377 | } | ||
1378 | EXPORT_SYMBOL(mlx4_eq_get_irq); | ||
1379 | |||
1430 | void mlx4_release_eq(struct mlx4_dev *dev, int vec) | 1380 | void mlx4_release_eq(struct mlx4_dev *dev, int vec) |
1431 | { | 1381 | { |
1432 | struct mlx4_priv *priv = mlx4_priv(dev); | 1382 | struct mlx4_priv *priv = mlx4_priv(dev); |
@@ -1438,9 +1388,6 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec) | |||
1438 | Belonging to a legacy EQ*/ | 1388 | Belonging to a legacy EQ*/ |
1439 | mutex_lock(&priv->msix_ctl.pool_lock); | 1389 | mutex_lock(&priv->msix_ctl.pool_lock); |
1440 | if (priv->msix_ctl.pool_bm & 1ULL << i) { | 1390 | if (priv->msix_ctl.pool_bm & 1ULL << i) { |
1441 | irq_set_affinity_notifier( | ||
1442 | priv->eq_table.eq[vec].irq, | ||
1443 | NULL); | ||
1444 | free_irq(priv->eq_table.eq[vec].irq, | 1391 | free_irq(priv->eq_table.eq[vec].irq, |
1445 | &priv->eq_table.eq[vec]); | 1392 | &priv->eq_table.eq[vec]); |
1446 | priv->msix_ctl.pool_bm &= ~(1ULL << i); | 1393 | priv->msix_ctl.pool_bm &= ~(1ULL << i); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 0e15295bedd6..d72a5a894fc6 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -126,6 +126,8 @@ enum { | |||
126 | #define MAX_TX_RINGS (MLX4_EN_MAX_TX_RING_P_UP * \ | 126 | #define MAX_TX_RINGS (MLX4_EN_MAX_TX_RING_P_UP * \ |
127 | MLX4_EN_NUM_UP) | 127 | MLX4_EN_NUM_UP) |
128 | 128 | ||
129 | #define MLX4_EN_DEFAULT_TX_WORK 256 | ||
130 | |||
129 | /* Target number of packets to coalesce with interrupt moderation */ | 131 | /* Target number of packets to coalesce with interrupt moderation */ |
130 | #define MLX4_EN_RX_COAL_TARGET 44 | 132 | #define MLX4_EN_RX_COAL_TARGET 44 |
131 | #define MLX4_EN_RX_COAL_TIME 0x10 | 133 | #define MLX4_EN_RX_COAL_TIME 0x10 |
@@ -343,6 +345,7 @@ struct mlx4_en_cq { | |||
343 | #define CQ_USER_PEND (MLX4_EN_CQ_STATE_POLL | MLX4_EN_CQ_STATE_POLL_YIELD) | 345 | #define CQ_USER_PEND (MLX4_EN_CQ_STATE_POLL | MLX4_EN_CQ_STATE_POLL_YIELD) |
344 | spinlock_t poll_lock; /* protects from LLS/napi conflicts */ | 346 | spinlock_t poll_lock; /* protects from LLS/napi conflicts */ |
345 | #endif /* CONFIG_NET_RX_BUSY_POLL */ | 347 | #endif /* CONFIG_NET_RX_BUSY_POLL */ |
348 | struct irq_desc *irq_desc; | ||
346 | }; | 349 | }; |
347 | 350 | ||
348 | struct mlx4_en_port_profile { | 351 | struct mlx4_en_port_profile { |
@@ -542,6 +545,7 @@ struct mlx4_en_priv { | |||
542 | __be32 ctrl_flags; | 545 | __be32 ctrl_flags; |
543 | u32 flags; | 546 | u32 flags; |
544 | u8 num_tx_rings_p_up; | 547 | u8 num_tx_rings_p_up; |
548 | u32 tx_work_limit; | ||
545 | u32 tx_ring_num; | 549 | u32 tx_ring_num; |
546 | u32 rx_ring_num; | 550 | u32 rx_ring_num; |
547 | u32 rx_skb_size; | 551 | u32 rx_skb_size; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mr.c b/drivers/net/ethernet/mellanox/mlx5/core/mr.c index ba0401d4af50..184c3615f479 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/mr.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/mr.c | |||
@@ -94,6 +94,11 @@ int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | |||
94 | write_lock_irq(&table->lock); | 94 | write_lock_irq(&table->lock); |
95 | err = radix_tree_insert(&table->tree, mlx5_base_mkey(mr->key), mr); | 95 | err = radix_tree_insert(&table->tree, mlx5_base_mkey(mr->key), mr); |
96 | write_unlock_irq(&table->lock); | 96 | write_unlock_irq(&table->lock); |
97 | if (err) { | ||
98 | mlx5_core_warn(dev, "failed radix tree insert of mr 0x%x, %d\n", | ||
99 | mlx5_base_mkey(mr->key), err); | ||
100 | mlx5_core_destroy_mkey(dev, mr); | ||
101 | } | ||
97 | 102 | ||
98 | return err; | 103 | return err; |
99 | } | 104 | } |
@@ -104,12 +109,22 @@ int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr) | |||
104 | struct mlx5_mr_table *table = &dev->priv.mr_table; | 109 | struct mlx5_mr_table *table = &dev->priv.mr_table; |
105 | struct mlx5_destroy_mkey_mbox_in in; | 110 | struct mlx5_destroy_mkey_mbox_in in; |
106 | struct mlx5_destroy_mkey_mbox_out out; | 111 | struct mlx5_destroy_mkey_mbox_out out; |
112 | struct mlx5_core_mr *deleted_mr; | ||
107 | unsigned long flags; | 113 | unsigned long flags; |
108 | int err; | 114 | int err; |
109 | 115 | ||
110 | memset(&in, 0, sizeof(in)); | 116 | memset(&in, 0, sizeof(in)); |
111 | memset(&out, 0, sizeof(out)); | 117 | memset(&out, 0, sizeof(out)); |
112 | 118 | ||
119 | write_lock_irqsave(&table->lock, flags); | ||
120 | deleted_mr = radix_tree_delete(&table->tree, mlx5_base_mkey(mr->key)); | ||
121 | write_unlock_irqrestore(&table->lock, flags); | ||
122 | if (!deleted_mr) { | ||
123 | mlx5_core_warn(dev, "failed radix tree delete of mr 0x%x\n", | ||
124 | mlx5_base_mkey(mr->key)); | ||
125 | return -ENOENT; | ||
126 | } | ||
127 | |||
113 | in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_DESTROY_MKEY); | 128 | in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_DESTROY_MKEY); |
114 | in.mkey = cpu_to_be32(mlx5_mkey_to_idx(mr->key)); | 129 | in.mkey = cpu_to_be32(mlx5_mkey_to_idx(mr->key)); |
115 | err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out)); | 130 | err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out)); |
@@ -119,10 +134,6 @@ int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr) | |||
119 | if (out.hdr.status) | 134 | if (out.hdr.status) |
120 | return mlx5_cmd_status_to_err(&out.hdr); | 135 | return mlx5_cmd_status_to_err(&out.hdr); |
121 | 136 | ||
122 | write_lock_irqsave(&table->lock, flags); | ||
123 | radix_tree_delete(&table->tree, mlx5_base_mkey(mr->key)); | ||
124 | write_unlock_irqrestore(&table->lock, flags); | ||
125 | |||
126 | return err; | 137 | return err; |
127 | } | 138 | } |
128 | EXPORT_SYMBOL(mlx5_core_destroy_mkey); | 139 | EXPORT_SYMBOL(mlx5_core_destroy_mkey); |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index be425ad5e824..61623e9af574 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -538,6 +538,7 @@ enum rtl_register_content { | |||
538 | MagicPacket = (1 << 5), /* Wake up when receives a Magic Packet */ | 538 | MagicPacket = (1 << 5), /* Wake up when receives a Magic Packet */ |
539 | LinkUp = (1 << 4), /* Wake up when the cable connection is re-established */ | 539 | LinkUp = (1 << 4), /* Wake up when the cable connection is re-established */ |
540 | Jumbo_En0 = (1 << 2), /* 8168 only. Reserved in the 8168b */ | 540 | Jumbo_En0 = (1 << 2), /* 8168 only. Reserved in the 8168b */ |
541 | Rdy_to_L23 = (1 << 1), /* L23 Enable */ | ||
541 | Beacon_en = (1 << 0), /* 8168 only. Reserved in the 8168b */ | 542 | Beacon_en = (1 << 0), /* 8168 only. Reserved in the 8168b */ |
542 | 543 | ||
543 | /* Config4 register */ | 544 | /* Config4 register */ |
@@ -4239,6 +4240,8 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp) | |||
4239 | RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); | 4240 | RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); |
4240 | break; | 4241 | break; |
4241 | case RTL_GIGA_MAC_VER_40: | 4242 | case RTL_GIGA_MAC_VER_40: |
4243 | RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST | RX_EARLY_OFF); | ||
4244 | break; | ||
4242 | case RTL_GIGA_MAC_VER_41: | 4245 | case RTL_GIGA_MAC_VER_41: |
4243 | case RTL_GIGA_MAC_VER_42: | 4246 | case RTL_GIGA_MAC_VER_42: |
4244 | case RTL_GIGA_MAC_VER_43: | 4247 | case RTL_GIGA_MAC_VER_43: |
@@ -4897,6 +4900,21 @@ static void rtl_enable_clock_request(struct pci_dev *pdev) | |||
4897 | PCI_EXP_LNKCTL_CLKREQ_EN); | 4900 | PCI_EXP_LNKCTL_CLKREQ_EN); |
4898 | } | 4901 | } |
4899 | 4902 | ||
4903 | static void rtl_pcie_state_l2l3_enable(struct rtl8169_private *tp, bool enable) | ||
4904 | { | ||
4905 | void __iomem *ioaddr = tp->mmio_addr; | ||
4906 | u8 data; | ||
4907 | |||
4908 | data = RTL_R8(Config3); | ||
4909 | |||
4910 | if (enable) | ||
4911 | data |= Rdy_to_L23; | ||
4912 | else | ||
4913 | data &= ~Rdy_to_L23; | ||
4914 | |||
4915 | RTL_W8(Config3, data); | ||
4916 | } | ||
4917 | |||
4900 | #define R8168_CPCMD_QUIRK_MASK (\ | 4918 | #define R8168_CPCMD_QUIRK_MASK (\ |
4901 | EnableBist | \ | 4919 | EnableBist | \ |
4902 | Mac_dbgo_oe | \ | 4920 | Mac_dbgo_oe | \ |
@@ -5246,6 +5264,7 @@ static void rtl_hw_start_8411(struct rtl8169_private *tp) | |||
5246 | }; | 5264 | }; |
5247 | 5265 | ||
5248 | rtl_hw_start_8168f(tp); | 5266 | rtl_hw_start_8168f(tp); |
5267 | rtl_pcie_state_l2l3_enable(tp, false); | ||
5249 | 5268 | ||
5250 | rtl_ephy_init(tp, e_info_8168f_1, ARRAY_SIZE(e_info_8168f_1)); | 5269 | rtl_ephy_init(tp, e_info_8168f_1, ARRAY_SIZE(e_info_8168f_1)); |
5251 | 5270 | ||
@@ -5284,6 +5303,8 @@ static void rtl_hw_start_8168g_1(struct rtl8169_private *tp) | |||
5284 | 5303 | ||
5285 | rtl_w1w0_eri(tp, 0x2fc, ERIAR_MASK_0001, 0x01, 0x06, ERIAR_EXGMAC); | 5304 | rtl_w1w0_eri(tp, 0x2fc, ERIAR_MASK_0001, 0x01, 0x06, ERIAR_EXGMAC); |
5286 | rtl_w1w0_eri(tp, 0x1b0, ERIAR_MASK_0011, 0x0000, 0x1000, ERIAR_EXGMAC); | 5305 | rtl_w1w0_eri(tp, 0x1b0, ERIAR_MASK_0011, 0x0000, 0x1000, ERIAR_EXGMAC); |
5306 | |||
5307 | rtl_pcie_state_l2l3_enable(tp, false); | ||
5287 | } | 5308 | } |
5288 | 5309 | ||
5289 | static void rtl_hw_start_8168g_2(struct rtl8169_private *tp) | 5310 | static void rtl_hw_start_8168g_2(struct rtl8169_private *tp) |
@@ -5536,6 +5557,8 @@ static void rtl_hw_start_8105e_1(struct rtl8169_private *tp) | |||
5536 | RTL_W8(DLLPR, RTL_R8(DLLPR) | PFM_EN); | 5557 | RTL_W8(DLLPR, RTL_R8(DLLPR) | PFM_EN); |
5537 | 5558 | ||
5538 | rtl_ephy_init(tp, e_info_8105e_1, ARRAY_SIZE(e_info_8105e_1)); | 5559 | rtl_ephy_init(tp, e_info_8105e_1, ARRAY_SIZE(e_info_8105e_1)); |
5560 | |||
5561 | rtl_pcie_state_l2l3_enable(tp, false); | ||
5539 | } | 5562 | } |
5540 | 5563 | ||
5541 | static void rtl_hw_start_8105e_2(struct rtl8169_private *tp) | 5564 | static void rtl_hw_start_8105e_2(struct rtl8169_private *tp) |
@@ -5571,6 +5594,8 @@ static void rtl_hw_start_8402(struct rtl8169_private *tp) | |||
5571 | rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC); | 5594 | rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC); |
5572 | rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC); | 5595 | rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC); |
5573 | rtl_w1w0_eri(tp, 0x0d4, ERIAR_MASK_0011, 0x0e00, 0xff00, ERIAR_EXGMAC); | 5596 | rtl_w1w0_eri(tp, 0x0d4, ERIAR_MASK_0011, 0x0e00, 0xff00, ERIAR_EXGMAC); |
5597 | |||
5598 | rtl_pcie_state_l2l3_enable(tp, false); | ||
5574 | } | 5599 | } |
5575 | 5600 | ||
5576 | static void rtl_hw_start_8106(struct rtl8169_private *tp) | 5601 | static void rtl_hw_start_8106(struct rtl8169_private *tp) |
@@ -5583,6 +5608,8 @@ static void rtl_hw_start_8106(struct rtl8169_private *tp) | |||
5583 | RTL_W32(MISC, (RTL_R32(MISC) | DISABLE_LAN_EN) & ~EARLY_TALLY_EN); | 5608 | RTL_W32(MISC, (RTL_R32(MISC) | DISABLE_LAN_EN) & ~EARLY_TALLY_EN); |
5584 | RTL_W8(MCU, RTL_R8(MCU) | EN_NDP | EN_OOB_RESET); | 5609 | RTL_W8(MCU, RTL_R8(MCU) | EN_NDP | EN_OOB_RESET); |
5585 | RTL_W8(DLLPR, RTL_R8(DLLPR) & ~PFM_EN); | 5610 | RTL_W8(DLLPR, RTL_R8(DLLPR) & ~PFM_EN); |
5611 | |||
5612 | rtl_pcie_state_l2l3_enable(tp, false); | ||
5586 | } | 5613 | } |
5587 | 5614 | ||
5588 | static void rtl_hw_start_8101(struct net_device *dev) | 5615 | static void rtl_hw_start_8101(struct net_device *dev) |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c index b3e148ef5683..9d3748361a1e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | |||
@@ -320,11 +320,8 @@ static void dwmac1000_set_eee_timer(void __iomem *ioaddr, int ls, int tw) | |||
320 | 320 | ||
321 | static void dwmac1000_ctrl_ane(void __iomem *ioaddr, bool restart) | 321 | static void dwmac1000_ctrl_ane(void __iomem *ioaddr, bool restart) |
322 | { | 322 | { |
323 | u32 value; | ||
324 | |||
325 | value = readl(ioaddr + GMAC_AN_CTRL); | ||
326 | /* auto negotiation enable and External Loopback enable */ | 323 | /* auto negotiation enable and External Loopback enable */ |
327 | value = GMAC_AN_CTRL_ANE | GMAC_AN_CTRL_ELE; | 324 | u32 value = GMAC_AN_CTRL_ANE | GMAC_AN_CTRL_ELE; |
328 | 325 | ||
329 | if (restart) | 326 | if (restart) |
330 | value |= GMAC_AN_CTRL_RAN; | 327 | value |= GMAC_AN_CTRL_RAN; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c index 7e6628a91514..1e2bcf5f89e1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c | |||
@@ -145,7 +145,7 @@ static void enh_desc_get_ext_status(void *data, struct stmmac_extra_stats *x, | |||
145 | x->rx_msg_type_delay_req++; | 145 | x->rx_msg_type_delay_req++; |
146 | else if (p->des4.erx.msg_type == RDES_EXT_DELAY_RESP) | 146 | else if (p->des4.erx.msg_type == RDES_EXT_DELAY_RESP) |
147 | x->rx_msg_type_delay_resp++; | 147 | x->rx_msg_type_delay_resp++; |
148 | else if (p->des4.erx.msg_type == RDES_EXT_DELAY_REQ) | 148 | else if (p->des4.erx.msg_type == RDES_EXT_PDELAY_REQ) |
149 | x->rx_msg_type_pdelay_req++; | 149 | x->rx_msg_type_pdelay_req++; |
150 | else if (p->des4.erx.msg_type == RDES_EXT_PDELAY_RESP) | 150 | else if (p->des4.erx.msg_type == RDES_EXT_PDELAY_RESP) |
151 | x->rx_msg_type_pdelay_resp++; | 151 | x->rx_msg_type_pdelay_resp++; |
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 1c24a8f368bd..d813bfb1a847 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c | |||
@@ -610,6 +610,13 @@ static int __vnet_tx_trigger(struct vnet_port *port) | |||
610 | return err; | 610 | return err; |
611 | } | 611 | } |
612 | 612 | ||
613 | static inline bool port_is_up(struct vnet_port *vnet) | ||
614 | { | ||
615 | struct vio_driver_state *vio = &vnet->vio; | ||
616 | |||
617 | return !!(vio->hs_state & VIO_HS_COMPLETE); | ||
618 | } | ||
619 | |||
613 | struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb) | 620 | struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb) |
614 | { | 621 | { |
615 | unsigned int hash = vnet_hashfn(skb->data); | 622 | unsigned int hash = vnet_hashfn(skb->data); |
@@ -617,14 +624,19 @@ struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb) | |||
617 | struct vnet_port *port; | 624 | struct vnet_port *port; |
618 | 625 | ||
619 | hlist_for_each_entry(port, hp, hash) { | 626 | hlist_for_each_entry(port, hp, hash) { |
627 | if (!port_is_up(port)) | ||
628 | continue; | ||
620 | if (ether_addr_equal(port->raddr, skb->data)) | 629 | if (ether_addr_equal(port->raddr, skb->data)) |
621 | return port; | 630 | return port; |
622 | } | 631 | } |
623 | port = NULL; | 632 | list_for_each_entry(port, &vp->port_list, list) { |
624 | if (!list_empty(&vp->port_list)) | 633 | if (!port->switch_port) |
625 | port = list_entry(vp->port_list.next, struct vnet_port, list); | 634 | continue; |
626 | 635 | if (!port_is_up(port)) | |
627 | return port; | 636 | continue; |
637 | return port; | ||
638 | } | ||
639 | return NULL; | ||
628 | } | 640 | } |
629 | 641 | ||
630 | struct vnet_port *tx_port_find(struct vnet *vp, struct sk_buff *skb) | 642 | struct vnet_port *tx_port_find(struct vnet *vp, struct sk_buff *skb) |
@@ -1083,6 +1095,24 @@ static struct vnet *vnet_find_or_create(const u64 *local_mac) | |||
1083 | return vp; | 1095 | return vp; |
1084 | } | 1096 | } |
1085 | 1097 | ||
1098 | static void vnet_cleanup(void) | ||
1099 | { | ||
1100 | struct vnet *vp; | ||
1101 | struct net_device *dev; | ||
1102 | |||
1103 | mutex_lock(&vnet_list_mutex); | ||
1104 | while (!list_empty(&vnet_list)) { | ||
1105 | vp = list_first_entry(&vnet_list, struct vnet, list); | ||
1106 | list_del(&vp->list); | ||
1107 | dev = vp->dev; | ||
1108 | /* vio_unregister_driver() should have cleaned up port_list */ | ||
1109 | BUG_ON(!list_empty(&vp->port_list)); | ||
1110 | unregister_netdev(dev); | ||
1111 | free_netdev(dev); | ||
1112 | } | ||
1113 | mutex_unlock(&vnet_list_mutex); | ||
1114 | } | ||
1115 | |||
1086 | static const char *local_mac_prop = "local-mac-address"; | 1116 | static const char *local_mac_prop = "local-mac-address"; |
1087 | 1117 | ||
1088 | static struct vnet *vnet_find_parent(struct mdesc_handle *hp, | 1118 | static struct vnet *vnet_find_parent(struct mdesc_handle *hp, |
@@ -1240,7 +1270,6 @@ static int vnet_port_remove(struct vio_dev *vdev) | |||
1240 | 1270 | ||
1241 | kfree(port); | 1271 | kfree(port); |
1242 | 1272 | ||
1243 | unregister_netdev(vp->dev); | ||
1244 | } | 1273 | } |
1245 | return 0; | 1274 | return 0; |
1246 | } | 1275 | } |
@@ -1268,6 +1297,7 @@ static int __init vnet_init(void) | |||
1268 | static void __exit vnet_exit(void) | 1297 | static void __exit vnet_exit(void) |
1269 | { | 1298 | { |
1270 | vio_unregister_driver(&vnet_port_driver); | 1299 | vio_unregister_driver(&vnet_port_driver); |
1300 | vnet_cleanup(); | ||
1271 | } | 1301 | } |
1272 | 1302 | ||
1273 | module_init(vnet_init); | 1303 | module_init(vnet_init); |
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c index eb78203cd58e..2aa57270838f 100644 --- a/drivers/net/fddi/defxx.c +++ b/drivers/net/fddi/defxx.c | |||
@@ -291,7 +291,11 @@ static int dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type); | |||
291 | 291 | ||
292 | static int dfx_rcv_init(DFX_board_t *bp, int get_buffers); | 292 | static int dfx_rcv_init(DFX_board_t *bp, int get_buffers); |
293 | static void dfx_rcv_queue_process(DFX_board_t *bp); | 293 | static void dfx_rcv_queue_process(DFX_board_t *bp); |
294 | #ifdef DYNAMIC_BUFFERS | ||
294 | static void dfx_rcv_flush(DFX_board_t *bp); | 295 | static void dfx_rcv_flush(DFX_board_t *bp); |
296 | #else | ||
297 | static inline void dfx_rcv_flush(DFX_board_t *bp) {} | ||
298 | #endif | ||
295 | 299 | ||
296 | static netdev_tx_t dfx_xmt_queue_pkt(struct sk_buff *skb, | 300 | static netdev_tx_t dfx_xmt_queue_pkt(struct sk_buff *skb, |
297 | struct net_device *dev); | 301 | struct net_device *dev); |
@@ -2849,7 +2853,7 @@ static int dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type) | |||
2849 | * Align an sk_buff to a boundary power of 2 | 2853 | * Align an sk_buff to a boundary power of 2 |
2850 | * | 2854 | * |
2851 | */ | 2855 | */ |
2852 | 2856 | #ifdef DYNAMIC_BUFFERS | |
2853 | static void my_skb_align(struct sk_buff *skb, int n) | 2857 | static void my_skb_align(struct sk_buff *skb, int n) |
2854 | { | 2858 | { |
2855 | unsigned long x = (unsigned long)skb->data; | 2859 | unsigned long x = (unsigned long)skb->data; |
@@ -2859,7 +2863,7 @@ static void my_skb_align(struct sk_buff *skb, int n) | |||
2859 | 2863 | ||
2860 | skb_reserve(skb, v - x); | 2864 | skb_reserve(skb, v - x); |
2861 | } | 2865 | } |
2862 | 2866 | #endif | |
2863 | 2867 | ||
2864 | /* | 2868 | /* |
2865 | * ================ | 2869 | * ================ |
@@ -3074,10 +3078,7 @@ static void dfx_rcv_queue_process( | |||
3074 | break; | 3078 | break; |
3075 | } | 3079 | } |
3076 | else { | 3080 | else { |
3077 | #ifndef DYNAMIC_BUFFERS | 3081 | if (!rx_in_place) { |
3078 | if (! rx_in_place) | ||
3079 | #endif | ||
3080 | { | ||
3081 | /* Receive buffer allocated, pass receive packet up */ | 3082 | /* Receive buffer allocated, pass receive packet up */ |
3082 | 3083 | ||
3083 | skb_copy_to_linear_data(skb, | 3084 | skb_copy_to_linear_data(skb, |
@@ -3453,10 +3454,6 @@ static void dfx_rcv_flush( DFX_board_t *bp ) | |||
3453 | } | 3454 | } |
3454 | 3455 | ||
3455 | } | 3456 | } |
3456 | #else | ||
3457 | static inline void dfx_rcv_flush( DFX_board_t *bp ) | ||
3458 | { | ||
3459 | } | ||
3460 | #endif /* DYNAMIC_BUFFERS */ | 3457 | #endif /* DYNAMIC_BUFFERS */ |
3461 | 3458 | ||
3462 | /* | 3459 | /* |
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 4ed38eaecea8..d97d5f39a04e 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
@@ -378,8 +378,10 @@ static int netvsc_init_buf(struct hv_device *device) | |||
378 | 378 | ||
379 | net_device->send_section_map = | 379 | net_device->send_section_map = |
380 | kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL); | 380 | kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL); |
381 | if (net_device->send_section_map == NULL) | 381 | if (net_device->send_section_map == NULL) { |
382 | ret = -ENOMEM; | ||
382 | goto cleanup; | 383 | goto cleanup; |
384 | } | ||
383 | 385 | ||
384 | goto exit; | 386 | goto exit; |
385 | 387 | ||
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index 6a999e6814a0..9408157a246c 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c | |||
@@ -1323,15 +1323,15 @@ static bool dp83640_rxtstamp(struct phy_device *phydev, | |||
1323 | { | 1323 | { |
1324 | struct dp83640_private *dp83640 = phydev->priv; | 1324 | struct dp83640_private *dp83640 = phydev->priv; |
1325 | 1325 | ||
1326 | if (!dp83640->hwts_rx_en) | ||
1327 | return false; | ||
1328 | |||
1329 | if (is_status_frame(skb, type)) { | 1326 | if (is_status_frame(skb, type)) { |
1330 | decode_status_frame(dp83640, skb); | 1327 | decode_status_frame(dp83640, skb); |
1331 | kfree_skb(skb); | 1328 | kfree_skb(skb); |
1332 | return true; | 1329 | return true; |
1333 | } | 1330 | } |
1334 | 1331 | ||
1332 | if (!dp83640->hwts_rx_en) | ||
1333 | return false; | ||
1334 | |||
1335 | SKB_PTP_TYPE(skb) = type; | 1335 | SKB_PTP_TYPE(skb) = type; |
1336 | skb_queue_tail(&dp83640->rx_queue, skb); | 1336 | skb_queue_tail(&dp83640->rx_queue, skb); |
1337 | schedule_work(&dp83640->ts_work); | 1337 | schedule_work(&dp83640->ts_work); |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 2e58aa54484c..203651ebccb0 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -187,6 +187,50 @@ struct mii_bus *of_mdio_find_bus(struct device_node *mdio_bus_np) | |||
187 | return d ? to_mii_bus(d) : NULL; | 187 | return d ? to_mii_bus(d) : NULL; |
188 | } | 188 | } |
189 | EXPORT_SYMBOL(of_mdio_find_bus); | 189 | EXPORT_SYMBOL(of_mdio_find_bus); |
190 | |||
191 | /* Walk the list of subnodes of a mdio bus and look for a node that matches the | ||
192 | * phy's address with its 'reg' property. If found, set the of_node pointer for | ||
193 | * the phy. This allows auto-probed pyh devices to be supplied with information | ||
194 | * passed in via DT. | ||
195 | */ | ||
196 | static void of_mdiobus_link_phydev(struct mii_bus *mdio, | ||
197 | struct phy_device *phydev) | ||
198 | { | ||
199 | struct device *dev = &phydev->dev; | ||
200 | struct device_node *child; | ||
201 | |||
202 | if (dev->of_node || !mdio->dev.of_node) | ||
203 | return; | ||
204 | |||
205 | for_each_available_child_of_node(mdio->dev.of_node, child) { | ||
206 | int addr; | ||
207 | int ret; | ||
208 | |||
209 | ret = of_property_read_u32(child, "reg", &addr); | ||
210 | if (ret < 0) { | ||
211 | dev_err(dev, "%s has invalid PHY address\n", | ||
212 | child->full_name); | ||
213 | continue; | ||
214 | } | ||
215 | |||
216 | /* A PHY must have a reg property in the range [0-31] */ | ||
217 | if (addr >= PHY_MAX_ADDR) { | ||
218 | dev_err(dev, "%s PHY address %i is too large\n", | ||
219 | child->full_name, addr); | ||
220 | continue; | ||
221 | } | ||
222 | |||
223 | if (addr == phydev->addr) { | ||
224 | dev->of_node = child; | ||
225 | return; | ||
226 | } | ||
227 | } | ||
228 | } | ||
229 | #else /* !IS_ENABLED(CONFIG_OF_MDIO) */ | ||
230 | static inline void of_mdiobus_link_phydev(struct mii_bus *mdio, | ||
231 | struct phy_device *phydev) | ||
232 | { | ||
233 | } | ||
190 | #endif | 234 | #endif |
191 | 235 | ||
192 | /** | 236 | /** |
@@ -211,6 +255,7 @@ int mdiobus_register(struct mii_bus *bus) | |||
211 | 255 | ||
212 | bus->dev.parent = bus->parent; | 256 | bus->dev.parent = bus->parent; |
213 | bus->dev.class = &mdio_bus_class; | 257 | bus->dev.class = &mdio_bus_class; |
258 | bus->dev.driver = bus->parent->driver; | ||
214 | bus->dev.groups = NULL; | 259 | bus->dev.groups = NULL; |
215 | dev_set_name(&bus->dev, "%s", bus->id); | 260 | dev_set_name(&bus->dev, "%s", bus->id); |
216 | 261 | ||
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 35d753d22f78..22c57be4dfa0 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -355,7 +355,7 @@ int phy_device_register(struct phy_device *phydev) | |||
355 | phydev->bus->phy_map[phydev->addr] = phydev; | 355 | phydev->bus->phy_map[phydev->addr] = phydev; |
356 | 356 | ||
357 | /* Run all of the fixups for this PHY */ | 357 | /* Run all of the fixups for this PHY */ |
358 | err = phy_init_hw(phydev); | 358 | err = phy_scan_fixups(phydev); |
359 | if (err) { | 359 | if (err) { |
360 | pr_err("PHY %d failed to initialize\n", phydev->addr); | 360 | pr_err("PHY %d failed to initialize\n", phydev->addr); |
361 | goto out; | 361 | goto out; |
@@ -575,6 +575,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
575 | u32 flags, phy_interface_t interface) | 575 | u32 flags, phy_interface_t interface) |
576 | { | 576 | { |
577 | struct device *d = &phydev->dev; | 577 | struct device *d = &phydev->dev; |
578 | struct module *bus_module; | ||
578 | int err; | 579 | int err; |
579 | 580 | ||
580 | /* Assume that if there is no driver, that it doesn't | 581 | /* Assume that if there is no driver, that it doesn't |
@@ -599,6 +600,14 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
599 | return -EBUSY; | 600 | return -EBUSY; |
600 | } | 601 | } |
601 | 602 | ||
603 | /* Increment the bus module reference count */ | ||
604 | bus_module = phydev->bus->dev.driver ? | ||
605 | phydev->bus->dev.driver->owner : NULL; | ||
606 | if (!try_module_get(bus_module)) { | ||
607 | dev_err(&dev->dev, "failed to get the bus module\n"); | ||
608 | return -EIO; | ||
609 | } | ||
610 | |||
602 | phydev->attached_dev = dev; | 611 | phydev->attached_dev = dev; |
603 | dev->phydev = phydev; | 612 | dev->phydev = phydev; |
604 | 613 | ||
@@ -664,6 +673,10 @@ EXPORT_SYMBOL(phy_attach); | |||
664 | void phy_detach(struct phy_device *phydev) | 673 | void phy_detach(struct phy_device *phydev) |
665 | { | 674 | { |
666 | int i; | 675 | int i; |
676 | |||
677 | if (phydev->bus->dev.driver) | ||
678 | module_put(phydev->bus->dev.driver->owner); | ||
679 | |||
667 | phydev->attached_dev->phydev = NULL; | 680 | phydev->attached_dev->phydev = NULL; |
668 | phydev->attached_dev = NULL; | 681 | phydev->attached_dev = NULL; |
669 | phy_suspend(phydev); | 682 | phy_suspend(phydev); |
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 91d6c1272fcf..d5b77ef3a210 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c | |||
@@ -539,7 +539,7 @@ static int get_filter(void __user *arg, struct sock_filter **p) | |||
539 | { | 539 | { |
540 | struct sock_fprog uprog; | 540 | struct sock_fprog uprog; |
541 | struct sock_filter *code = NULL; | 541 | struct sock_filter *code = NULL; |
542 | int len, err; | 542 | int len; |
543 | 543 | ||
544 | if (copy_from_user(&uprog, arg, sizeof(uprog))) | 544 | if (copy_from_user(&uprog, arg, sizeof(uprog))) |
545 | return -EFAULT; | 545 | return -EFAULT; |
@@ -554,12 +554,6 @@ static int get_filter(void __user *arg, struct sock_filter **p) | |||
554 | if (IS_ERR(code)) | 554 | if (IS_ERR(code)) |
555 | return PTR_ERR(code); | 555 | return PTR_ERR(code); |
556 | 556 | ||
557 | err = sk_chk_filter(code, uprog.len); | ||
558 | if (err) { | ||
559 | kfree(code); | ||
560 | return err; | ||
561 | } | ||
562 | |||
563 | *p = code; | 557 | *p = code; |
564 | return uprog.len; | 558 | return uprog.len; |
565 | } | 559 | } |
@@ -763,10 +757,15 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
763 | }; | 757 | }; |
764 | 758 | ||
765 | ppp_lock(ppp); | 759 | ppp_lock(ppp); |
766 | if (ppp->pass_filter) | 760 | if (ppp->pass_filter) { |
767 | sk_unattached_filter_destroy(ppp->pass_filter); | 761 | sk_unattached_filter_destroy(ppp->pass_filter); |
768 | err = sk_unattached_filter_create(&ppp->pass_filter, | 762 | ppp->pass_filter = NULL; |
769 | &fprog); | 763 | } |
764 | if (fprog.filter != NULL) | ||
765 | err = sk_unattached_filter_create(&ppp->pass_filter, | ||
766 | &fprog); | ||
767 | else | ||
768 | err = 0; | ||
770 | kfree(code); | 769 | kfree(code); |
771 | ppp_unlock(ppp); | 770 | ppp_unlock(ppp); |
772 | } | 771 | } |
@@ -784,10 +783,15 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
784 | }; | 783 | }; |
785 | 784 | ||
786 | ppp_lock(ppp); | 785 | ppp_lock(ppp); |
787 | if (ppp->active_filter) | 786 | if (ppp->active_filter) { |
788 | sk_unattached_filter_destroy(ppp->active_filter); | 787 | sk_unattached_filter_destroy(ppp->active_filter); |
789 | err = sk_unattached_filter_create(&ppp->active_filter, | 788 | ppp->active_filter = NULL; |
790 | &fprog); | 789 | } |
790 | if (fprog.filter != NULL) | ||
791 | err = sk_unattached_filter_create(&ppp->active_filter, | ||
792 | &fprog); | ||
793 | else | ||
794 | err = 0; | ||
791 | kfree(code); | 795 | kfree(code); |
792 | ppp_unlock(ppp); | 796 | ppp_unlock(ppp); |
793 | } | 797 | } |
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index 2ea7efd11857..6c9c16d76935 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c | |||
@@ -675,7 +675,7 @@ static int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr, | |||
675 | po->chan.hdrlen = (sizeof(struct pppoe_hdr) + | 675 | po->chan.hdrlen = (sizeof(struct pppoe_hdr) + |
676 | dev->hard_header_len); | 676 | dev->hard_header_len); |
677 | 677 | ||
678 | po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr); | 678 | po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr) - 2; |
679 | po->chan.private = sk; | 679 | po->chan.private = sk; |
680 | po->chan.ops = &pppoe_chan_ops; | 680 | po->chan.ops = &pppoe_chan_ops; |
681 | 681 | ||
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 9ea4bfe5d318..2a32d9167d3b 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -341,6 +341,22 @@ next_desc: | |||
341 | usb_driver_release_interface(driver, info->data); | 341 | usb_driver_release_interface(driver, info->data); |
342 | return -ENODEV; | 342 | return -ENODEV; |
343 | } | 343 | } |
344 | |||
345 | /* Some devices don't initialise properly. In particular | ||
346 | * the packet filter is not reset. There are devices that | ||
347 | * don't do reset all the way. So the packet filter should | ||
348 | * be set to a sane initial value. | ||
349 | */ | ||
350 | usb_control_msg(dev->udev, | ||
351 | usb_sndctrlpipe(dev->udev, 0), | ||
352 | USB_CDC_SET_ETHERNET_PACKET_FILTER, | ||
353 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
354 | USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | USB_CDC_PACKET_TYPE_BROADCAST, | ||
355 | intf->cur_altsetting->desc.bInterfaceNumber, | ||
356 | NULL, | ||
357 | 0, | ||
358 | USB_CTRL_SET_TIMEOUT | ||
359 | ); | ||
344 | return 0; | 360 | return 0; |
345 | 361 | ||
346 | bad_desc: | 362 | bad_desc: |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index a3a05869309d..a4272ed62da8 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -258,10 +258,8 @@ struct hso_serial { | |||
258 | * so as not to drop characters on the floor. | 258 | * so as not to drop characters on the floor. |
259 | */ | 259 | */ |
260 | int curr_rx_urb_idx; | 260 | int curr_rx_urb_idx; |
261 | u16 curr_rx_urb_offset; | ||
262 | u8 rx_urb_filled[MAX_RX_URBS]; | 261 | u8 rx_urb_filled[MAX_RX_URBS]; |
263 | struct tasklet_struct unthrottle_tasklet; | 262 | struct tasklet_struct unthrottle_tasklet; |
264 | struct work_struct retry_unthrottle_workqueue; | ||
265 | }; | 263 | }; |
266 | 264 | ||
267 | struct hso_device { | 265 | struct hso_device { |
@@ -1252,14 +1250,6 @@ static void hso_unthrottle(struct tty_struct *tty) | |||
1252 | tasklet_hi_schedule(&serial->unthrottle_tasklet); | 1250 | tasklet_hi_schedule(&serial->unthrottle_tasklet); |
1253 | } | 1251 | } |
1254 | 1252 | ||
1255 | static void hso_unthrottle_workfunc(struct work_struct *work) | ||
1256 | { | ||
1257 | struct hso_serial *serial = | ||
1258 | container_of(work, struct hso_serial, | ||
1259 | retry_unthrottle_workqueue); | ||
1260 | hso_unthrottle_tasklet(serial); | ||
1261 | } | ||
1262 | |||
1263 | /* open the requested serial port */ | 1253 | /* open the requested serial port */ |
1264 | static int hso_serial_open(struct tty_struct *tty, struct file *filp) | 1254 | static int hso_serial_open(struct tty_struct *tty, struct file *filp) |
1265 | { | 1255 | { |
@@ -1295,8 +1285,6 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) | |||
1295 | tasklet_init(&serial->unthrottle_tasklet, | 1285 | tasklet_init(&serial->unthrottle_tasklet, |
1296 | (void (*)(unsigned long))hso_unthrottle_tasklet, | 1286 | (void (*)(unsigned long))hso_unthrottle_tasklet, |
1297 | (unsigned long)serial); | 1287 | (unsigned long)serial); |
1298 | INIT_WORK(&serial->retry_unthrottle_workqueue, | ||
1299 | hso_unthrottle_workfunc); | ||
1300 | result = hso_start_serial_device(serial->parent, GFP_KERNEL); | 1288 | result = hso_start_serial_device(serial->parent, GFP_KERNEL); |
1301 | if (result) { | 1289 | if (result) { |
1302 | hso_stop_serial_device(serial->parent); | 1290 | hso_stop_serial_device(serial->parent); |
@@ -1345,7 +1333,6 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) | |||
1345 | if (!usb_gone) | 1333 | if (!usb_gone) |
1346 | hso_stop_serial_device(serial->parent); | 1334 | hso_stop_serial_device(serial->parent); |
1347 | tasklet_kill(&serial->unthrottle_tasklet); | 1335 | tasklet_kill(&serial->unthrottle_tasklet); |
1348 | cancel_work_sync(&serial->retry_unthrottle_workqueue); | ||
1349 | } | 1336 | } |
1350 | 1337 | ||
1351 | if (!usb_gone) | 1338 | if (!usb_gone) |
@@ -2013,8 +2000,7 @@ static void ctrl_callback(struct urb *urb) | |||
2013 | static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial) | 2000 | static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial) |
2014 | { | 2001 | { |
2015 | struct tty_struct *tty; | 2002 | struct tty_struct *tty; |
2016 | int write_length_remaining = 0; | 2003 | int count; |
2017 | int curr_write_len; | ||
2018 | 2004 | ||
2019 | /* Sanity check */ | 2005 | /* Sanity check */ |
2020 | if (urb == NULL || serial == NULL) { | 2006 | if (urb == NULL || serial == NULL) { |
@@ -2024,29 +2010,28 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial) | |||
2024 | 2010 | ||
2025 | tty = tty_port_tty_get(&serial->port); | 2011 | tty = tty_port_tty_get(&serial->port); |
2026 | 2012 | ||
2013 | if (tty && test_bit(TTY_THROTTLED, &tty->flags)) { | ||
2014 | tty_kref_put(tty); | ||
2015 | return -1; | ||
2016 | } | ||
2017 | |||
2027 | /* Push data to tty */ | 2018 | /* Push data to tty */ |
2028 | write_length_remaining = urb->actual_length - | ||
2029 | serial->curr_rx_urb_offset; | ||
2030 | D1("data to push to tty"); | 2019 | D1("data to push to tty"); |
2031 | while (write_length_remaining) { | 2020 | count = tty_buffer_request_room(&serial->port, urb->actual_length); |
2032 | if (tty && test_bit(TTY_THROTTLED, &tty->flags)) { | 2021 | if (count >= urb->actual_length) { |
2033 | tty_kref_put(tty); | 2022 | tty_insert_flip_string(&serial->port, urb->transfer_buffer, |
2034 | return -1; | 2023 | urb->actual_length); |
2035 | } | ||
2036 | curr_write_len = tty_insert_flip_string(&serial->port, | ||
2037 | urb->transfer_buffer + serial->curr_rx_urb_offset, | ||
2038 | write_length_remaining); | ||
2039 | serial->curr_rx_urb_offset += curr_write_len; | ||
2040 | write_length_remaining -= curr_write_len; | ||
2041 | tty_flip_buffer_push(&serial->port); | 2024 | tty_flip_buffer_push(&serial->port); |
2025 | } else { | ||
2026 | dev_warn(&serial->parent->usb->dev, | ||
2027 | "dropping data, %d bytes lost\n", urb->actual_length); | ||
2042 | } | 2028 | } |
2029 | |||
2043 | tty_kref_put(tty); | 2030 | tty_kref_put(tty); |
2044 | 2031 | ||
2045 | if (write_length_remaining == 0) { | 2032 | serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 0; |
2046 | serial->curr_rx_urb_offset = 0; | 2033 | |
2047 | serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 0; | 2034 | return 0; |
2048 | } | ||
2049 | return write_length_remaining; | ||
2050 | } | 2035 | } |
2051 | 2036 | ||
2052 | 2037 | ||
@@ -2217,7 +2202,6 @@ static int hso_stop_serial_device(struct hso_device *hso_dev) | |||
2217 | } | 2202 | } |
2218 | } | 2203 | } |
2219 | serial->curr_rx_urb_idx = 0; | 2204 | serial->curr_rx_urb_idx = 0; |
2220 | serial->curr_rx_urb_offset = 0; | ||
2221 | 2205 | ||
2222 | if (serial->tx_urb) | 2206 | if (serial->tx_urb) |
2223 | usb_kill_urb(serial->tx_urb); | 2207 | usb_kill_urb(serial->tx_urb); |
diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c index 5d95a13dbe2a..735f7dadb9a0 100644 --- a/drivers/net/usb/huawei_cdc_ncm.c +++ b/drivers/net/usb/huawei_cdc_ncm.c | |||
@@ -194,6 +194,9 @@ static const struct usb_device_id huawei_cdc_ncm_devs[] = { | |||
194 | { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), | 194 | { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), |
195 | .driver_info = (unsigned long)&huawei_cdc_ncm_info, | 195 | .driver_info = (unsigned long)&huawei_cdc_ncm_info, |
196 | }, | 196 | }, |
197 | { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x03, 0x16), | ||
198 | .driver_info = (unsigned long)&huawei_cdc_ncm_info, | ||
199 | }, | ||
197 | 200 | ||
198 | /* Terminating entry */ | 201 | /* Terminating entry */ |
199 | { | 202 | { |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index cf62d7e8329f..22756db53dca 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -667,6 +667,7 @@ static const struct usb_device_id products[] = { | |||
667 | {QMI_FIXED_INTF(0x05c6, 0x9084, 4)}, | 667 | {QMI_FIXED_INTF(0x05c6, 0x9084, 4)}, |
668 | {QMI_FIXED_INTF(0x05c6, 0x920d, 0)}, | 668 | {QMI_FIXED_INTF(0x05c6, 0x920d, 0)}, |
669 | {QMI_FIXED_INTF(0x05c6, 0x920d, 5)}, | 669 | {QMI_FIXED_INTF(0x05c6, 0x920d, 5)}, |
670 | {QMI_FIXED_INTF(0x0846, 0x68a2, 8)}, | ||
670 | {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */ | 671 | {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */ |
671 | {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */ | 672 | {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */ |
672 | {QMI_FIXED_INTF(0x16d8, 0x6003, 0)}, /* CMOTech 6003 */ | 673 | {QMI_FIXED_INTF(0x16d8, 0x6003, 0)}, /* CMOTech 6003 */ |
@@ -741,6 +742,7 @@ static const struct usb_device_id products[] = { | |||
741 | {QMI_FIXED_INTF(0x19d2, 0x1424, 2)}, | 742 | {QMI_FIXED_INTF(0x19d2, 0x1424, 2)}, |
742 | {QMI_FIXED_INTF(0x19d2, 0x1425, 2)}, | 743 | {QMI_FIXED_INTF(0x19d2, 0x1425, 2)}, |
743 | {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */ | 744 | {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */ |
745 | {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ | ||
744 | {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ | 746 | {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ |
745 | {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ | 747 | {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ |
746 | {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ | 748 | {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ |
@@ -756,6 +758,7 @@ static const struct usb_device_id products[] = { | |||
756 | {QMI_FIXED_INTF(0x1199, 0x9054, 8)}, /* Sierra Wireless Modem */ | 758 | {QMI_FIXED_INTF(0x1199, 0x9054, 8)}, /* Sierra Wireless Modem */ |
757 | {QMI_FIXED_INTF(0x1199, 0x9055, 8)}, /* Netgear AirCard 341U */ | 759 | {QMI_FIXED_INTF(0x1199, 0x9055, 8)}, /* Netgear AirCard 341U */ |
758 | {QMI_FIXED_INTF(0x1199, 0x9056, 8)}, /* Sierra Wireless Modem */ | 760 | {QMI_FIXED_INTF(0x1199, 0x9056, 8)}, /* Sierra Wireless Modem */ |
761 | {QMI_FIXED_INTF(0x1199, 0x9057, 8)}, | ||
759 | {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */ | 762 | {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */ |
760 | {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ | 763 | {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ |
761 | {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */ | 764 | {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */ |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 25431965a625..3eab74c7c554 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -282,7 +282,7 @@ | |||
282 | /* USB_DEV_STAT */ | 282 | /* USB_DEV_STAT */ |
283 | #define STAT_SPEED_MASK 0x0006 | 283 | #define STAT_SPEED_MASK 0x0006 |
284 | #define STAT_SPEED_HIGH 0x0000 | 284 | #define STAT_SPEED_HIGH 0x0000 |
285 | #define STAT_SPEED_FULL 0x0001 | 285 | #define STAT_SPEED_FULL 0x0002 |
286 | 286 | ||
287 | /* USB_TX_AGG */ | 287 | /* USB_TX_AGG */ |
288 | #define TX_AGG_MAX_THRESHOLD 0x03 | 288 | #define TX_AGG_MAX_THRESHOLD 0x03 |
@@ -1359,7 +1359,7 @@ static void r8152_csum_workaround(struct r8152 *tp, struct sk_buff *skb, | |||
1359 | struct sk_buff_head seg_list; | 1359 | struct sk_buff_head seg_list; |
1360 | struct sk_buff *segs, *nskb; | 1360 | struct sk_buff *segs, *nskb; |
1361 | 1361 | ||
1362 | features &= ~(NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO); | 1362 | features &= ~(NETIF_F_SG | NETIF_F_IPV6_CSUM | NETIF_F_TSO6); |
1363 | segs = skb_gso_segment(skb, features); | 1363 | segs = skb_gso_segment(skb, features); |
1364 | if (IS_ERR(segs) || !segs) | 1364 | if (IS_ERR(segs) || !segs) |
1365 | goto drop; | 1365 | goto drop; |
@@ -2292,9 +2292,8 @@ static void r8152b_exit_oob(struct r8152 *tp) | |||
2292 | /* rx share fifo credit full threshold */ | 2292 | /* rx share fifo credit full threshold */ |
2293 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_NORMAL); | 2293 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_NORMAL); |
2294 | 2294 | ||
2295 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_DEV_STAT); | 2295 | if (tp->udev->speed == USB_SPEED_FULL || |
2296 | ocp_data &= STAT_SPEED_MASK; | 2296 | tp->udev->speed == USB_SPEED_LOW) { |
2297 | if (ocp_data == STAT_SPEED_FULL) { | ||
2298 | /* rx share fifo credit near full threshold */ | 2297 | /* rx share fifo credit near full threshold */ |
2299 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, | 2298 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, |
2300 | RXFIFO_THR2_FULL); | 2299 | RXFIFO_THR2_FULL); |
@@ -3204,8 +3203,13 @@ static void rtl8152_get_ethtool_stats(struct net_device *dev, | |||
3204 | struct r8152 *tp = netdev_priv(dev); | 3203 | struct r8152 *tp = netdev_priv(dev); |
3205 | struct tally_counter tally; | 3204 | struct tally_counter tally; |
3206 | 3205 | ||
3206 | if (usb_autopm_get_interface(tp->intf) < 0) | ||
3207 | return; | ||
3208 | |||
3207 | generic_ocp_read(tp, PLA_TALLYCNT, sizeof(tally), &tally, MCU_TYPE_PLA); | 3209 | generic_ocp_read(tp, PLA_TALLYCNT, sizeof(tally), &tally, MCU_TYPE_PLA); |
3208 | 3210 | ||
3211 | usb_autopm_put_interface(tp->intf); | ||
3212 | |||
3209 | data[0] = le64_to_cpu(tally.tx_packets); | 3213 | data[0] = le64_to_cpu(tally.tx_packets); |
3210 | data[1] = le64_to_cpu(tally.rx_packets); | 3214 | data[1] = le64_to_cpu(tally.rx_packets); |
3211 | data[2] = le64_to_cpu(tally.tx_errors); | 3215 | data[2] = le64_to_cpu(tally.tx_errors); |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 424db65e4396..d07bf4cb893f 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -1714,6 +1714,18 @@ static int smsc95xx_resume(struct usb_interface *intf) | |||
1714 | return ret; | 1714 | return ret; |
1715 | } | 1715 | } |
1716 | 1716 | ||
1717 | static int smsc95xx_reset_resume(struct usb_interface *intf) | ||
1718 | { | ||
1719 | struct usbnet *dev = usb_get_intfdata(intf); | ||
1720 | int ret; | ||
1721 | |||
1722 | ret = smsc95xx_reset(dev); | ||
1723 | if (ret < 0) | ||
1724 | return ret; | ||
1725 | |||
1726 | return smsc95xx_resume(intf); | ||
1727 | } | ||
1728 | |||
1717 | static void smsc95xx_rx_csum_offload(struct sk_buff *skb) | 1729 | static void smsc95xx_rx_csum_offload(struct sk_buff *skb) |
1718 | { | 1730 | { |
1719 | skb->csum = *(u16 *)(skb_tail_pointer(skb) - 2); | 1731 | skb->csum = *(u16 *)(skb_tail_pointer(skb) - 2); |
@@ -2004,7 +2016,7 @@ static struct usb_driver smsc95xx_driver = { | |||
2004 | .probe = usbnet_probe, | 2016 | .probe = usbnet_probe, |
2005 | .suspend = smsc95xx_suspend, | 2017 | .suspend = smsc95xx_suspend, |
2006 | .resume = smsc95xx_resume, | 2018 | .resume = smsc95xx_resume, |
2007 | .reset_resume = smsc95xx_resume, | 2019 | .reset_resume = smsc95xx_reset_resume, |
2008 | .disconnect = usbnet_disconnect, | 2020 | .disconnect = usbnet_disconnect, |
2009 | .disable_hub_initiated_lpm = 1, | 2021 | .disable_hub_initiated_lpm = 1, |
2010 | .supports_autosuspend = 1, | 2022 | .supports_autosuspend = 1, |
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index ade33ef82823..9f79192c9aa0 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -339,7 +339,7 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan, | |||
339 | ndm->ndm_state = fdb->state; | 339 | ndm->ndm_state = fdb->state; |
340 | ndm->ndm_ifindex = vxlan->dev->ifindex; | 340 | ndm->ndm_ifindex = vxlan->dev->ifindex; |
341 | ndm->ndm_flags = fdb->flags; | 341 | ndm->ndm_flags = fdb->flags; |
342 | ndm->ndm_type = NDA_DST; | 342 | ndm->ndm_type = RTN_UNICAST; |
343 | 343 | ||
344 | if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) | 344 | if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) |
345 | goto nla_put_failure; | 345 | goto nla_put_failure; |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 93ace042d0aa..1f041271f7fe 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -2363,7 +2363,7 @@ static char *type_strings[] = { | |||
2363 | "FarSync TE1" | 2363 | "FarSync TE1" |
2364 | }; | 2364 | }; |
2365 | 2365 | ||
2366 | static void | 2366 | static int |
2367 | fst_init_card(struct fst_card_info *card) | 2367 | fst_init_card(struct fst_card_info *card) |
2368 | { | 2368 | { |
2369 | int i; | 2369 | int i; |
@@ -2374,24 +2374,21 @@ fst_init_card(struct fst_card_info *card) | |||
2374 | * we'll have to revise it in some way then. | 2374 | * we'll have to revise it in some way then. |
2375 | */ | 2375 | */ |
2376 | for (i = 0; i < card->nports; i++) { | 2376 | for (i = 0; i < card->nports; i++) { |
2377 | err = register_hdlc_device(card->ports[i].dev); | 2377 | err = register_hdlc_device(card->ports[i].dev); |
2378 | if (err < 0) { | 2378 | if (err < 0) { |
2379 | int j; | ||
2380 | pr_err("Cannot register HDLC device for port %d (errno %d)\n", | 2379 | pr_err("Cannot register HDLC device for port %d (errno %d)\n", |
2381 | i, -err); | 2380 | i, -err); |
2382 | for (j = i; j < card->nports; j++) { | 2381 | while (i--) |
2383 | free_netdev(card->ports[j].dev); | 2382 | unregister_hdlc_device(card->ports[i].dev); |
2384 | card->ports[j].dev = NULL; | 2383 | return err; |
2385 | } | 2384 | } |
2386 | card->nports = i; | ||
2387 | break; | ||
2388 | } | ||
2389 | } | 2385 | } |
2390 | 2386 | ||
2391 | pr_info("%s-%s: %s IRQ%d, %d ports\n", | 2387 | pr_info("%s-%s: %s IRQ%d, %d ports\n", |
2392 | port_to_dev(&card->ports[0])->name, | 2388 | port_to_dev(&card->ports[0])->name, |
2393 | port_to_dev(&card->ports[card->nports - 1])->name, | 2389 | port_to_dev(&card->ports[card->nports - 1])->name, |
2394 | type_strings[card->type], card->irq, card->nports); | 2390 | type_strings[card->type], card->irq, card->nports); |
2391 | return 0; | ||
2395 | } | 2392 | } |
2396 | 2393 | ||
2397 | static const struct net_device_ops fst_ops = { | 2394 | static const struct net_device_ops fst_ops = { |
@@ -2447,15 +2444,12 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2447 | /* Try to enable the device */ | 2444 | /* Try to enable the device */ |
2448 | if ((err = pci_enable_device(pdev)) != 0) { | 2445 | if ((err = pci_enable_device(pdev)) != 0) { |
2449 | pr_err("Failed to enable card. Err %d\n", -err); | 2446 | pr_err("Failed to enable card. Err %d\n", -err); |
2450 | kfree(card); | 2447 | goto enable_fail; |
2451 | return err; | ||
2452 | } | 2448 | } |
2453 | 2449 | ||
2454 | if ((err = pci_request_regions(pdev, "FarSync")) !=0) { | 2450 | if ((err = pci_request_regions(pdev, "FarSync")) !=0) { |
2455 | pr_err("Failed to allocate regions. Err %d\n", -err); | 2451 | pr_err("Failed to allocate regions. Err %d\n", -err); |
2456 | pci_disable_device(pdev); | 2452 | goto regions_fail; |
2457 | kfree(card); | ||
2458 | return err; | ||
2459 | } | 2453 | } |
2460 | 2454 | ||
2461 | /* Get virtual addresses of memory regions */ | 2455 | /* Get virtual addresses of memory regions */ |
@@ -2464,30 +2458,21 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2464 | card->phys_ctlmem = pci_resource_start(pdev, 3); | 2458 | card->phys_ctlmem = pci_resource_start(pdev, 3); |
2465 | if ((card->mem = ioremap(card->phys_mem, FST_MEMSIZE)) == NULL) { | 2459 | if ((card->mem = ioremap(card->phys_mem, FST_MEMSIZE)) == NULL) { |
2466 | pr_err("Physical memory remap failed\n"); | 2460 | pr_err("Physical memory remap failed\n"); |
2467 | pci_release_regions(pdev); | 2461 | err = -ENODEV; |
2468 | pci_disable_device(pdev); | 2462 | goto ioremap_physmem_fail; |
2469 | kfree(card); | ||
2470 | return -ENODEV; | ||
2471 | } | 2463 | } |
2472 | if ((card->ctlmem = ioremap(card->phys_ctlmem, 0x10)) == NULL) { | 2464 | if ((card->ctlmem = ioremap(card->phys_ctlmem, 0x10)) == NULL) { |
2473 | pr_err("Control memory remap failed\n"); | 2465 | pr_err("Control memory remap failed\n"); |
2474 | pci_release_regions(pdev); | 2466 | err = -ENODEV; |
2475 | pci_disable_device(pdev); | 2467 | goto ioremap_ctlmem_fail; |
2476 | iounmap(card->mem); | ||
2477 | kfree(card); | ||
2478 | return -ENODEV; | ||
2479 | } | 2468 | } |
2480 | dbg(DBG_PCI, "kernel mem %p, ctlmem %p\n", card->mem, card->ctlmem); | 2469 | dbg(DBG_PCI, "kernel mem %p, ctlmem %p\n", card->mem, card->ctlmem); |
2481 | 2470 | ||
2482 | /* Register the interrupt handler */ | 2471 | /* Register the interrupt handler */ |
2483 | if (request_irq(pdev->irq, fst_intr, IRQF_SHARED, FST_DEV_NAME, card)) { | 2472 | if (request_irq(pdev->irq, fst_intr, IRQF_SHARED, FST_DEV_NAME, card)) { |
2484 | pr_err("Unable to register interrupt %d\n", card->irq); | 2473 | pr_err("Unable to register interrupt %d\n", card->irq); |
2485 | pci_release_regions(pdev); | 2474 | err = -ENODEV; |
2486 | pci_disable_device(pdev); | 2475 | goto irq_fail; |
2487 | iounmap(card->ctlmem); | ||
2488 | iounmap(card->mem); | ||
2489 | kfree(card); | ||
2490 | return -ENODEV; | ||
2491 | } | 2476 | } |
2492 | 2477 | ||
2493 | /* Record info we need */ | 2478 | /* Record info we need */ |
@@ -2513,13 +2498,8 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2513 | while (i--) | 2498 | while (i--) |
2514 | free_netdev(card->ports[i].dev); | 2499 | free_netdev(card->ports[i].dev); |
2515 | pr_err("FarSync: out of memory\n"); | 2500 | pr_err("FarSync: out of memory\n"); |
2516 | free_irq(card->irq, card); | 2501 | err = -ENOMEM; |
2517 | pci_release_regions(pdev); | 2502 | goto hdlcdev_fail; |
2518 | pci_disable_device(pdev); | ||
2519 | iounmap(card->ctlmem); | ||
2520 | iounmap(card->mem); | ||
2521 | kfree(card); | ||
2522 | return -ENODEV; | ||
2523 | } | 2503 | } |
2524 | card->ports[i].dev = dev; | 2504 | card->ports[i].dev = dev; |
2525 | card->ports[i].card = card; | 2505 | card->ports[i].card = card; |
@@ -2565,9 +2545,16 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2565 | pci_set_drvdata(pdev, card); | 2545 | pci_set_drvdata(pdev, card); |
2566 | 2546 | ||
2567 | /* Remainder of card setup */ | 2547 | /* Remainder of card setup */ |
2548 | if (no_of_cards_added >= FST_MAX_CARDS) { | ||
2549 | pr_err("FarSync: too many cards\n"); | ||
2550 | err = -ENOMEM; | ||
2551 | goto card_array_fail; | ||
2552 | } | ||
2568 | fst_card_array[no_of_cards_added] = card; | 2553 | fst_card_array[no_of_cards_added] = card; |
2569 | card->card_no = no_of_cards_added++; /* Record instance and bump it */ | 2554 | card->card_no = no_of_cards_added++; /* Record instance and bump it */ |
2570 | fst_init_card(card); | 2555 | err = fst_init_card(card); |
2556 | if (err) | ||
2557 | goto init_card_fail; | ||
2571 | if (card->family == FST_FAMILY_TXU) { | 2558 | if (card->family == FST_FAMILY_TXU) { |
2572 | /* | 2559 | /* |
2573 | * Allocate a dma buffer for transmit and receives | 2560 | * Allocate a dma buffer for transmit and receives |
@@ -2577,29 +2564,46 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2577 | &card->rx_dma_handle_card); | 2564 | &card->rx_dma_handle_card); |
2578 | if (card->rx_dma_handle_host == NULL) { | 2565 | if (card->rx_dma_handle_host == NULL) { |
2579 | pr_err("Could not allocate rx dma buffer\n"); | 2566 | pr_err("Could not allocate rx dma buffer\n"); |
2580 | fst_disable_intr(card); | 2567 | err = -ENOMEM; |
2581 | pci_release_regions(pdev); | 2568 | goto rx_dma_fail; |
2582 | pci_disable_device(pdev); | ||
2583 | iounmap(card->ctlmem); | ||
2584 | iounmap(card->mem); | ||
2585 | kfree(card); | ||
2586 | return -ENOMEM; | ||
2587 | } | 2569 | } |
2588 | card->tx_dma_handle_host = | 2570 | card->tx_dma_handle_host = |
2589 | pci_alloc_consistent(card->device, FST_MAX_MTU, | 2571 | pci_alloc_consistent(card->device, FST_MAX_MTU, |
2590 | &card->tx_dma_handle_card); | 2572 | &card->tx_dma_handle_card); |
2591 | if (card->tx_dma_handle_host == NULL) { | 2573 | if (card->tx_dma_handle_host == NULL) { |
2592 | pr_err("Could not allocate tx dma buffer\n"); | 2574 | pr_err("Could not allocate tx dma buffer\n"); |
2593 | fst_disable_intr(card); | 2575 | err = -ENOMEM; |
2594 | pci_release_regions(pdev); | 2576 | goto tx_dma_fail; |
2595 | pci_disable_device(pdev); | ||
2596 | iounmap(card->ctlmem); | ||
2597 | iounmap(card->mem); | ||
2598 | kfree(card); | ||
2599 | return -ENOMEM; | ||
2600 | } | 2577 | } |
2601 | } | 2578 | } |
2602 | return 0; /* Success */ | 2579 | return 0; /* Success */ |
2580 | |||
2581 | tx_dma_fail: | ||
2582 | pci_free_consistent(card->device, FST_MAX_MTU, | ||
2583 | card->rx_dma_handle_host, | ||
2584 | card->rx_dma_handle_card); | ||
2585 | rx_dma_fail: | ||
2586 | fst_disable_intr(card); | ||
2587 | for (i = 0 ; i < card->nports ; i++) | ||
2588 | unregister_hdlc_device(card->ports[i].dev); | ||
2589 | init_card_fail: | ||
2590 | fst_card_array[card->card_no] = NULL; | ||
2591 | card_array_fail: | ||
2592 | for (i = 0 ; i < card->nports ; i++) | ||
2593 | free_netdev(card->ports[i].dev); | ||
2594 | hdlcdev_fail: | ||
2595 | free_irq(card->irq, card); | ||
2596 | irq_fail: | ||
2597 | iounmap(card->ctlmem); | ||
2598 | ioremap_ctlmem_fail: | ||
2599 | iounmap(card->mem); | ||
2600 | ioremap_physmem_fail: | ||
2601 | pci_release_regions(pdev); | ||
2602 | regions_fail: | ||
2603 | pci_disable_device(pdev); | ||
2604 | enable_fail: | ||
2605 | kfree(card); | ||
2606 | return err; | ||
2603 | } | 2607 | } |
2604 | 2608 | ||
2605 | /* | 2609 | /* |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 5895f1978691..fa9fdfa128c1 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -122,8 +122,12 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu) | |||
122 | { | 122 | { |
123 | struct x25_asy *sl = netdev_priv(dev); | 123 | struct x25_asy *sl = netdev_priv(dev); |
124 | unsigned char *xbuff, *rbuff; | 124 | unsigned char *xbuff, *rbuff; |
125 | int len = 2 * newmtu; | 125 | int len; |
126 | 126 | ||
127 | if (newmtu > 65534) | ||
128 | return -EINVAL; | ||
129 | |||
130 | len = 2 * newmtu; | ||
127 | xbuff = kmalloc(len + 4, GFP_ATOMIC); | 131 | xbuff = kmalloc(len + 4, GFP_ATOMIC); |
128 | rbuff = kmalloc(len + 4, GFP_ATOMIC); | 132 | rbuff = kmalloc(len + 4, GFP_ATOMIC); |
129 | 133 | ||
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 82017f56e661..e6c56c5bb0f6 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c | |||
@@ -795,7 +795,11 @@ int ath10k_core_start(struct ath10k *ar) | |||
795 | if (status) | 795 | if (status) |
796 | goto err_htc_stop; | 796 | goto err_htc_stop; |
797 | 797 | ||
798 | ar->free_vdev_map = (1 << TARGET_NUM_VDEVS) - 1; | 798 | if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) |
799 | ar->free_vdev_map = (1 << TARGET_10X_NUM_VDEVS) - 1; | ||
800 | else | ||
801 | ar->free_vdev_map = (1 << TARGET_NUM_VDEVS) - 1; | ||
802 | |||
799 | INIT_LIST_HEAD(&ar->arvifs); | 803 | INIT_LIST_HEAD(&ar->arvifs); |
800 | 804 | ||
801 | if (!test_bit(ATH10K_FLAG_FIRST_BOOT_DONE, &ar->dev_flags)) | 805 | if (!test_bit(ATH10K_FLAG_FIRST_BOOT_DONE, &ar->dev_flags)) |
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 6c102b1312ff..eebc860c3655 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c | |||
@@ -312,7 +312,6 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
312 | int msdu_len, msdu_chaining = 0; | 312 | int msdu_len, msdu_chaining = 0; |
313 | struct sk_buff *msdu; | 313 | struct sk_buff *msdu; |
314 | struct htt_rx_desc *rx_desc; | 314 | struct htt_rx_desc *rx_desc; |
315 | bool corrupted = false; | ||
316 | 315 | ||
317 | lockdep_assert_held(&htt->rx_ring.lock); | 316 | lockdep_assert_held(&htt->rx_ring.lock); |
318 | 317 | ||
@@ -439,9 +438,6 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
439 | last_msdu = __le32_to_cpu(rx_desc->msdu_end.info0) & | 438 | last_msdu = __le32_to_cpu(rx_desc->msdu_end.info0) & |
440 | RX_MSDU_END_INFO0_LAST_MSDU; | 439 | RX_MSDU_END_INFO0_LAST_MSDU; |
441 | 440 | ||
442 | if (msdu_chaining && !last_msdu) | ||
443 | corrupted = true; | ||
444 | |||
445 | if (last_msdu) { | 441 | if (last_msdu) { |
446 | msdu->next = NULL; | 442 | msdu->next = NULL; |
447 | break; | 443 | break; |
@@ -457,20 +453,6 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
457 | msdu_chaining = -1; | 453 | msdu_chaining = -1; |
458 | 454 | ||
459 | /* | 455 | /* |
460 | * Apparently FW sometimes reports weird chained MSDU sequences with | ||
461 | * more than one rx descriptor. This seems like a bug but needs more | ||
462 | * analyzing. For the time being fix it by dropping such sequences to | ||
463 | * avoid blowing up the host system. | ||
464 | */ | ||
465 | if (corrupted) { | ||
466 | ath10k_warn("failed to pop chained msdus, dropping\n"); | ||
467 | ath10k_htt_rx_free_msdu_chain(*head_msdu); | ||
468 | *head_msdu = NULL; | ||
469 | *tail_msdu = NULL; | ||
470 | msdu_chaining = -EINVAL; | ||
471 | } | ||
472 | |||
473 | /* | ||
474 | * Don't refill the ring yet. | 456 | * Don't refill the ring yet. |
475 | * | 457 | * |
476 | * First, the elements popped here are still in use - it is not | 458 | * First, the elements popped here are still in use - it is not |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 66acb2cbd9df..7c28cb55610b 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -887,6 +887,15 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq, | |||
887 | 887 | ||
888 | tx_info = IEEE80211_SKB_CB(skb); | 888 | tx_info = IEEE80211_SKB_CB(skb); |
889 | tx_info->flags &= ~IEEE80211_TX_CTL_CLEAR_PS_FILT; | 889 | tx_info->flags &= ~IEEE80211_TX_CTL_CLEAR_PS_FILT; |
890 | |||
891 | /* | ||
892 | * No aggregation session is running, but there may be frames | ||
893 | * from a previous session or a failed attempt in the queue. | ||
894 | * Send them out as normal data frames | ||
895 | */ | ||
896 | if (!tid->active) | ||
897 | tx_info->flags &= ~IEEE80211_TX_CTL_AMPDU; | ||
898 | |||
890 | if (!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) { | 899 | if (!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) { |
891 | bf->bf_state.bf_type = 0; | 900 | bf->bf_state.bf_type = 0; |
892 | return bf; | 901 | return bf; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c index 6db51a666f61..d06fcb05adf2 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c | |||
@@ -1184,8 +1184,6 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo) | |||
1184 | bus->bus_priv.usb = bus_pub; | 1184 | bus->bus_priv.usb = bus_pub; |
1185 | dev_set_drvdata(dev, bus); | 1185 | dev_set_drvdata(dev, bus); |
1186 | bus->ops = &brcmf_usb_bus_ops; | 1186 | bus->ops = &brcmf_usb_bus_ops; |
1187 | bus->chip = bus_pub->devid; | ||
1188 | bus->chiprev = bus_pub->chiprev; | ||
1189 | bus->proto_type = BRCMF_PROTO_BCDC; | 1187 | bus->proto_type = BRCMF_PROTO_BCDC; |
1190 | bus->always_use_fws_queue = true; | 1188 | bus->always_use_fws_queue = true; |
1191 | 1189 | ||
@@ -1194,6 +1192,9 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo) | |||
1194 | if (ret) | 1192 | if (ret) |
1195 | goto fail; | 1193 | goto fail; |
1196 | } | 1194 | } |
1195 | bus->chip = bus_pub->devid; | ||
1196 | bus->chiprev = bus_pub->chiprev; | ||
1197 | |||
1197 | /* request firmware here */ | 1198 | /* request firmware here */ |
1198 | brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), NULL, | 1199 | brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), NULL, |
1199 | brcmf_usb_probe_phase2); | 1200 | brcmf_usb_probe_phase2); |
diff --git a/drivers/net/wireless/iwlwifi/dvm/rxon.c b/drivers/net/wireless/iwlwifi/dvm/rxon.c index ed50de6362ed..6dc5dd3ced44 100644 --- a/drivers/net/wireless/iwlwifi/dvm/rxon.c +++ b/drivers/net/wireless/iwlwifi/dvm/rxon.c | |||
@@ -1068,13 +1068,6 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | |||
1068 | /* recalculate basic rates */ | 1068 | /* recalculate basic rates */ |
1069 | iwl_calc_basic_rates(priv, ctx); | 1069 | iwl_calc_basic_rates(priv, ctx); |
1070 | 1070 | ||
1071 | /* | ||
1072 | * force CTS-to-self frames protection if RTS-CTS is not preferred | ||
1073 | * one aggregation protection method | ||
1074 | */ | ||
1075 | if (!priv->hw_params.use_rts_for_aggregation) | ||
1076 | ctx->staging.flags |= RXON_FLG_SELF_CTS_EN; | ||
1077 | |||
1078 | if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) || | 1071 | if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) || |
1079 | !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK)) | 1072 | !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK)) |
1080 | ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK; | 1073 | ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK; |
@@ -1480,11 +1473,6 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw, | |||
1480 | else | 1473 | else |
1481 | ctx->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK; | 1474 | ctx->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK; |
1482 | 1475 | ||
1483 | if (bss_conf->use_cts_prot) | ||
1484 | ctx->staging.flags |= RXON_FLG_SELF_CTS_EN; | ||
1485 | else | ||
1486 | ctx->staging.flags &= ~RXON_FLG_SELF_CTS_EN; | ||
1487 | |||
1488 | memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN); | 1476 | memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN); |
1489 | 1477 | ||
1490 | if (vif->type == NL80211_IFTYPE_AP || | 1478 | if (vif->type == NL80211_IFTYPE_AP || |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h index 0aa7c0085c9f..b1a33322b9ba 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw.h | |||
@@ -88,6 +88,7 @@ | |||
88 | * P2P client interfaces simultaneously if they are in different bindings. | 88 | * P2P client interfaces simultaneously if they are in different bindings. |
89 | * @IWL_UCODE_TLV_FLAGS_P2P_BSS_PS_SCM: support power save on BSS station and | 89 | * @IWL_UCODE_TLV_FLAGS_P2P_BSS_PS_SCM: support power save on BSS station and |
90 | * P2P client interfaces simultaneously if they are in same bindings. | 90 | * P2P client interfaces simultaneously if they are in same bindings. |
91 | * @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD | ||
91 | * @IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save | 92 | * @IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save |
92 | * @IWL_UCODE_TLV_FLAGS_BCAST_FILTERING: uCode supports broadcast filtering. | 93 | * @IWL_UCODE_TLV_FLAGS_BCAST_FILTERING: uCode supports broadcast filtering. |
93 | * @IWL_UCODE_TLV_FLAGS_GO_UAPSD: AP/GO interfaces support uAPSD clients | 94 | * @IWL_UCODE_TLV_FLAGS_GO_UAPSD: AP/GO interfaces support uAPSD clients |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c index 8b5302777632..8b79081d4885 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | |||
@@ -667,10 +667,9 @@ static void iwl_mvm_mac_ctxt_cmd_common(struct iwl_mvm *mvm, | |||
667 | if (vif->bss_conf.qos) | 667 | if (vif->bss_conf.qos) |
668 | cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA); | 668 | cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA); |
669 | 669 | ||
670 | if (vif->bss_conf.use_cts_prot) { | 670 | if (vif->bss_conf.use_cts_prot) |
671 | cmd->protection_flags |= cpu_to_le32(MAC_PROT_FLG_TGG_PROTECT); | 671 | cmd->protection_flags |= cpu_to_le32(MAC_PROT_FLG_TGG_PROTECT); |
672 | cmd->protection_flags |= cpu_to_le32(MAC_PROT_FLG_SELF_CTS_EN); | 672 | |
673 | } | ||
674 | IWL_DEBUG_RATE(mvm, "use_cts_prot %d, ht_operation_mode %d\n", | 673 | IWL_DEBUG_RATE(mvm, "use_cts_prot %d, ht_operation_mode %d\n", |
675 | vif->bss_conf.use_cts_prot, | 674 | vif->bss_conf.use_cts_prot, |
676 | vif->bss_conf.ht_operation_mode); | 675 | vif->bss_conf.ht_operation_mode); |
@@ -1073,8 +1072,12 @@ static int iwl_mvm_mac_ctxt_cmd_ap(struct iwl_mvm *mvm, | |||
1073 | /* Fill the common data for all mac context types */ | 1072 | /* Fill the common data for all mac context types */ |
1074 | iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, action); | 1073 | iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, action); |
1075 | 1074 | ||
1076 | /* Also enable probe requests to pass */ | 1075 | /* |
1077 | cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST); | 1076 | * pass probe requests and beacons from other APs (needed |
1077 | * for ht protection) | ||
1078 | */ | ||
1079 | cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST | | ||
1080 | MAC_FILTER_IN_BEACON); | ||
1078 | 1081 | ||
1079 | /* Fill the data specific for ap mode */ | 1082 | /* Fill the data specific for ap mode */ |
1080 | iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.ap, | 1083 | iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.ap, |
@@ -1095,6 +1098,13 @@ static int iwl_mvm_mac_ctxt_cmd_go(struct iwl_mvm *mvm, | |||
1095 | /* Fill the common data for all mac context types */ | 1098 | /* Fill the common data for all mac context types */ |
1096 | iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, action); | 1099 | iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, action); |
1097 | 1100 | ||
1101 | /* | ||
1102 | * pass probe requests and beacons from other APs (needed | ||
1103 | * for ht protection) | ||
1104 | */ | ||
1105 | cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST | | ||
1106 | MAC_FILTER_IN_BEACON); | ||
1107 | |||
1098 | /* Fill the data specific for GO mode */ | 1108 | /* Fill the data specific for GO mode */ |
1099 | iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.go.ap, | 1109 | iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.go.ap, |
1100 | action == FW_CTXT_ACTION_ADD); | 1110 | action == FW_CTXT_ACTION_ADD); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 7215f5980186..98556d03c1ed 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -1159,8 +1159,12 @@ static void iwl_mvm_bcast_filter_iterator(void *_data, u8 *mac, | |||
1159 | 1159 | ||
1160 | bcast_mac = &cmd->macs[mvmvif->id]; | 1160 | bcast_mac = &cmd->macs[mvmvif->id]; |
1161 | 1161 | ||
1162 | /* enable filtering only for associated stations */ | 1162 | /* |
1163 | if (vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc) | 1163 | * enable filtering only for associated stations, but not for P2P |
1164 | * Clients | ||
1165 | */ | ||
1166 | if (vif->type != NL80211_IFTYPE_STATION || vif->p2p || | ||
1167 | !vif->bss_conf.assoc) | ||
1164 | return; | 1168 | return; |
1165 | 1169 | ||
1166 | bcast_mac->default_discard = 1; | 1170 | bcast_mac->default_discard = 1; |
@@ -1237,10 +1241,6 @@ static int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm, | |||
1237 | if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING)) | 1241 | if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING)) |
1238 | return 0; | 1242 | return 0; |
1239 | 1243 | ||
1240 | /* bcast filtering isn't supported for P2P client */ | ||
1241 | if (vif->p2p) | ||
1242 | return 0; | ||
1243 | |||
1244 | if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd)) | 1244 | if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd)) |
1245 | return 0; | 1245 | return 0; |
1246 | 1246 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index 4b6c7d4bd199..eac2b424f6a0 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -588,9 +588,7 @@ static void iwl_build_scan_cmd(struct iwl_mvm *mvm, | |||
588 | struct iwl_scan_offload_cmd *scan, | 588 | struct iwl_scan_offload_cmd *scan, |
589 | struct iwl_mvm_scan_params *params) | 589 | struct iwl_mvm_scan_params *params) |
590 | { | 590 | { |
591 | scan->channel_count = | 591 | scan->channel_count = req->n_channels; |
592 | mvm->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels + | ||
593 | mvm->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels; | ||
594 | scan->quiet_time = cpu_to_le16(IWL_ACTIVE_QUIET_TIME); | 592 | scan->quiet_time = cpu_to_le16(IWL_ACTIVE_QUIET_TIME); |
595 | scan->quiet_plcp_th = cpu_to_le16(IWL_PLCP_QUIET_THRESH); | 593 | scan->quiet_plcp_th = cpu_to_le16(IWL_PLCP_QUIET_THRESH); |
596 | scan->good_CRC_th = IWL_GOOD_CRC_TH_DEFAULT; | 594 | scan->good_CRC_th = IWL_GOOD_CRC_TH_DEFAULT; |
@@ -669,61 +667,37 @@ static void iwl_build_channel_cfg(struct iwl_mvm *mvm, | |||
669 | struct cfg80211_sched_scan_request *req, | 667 | struct cfg80211_sched_scan_request *req, |
670 | struct iwl_scan_channel_cfg *channels, | 668 | struct iwl_scan_channel_cfg *channels, |
671 | enum ieee80211_band band, | 669 | enum ieee80211_band band, |
672 | int *head, int *tail, | 670 | int *head, |
673 | u32 ssid_bitmap, | 671 | u32 ssid_bitmap, |
674 | struct iwl_mvm_scan_params *params) | 672 | struct iwl_mvm_scan_params *params) |
675 | { | 673 | { |
676 | struct ieee80211_supported_band *s_band; | 674 | int i, index = 0; |
677 | int n_channels = req->n_channels; | ||
678 | int i, j, index = 0; | ||
679 | bool partial; | ||
680 | 675 | ||
681 | /* | 676 | for (i = 0; i < req->n_channels; i++) { |
682 | * We have to configure all supported channels, even if we don't want to | 677 | struct ieee80211_channel *chan = req->channels[i]; |
683 | * scan on them, but we have to send channels in the order that we want | 678 | |
684 | * to scan. So add requested channels to head of the list and others to | 679 | if (chan->band != band) |
685 | * the end. | 680 | continue; |
686 | */ | 681 | |
687 | s_band = &mvm->nvm_data->bands[band]; | 682 | index = *head; |
688 | 683 | (*head)++; | |
689 | for (i = 0; i < s_band->n_channels && *head <= *tail; i++) { | 684 | |
690 | partial = false; | 685 | channels->channel_number[index] = cpu_to_le16(chan->hw_value); |
691 | for (j = 0; j < n_channels; j++) | ||
692 | if (s_band->channels[i].center_freq == | ||
693 | req->channels[j]->center_freq) { | ||
694 | index = *head; | ||
695 | (*head)++; | ||
696 | /* | ||
697 | * Channels that came with the request will be | ||
698 | * in partial scan . | ||
699 | */ | ||
700 | partial = true; | ||
701 | break; | ||
702 | } | ||
703 | if (!partial) { | ||
704 | index = *tail; | ||
705 | (*tail)--; | ||
706 | } | ||
707 | channels->channel_number[index] = | ||
708 | cpu_to_le16(ieee80211_frequency_to_channel( | ||
709 | s_band->channels[i].center_freq)); | ||
710 | channels->dwell_time[index][0] = params->dwell[band].active; | 686 | channels->dwell_time[index][0] = params->dwell[band].active; |
711 | channels->dwell_time[index][1] = params->dwell[band].passive; | 687 | channels->dwell_time[index][1] = params->dwell[band].passive; |
712 | 688 | ||
713 | channels->iter_count[index] = cpu_to_le16(1); | 689 | channels->iter_count[index] = cpu_to_le16(1); |
714 | channels->iter_interval[index] = 0; | 690 | channels->iter_interval[index] = 0; |
715 | 691 | ||
716 | if (!(s_band->channels[i].flags & IEEE80211_CHAN_NO_IR)) | 692 | if (!(chan->flags & IEEE80211_CHAN_NO_IR)) |
717 | channels->type[index] |= | 693 | channels->type[index] |= |
718 | cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE); | 694 | cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE); |
719 | 695 | ||
720 | channels->type[index] |= | 696 | channels->type[index] |= |
721 | cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_FULL); | 697 | cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_FULL | |
722 | if (partial) | 698 | IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL); |
723 | channels->type[index] |= | ||
724 | cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL); | ||
725 | 699 | ||
726 | if (s_band->channels[i].flags & IEEE80211_CHAN_NO_HT40) | 700 | if (chan->flags & IEEE80211_CHAN_NO_HT40) |
727 | channels->type[index] |= | 701 | channels->type[index] |= |
728 | cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_NARROW); | 702 | cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_NARROW); |
729 | 703 | ||
@@ -740,7 +714,6 @@ int iwl_mvm_config_sched_scan(struct iwl_mvm *mvm, | |||
740 | int band_2ghz = mvm->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels; | 714 | int band_2ghz = mvm->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels; |
741 | int band_5ghz = mvm->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels; | 715 | int band_5ghz = mvm->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels; |
742 | int head = 0; | 716 | int head = 0; |
743 | int tail = band_2ghz + band_5ghz - 1; | ||
744 | u32 ssid_bitmap; | 717 | u32 ssid_bitmap; |
745 | int cmd_len; | 718 | int cmd_len; |
746 | int ret; | 719 | int ret; |
@@ -772,7 +745,7 @@ int iwl_mvm_config_sched_scan(struct iwl_mvm *mvm, | |||
772 | &scan_cfg->scan_cmd.tx_cmd[0], | 745 | &scan_cfg->scan_cmd.tx_cmd[0], |
773 | scan_cfg->data); | 746 | scan_cfg->data); |
774 | iwl_build_channel_cfg(mvm, req, &scan_cfg->channel_cfg, | 747 | iwl_build_channel_cfg(mvm, req, &scan_cfg->channel_cfg, |
775 | IEEE80211_BAND_2GHZ, &head, &tail, | 748 | IEEE80211_BAND_2GHZ, &head, |
776 | ssid_bitmap, ¶ms); | 749 | ssid_bitmap, ¶ms); |
777 | } | 750 | } |
778 | if (band_5ghz) { | 751 | if (band_5ghz) { |
@@ -782,7 +755,7 @@ int iwl_mvm_config_sched_scan(struct iwl_mvm *mvm, | |||
782 | scan_cfg->data + | 755 | scan_cfg->data + |
783 | SCAN_OFFLOAD_PROBE_REQ_SIZE); | 756 | SCAN_OFFLOAD_PROBE_REQ_SIZE); |
784 | iwl_build_channel_cfg(mvm, req, &scan_cfg->channel_cfg, | 757 | iwl_build_channel_cfg(mvm, req, &scan_cfg->channel_cfg, |
785 | IEEE80211_BAND_5GHZ, &head, &tail, | 758 | IEEE80211_BAND_5GHZ, &head, |
786 | ssid_bitmap, ¶ms); | 759 | ssid_bitmap, ¶ms); |
787 | } | 760 | } |
788 | 761 | ||
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index 7091a18d5a72..98950e45c7b0 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c | |||
@@ -367,6 +367,7 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
367 | {IWL_PCI_DEVICE(0x095A, 0x5012, iwl7265_2ac_cfg)}, | 367 | {IWL_PCI_DEVICE(0x095A, 0x5012, iwl7265_2ac_cfg)}, |
368 | {IWL_PCI_DEVICE(0x095A, 0x5412, iwl7265_2ac_cfg)}, | 368 | {IWL_PCI_DEVICE(0x095A, 0x5412, iwl7265_2ac_cfg)}, |
369 | {IWL_PCI_DEVICE(0x095A, 0x5410, iwl7265_2ac_cfg)}, | 369 | {IWL_PCI_DEVICE(0x095A, 0x5410, iwl7265_2ac_cfg)}, |
370 | {IWL_PCI_DEVICE(0x095A, 0x5510, iwl7265_2ac_cfg)}, | ||
370 | {IWL_PCI_DEVICE(0x095A, 0x5400, iwl7265_2ac_cfg)}, | 371 | {IWL_PCI_DEVICE(0x095A, 0x5400, iwl7265_2ac_cfg)}, |
371 | {IWL_PCI_DEVICE(0x095A, 0x1010, iwl7265_2ac_cfg)}, | 372 | {IWL_PCI_DEVICE(0x095A, 0x1010, iwl7265_2ac_cfg)}, |
372 | {IWL_PCI_DEVICE(0x095A, 0x5000, iwl7265_2n_cfg)}, | 373 | {IWL_PCI_DEVICE(0x095A, 0x5000, iwl7265_2n_cfg)}, |
@@ -380,7 +381,7 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
380 | {IWL_PCI_DEVICE(0x095A, 0x9110, iwl7265_2ac_cfg)}, | 381 | {IWL_PCI_DEVICE(0x095A, 0x9110, iwl7265_2ac_cfg)}, |
381 | {IWL_PCI_DEVICE(0x095A, 0x9112, iwl7265_2ac_cfg)}, | 382 | {IWL_PCI_DEVICE(0x095A, 0x9112, iwl7265_2ac_cfg)}, |
382 | {IWL_PCI_DEVICE(0x095A, 0x9210, iwl7265_2ac_cfg)}, | 383 | {IWL_PCI_DEVICE(0x095A, 0x9210, iwl7265_2ac_cfg)}, |
383 | {IWL_PCI_DEVICE(0x095A, 0x9200, iwl7265_2ac_cfg)}, | 384 | {IWL_PCI_DEVICE(0x095B, 0x9200, iwl7265_2ac_cfg)}, |
384 | {IWL_PCI_DEVICE(0x095A, 0x9510, iwl7265_2ac_cfg)}, | 385 | {IWL_PCI_DEVICE(0x095A, 0x9510, iwl7265_2ac_cfg)}, |
385 | {IWL_PCI_DEVICE(0x095A, 0x9310, iwl7265_2ac_cfg)}, | 386 | {IWL_PCI_DEVICE(0x095A, 0x9310, iwl7265_2ac_cfg)}, |
386 | {IWL_PCI_DEVICE(0x095A, 0x9410, iwl7265_2ac_cfg)}, | 387 | {IWL_PCI_DEVICE(0x095A, 0x9410, iwl7265_2ac_cfg)}, |
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c index 5b32106182f8..fe0f66f73507 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.c +++ b/drivers/net/wireless/mwifiex/11n_aggr.c | |||
@@ -185,6 +185,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | |||
185 | skb_reserve(skb_aggr, headroom + sizeof(struct txpd)); | 185 | skb_reserve(skb_aggr, headroom + sizeof(struct txpd)); |
186 | tx_info_aggr = MWIFIEX_SKB_TXCB(skb_aggr); | 186 | tx_info_aggr = MWIFIEX_SKB_TXCB(skb_aggr); |
187 | 187 | ||
188 | memset(tx_info_aggr, 0, sizeof(*tx_info_aggr)); | ||
188 | tx_info_aggr->bss_type = tx_info_src->bss_type; | 189 | tx_info_aggr->bss_type = tx_info_src->bss_type; |
189 | tx_info_aggr->bss_num = tx_info_src->bss_num; | 190 | tx_info_aggr->bss_num = tx_info_src->bss_num; |
190 | 191 | ||
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index e95dec91a561..b511613bba2d 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -220,6 +220,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
220 | } | 220 | } |
221 | 221 | ||
222 | tx_info = MWIFIEX_SKB_TXCB(skb); | 222 | tx_info = MWIFIEX_SKB_TXCB(skb); |
223 | memset(tx_info, 0, sizeof(*tx_info)); | ||
223 | tx_info->bss_num = priv->bss_num; | 224 | tx_info->bss_num = priv->bss_num; |
224 | tx_info->bss_type = priv->bss_type; | 225 | tx_info->bss_type = priv->bss_type; |
225 | tx_info->pkt_len = pkt_len; | 226 | tx_info->pkt_len = pkt_len; |
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 8dee6c86f4f1..c161141f6c39 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
@@ -453,6 +453,7 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter) | |||
453 | 453 | ||
454 | if (skb) { | 454 | if (skb) { |
455 | rx_info = MWIFIEX_SKB_RXCB(skb); | 455 | rx_info = MWIFIEX_SKB_RXCB(skb); |
456 | memset(rx_info, 0, sizeof(*rx_info)); | ||
456 | rx_info->bss_num = priv->bss_num; | 457 | rx_info->bss_num = priv->bss_num; |
457 | rx_info->bss_type = priv->bss_type; | 458 | rx_info->bss_type = priv->bss_type; |
458 | } | 459 | } |
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index cbabc12fbda3..e91cd0fa5ca8 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -645,6 +645,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
645 | } | 645 | } |
646 | 646 | ||
647 | tx_info = MWIFIEX_SKB_TXCB(skb); | 647 | tx_info = MWIFIEX_SKB_TXCB(skb); |
648 | memset(tx_info, 0, sizeof(*tx_info)); | ||
648 | tx_info->bss_num = priv->bss_num; | 649 | tx_info->bss_num = priv->bss_num; |
649 | tx_info->bss_type = priv->bss_type; | 650 | tx_info->bss_type = priv->bss_type; |
650 | tx_info->pkt_len = skb->len; | 651 | tx_info->pkt_len = skb->len; |
diff --git a/drivers/net/wireless/mwifiex/sta_tx.c b/drivers/net/wireless/mwifiex/sta_tx.c index 5fce7e78a36e..70eb863c7249 100644 --- a/drivers/net/wireless/mwifiex/sta_tx.c +++ b/drivers/net/wireless/mwifiex/sta_tx.c | |||
@@ -150,6 +150,7 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags) | |||
150 | return -1; | 150 | return -1; |
151 | 151 | ||
152 | tx_info = MWIFIEX_SKB_TXCB(skb); | 152 | tx_info = MWIFIEX_SKB_TXCB(skb); |
153 | memset(tx_info, 0, sizeof(*tx_info)); | ||
153 | tx_info->bss_num = priv->bss_num; | 154 | tx_info->bss_num = priv->bss_num; |
154 | tx_info->bss_type = priv->bss_type; | 155 | tx_info->bss_type = priv->bss_type; |
155 | tx_info->pkt_len = data_len - (sizeof(struct txpd) + INTF_HEADER_LEN); | 156 | tx_info->pkt_len = data_len - (sizeof(struct txpd) + INTF_HEADER_LEN); |
diff --git a/drivers/net/wireless/mwifiex/tdls.c b/drivers/net/wireless/mwifiex/tdls.c index e73034fbbde9..0e88364e0c67 100644 --- a/drivers/net/wireless/mwifiex/tdls.c +++ b/drivers/net/wireless/mwifiex/tdls.c | |||
@@ -605,6 +605,7 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer, | |||
605 | } | 605 | } |
606 | 606 | ||
607 | tx_info = MWIFIEX_SKB_TXCB(skb); | 607 | tx_info = MWIFIEX_SKB_TXCB(skb); |
608 | memset(tx_info, 0, sizeof(*tx_info)); | ||
608 | tx_info->bss_num = priv->bss_num; | 609 | tx_info->bss_num = priv->bss_num; |
609 | tx_info->bss_type = priv->bss_type; | 610 | tx_info->bss_type = priv->bss_type; |
610 | 611 | ||
@@ -760,6 +761,7 @@ int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer, | |||
760 | skb->priority = MWIFIEX_PRIO_VI; | 761 | skb->priority = MWIFIEX_PRIO_VI; |
761 | 762 | ||
762 | tx_info = MWIFIEX_SKB_TXCB(skb); | 763 | tx_info = MWIFIEX_SKB_TXCB(skb); |
764 | memset(tx_info, 0, sizeof(*tx_info)); | ||
763 | tx_info->bss_num = priv->bss_num; | 765 | tx_info->bss_num = priv->bss_num; |
764 | tx_info->bss_type = priv->bss_type; | 766 | tx_info->bss_type = priv->bss_type; |
765 | tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT; | 767 | tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT; |
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index 37f26afd4314..fd7e5b9b4581 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c | |||
@@ -55,6 +55,7 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, | |||
55 | return -1; | 55 | return -1; |
56 | } | 56 | } |
57 | 57 | ||
58 | memset(rx_info, 0, sizeof(*rx_info)); | ||
58 | rx_info->bss_num = priv->bss_num; | 59 | rx_info->bss_num = priv->bss_num; |
59 | rx_info->bss_type = priv->bss_type; | 60 | rx_info->bss_type = priv->bss_type; |
60 | 61 | ||
diff --git a/drivers/net/wireless/mwifiex/uap_txrx.c b/drivers/net/wireless/mwifiex/uap_txrx.c index 9a56bc61cb1d..b0601b91cc4f 100644 --- a/drivers/net/wireless/mwifiex/uap_txrx.c +++ b/drivers/net/wireless/mwifiex/uap_txrx.c | |||
@@ -175,6 +175,7 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv, | |||
175 | } | 175 | } |
176 | 176 | ||
177 | tx_info = MWIFIEX_SKB_TXCB(skb); | 177 | tx_info = MWIFIEX_SKB_TXCB(skb); |
178 | memset(tx_info, 0, sizeof(*tx_info)); | ||
178 | tx_info->bss_num = priv->bss_num; | 179 | tx_info->bss_num = priv->bss_num; |
179 | tx_info->bss_type = priv->bss_type; | 180 | tx_info->bss_type = priv->bss_type; |
180 | tx_info->flags |= MWIFIEX_BUF_FLAG_BRIDGED_PKT; | 181 | tx_info->flags |= MWIFIEX_BUF_FLAG_BRIDGED_PKT; |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index e11dab2216c6..832006b5aab1 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -231,9 +231,12 @@ static enum hrtimer_restart rt2800usb_tx_sta_fifo_timeout(struct hrtimer *timer) | |||
231 | */ | 231 | */ |
232 | static int rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev) | 232 | static int rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev) |
233 | { | 233 | { |
234 | __le32 reg; | 234 | __le32 *reg; |
235 | u32 fw_mode; | 235 | u32 fw_mode; |
236 | 236 | ||
237 | reg = kmalloc(sizeof(*reg), GFP_KERNEL); | ||
238 | if (reg == NULL) | ||
239 | return -ENOMEM; | ||
237 | /* cannot use rt2x00usb_register_read here as it uses different | 240 | /* cannot use rt2x00usb_register_read here as it uses different |
238 | * mode (MULTI_READ vs. DEVICE_MODE) and does not pass the | 241 | * mode (MULTI_READ vs. DEVICE_MODE) and does not pass the |
239 | * magic value USB_MODE_AUTORUN (0x11) to the device, thus the | 242 | * magic value USB_MODE_AUTORUN (0x11) to the device, thus the |
@@ -241,8 +244,9 @@ static int rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev) | |||
241 | */ | 244 | */ |
242 | rt2x00usb_vendor_request(rt2x00dev, USB_DEVICE_MODE, | 245 | rt2x00usb_vendor_request(rt2x00dev, USB_DEVICE_MODE, |
243 | USB_VENDOR_REQUEST_IN, 0, USB_MODE_AUTORUN, | 246 | USB_VENDOR_REQUEST_IN, 0, USB_MODE_AUTORUN, |
244 | ®, sizeof(reg), REGISTER_TIMEOUT_FIRMWARE); | 247 | reg, sizeof(*reg), REGISTER_TIMEOUT_FIRMWARE); |
245 | fw_mode = le32_to_cpu(reg); | 248 | fw_mode = le32_to_cpu(*reg); |
249 | kfree(reg); | ||
246 | 250 | ||
247 | if ((fw_mode & 0x00000003) == 2) | 251 | if ((fw_mode & 0x00000003) == 2) |
248 | return 1; | 252 | return 1; |
@@ -261,6 +265,7 @@ static int rt2800usb_write_firmware(struct rt2x00_dev *rt2x00dev, | |||
261 | int status; | 265 | int status; |
262 | u32 offset; | 266 | u32 offset; |
263 | u32 length; | 267 | u32 length; |
268 | int retval; | ||
264 | 269 | ||
265 | /* | 270 | /* |
266 | * Check which section of the firmware we need. | 271 | * Check which section of the firmware we need. |
@@ -278,7 +283,10 @@ static int rt2800usb_write_firmware(struct rt2x00_dev *rt2x00dev, | |||
278 | /* | 283 | /* |
279 | * Write firmware to device. | 284 | * Write firmware to device. |
280 | */ | 285 | */ |
281 | if (rt2800usb_autorun_detect(rt2x00dev)) { | 286 | retval = rt2800usb_autorun_detect(rt2x00dev); |
287 | if (retval < 0) | ||
288 | return retval; | ||
289 | if (retval) { | ||
282 | rt2x00_info(rt2x00dev, | 290 | rt2x00_info(rt2x00dev, |
283 | "Firmware loading not required - NIC in AutoRun mode\n"); | 291 | "Firmware loading not required - NIC in AutoRun mode\n"); |
284 | } else { | 292 | } else { |
@@ -763,7 +771,12 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, | |||
763 | */ | 771 | */ |
764 | static int rt2800usb_efuse_detect(struct rt2x00_dev *rt2x00dev) | 772 | static int rt2800usb_efuse_detect(struct rt2x00_dev *rt2x00dev) |
765 | { | 773 | { |
766 | if (rt2800usb_autorun_detect(rt2x00dev)) | 774 | int retval; |
775 | |||
776 | retval = rt2800usb_autorun_detect(rt2x00dev); | ||
777 | if (retval < 0) | ||
778 | return retval; | ||
779 | if (retval) | ||
767 | return 1; | 780 | return 1; |
768 | return rt2800_efuse_detect(rt2x00dev); | 781 | return rt2800_efuse_detect(rt2x00dev); |
769 | } | 782 | } |
@@ -772,7 +785,10 @@ static int rt2800usb_read_eeprom(struct rt2x00_dev *rt2x00dev) | |||
772 | { | 785 | { |
773 | int retval; | 786 | int retval; |
774 | 787 | ||
775 | if (rt2800usb_efuse_detect(rt2x00dev)) | 788 | retval = rt2800usb_efuse_detect(rt2x00dev); |
789 | if (retval < 0) | ||
790 | return retval; | ||
791 | if (retval) | ||
776 | retval = rt2800_read_eeprom_efuse(rt2x00dev); | 792 | retval = rt2800_read_eeprom_efuse(rt2x00dev); |
777 | else | 793 | else |
778 | retval = rt2x00usb_eeprom_read(rt2x00dev, rt2x00dev->eeprom, | 794 | retval = rt2x00usb_eeprom_read(rt2x00dev, rt2x00dev->eeprom, |
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 1844a47636b6..c65b636bcab9 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -1030,14 +1030,21 @@ static int xenvif_tx_check_gop(struct xenvif_queue *queue, | |||
1030 | { | 1030 | { |
1031 | struct gnttab_map_grant_ref *gop_map = *gopp_map; | 1031 | struct gnttab_map_grant_ref *gop_map = *gopp_map; |
1032 | u16 pending_idx = XENVIF_TX_CB(skb)->pending_idx; | 1032 | u16 pending_idx = XENVIF_TX_CB(skb)->pending_idx; |
1033 | /* This always points to the shinfo of the skb being checked, which | ||
1034 | * could be either the first or the one on the frag_list | ||
1035 | */ | ||
1033 | struct skb_shared_info *shinfo = skb_shinfo(skb); | 1036 | struct skb_shared_info *shinfo = skb_shinfo(skb); |
1037 | /* If this is non-NULL, we are currently checking the frag_list skb, and | ||
1038 | * this points to the shinfo of the first one | ||
1039 | */ | ||
1040 | struct skb_shared_info *first_shinfo = NULL; | ||
1034 | int nr_frags = shinfo->nr_frags; | 1041 | int nr_frags = shinfo->nr_frags; |
1042 | const bool sharedslot = nr_frags && | ||
1043 | frag_get_pending_idx(&shinfo->frags[0]) == pending_idx; | ||
1035 | int i, err; | 1044 | int i, err; |
1036 | struct sk_buff *first_skb = NULL; | ||
1037 | 1045 | ||
1038 | /* Check status of header. */ | 1046 | /* Check status of header. */ |
1039 | err = (*gopp_copy)->status; | 1047 | err = (*gopp_copy)->status; |
1040 | (*gopp_copy)++; | ||
1041 | if (unlikely(err)) { | 1048 | if (unlikely(err)) { |
1042 | if (net_ratelimit()) | 1049 | if (net_ratelimit()) |
1043 | netdev_dbg(queue->vif->dev, | 1050 | netdev_dbg(queue->vif->dev, |
@@ -1045,8 +1052,12 @@ static int xenvif_tx_check_gop(struct xenvif_queue *queue, | |||
1045 | (*gopp_copy)->status, | 1052 | (*gopp_copy)->status, |
1046 | pending_idx, | 1053 | pending_idx, |
1047 | (*gopp_copy)->source.u.ref); | 1054 | (*gopp_copy)->source.u.ref); |
1048 | xenvif_idx_release(queue, pending_idx, XEN_NETIF_RSP_ERROR); | 1055 | /* The first frag might still have this slot mapped */ |
1056 | if (!sharedslot) | ||
1057 | xenvif_idx_release(queue, pending_idx, | ||
1058 | XEN_NETIF_RSP_ERROR); | ||
1049 | } | 1059 | } |
1060 | (*gopp_copy)++; | ||
1050 | 1061 | ||
1051 | check_frags: | 1062 | check_frags: |
1052 | for (i = 0; i < nr_frags; i++, gop_map++) { | 1063 | for (i = 0; i < nr_frags; i++, gop_map++) { |
@@ -1062,8 +1073,19 @@ check_frags: | |||
1062 | pending_idx, | 1073 | pending_idx, |
1063 | gop_map->handle); | 1074 | gop_map->handle); |
1064 | /* Had a previous error? Invalidate this fragment. */ | 1075 | /* Had a previous error? Invalidate this fragment. */ |
1065 | if (unlikely(err)) | 1076 | if (unlikely(err)) { |
1066 | xenvif_idx_unmap(queue, pending_idx); | 1077 | xenvif_idx_unmap(queue, pending_idx); |
1078 | /* If the mapping of the first frag was OK, but | ||
1079 | * the header's copy failed, and they are | ||
1080 | * sharing a slot, send an error | ||
1081 | */ | ||
1082 | if (i == 0 && sharedslot) | ||
1083 | xenvif_idx_release(queue, pending_idx, | ||
1084 | XEN_NETIF_RSP_ERROR); | ||
1085 | else | ||
1086 | xenvif_idx_release(queue, pending_idx, | ||
1087 | XEN_NETIF_RSP_OKAY); | ||
1088 | } | ||
1067 | continue; | 1089 | continue; |
1068 | } | 1090 | } |
1069 | 1091 | ||
@@ -1075,42 +1097,53 @@ check_frags: | |||
1075 | gop_map->status, | 1097 | gop_map->status, |
1076 | pending_idx, | 1098 | pending_idx, |
1077 | gop_map->ref); | 1099 | gop_map->ref); |
1100 | |||
1078 | xenvif_idx_release(queue, pending_idx, XEN_NETIF_RSP_ERROR); | 1101 | xenvif_idx_release(queue, pending_idx, XEN_NETIF_RSP_ERROR); |
1079 | 1102 | ||
1080 | /* Not the first error? Preceding frags already invalidated. */ | 1103 | /* Not the first error? Preceding frags already invalidated. */ |
1081 | if (err) | 1104 | if (err) |
1082 | continue; | 1105 | continue; |
1083 | /* First error: invalidate preceding fragments. */ | 1106 | |
1107 | /* First error: if the header haven't shared a slot with the | ||
1108 | * first frag, release it as well. | ||
1109 | */ | ||
1110 | if (!sharedslot) | ||
1111 | xenvif_idx_release(queue, | ||
1112 | XENVIF_TX_CB(skb)->pending_idx, | ||
1113 | XEN_NETIF_RSP_OKAY); | ||
1114 | |||
1115 | /* Invalidate preceding fragments of this skb. */ | ||
1084 | for (j = 0; j < i; j++) { | 1116 | for (j = 0; j < i; j++) { |
1085 | pending_idx = frag_get_pending_idx(&shinfo->frags[j]); | 1117 | pending_idx = frag_get_pending_idx(&shinfo->frags[j]); |
1086 | xenvif_idx_unmap(queue, pending_idx); | 1118 | xenvif_idx_unmap(queue, pending_idx); |
1119 | xenvif_idx_release(queue, pending_idx, | ||
1120 | XEN_NETIF_RSP_OKAY); | ||
1121 | } | ||
1122 | |||
1123 | /* And if we found the error while checking the frag_list, unmap | ||
1124 | * the first skb's frags | ||
1125 | */ | ||
1126 | if (first_shinfo) { | ||
1127 | for (j = 0; j < first_shinfo->nr_frags; j++) { | ||
1128 | pending_idx = frag_get_pending_idx(&first_shinfo->frags[j]); | ||
1129 | xenvif_idx_unmap(queue, pending_idx); | ||
1130 | xenvif_idx_release(queue, pending_idx, | ||
1131 | XEN_NETIF_RSP_OKAY); | ||
1132 | } | ||
1087 | } | 1133 | } |
1088 | 1134 | ||
1089 | /* Remember the error: invalidate all subsequent fragments. */ | 1135 | /* Remember the error: invalidate all subsequent fragments. */ |
1090 | err = newerr; | 1136 | err = newerr; |
1091 | } | 1137 | } |
1092 | 1138 | ||
1093 | if (skb_has_frag_list(skb)) { | 1139 | if (skb_has_frag_list(skb) && !first_shinfo) { |
1094 | first_skb = skb; | 1140 | first_shinfo = skb_shinfo(skb); |
1095 | skb = shinfo->frag_list; | 1141 | shinfo = skb_shinfo(skb_shinfo(skb)->frag_list); |
1096 | shinfo = skb_shinfo(skb); | ||
1097 | nr_frags = shinfo->nr_frags; | 1142 | nr_frags = shinfo->nr_frags; |
1098 | 1143 | ||
1099 | goto check_frags; | 1144 | goto check_frags; |
1100 | } | 1145 | } |
1101 | 1146 | ||
1102 | /* There was a mapping error in the frag_list skb. We have to unmap | ||
1103 | * the first skb's frags | ||
1104 | */ | ||
1105 | if (first_skb && err) { | ||
1106 | int j; | ||
1107 | shinfo = skb_shinfo(first_skb); | ||
1108 | for (j = 0; j < shinfo->nr_frags; j++) { | ||
1109 | pending_idx = frag_get_pending_idx(&shinfo->frags[j]); | ||
1110 | xenvif_idx_unmap(queue, pending_idx); | ||
1111 | } | ||
1112 | } | ||
1113 | |||
1114 | *gopp_map = gop_map; | 1147 | *gopp_map = gop_map; |
1115 | return err; | 1148 | return err; |
1116 | } | 1149 | } |
@@ -1518,7 +1551,16 @@ static int xenvif_tx_submit(struct xenvif_queue *queue) | |||
1518 | 1551 | ||
1519 | /* Check the remap error code. */ | 1552 | /* Check the remap error code. */ |
1520 | if (unlikely(xenvif_tx_check_gop(queue, skb, &gop_map, &gop_copy))) { | 1553 | if (unlikely(xenvif_tx_check_gop(queue, skb, &gop_map, &gop_copy))) { |
1554 | /* If there was an error, xenvif_tx_check_gop is | ||
1555 | * expected to release all the frags which were mapped, | ||
1556 | * so kfree_skb shouldn't do it again | ||
1557 | */ | ||
1521 | skb_shinfo(skb)->nr_frags = 0; | 1558 | skb_shinfo(skb)->nr_frags = 0; |
1559 | if (skb_has_frag_list(skb)) { | ||
1560 | struct sk_buff *nskb = | ||
1561 | skb_shinfo(skb)->frag_list; | ||
1562 | skb_shinfo(nskb)->nr_frags = 0; | ||
1563 | } | ||
1522 | kfree_skb(skb); | 1564 | kfree_skb(skb); |
1523 | continue; | 1565 | continue; |
1524 | } | 1566 | } |
@@ -1822,8 +1864,6 @@ void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx) | |||
1822 | tx_unmap_op.status); | 1864 | tx_unmap_op.status); |
1823 | BUG(); | 1865 | BUG(); |
1824 | } | 1866 | } |
1825 | |||
1826 | xenvif_idx_release(queue, pending_idx, XEN_NETIF_RSP_OKAY); | ||
1827 | } | 1867 | } |
1828 | 1868 | ||
1829 | static inline int rx_work_todo(struct xenvif_queue *queue) | 1869 | static inline int rx_work_todo(struct xenvif_queue *queue) |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 2ccb4a02368b..055222bae6e4 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1439,16 +1439,11 @@ static void xennet_disconnect_backend(struct netfront_info *info) | |||
1439 | unsigned int i = 0; | 1439 | unsigned int i = 0; |
1440 | unsigned int num_queues = info->netdev->real_num_tx_queues; | 1440 | unsigned int num_queues = info->netdev->real_num_tx_queues; |
1441 | 1441 | ||
1442 | netif_carrier_off(info->netdev); | ||
1443 | |||
1442 | for (i = 0; i < num_queues; ++i) { | 1444 | for (i = 0; i < num_queues; ++i) { |
1443 | struct netfront_queue *queue = &info->queues[i]; | 1445 | struct netfront_queue *queue = &info->queues[i]; |
1444 | 1446 | ||
1445 | /* Stop old i/f to prevent errors whilst we rebuild the state. */ | ||
1446 | spin_lock_bh(&queue->rx_lock); | ||
1447 | spin_lock_irq(&queue->tx_lock); | ||
1448 | netif_carrier_off(queue->info->netdev); | ||
1449 | spin_unlock_irq(&queue->tx_lock); | ||
1450 | spin_unlock_bh(&queue->rx_lock); | ||
1451 | |||
1452 | if (queue->tx_irq && (queue->tx_irq == queue->rx_irq)) | 1447 | if (queue->tx_irq && (queue->tx_irq == queue->rx_irq)) |
1453 | unbind_from_irqhandler(queue->tx_irq, queue); | 1448 | unbind_from_irqhandler(queue->tx_irq, queue); |
1454 | if (queue->tx_irq && (queue->tx_irq != queue->rx_irq)) { | 1449 | if (queue->tx_irq && (queue->tx_irq != queue->rx_irq)) { |
@@ -1458,6 +1453,8 @@ static void xennet_disconnect_backend(struct netfront_info *info) | |||
1458 | queue->tx_evtchn = queue->rx_evtchn = 0; | 1453 | queue->tx_evtchn = queue->rx_evtchn = 0; |
1459 | queue->tx_irq = queue->rx_irq = 0; | 1454 | queue->tx_irq = queue->rx_irq = 0; |
1460 | 1455 | ||
1456 | napi_synchronize(&queue->napi); | ||
1457 | |||
1461 | /* End access and free the pages */ | 1458 | /* End access and free the pages */ |
1462 | xennet_end_access(queue->tx_ring_ref, queue->tx.sring); | 1459 | xennet_end_access(queue->tx_ring_ref, queue->tx.sring); |
1463 | xennet_end_access(queue->rx_ring_ref, queue->rx.sring); | 1460 | xennet_end_access(queue->rx_ring_ref, queue->rx.sring); |
@@ -2046,13 +2043,15 @@ static int xennet_connect(struct net_device *dev) | |||
2046 | /* By now, the queue structures have been set up */ | 2043 | /* By now, the queue structures have been set up */ |
2047 | for (j = 0; j < num_queues; ++j) { | 2044 | for (j = 0; j < num_queues; ++j) { |
2048 | queue = &np->queues[j]; | 2045 | queue = &np->queues[j]; |
2049 | spin_lock_bh(&queue->rx_lock); | ||
2050 | spin_lock_irq(&queue->tx_lock); | ||
2051 | 2046 | ||
2052 | /* Step 1: Discard all pending TX packet fragments. */ | 2047 | /* Step 1: Discard all pending TX packet fragments. */ |
2048 | spin_lock_irq(&queue->tx_lock); | ||
2053 | xennet_release_tx_bufs(queue); | 2049 | xennet_release_tx_bufs(queue); |
2050 | spin_unlock_irq(&queue->tx_lock); | ||
2054 | 2051 | ||
2055 | /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */ | 2052 | /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */ |
2053 | spin_lock_bh(&queue->rx_lock); | ||
2054 | |||
2056 | for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) { | 2055 | for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) { |
2057 | skb_frag_t *frag; | 2056 | skb_frag_t *frag; |
2058 | const struct page *page; | 2057 | const struct page *page; |
@@ -2076,6 +2075,8 @@ static int xennet_connect(struct net_device *dev) | |||
2076 | } | 2075 | } |
2077 | 2076 | ||
2078 | queue->rx.req_prod_pvt = requeue_idx; | 2077 | queue->rx.req_prod_pvt = requeue_idx; |
2078 | |||
2079 | spin_unlock_bh(&queue->rx_lock); | ||
2079 | } | 2080 | } |
2080 | 2081 | ||
2081 | /* | 2082 | /* |
@@ -2087,13 +2088,17 @@ static int xennet_connect(struct net_device *dev) | |||
2087 | netif_carrier_on(np->netdev); | 2088 | netif_carrier_on(np->netdev); |
2088 | for (j = 0; j < num_queues; ++j) { | 2089 | for (j = 0; j < num_queues; ++j) { |
2089 | queue = &np->queues[j]; | 2090 | queue = &np->queues[j]; |
2091 | |||
2090 | notify_remote_via_irq(queue->tx_irq); | 2092 | notify_remote_via_irq(queue->tx_irq); |
2091 | if (queue->tx_irq != queue->rx_irq) | 2093 | if (queue->tx_irq != queue->rx_irq) |
2092 | notify_remote_via_irq(queue->rx_irq); | 2094 | notify_remote_via_irq(queue->rx_irq); |
2093 | xennet_tx_buf_gc(queue); | ||
2094 | xennet_alloc_rx_buffers(queue); | ||
2095 | 2095 | ||
2096 | spin_lock_irq(&queue->tx_lock); | ||
2097 | xennet_tx_buf_gc(queue); | ||
2096 | spin_unlock_irq(&queue->tx_lock); | 2098 | spin_unlock_irq(&queue->tx_lock); |
2099 | |||
2100 | spin_lock_bh(&queue->rx_lock); | ||
2101 | xennet_alloc_rx_buffers(queue); | ||
2097 | spin_unlock_bh(&queue->rx_lock); | 2102 | spin_unlock_bh(&queue->rx_lock); |
2098 | } | 2103 | } |
2099 | 2104 | ||
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index b777d8f46bd5..9aa012e6ea0a 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -26,6 +26,54 @@ | |||
26 | #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ | 26 | #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ |
27 | #include <asm/page.h> | 27 | #include <asm/page.h> |
28 | 28 | ||
29 | /* | ||
30 | * of_fdt_limit_memory - limit the number of regions in the /memory node | ||
31 | * @limit: maximum entries | ||
32 | * | ||
33 | * Adjust the flattened device tree to have at most 'limit' number of | ||
34 | * memory entries in the /memory node. This function may be called | ||
35 | * any time after initial_boot_param is set. | ||
36 | */ | ||
37 | void of_fdt_limit_memory(int limit) | ||
38 | { | ||
39 | int memory; | ||
40 | int len; | ||
41 | const void *val; | ||
42 | int nr_address_cells = OF_ROOT_NODE_ADDR_CELLS_DEFAULT; | ||
43 | int nr_size_cells = OF_ROOT_NODE_SIZE_CELLS_DEFAULT; | ||
44 | const uint32_t *addr_prop; | ||
45 | const uint32_t *size_prop; | ||
46 | int root_offset; | ||
47 | int cell_size; | ||
48 | |||
49 | root_offset = fdt_path_offset(initial_boot_params, "/"); | ||
50 | if (root_offset < 0) | ||
51 | return; | ||
52 | |||
53 | addr_prop = fdt_getprop(initial_boot_params, root_offset, | ||
54 | "#address-cells", NULL); | ||
55 | if (addr_prop) | ||
56 | nr_address_cells = fdt32_to_cpu(*addr_prop); | ||
57 | |||
58 | size_prop = fdt_getprop(initial_boot_params, root_offset, | ||
59 | "#size-cells", NULL); | ||
60 | if (size_prop) | ||
61 | nr_size_cells = fdt32_to_cpu(*size_prop); | ||
62 | |||
63 | cell_size = sizeof(uint32_t)*(nr_address_cells + nr_size_cells); | ||
64 | |||
65 | memory = fdt_path_offset(initial_boot_params, "/memory"); | ||
66 | if (memory > 0) { | ||
67 | val = fdt_getprop(initial_boot_params, memory, "reg", &len); | ||
68 | if (len > limit*cell_size) { | ||
69 | len = limit*cell_size; | ||
70 | pr_debug("Limiting number of entries to %d\n", limit); | ||
71 | fdt_setprop(initial_boot_params, memory, "reg", val, | ||
72 | len); | ||
73 | } | ||
74 | } | ||
75 | } | ||
76 | |||
29 | /** | 77 | /** |
30 | * of_fdt_is_compatible - Return true if given node from the given blob has | 78 | * of_fdt_is_compatible - Return true if given node from the given blob has |
31 | * compat in its compatible list | 79 | * compat in its compatible list |
@@ -937,7 +985,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, | |||
937 | } | 985 | } |
938 | #endif | 986 | #endif |
939 | 987 | ||
940 | bool __init early_init_dt_scan(void *params) | 988 | bool __init early_init_dt_verify(void *params) |
941 | { | 989 | { |
942 | if (!params) | 990 | if (!params) |
943 | return false; | 991 | return false; |
@@ -951,6 +999,12 @@ bool __init early_init_dt_scan(void *params) | |||
951 | return false; | 999 | return false; |
952 | } | 1000 | } |
953 | 1001 | ||
1002 | return true; | ||
1003 | } | ||
1004 | |||
1005 | |||
1006 | void __init early_init_dt_scan_nodes(void) | ||
1007 | { | ||
954 | /* Retrieve various information from the /chosen node */ | 1008 | /* Retrieve various information from the /chosen node */ |
955 | of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); | 1009 | of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); |
956 | 1010 | ||
@@ -959,7 +1013,17 @@ bool __init early_init_dt_scan(void *params) | |||
959 | 1013 | ||
960 | /* Setup memory, calling early_init_dt_add_memory_arch */ | 1014 | /* Setup memory, calling early_init_dt_add_memory_arch */ |
961 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); | 1015 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); |
1016 | } | ||
1017 | |||
1018 | bool __init early_init_dt_scan(void *params) | ||
1019 | { | ||
1020 | bool status; | ||
1021 | |||
1022 | status = early_init_dt_verify(params); | ||
1023 | if (!status) | ||
1024 | return false; | ||
962 | 1025 | ||
1026 | early_init_dt_scan_nodes(); | ||
963 | return true; | 1027 | return true; |
964 | } | 1028 | } |
965 | 1029 | ||
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index a3bf2122a8d5..401b2453da45 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c | |||
@@ -182,40 +182,6 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | |||
182 | } | 182 | } |
183 | EXPORT_SYMBOL(of_mdiobus_register); | 183 | EXPORT_SYMBOL(of_mdiobus_register); |
184 | 184 | ||
185 | /** | ||
186 | * of_mdiobus_link_phydev - Find a device node for a phy | ||
187 | * @mdio: pointer to mii_bus structure | ||
188 | * @phydev: phydev for which the of_node pointer should be set | ||
189 | * | ||
190 | * Walk the list of subnodes of a mdio bus and look for a node that matches the | ||
191 | * phy's address with its 'reg' property. If found, set the of_node pointer for | ||
192 | * the phy. This allows auto-probed pyh devices to be supplied with information | ||
193 | * passed in via DT. | ||
194 | */ | ||
195 | void of_mdiobus_link_phydev(struct mii_bus *mdio, | ||
196 | struct phy_device *phydev) | ||
197 | { | ||
198 | struct device *dev = &phydev->dev; | ||
199 | struct device_node *child; | ||
200 | |||
201 | if (dev->of_node || !mdio->dev.of_node) | ||
202 | return; | ||
203 | |||
204 | for_each_available_child_of_node(mdio->dev.of_node, child) { | ||
205 | int addr; | ||
206 | |||
207 | addr = of_mdio_parse_addr(&mdio->dev, child); | ||
208 | if (addr < 0) | ||
209 | continue; | ||
210 | |||
211 | if (addr == phydev->addr) { | ||
212 | dev->of_node = child; | ||
213 | return; | ||
214 | } | ||
215 | } | ||
216 | } | ||
217 | EXPORT_SYMBOL(of_mdiobus_link_phydev); | ||
218 | |||
219 | /* Helper function for of_phy_find_device */ | 185 | /* Helper function for of_phy_find_device */ |
220 | static int of_phy_match(struct device *dev, void *phy_np) | 186 | static int of_phy_match(struct device *dev, void *phy_np) |
221 | { | 187 | { |
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig index 2872ece81f35..44333bd8f908 100644 --- a/drivers/parport/Kconfig +++ b/drivers/parport/Kconfig | |||
@@ -5,6 +5,12 @@ | |||
5 | # Parport configuration. | 5 | # Parport configuration. |
6 | # | 6 | # |
7 | 7 | ||
8 | config ARCH_MIGHT_HAVE_PC_PARPORT | ||
9 | bool | ||
10 | help | ||
11 | Select this config option from the architecture Kconfig if | ||
12 | the architecture might have PC parallel port hardware. | ||
13 | |||
8 | menuconfig PARPORT | 14 | menuconfig PARPORT |
9 | tristate "Parallel port support" | 15 | tristate "Parallel port support" |
10 | depends on HAS_IOMEM | 16 | depends on HAS_IOMEM |
@@ -31,12 +37,6 @@ menuconfig PARPORT | |||
31 | 37 | ||
32 | If unsure, say Y. | 38 | If unsure, say Y. |
33 | 39 | ||
34 | config ARCH_MIGHT_HAVE_PC_PARPORT | ||
35 | bool | ||
36 | help | ||
37 | Select this config option from the architecture Kconfig if | ||
38 | the architecture might have PC parallel port hardware. | ||
39 | |||
40 | if PARPORT | 40 | if PARPORT |
41 | 41 | ||
42 | config PARPORT_PC | 42 | config PARPORT_PC |
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 1bd6363bc95e..9f43916637ca 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c | |||
@@ -1431,7 +1431,7 @@ static void st_gpio_irqmux_handler(unsigned irq, struct irq_desc *desc) | |||
1431 | 1431 | ||
1432 | status = readl(info->irqmux_base); | 1432 | status = readl(info->irqmux_base); |
1433 | 1433 | ||
1434 | for_each_set_bit(n, &status, ST_GPIO_PINS_PER_BANK) | 1434 | for_each_set_bit(n, &status, info->nbanks) |
1435 | __gpio_irq_handler(&info->banks[n]); | 1435 | __gpio_irq_handler(&info->banks[n]); |
1436 | 1436 | ||
1437 | chained_irq_exit(chip, desc); | 1437 | chained_irq_exit(chip, desc); |
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index b81448b2c75d..a5c6cb773e5f 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -319,8 +319,7 @@ static int __init acpi_pnp_match(struct device *dev, void *_pnp) | |||
319 | struct pnp_dev *pnp = _pnp; | 319 | struct pnp_dev *pnp = _pnp; |
320 | 320 | ||
321 | /* true means it matched */ | 321 | /* true means it matched */ |
322 | return !acpi->physical_node_count | 322 | return pnp->data == acpi; |
323 | && compare_pnp_id(pnp->id, acpi_device_hid(acpi)); | ||
324 | } | 323 | } |
325 | 324 | ||
326 | static struct acpi_device * __init acpi_pnp_find_companion(struct device *dev) | 325 | static struct acpi_device * __init acpi_pnp_find_companion(struct device *dev) |
diff --git a/drivers/rapidio/devices/tsi721_dma.c b/drivers/rapidio/devices/tsi721_dma.c index 9b60b1f3261c..44341dc5b148 100644 --- a/drivers/rapidio/devices/tsi721_dma.c +++ b/drivers/rapidio/devices/tsi721_dma.c | |||
@@ -287,6 +287,12 @@ struct tsi721_tx_desc *tsi721_desc_get(struct tsi721_bdma_chan *bdma_chan) | |||
287 | "desc %p not ACKed\n", tx_desc); | 287 | "desc %p not ACKed\n", tx_desc); |
288 | } | 288 | } |
289 | 289 | ||
290 | if (ret == NULL) { | ||
291 | dev_dbg(bdma_chan->dchan.device->dev, | ||
292 | "%s: unable to obtain tx descriptor\n", __func__); | ||
293 | goto err_out; | ||
294 | } | ||
295 | |||
290 | i = bdma_chan->wr_count_next % bdma_chan->bd_num; | 296 | i = bdma_chan->wr_count_next % bdma_chan->bd_num; |
291 | if (i == bdma_chan->bd_num - 1) { | 297 | if (i == bdma_chan->bd_num - 1) { |
292 | i = 0; | 298 | i = 0; |
@@ -297,7 +303,7 @@ struct tsi721_tx_desc *tsi721_desc_get(struct tsi721_bdma_chan *bdma_chan) | |||
297 | tx_desc->txd.phys = bdma_chan->bd_phys + | 303 | tx_desc->txd.phys = bdma_chan->bd_phys + |
298 | i * sizeof(struct tsi721_dma_desc); | 304 | i * sizeof(struct tsi721_dma_desc); |
299 | tx_desc->hw_desc = &((struct tsi721_dma_desc *)bdma_chan->bd_base)[i]; | 305 | tx_desc->hw_desc = &((struct tsi721_dma_desc *)bdma_chan->bd_base)[i]; |
300 | 306 | err_out: | |
301 | spin_unlock_bh(&bdma_chan->lock); | 307 | spin_unlock_bh(&bdma_chan->lock); |
302 | 308 | ||
303 | return ret; | 309 | return ret; |
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 15b3459f8656..220acb4cbee5 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c | |||
@@ -633,7 +633,6 @@ raw3270_reset_device_cb(struct raw3270_request *rq, void *data) | |||
633 | } else | 633 | } else |
634 | raw3270_writesf_readpart(rp); | 634 | raw3270_writesf_readpart(rp); |
635 | memset(&rp->init_reset, 0, sizeof(rp->init_reset)); | 635 | memset(&rp->init_reset, 0, sizeof(rp->init_reset)); |
636 | memset(&rp->init_data, 0, sizeof(rp->init_data)); | ||
637 | } | 636 | } |
638 | 637 | ||
639 | static int | 638 | static int |
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 69ef4f8cfac8..4038437ff033 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -901,10 +901,15 @@ static int ap_device_probe(struct device *dev) | |||
901 | int rc; | 901 | int rc; |
902 | 902 | ||
903 | ap_dev->drv = ap_drv; | 903 | ap_dev->drv = ap_drv; |
904 | |||
905 | spin_lock_bh(&ap_device_list_lock); | ||
906 | list_add(&ap_dev->list, &ap_device_list); | ||
907 | spin_unlock_bh(&ap_device_list_lock); | ||
908 | |||
904 | rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; | 909 | rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; |
905 | if (!rc) { | 910 | if (rc) { |
906 | spin_lock_bh(&ap_device_list_lock); | 911 | spin_lock_bh(&ap_device_list_lock); |
907 | list_add(&ap_dev->list, &ap_device_list); | 912 | list_del_init(&ap_dev->list); |
908 | spin_unlock_bh(&ap_device_list_lock); | 913 | spin_unlock_bh(&ap_device_list_lock); |
909 | } | 914 | } |
910 | return rc; | 915 | return rc; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f7e316368c99..3f50dfcb3227 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -733,6 +733,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
733 | scsi_next_command(cmd); | 733 | scsi_next_command(cmd); |
734 | return; | 734 | return; |
735 | } | 735 | } |
736 | } else if (blk_rq_bytes(req) == 0 && result && !sense_deferred) { | ||
737 | /* | ||
738 | * Certain non BLOCK_PC requests are commands that don't | ||
739 | * actually transfer anything (FLUSH), so cannot use | ||
740 | * good_bytes != blk_rq_bytes(req) as the signal for an error. | ||
741 | * This sets the error explicitly for the problem case. | ||
742 | */ | ||
743 | error = __scsi_error_from_host_byte(cmd, result); | ||
736 | } | 744 | } |
737 | 745 | ||
738 | /* no bidi support for !REQ_TYPE_BLOCK_PC yet */ | 746 | /* no bidi support for !REQ_TYPE_BLOCK_PC yet */ |
diff --git a/drivers/staging/media/omap4iss/Kconfig b/drivers/staging/media/omap4iss/Kconfig index 78b0fba7047e..8afc6fee40c5 100644 --- a/drivers/staging/media/omap4iss/Kconfig +++ b/drivers/staging/media/omap4iss/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config VIDEO_OMAP4 | 1 | config VIDEO_OMAP4 |
2 | bool "OMAP 4 Camera support" | 2 | bool "OMAP 4 Camera support" |
3 | depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4 | 3 | depends on VIDEO_V4L2=y && VIDEO_V4L2_SUBDEV_API && I2C=y && ARCH_OMAP4 |
4 | select VIDEOBUF2_DMA_CONTIG | 4 | select VIDEOBUF2_DMA_CONTIG |
5 | ---help--- | 5 | ---help--- |
6 | Driver for an OMAP 4 ISS controller. | 6 | Driver for an OMAP 4 ISS controller. |
diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c index 8b25c1aa2025..ebb19b22f47f 100644 --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c | |||
@@ -530,8 +530,10 @@ int rtw_resume_process23a(struct rtw_adapter *padapter) | |||
530 | pwrpriv->bkeepfwalive = false; | 530 | pwrpriv->bkeepfwalive = false; |
531 | 531 | ||
532 | DBG_8723A("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive); | 532 | DBG_8723A("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive); |
533 | if (pm_netdev_open23a(pnetdev, true) != 0) | 533 | if (pm_netdev_open23a(pnetdev, true) != 0) { |
534 | up(&pwrpriv->lock); | ||
534 | goto exit; | 535 | goto exit; |
536 | } | ||
535 | 537 | ||
536 | netif_device_attach(pnetdev); | 538 | netif_device_attach(pnetdev); |
537 | netif_carrier_on(pnetdev); | 539 | netif_carrier_on(pnetdev); |
diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c index 59679cd46816..69b80e80b011 100644 --- a/drivers/staging/vt6655/bssdb.c +++ b/drivers/staging/vt6655/bssdb.c | |||
@@ -981,7 +981,7 @@ start: | |||
981 | pDevice->byERPFlag &= ~(WLAN_SET_ERP_USE_PROTECTION(1)); | 981 | pDevice->byERPFlag &= ~(WLAN_SET_ERP_USE_PROTECTION(1)); |
982 | } | 982 | } |
983 | 983 | ||
984 | { | 984 | if (pDevice->eCommandState == WLAN_ASSOCIATE_WAIT) { |
985 | pDevice->byReAssocCount++; | 985 | pDevice->byReAssocCount++; |
986 | /* 10 sec timeout */ | 986 | /* 10 sec timeout */ |
987 | if ((pDevice->byReAssocCount > 10) && (!pDevice->bLinkPass)) { | 987 | if ((pDevice->byReAssocCount > 10) && (!pDevice->bLinkPass)) { |
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 1d3908d044d0..5a5fd937a442 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c | |||
@@ -2318,6 +2318,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { | |||
2318 | int handled = 0; | 2318 | int handled = 0; |
2319 | unsigned char byData = 0; | 2319 | unsigned char byData = 0; |
2320 | int ii = 0; | 2320 | int ii = 0; |
2321 | unsigned long flags; | ||
2321 | 2322 | ||
2322 | MACvReadISR(pDevice->PortOffset, &pDevice->dwIsr); | 2323 | MACvReadISR(pDevice->PortOffset, &pDevice->dwIsr); |
2323 | 2324 | ||
@@ -2331,7 +2332,8 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { | |||
2331 | 2332 | ||
2332 | handled = 1; | 2333 | handled = 1; |
2333 | MACvIntDisable(pDevice->PortOffset); | 2334 | MACvIntDisable(pDevice->PortOffset); |
2334 | spin_lock_irq(&pDevice->lock); | 2335 | |
2336 | spin_lock_irqsave(&pDevice->lock, flags); | ||
2335 | 2337 | ||
2336 | //Make sure current page is 0 | 2338 | //Make sure current page is 0 |
2337 | VNSvInPortB(pDevice->PortOffset + MAC_REG_PAGE1SEL, &byOrgPageSel); | 2339 | VNSvInPortB(pDevice->PortOffset + MAC_REG_PAGE1SEL, &byOrgPageSel); |
@@ -2560,7 +2562,8 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { | |||
2560 | if (byOrgPageSel == 1) | 2562 | if (byOrgPageSel == 1) |
2561 | MACvSelectPage1(pDevice->PortOffset); | 2563 | MACvSelectPage1(pDevice->PortOffset); |
2562 | 2564 | ||
2563 | spin_unlock_irq(&pDevice->lock); | 2565 | spin_unlock_irqrestore(&pDevice->lock, flags); |
2566 | |||
2564 | MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE); | 2567 | MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE); |
2565 | 2568 | ||
2566 | return IRQ_RETVAL(handled); | 2569 | return IRQ_RETVAL(handled); |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 9d2b673f90e3..b8125aa64ad8 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -1169,8 +1169,8 @@ static int ep_enable(struct usb_ep *ep, | |||
1169 | 1169 | ||
1170 | if (hwep->type == USB_ENDPOINT_XFER_CONTROL) | 1170 | if (hwep->type == USB_ENDPOINT_XFER_CONTROL) |
1171 | cap |= QH_IOS; | 1171 | cap |= QH_IOS; |
1172 | if (hwep->num) | 1172 | |
1173 | cap |= QH_ZLT; | 1173 | cap |= QH_ZLT; |
1174 | cap |= (hwep->ep.maxpacket << __ffs(QH_MAX_PKT)) & QH_MAX_PKT; | 1174 | cap |= (hwep->ep.maxpacket << __ffs(QH_MAX_PKT)) & QH_MAX_PKT; |
1175 | /* | 1175 | /* |
1176 | * For ISO-TX, we set mult at QH as the largest value, and use | 1176 | * For ISO-TX, we set mult at QH as the largest value, and use |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 21b99b4b4082..0e950ad8cb25 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -889,6 +889,25 @@ static int hub_usb3_port_disable(struct usb_hub *hub, int port1) | |||
889 | if (!hub_is_superspeed(hub->hdev)) | 889 | if (!hub_is_superspeed(hub->hdev)) |
890 | return -EINVAL; | 890 | return -EINVAL; |
891 | 891 | ||
892 | ret = hub_port_status(hub, port1, &portstatus, &portchange); | ||
893 | if (ret < 0) | ||
894 | return ret; | ||
895 | |||
896 | /* | ||
897 | * USB controller Advanced Micro Devices, Inc. [AMD] FCH USB XHCI | ||
898 | * Controller [1022:7814] will have spurious result making the following | ||
899 | * usb 3.0 device hotplugging route to the 2.0 root hub and recognized | ||
900 | * as high-speed device if we set the usb 3.0 port link state to | ||
901 | * Disabled. Since it's already in USB_SS_PORT_LS_RX_DETECT state, we | ||
902 | * check the state here to avoid the bug. | ||
903 | */ | ||
904 | if ((portstatus & USB_PORT_STAT_LINK_STATE) == | ||
905 | USB_SS_PORT_LS_RX_DETECT) { | ||
906 | dev_dbg(&hub->ports[port1 - 1]->dev, | ||
907 | "Not disabling port; link state is RxDetect\n"); | ||
908 | return ret; | ||
909 | } | ||
910 | |||
892 | ret = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_SS_DISABLED); | 911 | ret = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_SS_DISABLED); |
893 | if (ret) | 912 | if (ret) |
894 | return ret; | 913 | return ret; |
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index b7a506f2bb14..5c660c77f03b 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -426,20 +426,18 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) | |||
426 | * p2m are consistent. | 426 | * p2m are consistent. |
427 | */ | 427 | */ |
428 | if (!xen_feature(XENFEAT_auto_translated_physmap)) { | 428 | if (!xen_feature(XENFEAT_auto_translated_physmap)) { |
429 | unsigned long p; | ||
430 | struct page *scratch_page = get_balloon_scratch_page(); | ||
431 | |||
432 | if (!PageHighMem(page)) { | 429 | if (!PageHighMem(page)) { |
430 | struct page *scratch_page = get_balloon_scratch_page(); | ||
431 | |||
433 | ret = HYPERVISOR_update_va_mapping( | 432 | ret = HYPERVISOR_update_va_mapping( |
434 | (unsigned long)__va(pfn << PAGE_SHIFT), | 433 | (unsigned long)__va(pfn << PAGE_SHIFT), |
435 | pfn_pte(page_to_pfn(scratch_page), | 434 | pfn_pte(page_to_pfn(scratch_page), |
436 | PAGE_KERNEL_RO), 0); | 435 | PAGE_KERNEL_RO), 0); |
437 | BUG_ON(ret); | 436 | BUG_ON(ret); |
438 | } | ||
439 | p = page_to_pfn(scratch_page); | ||
440 | __set_phys_to_machine(pfn, pfn_to_mfn(p)); | ||
441 | 437 | ||
442 | put_balloon_scratch_page(); | 438 | put_balloon_scratch_page(); |
439 | } | ||
440 | __set_phys_to_machine(pfn, INVALID_P2M_ENTRY); | ||
443 | } | 441 | } |
444 | #endif | 442 | #endif |
445 | 443 | ||
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 5d4de88fe5b8..eeba7544f0cd 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c | |||
@@ -1195,18 +1195,20 @@ static int gnttab_expand(unsigned int req_entries) | |||
1195 | int gnttab_init(void) | 1195 | int gnttab_init(void) |
1196 | { | 1196 | { |
1197 | int i; | 1197 | int i; |
1198 | unsigned long max_nr_grant_frames; | ||
1198 | unsigned int max_nr_glist_frames, nr_glist_frames; | 1199 | unsigned int max_nr_glist_frames, nr_glist_frames; |
1199 | unsigned int nr_init_grefs; | 1200 | unsigned int nr_init_grefs; |
1200 | int ret; | 1201 | int ret; |
1201 | 1202 | ||
1202 | gnttab_request_version(); | 1203 | gnttab_request_version(); |
1204 | max_nr_grant_frames = gnttab_max_grant_frames(); | ||
1203 | nr_grant_frames = 1; | 1205 | nr_grant_frames = 1; |
1204 | 1206 | ||
1205 | /* Determine the maximum number of frames required for the | 1207 | /* Determine the maximum number of frames required for the |
1206 | * grant reference free list on the current hypervisor. | 1208 | * grant reference free list on the current hypervisor. |
1207 | */ | 1209 | */ |
1208 | BUG_ON(grefs_per_grant_frame == 0); | 1210 | BUG_ON(grefs_per_grant_frame == 0); |
1209 | max_nr_glist_frames = (gnttab_max_grant_frames() * | 1211 | max_nr_glist_frames = (max_nr_grant_frames * |
1210 | grefs_per_grant_frame / RPP); | 1212 | grefs_per_grant_frame / RPP); |
1211 | 1213 | ||
1212 | gnttab_list = kmalloc(max_nr_glist_frames * sizeof(grant_ref_t *), | 1214 | gnttab_list = kmalloc(max_nr_glist_frames * sizeof(grant_ref_t *), |
@@ -1223,6 +1225,11 @@ int gnttab_init(void) | |||
1223 | } | 1225 | } |
1224 | } | 1226 | } |
1225 | 1227 | ||
1228 | ret = arch_gnttab_init(max_nr_grant_frames, | ||
1229 | nr_status_frames(max_nr_grant_frames)); | ||
1230 | if (ret < 0) | ||
1231 | goto ini_nomem; | ||
1232 | |||
1226 | if (gnttab_setup() < 0) { | 1233 | if (gnttab_setup() < 0) { |
1227 | ret = -ENODEV; | 1234 | ret = -ENODEV; |
1228 | goto ini_nomem; | 1235 | goto ini_nomem; |
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index c3667b202f2f..5f1e1f3cd186 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -88,7 +88,6 @@ static int xen_suspend(void *data) | |||
88 | 88 | ||
89 | if (!si->cancelled) { | 89 | if (!si->cancelled) { |
90 | xen_irq_resume(); | 90 | xen_irq_resume(); |
91 | xen_console_resume(); | ||
92 | xen_timer_resume(); | 91 | xen_timer_resume(); |
93 | } | 92 | } |
94 | 93 | ||
@@ -135,6 +134,10 @@ static void do_suspend(void) | |||
135 | 134 | ||
136 | err = stop_machine(xen_suspend, &si, cpumask_of(0)); | 135 | err = stop_machine(xen_suspend, &si, cpumask_of(0)); |
137 | 136 | ||
137 | /* Resume console as early as possible. */ | ||
138 | if (!si.cancelled) | ||
139 | xen_console_resume(); | ||
140 | |||
138 | raw_notifier_call_chain(&xen_resume_notifier, 0, NULL); | 141 | raw_notifier_call_chain(&xen_resume_notifier, 0, NULL); |
139 | 142 | ||
140 | dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE); | 143 | dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE); |