diff options
Diffstat (limited to 'drivers')
153 files changed, 1430 insertions, 1158 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 54eaf96ab217..01c2cf4efcdd 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
| @@ -497,37 +497,22 @@ static void amba_device_release(struct device *dev) | |||
| 497 | } | 497 | } |
| 498 | 498 | ||
| 499 | /** | 499 | /** |
| 500 | * amba_device_register - register an AMBA device | 500 | * amba_device_add - add a previously allocated AMBA device structure |
| 501 | * @dev: AMBA device to register | 501 | * @dev: AMBA device allocated by amba_device_alloc |
| 502 | * @parent: parent memory resource | 502 | * @parent: resource parent for this devices resources |
| 503 | * | 503 | * |
| 504 | * Setup the AMBA device, reading the cell ID if present. | 504 | * Claim the resource, and read the device cell ID if not already |
| 505 | * Claim the resource, and register the AMBA device with | 505 | * initialized. Register the AMBA device with the Linux device |
| 506 | * the Linux device manager. | 506 | * manager. |
| 507 | */ | 507 | */ |
| 508 | int amba_device_register(struct amba_device *dev, struct resource *parent) | 508 | int amba_device_add(struct amba_device *dev, struct resource *parent) |
| 509 | { | 509 | { |
| 510 | u32 size; | 510 | u32 size; |
| 511 | void __iomem *tmp; | 511 | void __iomem *tmp; |
| 512 | int i, ret; | 512 | int i, ret; |
| 513 | 513 | ||
| 514 | device_initialize(&dev->dev); | 514 | WARN_ON(dev->irq[0] == (unsigned int)-1); |
| 515 | 515 | WARN_ON(dev->irq[1] == (unsigned int)-1); | |
| 516 | /* | ||
| 517 | * Copy from device_add | ||
| 518 | */ | ||
| 519 | if (dev->dev.init_name) { | ||
| 520 | dev_set_name(&dev->dev, "%s", dev->dev.init_name); | ||
| 521 | dev->dev.init_name = NULL; | ||
| 522 | } | ||
| 523 | |||
| 524 | dev->dev.release = amba_device_release; | ||
| 525 | dev->dev.bus = &amba_bustype; | ||
| 526 | dev->dev.dma_mask = &dev->dma_mask; | ||
| 527 | dev->res.name = dev_name(&dev->dev); | ||
| 528 | |||
| 529 | if (!dev->dev.coherent_dma_mask && dev->dma_mask) | ||
| 530 | dev_warn(&dev->dev, "coherent dma mask is unset\n"); | ||
| 531 | 516 | ||
| 532 | ret = request_resource(parent, &dev->res); | 517 | ret = request_resource(parent, &dev->res); |
| 533 | if (ret) | 518 | if (ret) |
| @@ -582,9 +567,9 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) | |||
| 582 | if (ret) | 567 | if (ret) |
| 583 | goto err_release; | 568 | goto err_release; |
| 584 | 569 | ||
| 585 | if (dev->irq[0] != NO_IRQ) | 570 | if (dev->irq[0] && dev->irq[0] != NO_IRQ) |
| 586 | ret = device_create_file(&dev->dev, &dev_attr_irq0); | 571 | ret = device_create_file(&dev->dev, &dev_attr_irq0); |
| 587 | if (ret == 0 && dev->irq[1] != NO_IRQ) | 572 | if (ret == 0 && dev->irq[1] && dev->irq[1] != NO_IRQ) |
| 588 | ret = device_create_file(&dev->dev, &dev_attr_irq1); | 573 | ret = device_create_file(&dev->dev, &dev_attr_irq1); |
| 589 | if (ret == 0) | 574 | if (ret == 0) |
| 590 | return ret; | 575 | return ret; |
| @@ -596,6 +581,74 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) | |||
| 596 | err_out: | 581 | err_out: |
| 597 | return ret; | 582 | return ret; |
| 598 | } | 583 | } |
| 584 | EXPORT_SYMBOL_GPL(amba_device_add); | ||
| 585 | |||
| 586 | static void amba_device_initialize(struct amba_device *dev, const char *name) | ||
| 587 | { | ||
| 588 | device_initialize(&dev->dev); | ||
| 589 | if (name) | ||
| 590 | dev_set_name(&dev->dev, "%s", name); | ||
| 591 | dev->dev.release = amba_device_release; | ||
| 592 | dev->dev.bus = &amba_bustype; | ||
| 593 | dev->dev.dma_mask = &dev->dma_mask; | ||
| 594 | dev->res.name = dev_name(&dev->dev); | ||
| 595 | } | ||
| 596 | |||
| 597 | /** | ||
| 598 | * amba_device_alloc - allocate an AMBA device | ||
| 599 | * @name: sysfs name of the AMBA device | ||
| 600 | * @base: base of AMBA device | ||
| 601 | * @size: size of AMBA device | ||
| 602 | * | ||
| 603 | * Allocate and initialize an AMBA device structure. Returns %NULL | ||
| 604 | * on failure. | ||
| 605 | */ | ||
| 606 | struct amba_device *amba_device_alloc(const char *name, resource_size_t base, | ||
| 607 | size_t size) | ||
| 608 | { | ||
| 609 | struct amba_device *dev; | ||
| 610 | |||
| 611 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | ||
| 612 | if (dev) { | ||
| 613 | amba_device_initialize(dev, name); | ||
| 614 | dev->res.start = base; | ||
| 615 | dev->res.end = base + size - 1; | ||
| 616 | dev->res.flags = IORESOURCE_MEM; | ||
| 617 | } | ||
| 618 | |||
| 619 | return dev; | ||
| 620 | } | ||
| 621 | EXPORT_SYMBOL_GPL(amba_device_alloc); | ||
| 622 | |||
| 623 | /** | ||
| 624 | * amba_device_register - register an AMBA device | ||
| 625 | * @dev: AMBA device to register | ||
| 626 | * @parent: parent memory resource | ||
| 627 | * | ||
| 628 | * Setup the AMBA device, reading the cell ID if present. | ||
| 629 | * Claim the resource, and register the AMBA device with | ||
| 630 | * the Linux device manager. | ||
| 631 | */ | ||
| 632 | int amba_device_register(struct amba_device *dev, struct resource *parent) | ||
| 633 | { | ||
| 634 | amba_device_initialize(dev, dev->dev.init_name); | ||
| 635 | dev->dev.init_name = NULL; | ||
| 636 | |||
| 637 | if (!dev->dev.coherent_dma_mask && dev->dma_mask) | ||
| 638 | dev_warn(&dev->dev, "coherent dma mask is unset\n"); | ||
| 639 | |||
| 640 | return amba_device_add(dev, parent); | ||
| 641 | } | ||
| 642 | |||
| 643 | /** | ||
| 644 | * amba_device_put - put an AMBA device | ||
| 645 | * @dev: AMBA device to put | ||
| 646 | */ | ||
| 647 | void amba_device_put(struct amba_device *dev) | ||
| 648 | { | ||
| 649 | put_device(&dev->dev); | ||
| 650 | } | ||
| 651 | EXPORT_SYMBOL_GPL(amba_device_put); | ||
| 599 | 652 | ||
| 600 | /** | 653 | /** |
| 601 | * amba_device_unregister - unregister an AMBA device | 654 | * amba_device_unregister - unregister an AMBA device |
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 5d1d07645132..e8cd652d2017 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c | |||
| @@ -1206,9 +1206,9 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1206 | 1206 | ||
| 1207 | out_unmap_both: | 1207 | out_unmap_both: |
| 1208 | pci_set_drvdata(dev, NULL); | 1208 | pci_set_drvdata(dev, NULL); |
| 1209 | pci_iounmap(dev, card->config_regs); | ||
| 1210 | out_unmap_config: | ||
| 1211 | pci_iounmap(dev, card->buffers); | 1209 | pci_iounmap(dev, card->buffers); |
| 1210 | out_unmap_config: | ||
| 1211 | pci_iounmap(dev, card->config_regs); | ||
| 1212 | out_release_regions: | 1212 | out_release_regions: |
| 1213 | pci_release_regions(dev); | 1213 | pci_release_regions(dev); |
| 1214 | out: | 1214 | out: |
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index c1dc4d86c221..1f3c1a7d132a 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c | |||
| @@ -41,6 +41,8 @@ | |||
| 41 | #include <linux/types.h> | 41 | #include <linux/types.h> |
| 42 | #include <linux/version.h> | 42 | #include <linux/version.h> |
| 43 | 43 | ||
| 44 | #include <asm-generic/io-64-nonatomic-lo-hi.h> | ||
| 45 | |||
| 44 | #define NVME_Q_DEPTH 1024 | 46 | #define NVME_Q_DEPTH 1024 |
| 45 | #define SQ_SIZE(depth) (depth * sizeof(struct nvme_command)) | 47 | #define SQ_SIZE(depth) (depth * sizeof(struct nvme_command)) |
| 46 | #define CQ_SIZE(depth) (depth * sizeof(struct nvme_completion)) | 48 | #define CQ_SIZE(depth) (depth * sizeof(struct nvme_completion)) |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index f00f596c1029..789c9b579aea 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
| @@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = { | |||
| 102 | 102 | ||
| 103 | /* Broadcom BCM20702A0 */ | 103 | /* Broadcom BCM20702A0 */ |
| 104 | { USB_DEVICE(0x0a5c, 0x21e3) }, | 104 | { USB_DEVICE(0x0a5c, 0x21e3) }, |
| 105 | { USB_DEVICE(0x0a5c, 0x21f3) }, | ||
| 105 | { USB_DEVICE(0x413c, 0x8197) }, | 106 | { USB_DEVICE(0x413c, 0x8197) }, |
| 106 | 107 | ||
| 107 | { } /* Terminating entry */ | 108 | { } /* Terminating entry */ |
| @@ -726,9 +727,6 @@ static int btusb_send_frame(struct sk_buff *skb) | |||
| 726 | usb_fill_bulk_urb(urb, data->udev, pipe, | 727 | usb_fill_bulk_urb(urb, data->udev, pipe, |
| 727 | skb->data, skb->len, btusb_tx_complete, skb); | 728 | skb->data, skb->len, btusb_tx_complete, skb); |
| 728 | 729 | ||
| 729 | if (skb->priority >= HCI_PRIO_MAX - 1) | ||
| 730 | urb->transfer_flags = URB_ISO_ASAP; | ||
| 731 | |||
| 732 | hdev->stat.acl_tx++; | 730 | hdev->stat.acl_tx++; |
| 733 | break; | 731 | break; |
| 734 | 732 | ||
diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index 7dbc4a83c45c..78a666d1e5f5 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | config CPU_IDLE | 2 | config CPU_IDLE |
| 3 | bool "CPU idle PM support" | 3 | bool "CPU idle PM support" |
| 4 | default ACPI | 4 | default y if ACPI || PPC_PSERIES |
| 5 | help | 5 | help |
| 6 | CPU idle is a generic framework for supporting software-controlled | 6 | CPU idle is a generic framework for supporting software-controlled |
| 7 | idle processor power management. It includes modular cross-platform | 7 | idle processor power management. It includes modular cross-platform |
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c index 597235a2f8f9..0d40cf66b3cc 100644 --- a/drivers/crypto/mv_cesa.c +++ b/drivers/crypto/mv_cesa.c | |||
| @@ -714,6 +714,7 @@ static int mv_hash_final(struct ahash_request *req) | |||
| 714 | { | 714 | { |
| 715 | struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); | 715 | struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); |
| 716 | 716 | ||
| 717 | ahash_request_set_crypt(req, NULL, req->result, 0); | ||
| 717 | mv_update_hash_req_ctx(ctx, 1, 0); | 718 | mv_update_hash_req_ctx(ctx, 1, 0); |
| 718 | return mv_handle_req(&req->base); | 719 | return mv_handle_req(&req->base); |
| 719 | } | 720 | } |
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c index aa08497a075a..73f55e2008c2 100644 --- a/drivers/edac/i3200_edac.c +++ b/drivers/edac/i3200_edac.c | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
| 16 | #include "edac_core.h" | 16 | #include "edac_core.h" |
| 17 | 17 | ||
| 18 | #include <asm-generic/io-64-nonatomic-lo-hi.h> | ||
| 19 | |||
| 18 | #define I3200_REVISION "1.1" | 20 | #define I3200_REVISION "1.1" |
| 19 | 21 | ||
| 20 | #define EDAC_MOD_STR "i3200_edac" | 22 | #define EDAC_MOD_STR "i3200_edac" |
| @@ -101,19 +103,6 @@ struct i3200_priv { | |||
| 101 | 103 | ||
| 102 | static int nr_channels; | 104 | static int nr_channels; |
| 103 | 105 | ||
| 104 | #ifndef readq | ||
| 105 | static inline __u64 readq(const volatile void __iomem *addr) | ||
| 106 | { | ||
| 107 | const volatile u32 __iomem *p = addr; | ||
| 108 | u32 low, high; | ||
| 109 | |||
| 110 | low = readl(p); | ||
| 111 | high = readl(p + 1); | ||
| 112 | |||
| 113 | return low + ((u64)high << 32); | ||
| 114 | } | ||
| 115 | #endif | ||
| 116 | |||
| 117 | static int how_many_channels(struct pci_dev *pdev) | 106 | static int how_many_channels(struct pci_dev *pdev) |
| 118 | { | 107 | { |
| 119 | unsigned char capid0_8b; /* 8th byte of CAPID0 */ | 108 | unsigned char capid0_8b; /* 8th byte of CAPID0 */ |
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index 5cd04b65c556..e6568c19c939 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c | |||
| @@ -37,7 +37,7 @@ struct mpc8xxx_gpio_chip { | |||
| 37 | * open drain mode safely | 37 | * open drain mode safely |
| 38 | */ | 38 | */ |
| 39 | u32 data; | 39 | u32 data; |
| 40 | struct irq_host *irq; | 40 | struct irq_domain *irq; |
| 41 | void *of_dev_id_data; | 41 | void *of_dev_id_data; |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| @@ -281,7 +281,7 @@ static struct irq_chip mpc8xxx_irq_chip = { | |||
| 281 | .irq_set_type = mpc8xxx_irq_set_type, | 281 | .irq_set_type = mpc8xxx_irq_set_type, |
| 282 | }; | 282 | }; |
| 283 | 283 | ||
| 284 | static int mpc8xxx_gpio_irq_map(struct irq_host *h, unsigned int virq, | 284 | static int mpc8xxx_gpio_irq_map(struct irq_domain *h, unsigned int virq, |
| 285 | irq_hw_number_t hw) | 285 | irq_hw_number_t hw) |
| 286 | { | 286 | { |
| 287 | struct mpc8xxx_gpio_chip *mpc8xxx_gc = h->host_data; | 287 | struct mpc8xxx_gpio_chip *mpc8xxx_gc = h->host_data; |
| @@ -296,24 +296,9 @@ static int mpc8xxx_gpio_irq_map(struct irq_host *h, unsigned int virq, | |||
| 296 | return 0; | 296 | return 0; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | static int mpc8xxx_gpio_irq_xlate(struct irq_host *h, struct device_node *ct, | 299 | static struct irq_domain_ops mpc8xxx_gpio_irq_ops = { |
| 300 | const u32 *intspec, unsigned int intsize, | ||
| 301 | irq_hw_number_t *out_hwirq, | ||
| 302 | unsigned int *out_flags) | ||
| 303 | |||
| 304 | { | ||
| 305 | /* interrupt sense values coming from the device tree equal either | ||
| 306 | * EDGE_FALLING or EDGE_BOTH | ||
| 307 | */ | ||
| 308 | *out_hwirq = intspec[0]; | ||
| 309 | *out_flags = intspec[1]; | ||
| 310 | |||
| 311 | return 0; | ||
| 312 | } | ||
| 313 | |||
| 314 | static struct irq_host_ops mpc8xxx_gpio_irq_ops = { | ||
| 315 | .map = mpc8xxx_gpio_irq_map, | 300 | .map = mpc8xxx_gpio_irq_map, |
| 316 | .xlate = mpc8xxx_gpio_irq_xlate, | 301 | .xlate = irq_domain_xlate_twocell, |
| 317 | }; | 302 | }; |
| 318 | 303 | ||
| 319 | static struct of_device_id mpc8xxx_gpio_ids[] __initdata = { | 304 | static struct of_device_id mpc8xxx_gpio_ids[] __initdata = { |
| @@ -364,9 +349,8 @@ static void __init mpc8xxx_add_controller(struct device_node *np) | |||
| 364 | if (hwirq == NO_IRQ) | 349 | if (hwirq == NO_IRQ) |
| 365 | goto skip_irq; | 350 | goto skip_irq; |
| 366 | 351 | ||
| 367 | mpc8xxx_gc->irq = | 352 | mpc8xxx_gc->irq = irq_domain_add_linear(np, MPC8XXX_GPIO_PINS, |
| 368 | irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, MPC8XXX_GPIO_PINS, | 353 | &mpc8xxx_gpio_irq_ops, mpc8xxx_gc); |
| 369 | &mpc8xxx_gpio_irq_ops, MPC8XXX_GPIO_PINS); | ||
| 370 | if (!mpc8xxx_gc->irq) | 354 | if (!mpc8xxx_gc->irq) |
| 371 | goto skip_irq; | 355 | goto skip_irq; |
| 372 | 356 | ||
| @@ -374,8 +358,6 @@ static void __init mpc8xxx_add_controller(struct device_node *np) | |||
| 374 | if (id) | 358 | if (id) |
| 375 | mpc8xxx_gc->of_dev_id_data = id->data; | 359 | mpc8xxx_gc->of_dev_id_data = id->data; |
| 376 | 360 | ||
| 377 | mpc8xxx_gc->irq->host_data = mpc8xxx_gc; | ||
| 378 | |||
| 379 | /* ack and mask all irqs */ | 361 | /* ack and mask all irqs */ |
| 380 | out_be32(mm_gc->regs + GPIO_IER, 0xffffffff); | 362 | out_be32(mm_gc->regs + GPIO_IER, 0xffffffff); |
| 381 | out_be32(mm_gc->regs + GPIO_IMR, 0); | 363 | out_be32(mm_gc->regs + GPIO_IMR, 0); |
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index bdc293791590..6f17671260e1 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/of.h> | 25 | #include <linux/of.h> |
| 26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
| 27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
| 28 | #include <linux/irqdomain.h> | ||
| 28 | 29 | ||
| 29 | #include <asm/mach/irq.h> | 30 | #include <asm/mach/irq.h> |
| 30 | 31 | ||
| @@ -74,9 +75,10 @@ struct tegra_gpio_bank { | |||
| 74 | #endif | 75 | #endif |
| 75 | }; | 76 | }; |
| 76 | 77 | ||
| 77 | 78 | static struct irq_domain *irq_domain; | |
| 78 | static void __iomem *regs; | 79 | static void __iomem *regs; |
| 79 | static struct tegra_gpio_bank tegra_gpio_banks[7]; | 80 | static u32 tegra_gpio_bank_count; |
| 81 | static struct tegra_gpio_bank *tegra_gpio_banks; | ||
| 80 | 82 | ||
| 81 | static inline void tegra_gpio_writel(u32 val, u32 reg) | 83 | static inline void tegra_gpio_writel(u32 val, u32 reg) |
| 82 | { | 84 | { |
| @@ -139,7 +141,7 @@ static int tegra_gpio_direction_output(struct gpio_chip *chip, unsigned offset, | |||
| 139 | 141 | ||
| 140 | static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | 142 | static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset) |
| 141 | { | 143 | { |
| 142 | return TEGRA_GPIO_TO_IRQ(offset); | 144 | return irq_find_mapping(irq_domain, offset); |
| 143 | } | 145 | } |
| 144 | 146 | ||
| 145 | static struct gpio_chip tegra_gpio_chip = { | 147 | static struct gpio_chip tegra_gpio_chip = { |
| @@ -155,28 +157,28 @@ static struct gpio_chip tegra_gpio_chip = { | |||
| 155 | 157 | ||
| 156 | static void tegra_gpio_irq_ack(struct irq_data *d) | 158 | static void tegra_gpio_irq_ack(struct irq_data *d) |
| 157 | { | 159 | { |
| 158 | int gpio = d->irq - INT_GPIO_BASE; | 160 | int gpio = d->hwirq; |
| 159 | 161 | ||
| 160 | tegra_gpio_writel(1 << GPIO_BIT(gpio), GPIO_INT_CLR(gpio)); | 162 | tegra_gpio_writel(1 << GPIO_BIT(gpio), GPIO_INT_CLR(gpio)); |
| 161 | } | 163 | } |
| 162 | 164 | ||
| 163 | static void tegra_gpio_irq_mask(struct irq_data *d) | 165 | static void tegra_gpio_irq_mask(struct irq_data *d) |
| 164 | { | 166 | { |
| 165 | int gpio = d->irq - INT_GPIO_BASE; | 167 | int gpio = d->hwirq; |
| 166 | 168 | ||
| 167 | tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 0); | 169 | tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 0); |
| 168 | } | 170 | } |
| 169 | 171 | ||
| 170 | static void tegra_gpio_irq_unmask(struct irq_data *d) | 172 | static void tegra_gpio_irq_unmask(struct irq_data *d) |
| 171 | { | 173 | { |
| 172 | int gpio = d->irq - INT_GPIO_BASE; | 174 | int gpio = d->hwirq; |
| 173 | 175 | ||
| 174 | tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 1); | 176 | tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 1); |
| 175 | } | 177 | } |
| 176 | 178 | ||
| 177 | static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) | 179 | static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) |
| 178 | { | 180 | { |
| 179 | int gpio = d->irq - INT_GPIO_BASE; | 181 | int gpio = d->hwirq; |
| 180 | struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d); | 182 | struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d); |
| 181 | int port = GPIO_PORT(gpio); | 183 | int port = GPIO_PORT(gpio); |
| 182 | int lvl_type; | 184 | int lvl_type; |
| @@ -273,7 +275,7 @@ void tegra_gpio_resume(void) | |||
| 273 | 275 | ||
| 274 | local_irq_save(flags); | 276 | local_irq_save(flags); |
| 275 | 277 | ||
| 276 | for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) { | 278 | for (b = 0; b < tegra_gpio_bank_count; b++) { |
| 277 | struct tegra_gpio_bank *bank = &tegra_gpio_banks[b]; | 279 | struct tegra_gpio_bank *bank = &tegra_gpio_banks[b]; |
| 278 | 280 | ||
| 279 | for (p = 0; p < ARRAY_SIZE(bank->oe); p++) { | 281 | for (p = 0; p < ARRAY_SIZE(bank->oe); p++) { |
| @@ -296,7 +298,7 @@ void tegra_gpio_suspend(void) | |||
| 296 | int p; | 298 | int p; |
| 297 | 299 | ||
| 298 | local_irq_save(flags); | 300 | local_irq_save(flags); |
| 299 | for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) { | 301 | for (b = 0; b < tegra_gpio_bank_count; b++) { |
| 300 | struct tegra_gpio_bank *bank = &tegra_gpio_banks[b]; | 302 | struct tegra_gpio_bank *bank = &tegra_gpio_banks[b]; |
| 301 | 303 | ||
| 302 | for (p = 0; p < ARRAY_SIZE(bank->oe); p++) { | 304 | for (p = 0; p < ARRAY_SIZE(bank->oe); p++) { |
| @@ -337,13 +339,44 @@ static struct lock_class_key gpio_lock_class; | |||
| 337 | 339 | ||
| 338 | static int __devinit tegra_gpio_probe(struct platform_device *pdev) | 340 | static int __devinit tegra_gpio_probe(struct platform_device *pdev) |
| 339 | { | 341 | { |
| 342 | int irq_base; | ||
| 340 | struct resource *res; | 343 | struct resource *res; |
| 341 | struct tegra_gpio_bank *bank; | 344 | struct tegra_gpio_bank *bank; |
| 342 | int gpio; | 345 | int gpio; |
| 343 | int i; | 346 | int i; |
| 344 | int j; | 347 | int j; |
| 345 | 348 | ||
| 346 | for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) { | 349 | for (;;) { |
| 350 | res = platform_get_resource(pdev, IORESOURCE_IRQ, tegra_gpio_bank_count); | ||
| 351 | if (!res) | ||
| 352 | break; | ||
| 353 | tegra_gpio_bank_count++; | ||
| 354 | } | ||
| 355 | if (!tegra_gpio_bank_count) { | ||
| 356 | dev_err(&pdev->dev, "Missing IRQ resource\n"); | ||
| 357 | return -ENODEV; | ||
| 358 | } | ||
| 359 | |||
| 360 | tegra_gpio_chip.ngpio = tegra_gpio_bank_count * 32; | ||
| 361 | |||
| 362 | tegra_gpio_banks = devm_kzalloc(&pdev->dev, | ||
| 363 | tegra_gpio_bank_count * sizeof(*tegra_gpio_banks), | ||
| 364 | GFP_KERNEL); | ||
| 365 | if (!tegra_gpio_banks) { | ||
| 366 | dev_err(&pdev->dev, "Couldn't allocate bank structure\n"); | ||
| 367 | return -ENODEV; | ||
| 368 | } | ||
| 369 | |||
| 370 | irq_base = irq_alloc_descs(-1, 0, tegra_gpio_chip.ngpio, 0); | ||
| 371 | if (irq_base < 0) { | ||
| 372 | dev_err(&pdev->dev, "Couldn't allocate IRQ numbers\n"); | ||
| 373 | return -ENODEV; | ||
| 374 | } | ||
| 375 | irq_domain = irq_domain_add_legacy(pdev->dev.of_node, | ||
| 376 | tegra_gpio_chip.ngpio, irq_base, 0, | ||
| 377 | &irq_domain_simple_ops, NULL); | ||
| 378 | |||
| 379 | for (i = 0; i < tegra_gpio_bank_count; i++) { | ||
| 347 | res = platform_get_resource(pdev, IORESOURCE_IRQ, i); | 380 | res = platform_get_resource(pdev, IORESOURCE_IRQ, i); |
| 348 | if (!res) { | 381 | if (!res) { |
| 349 | dev_err(&pdev->dev, "Missing IRQ resource\n"); | 382 | dev_err(&pdev->dev, "Missing IRQ resource\n"); |
| @@ -380,8 +413,8 @@ static int __devinit tegra_gpio_probe(struct platform_device *pdev) | |||
| 380 | 413 | ||
| 381 | gpiochip_add(&tegra_gpio_chip); | 414 | gpiochip_add(&tegra_gpio_chip); |
| 382 | 415 | ||
| 383 | for (gpio = 0; gpio < TEGRA_NR_GPIOS; gpio++) { | 416 | for (gpio = 0; gpio < tegra_gpio_chip.ngpio; gpio++) { |
| 384 | int irq = TEGRA_GPIO_TO_IRQ(gpio); | 417 | int irq = irq_find_mapping(irq_domain, gpio); |
| 385 | /* No validity check; all Tegra GPIOs are valid IRQs */ | 418 | /* No validity check; all Tegra GPIOs are valid IRQs */ |
| 386 | 419 | ||
| 387 | bank = &tegra_gpio_banks[GPIO_BANK(gpio)]; | 420 | bank = &tegra_gpio_banks[GPIO_BANK(gpio)]; |
| @@ -393,7 +426,7 @@ static int __devinit tegra_gpio_probe(struct platform_device *pdev) | |||
| 393 | set_irq_flags(irq, IRQF_VALID); | 426 | set_irq_flags(irq, IRQF_VALID); |
| 394 | } | 427 | } |
| 395 | 428 | ||
| 396 | for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) { | 429 | for (i = 0; i < tegra_gpio_bank_count; i++) { |
| 397 | bank = &tegra_gpio_banks[i]; | 430 | bank = &tegra_gpio_banks[i]; |
| 398 | 431 | ||
| 399 | irq_set_chained_handler(bank->irq, tegra_gpio_irq_handler); | 432 | irq_set_chained_handler(bank->irq, tegra_gpio_irq_handler); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c index d620b0784257..618bd4d87d28 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include "drmP.h" | 28 | #include "drmP.h" |
| 29 | #include "drm_crtc_helper.h" | 29 | #include "drm_crtc_helper.h" |
| 30 | 30 | ||
| 31 | #include <drm/exynos_drm.h> | ||
| 31 | #include "exynos_drm_drv.h" | 32 | #include "exynos_drm_drv.h" |
| 32 | #include "exynos_drm_encoder.h" | 33 | #include "exynos_drm_encoder.h" |
| 33 | 34 | ||
| @@ -44,8 +45,9 @@ struct exynos_drm_connector { | |||
| 44 | /* convert exynos_video_timings to drm_display_mode */ | 45 | /* convert exynos_video_timings to drm_display_mode */ |
| 45 | static inline void | 46 | static inline void |
| 46 | convert_to_display_mode(struct drm_display_mode *mode, | 47 | convert_to_display_mode(struct drm_display_mode *mode, |
| 47 | struct fb_videomode *timing) | 48 | struct exynos_drm_panel_info *panel) |
| 48 | { | 49 | { |
| 50 | struct fb_videomode *timing = &panel->timing; | ||
| 49 | DRM_DEBUG_KMS("%s\n", __FILE__); | 51 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 50 | 52 | ||
| 51 | mode->clock = timing->pixclock / 1000; | 53 | mode->clock = timing->pixclock / 1000; |
| @@ -60,6 +62,8 @@ convert_to_display_mode(struct drm_display_mode *mode, | |||
| 60 | mode->vsync_start = mode->vdisplay + timing->upper_margin; | 62 | mode->vsync_start = mode->vdisplay + timing->upper_margin; |
| 61 | mode->vsync_end = mode->vsync_start + timing->vsync_len; | 63 | mode->vsync_end = mode->vsync_start + timing->vsync_len; |
| 62 | mode->vtotal = mode->vsync_end + timing->lower_margin; | 64 | mode->vtotal = mode->vsync_end + timing->lower_margin; |
| 65 | mode->width_mm = panel->width_mm; | ||
| 66 | mode->height_mm = panel->height_mm; | ||
| 63 | 67 | ||
| 64 | if (timing->vmode & FB_VMODE_INTERLACED) | 68 | if (timing->vmode & FB_VMODE_INTERLACED) |
| 65 | mode->flags |= DRM_MODE_FLAG_INTERLACE; | 69 | mode->flags |= DRM_MODE_FLAG_INTERLACE; |
| @@ -148,16 +152,18 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) | |||
| 148 | connector->display_info.raw_edid = edid; | 152 | connector->display_info.raw_edid = edid; |
| 149 | } else { | 153 | } else { |
| 150 | struct drm_display_mode *mode = drm_mode_create(connector->dev); | 154 | struct drm_display_mode *mode = drm_mode_create(connector->dev); |
| 151 | struct fb_videomode *timing; | 155 | struct exynos_drm_panel_info *panel; |
| 152 | 156 | ||
| 153 | if (display_ops->get_timing) | 157 | if (display_ops->get_panel) |
| 154 | timing = display_ops->get_timing(manager->dev); | 158 | panel = display_ops->get_panel(manager->dev); |
| 155 | else { | 159 | else { |
| 156 | drm_mode_destroy(connector->dev, mode); | 160 | drm_mode_destroy(connector->dev, mode); |
| 157 | return 0; | 161 | return 0; |
| 158 | } | 162 | } |
| 159 | 163 | ||
| 160 | convert_to_display_mode(mode, timing); | 164 | convert_to_display_mode(mode, panel); |
| 165 | connector->display_info.width_mm = mode->width_mm; | ||
| 166 | connector->display_info.height_mm = mode->height_mm; | ||
| 161 | 167 | ||
| 162 | mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; | 168 | mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; |
| 163 | drm_mode_set_name(mode); | 169 | drm_mode_set_name(mode); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c b/drivers/gpu/drm/exynos/exynos_drm_core.c index 661a03571d0c..d08a55896d50 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_core.c +++ b/drivers/gpu/drm/exynos/exynos_drm_core.c | |||
| @@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv) | |||
| 193 | return err; | 193 | return err; |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | /* setup possible_clones. */ | ||
| 197 | exynos_drm_encoder_setup(drm_dev); | ||
| 198 | |||
| 196 | /* | 199 | /* |
| 197 | * if any specific driver such as fimd or hdmi driver called | 200 | * if any specific driver such as fimd or hdmi driver called |
| 198 | * exynos_drm_subdrv_register() later than drm_load(), | 201 | * exynos_drm_subdrv_register() later than drm_load(), |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index e3861ac49295..de818831a511 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c | |||
| @@ -307,9 +307,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, | |||
| 307 | */ | 307 | */ |
| 308 | event->pipe = exynos_crtc->pipe; | 308 | event->pipe = exynos_crtc->pipe; |
| 309 | 309 | ||
| 310 | list_add_tail(&event->base.link, | ||
| 311 | &dev_priv->pageflip_event_list); | ||
| 312 | |||
| 313 | ret = drm_vblank_get(dev, exynos_crtc->pipe); | 310 | ret = drm_vblank_get(dev, exynos_crtc->pipe); |
| 314 | if (ret) { | 311 | if (ret) { |
| 315 | DRM_DEBUG("failed to acquire vblank counter\n"); | 312 | DRM_DEBUG("failed to acquire vblank counter\n"); |
| @@ -318,6 +315,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, | |||
| 318 | goto out; | 315 | goto out; |
| 319 | } | 316 | } |
| 320 | 317 | ||
| 318 | list_add_tail(&event->base.link, | ||
| 319 | &dev_priv->pageflip_event_list); | ||
| 320 | |||
| 321 | crtc->fb = fb; | 321 | crtc->fb = fb; |
| 322 | ret = exynos_drm_crtc_update(crtc); | 322 | ret = exynos_drm_crtc_update(crtc); |
| 323 | if (ret) { | 323 | if (ret) { |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 35889ca255e9..58820ebd3558 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | 33 | ||
| 34 | #include "exynos_drm_drv.h" | 34 | #include "exynos_drm_drv.h" |
| 35 | #include "exynos_drm_crtc.h" | 35 | #include "exynos_drm_crtc.h" |
| 36 | #include "exynos_drm_encoder.h" | ||
| 36 | #include "exynos_drm_fbdev.h" | 37 | #include "exynos_drm_fbdev.h" |
| 37 | #include "exynos_drm_fb.h" | 38 | #include "exynos_drm_fb.h" |
| 38 | #include "exynos_drm_gem.h" | 39 | #include "exynos_drm_gem.h" |
| @@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) | |||
| 99 | if (ret) | 100 | if (ret) |
| 100 | goto err_vblank; | 101 | goto err_vblank; |
| 101 | 102 | ||
| 103 | /* setup possible_clones. */ | ||
| 104 | exynos_drm_encoder_setup(dev); | ||
| 105 | |||
| 102 | /* | 106 | /* |
| 103 | * create and configure fb helper and also exynos specific | 107 | * create and configure fb helper and also exynos specific |
| 104 | * fbdev object. | 108 | * fbdev object. |
| @@ -141,16 +145,21 @@ static int exynos_drm_unload(struct drm_device *dev) | |||
| 141 | } | 145 | } |
| 142 | 146 | ||
| 143 | static void exynos_drm_preclose(struct drm_device *dev, | 147 | static void exynos_drm_preclose(struct drm_device *dev, |
| 144 | struct drm_file *file_priv) | 148 | struct drm_file *file) |
| 145 | { | 149 | { |
| 146 | struct exynos_drm_private *dev_priv = dev->dev_private; | 150 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 147 | 151 | ||
| 148 | /* | 152 | } |
| 149 | * drm framework frees all events at release time, | 153 | |
| 150 | * so private event list should be cleared. | 154 | static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file) |
| 151 | */ | 155 | { |
| 152 | if (!list_empty(&dev_priv->pageflip_event_list)) | 156 | DRM_DEBUG_DRIVER("%s\n", __FILE__); |
| 153 | INIT_LIST_HEAD(&dev_priv->pageflip_event_list); | 157 | |
| 158 | if (!file->driver_priv) | ||
| 159 | return; | ||
| 160 | |||
| 161 | kfree(file->driver_priv); | ||
| 162 | file->driver_priv = NULL; | ||
| 154 | } | 163 | } |
| 155 | 164 | ||
| 156 | static void exynos_drm_lastclose(struct drm_device *dev) | 165 | static void exynos_drm_lastclose(struct drm_device *dev) |
| @@ -195,6 +204,7 @@ static struct drm_driver exynos_drm_driver = { | |||
| 195 | .unload = exynos_drm_unload, | 204 | .unload = exynos_drm_unload, |
| 196 | .preclose = exynos_drm_preclose, | 205 | .preclose = exynos_drm_preclose, |
| 197 | .lastclose = exynos_drm_lastclose, | 206 | .lastclose = exynos_drm_lastclose, |
| 207 | .postclose = exynos_drm_postclose, | ||
| 198 | .get_vblank_counter = drm_vblank_count, | 208 | .get_vblank_counter = drm_vblank_count, |
| 199 | .enable_vblank = exynos_drm_crtc_enable_vblank, | 209 | .enable_vblank = exynos_drm_crtc_enable_vblank, |
| 200 | .disable_vblank = exynos_drm_crtc_disable_vblank, | 210 | .disable_vblank = exynos_drm_crtc_disable_vblank, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index e685e1e33055..13540de90bfc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h | |||
| @@ -136,7 +136,7 @@ struct exynos_drm_overlay { | |||
| 136 | * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. | 136 | * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. |
| 137 | * @is_connected: check for that display is connected or not. | 137 | * @is_connected: check for that display is connected or not. |
| 138 | * @get_edid: get edid modes from display driver. | 138 | * @get_edid: get edid modes from display driver. |
| 139 | * @get_timing: get timing object from display driver. | 139 | * @get_panel: get panel object from display driver. |
| 140 | * @check_timing: check if timing is valid or not. | 140 | * @check_timing: check if timing is valid or not. |
| 141 | * @power_on: display device on or off. | 141 | * @power_on: display device on or off. |
| 142 | */ | 142 | */ |
| @@ -145,7 +145,7 @@ struct exynos_drm_display_ops { | |||
| 145 | bool (*is_connected)(struct device *dev); | 145 | bool (*is_connected)(struct device *dev); |
| 146 | int (*get_edid)(struct device *dev, struct drm_connector *connector, | 146 | int (*get_edid)(struct device *dev, struct drm_connector *connector, |
| 147 | u8 *edid, int len); | 147 | u8 *edid, int len); |
| 148 | void *(*get_timing)(struct device *dev); | 148 | void *(*get_panel)(struct device *dev); |
| 149 | int (*check_timing)(struct device *dev, void *timing); | 149 | int (*check_timing)(struct device *dev, void *timing); |
| 150 | int (*power_on)(struct device *dev, int mode); | 150 | int (*power_on)(struct device *dev, int mode); |
| 151 | }; | 151 | }; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 86b93dde219a..ef4754f1519b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c | |||
| @@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = { | |||
| 195 | .destroy = exynos_drm_encoder_destroy, | 195 | .destroy = exynos_drm_encoder_destroy, |
| 196 | }; | 196 | }; |
| 197 | 197 | ||
| 198 | static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder) | ||
| 199 | { | ||
| 200 | struct drm_encoder *clone; | ||
| 201 | struct drm_device *dev = encoder->dev; | ||
| 202 | struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); | ||
| 203 | struct exynos_drm_display_ops *display_ops = | ||
| 204 | exynos_encoder->manager->display_ops; | ||
| 205 | unsigned int clone_mask = 0; | ||
| 206 | int cnt = 0; | ||
| 207 | |||
| 208 | list_for_each_entry(clone, &dev->mode_config.encoder_list, head) { | ||
| 209 | switch (display_ops->type) { | ||
| 210 | case EXYNOS_DISPLAY_TYPE_LCD: | ||
| 211 | case EXYNOS_DISPLAY_TYPE_HDMI: | ||
| 212 | clone_mask |= (1 << (cnt++)); | ||
| 213 | break; | ||
| 214 | default: | ||
| 215 | continue; | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | return clone_mask; | ||
| 220 | } | ||
| 221 | |||
| 222 | void exynos_drm_encoder_setup(struct drm_device *dev) | ||
| 223 | { | ||
| 224 | struct drm_encoder *encoder; | ||
| 225 | |||
| 226 | DRM_DEBUG_KMS("%s\n", __FILE__); | ||
| 227 | |||
| 228 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) | ||
| 229 | encoder->possible_clones = exynos_drm_encoder_clones(encoder); | ||
| 230 | } | ||
| 231 | |||
| 198 | struct drm_encoder * | 232 | struct drm_encoder * |
| 199 | exynos_drm_encoder_create(struct drm_device *dev, | 233 | exynos_drm_encoder_create(struct drm_device *dev, |
| 200 | struct exynos_drm_manager *manager, | 234 | struct exynos_drm_manager *manager, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h b/drivers/gpu/drm/exynos/exynos_drm_encoder.h index 97b087a51cb6..eb7d2316847e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | struct exynos_drm_manager; | 31 | struct exynos_drm_manager; |
| 32 | 32 | ||
| 33 | void exynos_drm_encoder_setup(struct drm_device *dev); | ||
| 33 | struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev, | 34 | struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev, |
| 34 | struct exynos_drm_manager *mgr, | 35 | struct exynos_drm_manager *mgr, |
| 35 | unsigned int possible_crtcs); | 36 | unsigned int possible_crtcs); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index d7ae29d2f3d6..3508700e529b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c | |||
| @@ -195,66 +195,6 @@ out: | |||
| 195 | return ret; | 195 | return ret; |
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | static bool | ||
| 199 | exynos_drm_fbdev_is_samefb(struct drm_framebuffer *fb, | ||
| 200 | struct drm_fb_helper_surface_size *sizes) | ||
| 201 | { | ||
| 202 | if (fb->width != sizes->surface_width) | ||
| 203 | return false; | ||
| 204 | if (fb->height != sizes->surface_height) | ||
| 205 | return false; | ||
| 206 | if (fb->bits_per_pixel != sizes->surface_bpp) | ||
| 207 | return false; | ||
| 208 | if (fb->depth != sizes->surface_depth) | ||
| 209 | return false; | ||
| 210 | |||
| 211 | return true; | ||
| 212 | } | ||
| 213 | |||
| 214 | static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper, | ||
| 215 | struct drm_fb_helper_surface_size *sizes) | ||
| 216 | { | ||
| 217 | struct drm_device *dev = helper->dev; | ||
| 218 | struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper); | ||
| 219 | struct exynos_drm_gem_obj *exynos_gem_obj; | ||
| 220 | struct drm_framebuffer *fb = helper->fb; | ||
| 221 | struct drm_mode_fb_cmd2 mode_cmd = { 0 }; | ||
| 222 | unsigned long size; | ||
| 223 | |||
| 224 | DRM_DEBUG_KMS("%s\n", __FILE__); | ||
| 225 | |||
| 226 | if (exynos_drm_fbdev_is_samefb(fb, sizes)) | ||
| 227 | return 0; | ||
| 228 | |||
| 229 | mode_cmd.width = sizes->surface_width; | ||
| 230 | mode_cmd.height = sizes->surface_height; | ||
| 231 | mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3); | ||
| 232 | mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, | ||
| 233 | sizes->surface_depth); | ||
| 234 | |||
| 235 | if (exynos_fbdev->exynos_gem_obj) | ||
| 236 | exynos_drm_gem_destroy(exynos_fbdev->exynos_gem_obj); | ||
| 237 | |||
| 238 | if (fb->funcs->destroy) | ||
| 239 | fb->funcs->destroy(fb); | ||
| 240 | |||
| 241 | size = mode_cmd.pitches[0] * mode_cmd.height; | ||
| 242 | exynos_gem_obj = exynos_drm_gem_create(dev, size); | ||
| 243 | if (IS_ERR(exynos_gem_obj)) | ||
| 244 | return PTR_ERR(exynos_gem_obj); | ||
| 245 | |||
| 246 | exynos_fbdev->exynos_gem_obj = exynos_gem_obj; | ||
| 247 | |||
| 248 | helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd, | ||
| 249 | &exynos_gem_obj->base); | ||
| 250 | if (IS_ERR_OR_NULL(helper->fb)) { | ||
| 251 | DRM_ERROR("failed to create drm framebuffer.\n"); | ||
| 252 | return PTR_ERR(helper->fb); | ||
| 253 | } | ||
| 254 | |||
| 255 | return exynos_drm_fbdev_update(helper, helper->fb); | ||
| 256 | } | ||
| 257 | |||
| 258 | static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, | 198 | static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, |
| 259 | struct drm_fb_helper_surface_size *sizes) | 199 | struct drm_fb_helper_surface_size *sizes) |
| 260 | { | 200 | { |
| @@ -262,6 +202,10 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, | |||
| 262 | 202 | ||
| 263 | DRM_DEBUG_KMS("%s\n", __FILE__); | 203 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 264 | 204 | ||
| 205 | /* | ||
| 206 | * with !helper->fb, it means that this funcion is called first time | ||
| 207 | * and after that, the helper->fb would be used as clone mode. | ||
| 208 | */ | ||
| 265 | if (!helper->fb) { | 209 | if (!helper->fb) { |
| 266 | ret = exynos_drm_fbdev_create(helper, sizes); | 210 | ret = exynos_drm_fbdev_create(helper, sizes); |
| 267 | if (ret < 0) { | 211 | if (ret < 0) { |
| @@ -274,12 +218,6 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, | |||
| 274 | * because register_framebuffer() should be called. | 218 | * because register_framebuffer() should be called. |
| 275 | */ | 219 | */ |
| 276 | ret = 1; | 220 | ret = 1; |
| 277 | } else { | ||
| 278 | ret = exynos_drm_fbdev_recreate(helper, sizes); | ||
| 279 | if (ret < 0) { | ||
| 280 | DRM_ERROR("failed to reconfigure fbdev\n"); | ||
| 281 | return ret; | ||
| 282 | } | ||
| 283 | } | 221 | } |
| 284 | 222 | ||
| 285 | return ret; | 223 | return ret; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index b6a737d196ae..360adf2bba04 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
| @@ -89,7 +89,7 @@ struct fimd_context { | |||
| 89 | bool suspended; | 89 | bool suspended; |
| 90 | struct mutex lock; | 90 | struct mutex lock; |
| 91 | 91 | ||
| 92 | struct fb_videomode *timing; | 92 | struct exynos_drm_panel_info *panel; |
| 93 | }; | 93 | }; |
| 94 | 94 | ||
| 95 | static bool fimd_display_is_connected(struct device *dev) | 95 | static bool fimd_display_is_connected(struct device *dev) |
| @@ -101,13 +101,13 @@ static bool fimd_display_is_connected(struct device *dev) | |||
| 101 | return true; | 101 | return true; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | static void *fimd_get_timing(struct device *dev) | 104 | static void *fimd_get_panel(struct device *dev) |
| 105 | { | 105 | { |
| 106 | struct fimd_context *ctx = get_fimd_context(dev); | 106 | struct fimd_context *ctx = get_fimd_context(dev); |
| 107 | 107 | ||
| 108 | DRM_DEBUG_KMS("%s\n", __FILE__); | 108 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 109 | 109 | ||
| 110 | return ctx->timing; | 110 | return ctx->panel; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | static int fimd_check_timing(struct device *dev, void *timing) | 113 | static int fimd_check_timing(struct device *dev, void *timing) |
| @@ -131,7 +131,7 @@ static int fimd_display_power_on(struct device *dev, int mode) | |||
| 131 | static struct exynos_drm_display_ops fimd_display_ops = { | 131 | static struct exynos_drm_display_ops fimd_display_ops = { |
| 132 | .type = EXYNOS_DISPLAY_TYPE_LCD, | 132 | .type = EXYNOS_DISPLAY_TYPE_LCD, |
| 133 | .is_connected = fimd_display_is_connected, | 133 | .is_connected = fimd_display_is_connected, |
| 134 | .get_timing = fimd_get_timing, | 134 | .get_panel = fimd_get_panel, |
| 135 | .check_timing = fimd_check_timing, | 135 | .check_timing = fimd_check_timing, |
| 136 | .power_on = fimd_display_power_on, | 136 | .power_on = fimd_display_power_on, |
| 137 | }; | 137 | }; |
| @@ -193,7 +193,8 @@ static void fimd_apply(struct device *subdrv_dev) | |||
| 193 | static void fimd_commit(struct device *dev) | 193 | static void fimd_commit(struct device *dev) |
| 194 | { | 194 | { |
| 195 | struct fimd_context *ctx = get_fimd_context(dev); | 195 | struct fimd_context *ctx = get_fimd_context(dev); |
| 196 | struct fb_videomode *timing = ctx->timing; | 196 | struct exynos_drm_panel_info *panel = ctx->panel; |
| 197 | struct fb_videomode *timing = &panel->timing; | ||
| 197 | u32 val; | 198 | u32 val; |
| 198 | 199 | ||
| 199 | if (ctx->suspended) | 200 | if (ctx->suspended) |
| @@ -604,7 +605,12 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc) | |||
| 604 | } | 605 | } |
| 605 | 606 | ||
| 606 | if (is_checked) { | 607 | if (is_checked) { |
| 607 | drm_vblank_put(drm_dev, crtc); | 608 | /* |
| 609 | * call drm_vblank_put only in case that drm_vblank_get was | ||
| 610 | * called. | ||
| 611 | */ | ||
| 612 | if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0) | ||
| 613 | drm_vblank_put(drm_dev, crtc); | ||
| 608 | 614 | ||
| 609 | /* | 615 | /* |
| 610 | * don't off vblank if vblank_disable_allowed is 1, | 616 | * don't off vblank if vblank_disable_allowed is 1, |
| @@ -781,7 +787,7 @@ static int __devinit fimd_probe(struct platform_device *pdev) | |||
| 781 | struct fimd_context *ctx; | 787 | struct fimd_context *ctx; |
| 782 | struct exynos_drm_subdrv *subdrv; | 788 | struct exynos_drm_subdrv *subdrv; |
| 783 | struct exynos_drm_fimd_pdata *pdata; | 789 | struct exynos_drm_fimd_pdata *pdata; |
| 784 | struct fb_videomode *timing; | 790 | struct exynos_drm_panel_info *panel; |
| 785 | struct resource *res; | 791 | struct resource *res; |
| 786 | int win; | 792 | int win; |
| 787 | int ret = -EINVAL; | 793 | int ret = -EINVAL; |
| @@ -794,9 +800,9 @@ static int __devinit fimd_probe(struct platform_device *pdev) | |||
| 794 | return -EINVAL; | 800 | return -EINVAL; |
| 795 | } | 801 | } |
| 796 | 802 | ||
| 797 | timing = &pdata->timing; | 803 | panel = &pdata->panel; |
| 798 | if (!timing) { | 804 | if (!panel) { |
| 799 | dev_err(dev, "timing is null.\n"); | 805 | dev_err(dev, "panel is null.\n"); |
| 800 | return -EINVAL; | 806 | return -EINVAL; |
| 801 | } | 807 | } |
| 802 | 808 | ||
| @@ -858,16 +864,16 @@ static int __devinit fimd_probe(struct platform_device *pdev) | |||
| 858 | goto err_req_irq; | 864 | goto err_req_irq; |
| 859 | } | 865 | } |
| 860 | 866 | ||
| 861 | ctx->clkdiv = fimd_calc_clkdiv(ctx, timing); | 867 | ctx->clkdiv = fimd_calc_clkdiv(ctx, &panel->timing); |
| 862 | ctx->vidcon0 = pdata->vidcon0; | 868 | ctx->vidcon0 = pdata->vidcon0; |
| 863 | ctx->vidcon1 = pdata->vidcon1; | 869 | ctx->vidcon1 = pdata->vidcon1; |
| 864 | ctx->default_win = pdata->default_win; | 870 | ctx->default_win = pdata->default_win; |
| 865 | ctx->timing = timing; | 871 | ctx->panel = panel; |
| 866 | 872 | ||
| 867 | timing->pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv; | 873 | panel->timing.pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv; |
| 868 | 874 | ||
| 869 | DRM_DEBUG_KMS("pixel clock = %d, clkdiv = %d\n", | 875 | DRM_DEBUG_KMS("pixel clock = %d, clkdiv = %d\n", |
| 870 | timing->pixclock, ctx->clkdiv); | 876 | panel->timing.pixclock, ctx->clkdiv); |
| 871 | 877 | ||
| 872 | subdrv = &ctx->subdrv; | 878 | subdrv = &ctx->subdrv; |
| 873 | 879 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index ac24cff39775..93846e810e38 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
| @@ -712,7 +712,12 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc) | |||
| 712 | } | 712 | } |
| 713 | 713 | ||
| 714 | if (is_checked) | 714 | if (is_checked) |
| 715 | drm_vblank_put(drm_dev, crtc); | 715 | /* |
| 716 | * call drm_vblank_put only in case that drm_vblank_get was | ||
| 717 | * called. | ||
| 718 | */ | ||
| 719 | if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0) | ||
| 720 | drm_vblank_put(drm_dev, crtc); | ||
| 716 | 721 | ||
| 717 | spin_unlock_irqrestore(&drm_dev->event_lock, flags); | 722 | spin_unlock_irqrestore(&drm_dev->event_lock, flags); |
| 718 | } | 723 | } |
| @@ -779,15 +784,15 @@ static void mixer_win_reset(struct mixer_context *ctx) | |||
| 779 | mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST, | 784 | mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST, |
| 780 | MXR_STATUS_BURST_MASK); | 785 | MXR_STATUS_BURST_MASK); |
| 781 | 786 | ||
| 782 | /* setting default layer priority: layer1 > video > layer0 | 787 | /* setting default layer priority: layer1 > layer0 > video |
| 783 | * because typical usage scenario would be | 788 | * because typical usage scenario would be |
| 789 | * layer1 - OSD | ||
| 784 | * layer0 - framebuffer | 790 | * layer0 - framebuffer |
| 785 | * video - video overlay | 791 | * video - video overlay |
| 786 | * layer1 - OSD | ||
| 787 | */ | 792 | */ |
| 788 | val = MXR_LAYER_CFG_GRP0_VAL(1); | 793 | val = MXR_LAYER_CFG_GRP1_VAL(3); |
| 789 | val |= MXR_LAYER_CFG_VP_VAL(2); | 794 | val |= MXR_LAYER_CFG_GRP0_VAL(2); |
| 790 | val |= MXR_LAYER_CFG_GRP1_VAL(3); | 795 | val |= MXR_LAYER_CFG_VP_VAL(1); |
| 791 | mixer_reg_write(res, MXR_LAYER_CFG, val); | 796 | mixer_reg_write(res, MXR_LAYER_CFG, val); |
| 792 | 797 | ||
| 793 | /* setting background color */ | 798 | /* setting background color */ |
| @@ -1044,7 +1049,7 @@ static int mixer_remove(struct platform_device *pdev) | |||
| 1044 | platform_get_drvdata(pdev); | 1049 | platform_get_drvdata(pdev); |
| 1045 | struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx; | 1050 | struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx; |
| 1046 | 1051 | ||
| 1047 | dev_info(dev, "remove sucessful\n"); | 1052 | dev_info(dev, "remove successful\n"); |
| 1048 | 1053 | ||
| 1049 | mixer_resource_poweroff(ctx); | 1054 | mixer_resource_poweroff(ctx); |
| 1050 | mixer_resources_cleanup(ctx); | 1055 | mixer_resources_cleanup(ctx); |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index c3afb783cb9d..03c53fcf8653 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -3028,6 +3028,20 @@ | |||
| 3028 | #define DISP_TILE_SURFACE_SWIZZLING (1<<13) | 3028 | #define DISP_TILE_SURFACE_SWIZZLING (1<<13) |
| 3029 | #define DISP_FBC_WM_DIS (1<<15) | 3029 | #define DISP_FBC_WM_DIS (1<<15) |
| 3030 | 3030 | ||
| 3031 | /* GEN7 chicken */ | ||
| 3032 | #define GEN7_COMMON_SLICE_CHICKEN1 0x7010 | ||
| 3033 | # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1<<10) | (1<<26)) | ||
| 3034 | |||
| 3035 | #define GEN7_L3CNTLREG1 0xB01C | ||
| 3036 | #define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C4FFF8C | ||
| 3037 | |||
| 3038 | #define GEN7_L3_CHICKEN_MODE_REGISTER 0xB030 | ||
| 3039 | #define GEN7_WA_L3_CHICKEN_MODE 0x20000000 | ||
| 3040 | |||
| 3041 | /* WaCatErrorRejectionIssue */ | ||
| 3042 | #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030 | ||
| 3043 | #define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11) | ||
| 3044 | |||
| 3031 | /* PCH */ | 3045 | /* PCH */ |
| 3032 | 3046 | ||
| 3033 | /* south display engine interrupt */ | 3047 | /* south display engine interrupt */ |
| @@ -3618,6 +3632,7 @@ | |||
| 3618 | #define GT_FIFO_NUM_RESERVED_ENTRIES 20 | 3632 | #define GT_FIFO_NUM_RESERVED_ENTRIES 20 |
| 3619 | 3633 | ||
| 3620 | #define GEN6_UCGCTL2 0x9404 | 3634 | #define GEN6_UCGCTL2 0x9404 |
| 3635 | # define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13) | ||
| 3621 | # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12) | 3636 | # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12) |
| 3622 | # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11) | 3637 | # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11) |
| 3623 | 3638 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 00fbff5ddd81..f851db7be2cc 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -4680,8 +4680,17 @@ sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane, | |||
| 4680 | 4680 | ||
| 4681 | crtc = intel_get_crtc_for_plane(dev, plane); | 4681 | crtc = intel_get_crtc_for_plane(dev, plane); |
| 4682 | clock = crtc->mode.clock; | 4682 | clock = crtc->mode.clock; |
| 4683 | if (!clock) { | ||
| 4684 | *sprite_wm = 0; | ||
| 4685 | return false; | ||
| 4686 | } | ||
| 4683 | 4687 | ||
| 4684 | line_time_us = (sprite_width * 1000) / clock; | 4688 | line_time_us = (sprite_width * 1000) / clock; |
| 4689 | if (!line_time_us) { | ||
| 4690 | *sprite_wm = 0; | ||
| 4691 | return false; | ||
| 4692 | } | ||
| 4693 | |||
| 4685 | line_count = (latency_ns / line_time_us + 1000) / 1000; | 4694 | line_count = (latency_ns / line_time_us + 1000) / 1000; |
| 4686 | line_size = sprite_width * pixel_size; | 4695 | line_size = sprite_width * pixel_size; |
| 4687 | 4696 | ||
| @@ -6175,7 +6184,7 @@ void intel_crtc_load_lut(struct drm_crtc *crtc) | |||
| 6175 | int i; | 6184 | int i; |
| 6176 | 6185 | ||
| 6177 | /* The clocks have to be on to load the palette. */ | 6186 | /* The clocks have to be on to load the palette. */ |
| 6178 | if (!crtc->enabled) | 6187 | if (!crtc->enabled || !intel_crtc->active) |
| 6179 | return; | 6188 | return; |
| 6180 | 6189 | ||
| 6181 | /* use legacy palette for Ironlake */ | 6190 | /* use legacy palette for Ironlake */ |
| @@ -6561,7 +6570,7 @@ intel_framebuffer_create_for_mode(struct drm_device *dev, | |||
| 6561 | mode_cmd.height = mode->vdisplay; | 6570 | mode_cmd.height = mode->vdisplay; |
| 6562 | mode_cmd.pitches[0] = intel_framebuffer_pitch_for_width(mode_cmd.width, | 6571 | mode_cmd.pitches[0] = intel_framebuffer_pitch_for_width(mode_cmd.width, |
| 6563 | bpp); | 6572 | bpp); |
| 6564 | mode_cmd.pixel_format = 0; | 6573 | mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth); |
| 6565 | 6574 | ||
| 6566 | return intel_framebuffer_create(dev, &mode_cmd, obj); | 6575 | return intel_framebuffer_create(dev, &mode_cmd, obj); |
| 6567 | } | 6576 | } |
| @@ -8184,8 +8193,8 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv) | |||
| 8184 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ | 8193 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ |
| 8185 | 8194 | ||
| 8186 | if (intel_enable_rc6(dev_priv->dev)) | 8195 | if (intel_enable_rc6(dev_priv->dev)) |
| 8187 | rc6_mask = GEN6_RC_CTL_RC6p_ENABLE | | 8196 | rc6_mask = GEN6_RC_CTL_RC6_ENABLE | |
| 8188 | GEN6_RC_CTL_RC6_ENABLE; | 8197 | ((IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0); |
| 8189 | 8198 | ||
| 8190 | I915_WRITE(GEN6_RC_CONTROL, | 8199 | I915_WRITE(GEN6_RC_CONTROL, |
| 8191 | rc6_mask | | 8200 | rc6_mask | |
| @@ -8463,12 +8472,32 @@ static void ivybridge_init_clock_gating(struct drm_device *dev) | |||
| 8463 | I915_WRITE(WM2_LP_ILK, 0); | 8472 | I915_WRITE(WM2_LP_ILK, 0); |
| 8464 | I915_WRITE(WM1_LP_ILK, 0); | 8473 | I915_WRITE(WM1_LP_ILK, 0); |
| 8465 | 8474 | ||
| 8475 | /* According to the spec, bit 13 (RCZUNIT) must be set on IVB. | ||
| 8476 | * This implements the WaDisableRCZUnitClockGating workaround. | ||
| 8477 | */ | ||
| 8478 | I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE); | ||
| 8479 | |||
| 8466 | I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); | 8480 | I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); |
| 8467 | 8481 | ||
| 8468 | I915_WRITE(IVB_CHICKEN3, | 8482 | I915_WRITE(IVB_CHICKEN3, |
| 8469 | CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE | | 8483 | CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE | |
| 8470 | CHICKEN3_DGMG_DONE_FIX_DISABLE); | 8484 | CHICKEN3_DGMG_DONE_FIX_DISABLE); |
| 8471 | 8485 | ||
| 8486 | /* Apply the WaDisableRHWOOptimizationForRenderHang workaround. */ | ||
| 8487 | I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1, | ||
| 8488 | GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC); | ||
| 8489 | |||
| 8490 | /* WaApplyL3ControlAndL3ChickenMode requires those two on Ivy Bridge */ | ||
| 8491 | I915_WRITE(GEN7_L3CNTLREG1, | ||
| 8492 | GEN7_WA_FOR_GEN7_L3_CONTROL); | ||
| 8493 | I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER, | ||
| 8494 | GEN7_WA_L3_CHICKEN_MODE); | ||
| 8495 | |||
| 8496 | /* This is required by WaCatErrorRejectionIssue */ | ||
| 8497 | I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, | ||
| 8498 | I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | | ||
| 8499 | GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB); | ||
| 8500 | |||
| 8472 | for_each_pipe(pipe) { | 8501 | for_each_pipe(pipe) { |
| 8473 | I915_WRITE(DSPCNTR(pipe), | 8502 | I915_WRITE(DSPCNTR(pipe), |
| 8474 | I915_READ(DSPCNTR(pipe)) | | 8503 | I915_READ(DSPCNTR(pipe)) | |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 1ab842c6032e..536191540b03 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
| @@ -301,7 +301,7 @@ static int init_ring_common(struct intel_ring_buffer *ring) | |||
| 301 | 301 | ||
| 302 | I915_WRITE_CTL(ring, | 302 | I915_WRITE_CTL(ring, |
| 303 | ((ring->size - PAGE_SIZE) & RING_NR_PAGES) | 303 | ((ring->size - PAGE_SIZE) & RING_NR_PAGES) |
| 304 | | RING_REPORT_64K | RING_VALID); | 304 | | RING_VALID); |
| 305 | 305 | ||
| 306 | /* If the head is still not zero, the ring is dead */ | 306 | /* If the head is still not zero, the ring is dead */ |
| 307 | if ((I915_READ_CTL(ring) & RING_VALID) == 0 || | 307 | if ((I915_READ_CTL(ring) & RING_VALID) == 0 || |
| @@ -1132,18 +1132,6 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n) | |||
| 1132 | struct drm_device *dev = ring->dev; | 1132 | struct drm_device *dev = ring->dev; |
| 1133 | struct drm_i915_private *dev_priv = dev->dev_private; | 1133 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1134 | unsigned long end; | 1134 | unsigned long end; |
| 1135 | u32 head; | ||
| 1136 | |||
| 1137 | /* If the reported head position has wrapped or hasn't advanced, | ||
| 1138 | * fallback to the slow and accurate path. | ||
| 1139 | */ | ||
| 1140 | head = intel_read_status_page(ring, 4); | ||
| 1141 | if (head > ring->head) { | ||
| 1142 | ring->head = head; | ||
| 1143 | ring->space = ring_space(ring); | ||
| 1144 | if (ring->space >= n) | ||
| 1145 | return 0; | ||
| 1146 | } | ||
| 1147 | 1135 | ||
| 1148 | trace_i915_ring_wait_begin(ring); | 1136 | trace_i915_ring_wait_begin(ring); |
| 1149 | if (drm_core_check_feature(dev, DRIVER_GEM)) | 1137 | if (drm_core_check_feature(dev, DRIVER_GEM)) |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 9be353b894cc..f58254a3fb01 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -3223,6 +3223,7 @@ int evergreen_resume(struct radeon_device *rdev) | |||
| 3223 | r = evergreen_startup(rdev); | 3223 | r = evergreen_startup(rdev); |
| 3224 | if (r) { | 3224 | if (r) { |
| 3225 | DRM_ERROR("evergreen startup failed on resume\n"); | 3225 | DRM_ERROR("evergreen startup failed on resume\n"); |
| 3226 | rdev->accel_working = false; | ||
| 3226 | return r; | 3227 | return r; |
| 3227 | } | 3228 | } |
| 3228 | 3229 | ||
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index db09065e68fd..2509c505acb8 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
| @@ -1547,6 +1547,7 @@ int cayman_resume(struct radeon_device *rdev) | |||
| 1547 | r = cayman_startup(rdev); | 1547 | r = cayman_startup(rdev); |
| 1548 | if (r) { | 1548 | if (r) { |
| 1549 | DRM_ERROR("cayman startup failed on resume\n"); | 1549 | DRM_ERROR("cayman startup failed on resume\n"); |
| 1550 | rdev->accel_working = false; | ||
| 1550 | return r; | 1551 | return r; |
| 1551 | } | 1552 | } |
| 1552 | return r; | 1553 | return r; |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 18cd84fae99c..333cde9d4e7b 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
| @@ -3928,6 +3928,8 @@ static int r100_startup(struct radeon_device *rdev) | |||
| 3928 | 3928 | ||
| 3929 | int r100_resume(struct radeon_device *rdev) | 3929 | int r100_resume(struct radeon_device *rdev) |
| 3930 | { | 3930 | { |
| 3931 | int r; | ||
| 3932 | |||
| 3931 | /* Make sur GART are not working */ | 3933 | /* Make sur GART are not working */ |
| 3932 | if (rdev->flags & RADEON_IS_PCI) | 3934 | if (rdev->flags & RADEON_IS_PCI) |
| 3933 | r100_pci_gart_disable(rdev); | 3935 | r100_pci_gart_disable(rdev); |
| @@ -3947,7 +3949,11 @@ int r100_resume(struct radeon_device *rdev) | |||
| 3947 | radeon_surface_init(rdev); | 3949 | radeon_surface_init(rdev); |
| 3948 | 3950 | ||
| 3949 | rdev->accel_working = true; | 3951 | rdev->accel_working = true; |
| 3950 | return r100_startup(rdev); | 3952 | r = r100_startup(rdev); |
| 3953 | if (r) { | ||
| 3954 | rdev->accel_working = false; | ||
| 3955 | } | ||
| 3956 | return r; | ||
| 3951 | } | 3957 | } |
| 3952 | 3958 | ||
| 3953 | int r100_suspend(struct radeon_device *rdev) | 3959 | int r100_suspend(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 3fc0d29a5f39..6829638cca40 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
| @@ -1431,6 +1431,8 @@ static int r300_startup(struct radeon_device *rdev) | |||
| 1431 | 1431 | ||
| 1432 | int r300_resume(struct radeon_device *rdev) | 1432 | int r300_resume(struct radeon_device *rdev) |
| 1433 | { | 1433 | { |
| 1434 | int r; | ||
| 1435 | |||
| 1434 | /* Make sur GART are not working */ | 1436 | /* Make sur GART are not working */ |
| 1435 | if (rdev->flags & RADEON_IS_PCIE) | 1437 | if (rdev->flags & RADEON_IS_PCIE) |
| 1436 | rv370_pcie_gart_disable(rdev); | 1438 | rv370_pcie_gart_disable(rdev); |
| @@ -1452,7 +1454,11 @@ int r300_resume(struct radeon_device *rdev) | |||
| 1452 | radeon_surface_init(rdev); | 1454 | radeon_surface_init(rdev); |
| 1453 | 1455 | ||
| 1454 | rdev->accel_working = true; | 1456 | rdev->accel_working = true; |
| 1455 | return r300_startup(rdev); | 1457 | r = r300_startup(rdev); |
| 1458 | if (r) { | ||
| 1459 | rdev->accel_working = false; | ||
| 1460 | } | ||
| 1461 | return r; | ||
| 1456 | } | 1462 | } |
| 1457 | 1463 | ||
| 1458 | int r300_suspend(struct radeon_device *rdev) | 1464 | int r300_suspend(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 666e28fe509c..b14323053bad 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c | |||
| @@ -291,6 +291,8 @@ static int r420_startup(struct radeon_device *rdev) | |||
| 291 | 291 | ||
| 292 | int r420_resume(struct radeon_device *rdev) | 292 | int r420_resume(struct radeon_device *rdev) |
| 293 | { | 293 | { |
| 294 | int r; | ||
| 295 | |||
| 294 | /* Make sur GART are not working */ | 296 | /* Make sur GART are not working */ |
| 295 | if (rdev->flags & RADEON_IS_PCIE) | 297 | if (rdev->flags & RADEON_IS_PCIE) |
| 296 | rv370_pcie_gart_disable(rdev); | 298 | rv370_pcie_gart_disable(rdev); |
| @@ -316,7 +318,11 @@ int r420_resume(struct radeon_device *rdev) | |||
| 316 | radeon_surface_init(rdev); | 318 | radeon_surface_init(rdev); |
| 317 | 319 | ||
| 318 | rdev->accel_working = true; | 320 | rdev->accel_working = true; |
| 319 | return r420_startup(rdev); | 321 | r = r420_startup(rdev); |
| 322 | if (r) { | ||
| 323 | rdev->accel_working = false; | ||
| 324 | } | ||
| 325 | return r; | ||
| 320 | } | 326 | } |
| 321 | 327 | ||
| 322 | int r420_suspend(struct radeon_device *rdev) | 328 | int r420_suspend(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c index 4ae1615e752f..25084e824dbc 100644 --- a/drivers/gpu/drm/radeon/r520.c +++ b/drivers/gpu/drm/radeon/r520.c | |||
| @@ -218,6 +218,8 @@ static int r520_startup(struct radeon_device *rdev) | |||
| 218 | 218 | ||
| 219 | int r520_resume(struct radeon_device *rdev) | 219 | int r520_resume(struct radeon_device *rdev) |
| 220 | { | 220 | { |
| 221 | int r; | ||
| 222 | |||
| 221 | /* Make sur GART are not working */ | 223 | /* Make sur GART are not working */ |
| 222 | if (rdev->flags & RADEON_IS_PCIE) | 224 | if (rdev->flags & RADEON_IS_PCIE) |
| 223 | rv370_pcie_gart_disable(rdev); | 225 | rv370_pcie_gart_disable(rdev); |
| @@ -237,7 +239,11 @@ int r520_resume(struct radeon_device *rdev) | |||
| 237 | radeon_surface_init(rdev); | 239 | radeon_surface_init(rdev); |
| 238 | 240 | ||
| 239 | rdev->accel_working = true; | 241 | rdev->accel_working = true; |
| 240 | return r520_startup(rdev); | 242 | r = r520_startup(rdev); |
| 243 | if (r) { | ||
| 244 | rdev->accel_working = false; | ||
| 245 | } | ||
| 246 | return r; | ||
| 241 | } | 247 | } |
| 242 | 248 | ||
| 243 | int r520_init(struct radeon_device *rdev) | 249 | int r520_init(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 4f08e5e6ee9d..fbcd84803b60 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -2529,6 +2529,7 @@ int r600_resume(struct radeon_device *rdev) | |||
| 2529 | r = r600_startup(rdev); | 2529 | r = r600_startup(rdev); |
| 2530 | if (r) { | 2530 | if (r) { |
| 2531 | DRM_ERROR("r600 startup failed on resume\n"); | 2531 | DRM_ERROR("r600 startup failed on resume\n"); |
| 2532 | rdev->accel_working = false; | ||
| 2532 | return r; | 2533 | return r; |
| 2533 | } | 2534 | } |
| 2534 | 2535 | ||
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 38ce5d0427e3..387fcc9f03ef 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
| @@ -1304,6 +1304,7 @@ static int r600_check_texture_resource(struct radeon_cs_parser *p, u32 idx, | |||
| 1304 | h0 = G_038004_TEX_HEIGHT(word1) + 1; | 1304 | h0 = G_038004_TEX_HEIGHT(word1) + 1; |
| 1305 | d0 = G_038004_TEX_DEPTH(word1); | 1305 | d0 = G_038004_TEX_DEPTH(word1); |
| 1306 | nfaces = 1; | 1306 | nfaces = 1; |
| 1307 | array = 0; | ||
| 1307 | switch (G_038000_DIM(word0)) { | 1308 | switch (G_038000_DIM(word0)) { |
| 1308 | case V_038000_SQ_TEX_DIM_1D: | 1309 | case V_038000_SQ_TEX_DIM_1D: |
| 1309 | case V_038000_SQ_TEX_DIM_2D: | 1310 | case V_038000_SQ_TEX_DIM_2D: |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 9e72daeeddc6..1f53ae74ada1 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -3020,6 +3020,9 @@ radeon_atombios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on) | |||
| 3020 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 3020 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
| 3021 | uint32_t bios_2_scratch; | 3021 | uint32_t bios_2_scratch; |
| 3022 | 3022 | ||
| 3023 | if (ASIC_IS_DCE4(rdev)) | ||
| 3024 | return; | ||
| 3025 | |||
| 3023 | if (rdev->family >= CHIP_R600) | 3026 | if (rdev->family >= CHIP_R600) |
| 3024 | bios_2_scratch = RREG32(R600_BIOS_2_SCRATCH); | 3027 | bios_2_scratch = RREG32(R600_BIOS_2_SCRATCH); |
| 3025 | else | 3028 | else |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index e7cb3ab09243..8b3d8ed52ff6 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -1117,13 +1117,23 @@ static int radeon_dp_get_modes(struct drm_connector *connector) | |||
| 1117 | (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { | 1117 | (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) { |
| 1118 | struct drm_display_mode *mode; | 1118 | struct drm_display_mode *mode; |
| 1119 | 1119 | ||
| 1120 | if (!radeon_dig_connector->edp_on) | 1120 | if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { |
| 1121 | atombios_set_edp_panel_power(connector, | 1121 | if (!radeon_dig_connector->edp_on) |
| 1122 | ATOM_TRANSMITTER_ACTION_POWER_ON); | 1122 | atombios_set_edp_panel_power(connector, |
| 1123 | ret = radeon_ddc_get_modes(radeon_connector); | 1123 | ATOM_TRANSMITTER_ACTION_POWER_ON); |
| 1124 | if (!radeon_dig_connector->edp_on) | 1124 | ret = radeon_ddc_get_modes(radeon_connector); |
| 1125 | atombios_set_edp_panel_power(connector, | 1125 | if (!radeon_dig_connector->edp_on) |
| 1126 | ATOM_TRANSMITTER_ACTION_POWER_OFF); | 1126 | atombios_set_edp_panel_power(connector, |
| 1127 | ATOM_TRANSMITTER_ACTION_POWER_OFF); | ||
| 1128 | } else { | ||
| 1129 | /* need to setup ddc on the bridge */ | ||
| 1130 | if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) != | ||
| 1131 | ENCODER_OBJECT_ID_NONE) { | ||
| 1132 | if (encoder) | ||
| 1133 | radeon_atom_ext_encoder_setup_ddc(encoder); | ||
| 1134 | } | ||
| 1135 | ret = radeon_ddc_get_modes(radeon_connector); | ||
| 1136 | } | ||
| 1127 | 1137 | ||
| 1128 | if (ret > 0) { | 1138 | if (ret > 0) { |
| 1129 | if (encoder) { | 1139 | if (encoder) { |
| @@ -1134,7 +1144,6 @@ static int radeon_dp_get_modes(struct drm_connector *connector) | |||
| 1134 | return ret; | 1144 | return ret; |
| 1135 | } | 1145 | } |
| 1136 | 1146 | ||
| 1137 | encoder = radeon_best_single_encoder(connector); | ||
| 1138 | if (!encoder) | 1147 | if (!encoder) |
| 1139 | return 0; | 1148 | return 0; |
| 1140 | 1149 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 435a3d970ab8..e64bec488ed8 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
| @@ -453,6 +453,10 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) | |||
| 453 | int r; | 453 | int r; |
| 454 | 454 | ||
| 455 | radeon_mutex_lock(&rdev->cs_mutex); | 455 | radeon_mutex_lock(&rdev->cs_mutex); |
| 456 | if (!rdev->accel_working) { | ||
| 457 | radeon_mutex_unlock(&rdev->cs_mutex); | ||
| 458 | return -EBUSY; | ||
| 459 | } | ||
| 456 | /* initialize parser */ | 460 | /* initialize parser */ |
| 457 | memset(&parser, 0, sizeof(struct radeon_cs_parser)); | 461 | memset(&parser, 0, sizeof(struct radeon_cs_parser)); |
| 458 | parser.filp = filp; | 462 | parser.filp = filp; |
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 010dad8b66ae..c58a036233fb 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c | |||
| @@ -597,13 +597,13 @@ int radeon_vm_bo_rmv(struct radeon_device *rdev, | |||
| 597 | if (bo_va == NULL) | 597 | if (bo_va == NULL) |
| 598 | return 0; | 598 | return 0; |
| 599 | 599 | ||
| 600 | list_del(&bo_va->bo_list); | ||
| 601 | mutex_lock(&vm->mutex); | 600 | mutex_lock(&vm->mutex); |
| 602 | radeon_mutex_lock(&rdev->cs_mutex); | 601 | radeon_mutex_lock(&rdev->cs_mutex); |
| 603 | radeon_vm_bo_update_pte(rdev, vm, bo, NULL); | 602 | radeon_vm_bo_update_pte(rdev, vm, bo, NULL); |
| 604 | radeon_mutex_unlock(&rdev->cs_mutex); | 603 | radeon_mutex_unlock(&rdev->cs_mutex); |
| 605 | list_del(&bo_va->vm_list); | 604 | list_del(&bo_va->vm_list); |
| 606 | mutex_unlock(&vm->mutex); | 605 | mutex_unlock(&vm->mutex); |
| 606 | list_del(&bo_va->bo_list); | ||
| 607 | 607 | ||
| 608 | kfree(bo_va); | 608 | kfree(bo_va); |
| 609 | return 0; | 609 | return 0; |
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index 30a4c5014c8b..92c9ea4751fb 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c | |||
| @@ -500,8 +500,11 @@ static char radeon_debugfs_ib_names[RADEON_IB_POOL_SIZE][32]; | |||
| 500 | int radeon_debugfs_ring_init(struct radeon_device *rdev) | 500 | int radeon_debugfs_ring_init(struct radeon_device *rdev) |
| 501 | { | 501 | { |
| 502 | #if defined(CONFIG_DEBUG_FS) | 502 | #if defined(CONFIG_DEBUG_FS) |
| 503 | return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list, | 503 | if (rdev->family >= CHIP_CAYMAN) |
| 504 | ARRAY_SIZE(radeon_debugfs_ring_info_list)); | 504 | return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list, |
| 505 | ARRAY_SIZE(radeon_debugfs_ring_info_list)); | ||
| 506 | else | ||
| 507 | return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list, 1); | ||
| 505 | #else | 508 | #else |
| 506 | return 0; | 509 | return 0; |
| 507 | #endif | 510 | #endif |
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index b0ce84a20a68..866a05be75f2 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c | |||
| @@ -442,6 +442,8 @@ static int rs400_startup(struct radeon_device *rdev) | |||
| 442 | 442 | ||
| 443 | int rs400_resume(struct radeon_device *rdev) | 443 | int rs400_resume(struct radeon_device *rdev) |
| 444 | { | 444 | { |
| 445 | int r; | ||
| 446 | |||
| 445 | /* Make sur GART are not working */ | 447 | /* Make sur GART are not working */ |
| 446 | rs400_gart_disable(rdev); | 448 | rs400_gart_disable(rdev); |
| 447 | /* Resume clock before doing reset */ | 449 | /* Resume clock before doing reset */ |
| @@ -462,7 +464,11 @@ int rs400_resume(struct radeon_device *rdev) | |||
| 462 | radeon_surface_init(rdev); | 464 | radeon_surface_init(rdev); |
| 463 | 465 | ||
| 464 | rdev->accel_working = true; | 466 | rdev->accel_working = true; |
| 465 | return rs400_startup(rdev); | 467 | r = rs400_startup(rdev); |
| 468 | if (r) { | ||
| 469 | rdev->accel_working = false; | ||
| 470 | } | ||
| 471 | return r; | ||
| 466 | } | 472 | } |
| 467 | 473 | ||
| 468 | int rs400_suspend(struct radeon_device *rdev) | 474 | int rs400_suspend(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index c05865e5521f..4fc700684dcd 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
| @@ -876,6 +876,8 @@ static int rs600_startup(struct radeon_device *rdev) | |||
| 876 | 876 | ||
| 877 | int rs600_resume(struct radeon_device *rdev) | 877 | int rs600_resume(struct radeon_device *rdev) |
| 878 | { | 878 | { |
| 879 | int r; | ||
| 880 | |||
| 879 | /* Make sur GART are not working */ | 881 | /* Make sur GART are not working */ |
| 880 | rs600_gart_disable(rdev); | 882 | rs600_gart_disable(rdev); |
| 881 | /* Resume clock before doing reset */ | 883 | /* Resume clock before doing reset */ |
| @@ -894,7 +896,11 @@ int rs600_resume(struct radeon_device *rdev) | |||
| 894 | radeon_surface_init(rdev); | 896 | radeon_surface_init(rdev); |
| 895 | 897 | ||
| 896 | rdev->accel_working = true; | 898 | rdev->accel_working = true; |
| 897 | return rs600_startup(rdev); | 899 | r = rs600_startup(rdev); |
| 900 | if (r) { | ||
| 901 | rdev->accel_working = false; | ||
| 902 | } | ||
| 903 | return r; | ||
| 898 | } | 904 | } |
| 899 | 905 | ||
| 900 | int rs600_suspend(struct radeon_device *rdev) | 906 | int rs600_suspend(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index 4f24a0fa8c82..f68dff2fadcb 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
| @@ -659,6 +659,8 @@ static int rs690_startup(struct radeon_device *rdev) | |||
| 659 | 659 | ||
| 660 | int rs690_resume(struct radeon_device *rdev) | 660 | int rs690_resume(struct radeon_device *rdev) |
| 661 | { | 661 | { |
| 662 | int r; | ||
| 663 | |||
| 662 | /* Make sur GART are not working */ | 664 | /* Make sur GART are not working */ |
| 663 | rs400_gart_disable(rdev); | 665 | rs400_gart_disable(rdev); |
| 664 | /* Resume clock before doing reset */ | 666 | /* Resume clock before doing reset */ |
| @@ -677,7 +679,11 @@ int rs690_resume(struct radeon_device *rdev) | |||
| 677 | radeon_surface_init(rdev); | 679 | radeon_surface_init(rdev); |
| 678 | 680 | ||
| 679 | rdev->accel_working = true; | 681 | rdev->accel_working = true; |
| 680 | return rs690_startup(rdev); | 682 | r = rs690_startup(rdev); |
| 683 | if (r) { | ||
| 684 | rdev->accel_working = false; | ||
| 685 | } | ||
| 686 | return r; | ||
| 681 | } | 687 | } |
| 682 | 688 | ||
| 683 | int rs690_suspend(struct radeon_device *rdev) | 689 | int rs690_suspend(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 880637fd1946..959bf4483bea 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
| @@ -424,6 +424,8 @@ static int rv515_startup(struct radeon_device *rdev) | |||
| 424 | 424 | ||
| 425 | int rv515_resume(struct radeon_device *rdev) | 425 | int rv515_resume(struct radeon_device *rdev) |
| 426 | { | 426 | { |
| 427 | int r; | ||
| 428 | |||
| 427 | /* Make sur GART are not working */ | 429 | /* Make sur GART are not working */ |
| 428 | if (rdev->flags & RADEON_IS_PCIE) | 430 | if (rdev->flags & RADEON_IS_PCIE) |
| 429 | rv370_pcie_gart_disable(rdev); | 431 | rv370_pcie_gart_disable(rdev); |
| @@ -443,7 +445,11 @@ int rv515_resume(struct radeon_device *rdev) | |||
| 443 | radeon_surface_init(rdev); | 445 | radeon_surface_init(rdev); |
| 444 | 446 | ||
| 445 | rdev->accel_working = true; | 447 | rdev->accel_working = true; |
| 446 | return rv515_startup(rdev); | 448 | r = rv515_startup(rdev); |
| 449 | if (r) { | ||
| 450 | rdev->accel_working = false; | ||
| 451 | } | ||
| 452 | return r; | ||
| 447 | } | 453 | } |
| 448 | 454 | ||
| 449 | int rv515_suspend(struct radeon_device *rdev) | 455 | int rv515_suspend(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index a1668b659ddd..c049c0c51841 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
| @@ -1139,6 +1139,7 @@ int rv770_resume(struct radeon_device *rdev) | |||
| 1139 | r = rv770_startup(rdev); | 1139 | r = rv770_startup(rdev); |
| 1140 | if (r) { | 1140 | if (r) { |
| 1141 | DRM_ERROR("r600 startup failed on resume\n"); | 1141 | DRM_ERROR("r600 startup failed on resume\n"); |
| 1142 | rdev->accel_working = false; | ||
| 1142 | return r; | 1143 | return r; |
| 1143 | } | 1144 | } |
| 1144 | 1145 | ||
diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c index eedca3cf9968..dd87ae96c262 100644 --- a/drivers/hwmon/ads1015.c +++ b/drivers/hwmon/ads1015.c | |||
| @@ -271,7 +271,7 @@ static int ads1015_probe(struct i2c_client *client, | |||
| 271 | continue; | 271 | continue; |
| 272 | err = device_create_file(&client->dev, &ads1015_in[k].dev_attr); | 272 | err = device_create_file(&client->dev, &ads1015_in[k].dev_attr); |
| 273 | if (err) | 273 | if (err) |
| 274 | goto exit_free; | 274 | goto exit_remove; |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | data->hwmon_dev = hwmon_device_register(&client->dev); | 277 | data->hwmon_dev = hwmon_device_register(&client->dev); |
| @@ -285,7 +285,6 @@ static int ads1015_probe(struct i2c_client *client, | |||
| 285 | exit_remove: | 285 | exit_remove: |
| 286 | for (k = 0; k < ADS1015_CHANNELS; ++k) | 286 | for (k = 0; k < ADS1015_CHANNELS; ++k) |
| 287 | device_remove_file(&client->dev, &ads1015_in[k].dev_attr); | 287 | device_remove_file(&client->dev, &ads1015_in[k].dev_attr); |
| 288 | exit_free: | ||
| 289 | kfree(data); | 288 | kfree(data); |
| 290 | exit: | 289 | exit: |
| 291 | return err; | 290 | return err; |
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index f609b5727ba9..6aa5a9fad879 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
| @@ -178,6 +178,16 @@ static inline void f75375_write16(struct i2c_client *client, u8 reg, | |||
| 178 | i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF)); | 178 | i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF)); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | static void f75375_write_pwm(struct i2c_client *client, int nr) | ||
| 182 | { | ||
| 183 | struct f75375_data *data = i2c_get_clientdata(client); | ||
| 184 | if (data->kind == f75387) | ||
| 185 | f75375_write16(client, F75375_REG_FAN_EXP(nr), data->pwm[nr]); | ||
| 186 | else | ||
| 187 | f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), | ||
| 188 | data->pwm[nr]); | ||
| 189 | } | ||
| 190 | |||
| 181 | static struct f75375_data *f75375_update_device(struct device *dev) | 191 | static struct f75375_data *f75375_update_device(struct device *dev) |
| 182 | { | 192 | { |
| 183 | struct i2c_client *client = to_i2c_client(dev); | 193 | struct i2c_client *client = to_i2c_client(dev); |
| @@ -254,6 +264,36 @@ static inline u16 rpm_to_reg(int rpm) | |||
| 254 | return 1500000 / rpm; | 264 | return 1500000 / rpm; |
| 255 | } | 265 | } |
| 256 | 266 | ||
| 267 | static bool duty_mode_enabled(u8 pwm_enable) | ||
| 268 | { | ||
| 269 | switch (pwm_enable) { | ||
| 270 | case 0: /* Manual, duty mode (full speed) */ | ||
| 271 | case 1: /* Manual, duty mode */ | ||
| 272 | case 4: /* Auto, duty mode */ | ||
| 273 | return true; | ||
| 274 | case 2: /* Auto, speed mode */ | ||
| 275 | case 3: /* Manual, speed mode */ | ||
| 276 | return false; | ||
| 277 | default: | ||
| 278 | BUG(); | ||
| 279 | } | ||
| 280 | } | ||
| 281 | |||
| 282 | static bool auto_mode_enabled(u8 pwm_enable) | ||
| 283 | { | ||
| 284 | switch (pwm_enable) { | ||
| 285 | case 0: /* Manual, duty mode (full speed) */ | ||
| 286 | case 1: /* Manual, duty mode */ | ||
| 287 | case 3: /* Manual, speed mode */ | ||
| 288 | return false; | ||
| 289 | case 2: /* Auto, speed mode */ | ||
| 290 | case 4: /* Auto, duty mode */ | ||
| 291 | return true; | ||
| 292 | default: | ||
| 293 | BUG(); | ||
| 294 | } | ||
| 295 | } | ||
| 296 | |||
| 257 | static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, | 297 | static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, |
| 258 | const char *buf, size_t count) | 298 | const char *buf, size_t count) |
| 259 | { | 299 | { |
| @@ -287,6 +327,11 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *attr, | |||
| 287 | if (err < 0) | 327 | if (err < 0) |
| 288 | return err; | 328 | return err; |
| 289 | 329 | ||
| 330 | if (auto_mode_enabled(data->pwm_enable[nr])) | ||
| 331 | return -EINVAL; | ||
| 332 | if (data->kind == f75387 && duty_mode_enabled(data->pwm_enable[nr])) | ||
| 333 | return -EINVAL; | ||
| 334 | |||
| 290 | mutex_lock(&data->update_lock); | 335 | mutex_lock(&data->update_lock); |
| 291 | data->fan_target[nr] = rpm_to_reg(val); | 336 | data->fan_target[nr] = rpm_to_reg(val); |
| 292 | f75375_write16(client, F75375_REG_FAN_EXP(nr), data->fan_target[nr]); | 337 | f75375_write16(client, F75375_REG_FAN_EXP(nr), data->fan_target[nr]); |
| @@ -307,9 +352,13 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, | |||
| 307 | if (err < 0) | 352 | if (err < 0) |
| 308 | return err; | 353 | return err; |
| 309 | 354 | ||
| 355 | if (auto_mode_enabled(data->pwm_enable[nr]) || | ||
| 356 | !duty_mode_enabled(data->pwm_enable[nr])) | ||
| 357 | return -EINVAL; | ||
| 358 | |||
| 310 | mutex_lock(&data->update_lock); | 359 | mutex_lock(&data->update_lock); |
| 311 | data->pwm[nr] = SENSORS_LIMIT(val, 0, 255); | 360 | data->pwm[nr] = SENSORS_LIMIT(val, 0, 255); |
| 312 | f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), data->pwm[nr]); | 361 | f75375_write_pwm(client, nr); |
| 313 | mutex_unlock(&data->update_lock); | 362 | mutex_unlock(&data->update_lock); |
| 314 | return count; | 363 | return count; |
| 315 | } | 364 | } |
| @@ -327,11 +376,15 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | |||
| 327 | struct f75375_data *data = i2c_get_clientdata(client); | 376 | struct f75375_data *data = i2c_get_clientdata(client); |
| 328 | u8 fanmode; | 377 | u8 fanmode; |
| 329 | 378 | ||
| 330 | if (val < 0 || val > 3) | 379 | if (val < 0 || val > 4) |
| 331 | return -EINVAL; | 380 | return -EINVAL; |
| 332 | 381 | ||
| 333 | fanmode = f75375_read8(client, F75375_REG_FAN_TIMER); | 382 | fanmode = f75375_read8(client, F75375_REG_FAN_TIMER); |
| 334 | if (data->kind == f75387) { | 383 | if (data->kind == f75387) { |
| 384 | /* For now, deny dangerous toggling of duty mode */ | ||
| 385 | if (duty_mode_enabled(data->pwm_enable[nr]) != | ||
| 386 | duty_mode_enabled(val)) | ||
| 387 | return -EOPNOTSUPP; | ||
| 335 | /* clear each fanX_mode bit before setting them properly */ | 388 | /* clear each fanX_mode bit before setting them properly */ |
| 336 | fanmode &= ~(1 << F75387_FAN_DUTY_MODE(nr)); | 389 | fanmode &= ~(1 << F75387_FAN_DUTY_MODE(nr)); |
| 337 | fanmode &= ~(1 << F75387_FAN_MANU_MODE(nr)); | 390 | fanmode &= ~(1 << F75387_FAN_MANU_MODE(nr)); |
| @@ -340,19 +393,19 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | |||
| 340 | fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); | 393 | fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); |
| 341 | fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); | 394 | fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); |
| 342 | data->pwm[nr] = 255; | 395 | data->pwm[nr] = 255; |
| 343 | f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), | ||
| 344 | data->pwm[nr]); | ||
| 345 | break; | 396 | break; |
| 346 | case 1: /* PWM */ | 397 | case 1: /* PWM */ |
| 347 | fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); | 398 | fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); |
| 348 | fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); | 399 | fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); |
| 349 | break; | 400 | break; |
| 350 | case 2: /* AUTOMATIC*/ | 401 | case 2: /* Automatic, speed mode */ |
| 351 | fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); | ||
| 352 | break; | 402 | break; |
| 353 | case 3: /* fan speed */ | 403 | case 3: /* fan speed */ |
| 354 | fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); | 404 | fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); |
| 355 | break; | 405 | break; |
| 406 | case 4: /* Automatic, pwm */ | ||
| 407 | fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); | ||
| 408 | break; | ||
| 356 | } | 409 | } |
| 357 | } else { | 410 | } else { |
| 358 | /* clear each fanX_mode bit before setting them properly */ | 411 | /* clear each fanX_mode bit before setting them properly */ |
| @@ -361,8 +414,6 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | |||
| 361 | case 0: /* full speed */ | 414 | case 0: /* full speed */ |
| 362 | fanmode |= (3 << FAN_CTRL_MODE(nr)); | 415 | fanmode |= (3 << FAN_CTRL_MODE(nr)); |
| 363 | data->pwm[nr] = 255; | 416 | data->pwm[nr] = 255; |
| 364 | f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), | ||
| 365 | data->pwm[nr]); | ||
| 366 | break; | 417 | break; |
| 367 | case 1: /* PWM */ | 418 | case 1: /* PWM */ |
| 368 | fanmode |= (3 << FAN_CTRL_MODE(nr)); | 419 | fanmode |= (3 << FAN_CTRL_MODE(nr)); |
| @@ -372,11 +423,15 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | |||
| 372 | break; | 423 | break; |
| 373 | case 3: /* fan speed */ | 424 | case 3: /* fan speed */ |
| 374 | break; | 425 | break; |
| 426 | case 4: /* Automatic pwm */ | ||
| 427 | return -EINVAL; | ||
| 375 | } | 428 | } |
| 376 | } | 429 | } |
| 377 | 430 | ||
| 378 | f75375_write8(client, F75375_REG_FAN_TIMER, fanmode); | 431 | f75375_write8(client, F75375_REG_FAN_TIMER, fanmode); |
| 379 | data->pwm_enable[nr] = val; | 432 | data->pwm_enable[nr] = val; |
| 433 | if (val == 0) | ||
| 434 | f75375_write_pwm(client, nr); | ||
| 380 | return 0; | 435 | return 0; |
| 381 | } | 436 | } |
| 382 | 437 | ||
| @@ -727,14 +782,17 @@ static void f75375_init(struct i2c_client *client, struct f75375_data *data, | |||
| 727 | 782 | ||
| 728 | manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1); | 783 | manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1); |
| 729 | duty = ((mode >> F75387_FAN_DUTY_MODE(nr)) & 1); | 784 | duty = ((mode >> F75387_FAN_DUTY_MODE(nr)) & 1); |
| 730 | if (manu && duty) | 785 | if (!manu && duty) |
| 731 | /* speed */ | 786 | /* auto, pwm */ |
| 787 | data->pwm_enable[nr] = 4; | ||
| 788 | else if (manu && !duty) | ||
| 789 | /* manual, speed */ | ||
| 732 | data->pwm_enable[nr] = 3; | 790 | data->pwm_enable[nr] = 3; |
| 733 | else if (!manu && duty) | 791 | else if (!manu && !duty) |
| 734 | /* automatic */ | 792 | /* automatic, speed */ |
| 735 | data->pwm_enable[nr] = 2; | 793 | data->pwm_enable[nr] = 2; |
| 736 | else | 794 | else |
| 737 | /* manual */ | 795 | /* manual, pwm */ |
| 738 | data->pwm_enable[nr] = 1; | 796 | data->pwm_enable[nr] = 1; |
| 739 | } else { | 797 | } else { |
| 740 | if (!(conf & (1 << F75375_FAN_CTRL_LINEAR(nr)))) | 798 | if (!(conf & (1 << F75375_FAN_CTRL_LINEAR(nr)))) |
| @@ -759,9 +817,11 @@ static void f75375_init(struct i2c_client *client, struct f75375_data *data, | |||
| 759 | set_pwm_enable_direct(client, 0, f75375s_pdata->pwm_enable[0]); | 817 | set_pwm_enable_direct(client, 0, f75375s_pdata->pwm_enable[0]); |
| 760 | set_pwm_enable_direct(client, 1, f75375s_pdata->pwm_enable[1]); | 818 | set_pwm_enable_direct(client, 1, f75375s_pdata->pwm_enable[1]); |
| 761 | for (nr = 0; nr < 2; nr++) { | 819 | for (nr = 0; nr < 2; nr++) { |
| 820 | if (auto_mode_enabled(f75375s_pdata->pwm_enable[nr]) || | ||
| 821 | !duty_mode_enabled(f75375s_pdata->pwm_enable[nr])) | ||
| 822 | continue; | ||
| 762 | data->pwm[nr] = SENSORS_LIMIT(f75375s_pdata->pwm[nr], 0, 255); | 823 | data->pwm[nr] = SENSORS_LIMIT(f75375s_pdata->pwm[nr], 0, 255); |
| 763 | f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), | 824 | f75375_write_pwm(client, nr); |
| 764 | data->pwm[nr]); | ||
| 765 | } | 825 | } |
| 766 | 826 | ||
| 767 | } | 827 | } |
| @@ -788,7 +848,7 @@ static int f75375_probe(struct i2c_client *client, | |||
| 788 | if (err) | 848 | if (err) |
| 789 | goto exit_free; | 849 | goto exit_free; |
| 790 | 850 | ||
| 791 | if (data->kind == f75375) { | 851 | if (data->kind != f75373) { |
| 792 | err = sysfs_chmod_file(&client->dev.kobj, | 852 | err = sysfs_chmod_file(&client->dev.kobj, |
| 793 | &sensor_dev_attr_pwm1_mode.dev_attr.attr, | 853 | &sensor_dev_attr_pwm1_mode.dev_attr.attr, |
| 794 | S_IRUGO | S_IWUSR); | 854 | S_IRUGO | S_IWUSR); |
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c index e10a092c603c..a6760bacd915 100644 --- a/drivers/hwmon/max6639.c +++ b/drivers/hwmon/max6639.c | |||
| @@ -72,8 +72,8 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2e, 0x2f, I2C_CLIENT_END }; | |||
| 72 | 72 | ||
| 73 | static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 }; | 73 | static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 }; |
| 74 | 74 | ||
| 75 | #define FAN_FROM_REG(val, div, rpm_range) ((val) == 0 ? -1 : \ | 75 | #define FAN_FROM_REG(val, rpm_range) ((val) == 0 || (val) == 255 ? \ |
| 76 | (val) == 255 ? 0 : (rpm_ranges[rpm_range] * 30) / ((div + 1) * (val))) | 76 | 0 : (rpm_ranges[rpm_range] * 30) / (val)) |
| 77 | #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255) | 77 | #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255) |
| 78 | 78 | ||
| 79 | /* | 79 | /* |
| @@ -333,7 +333,7 @@ static ssize_t show_fan_input(struct device *dev, | |||
| 333 | return PTR_ERR(data); | 333 | return PTR_ERR(data); |
| 334 | 334 | ||
| 335 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index], | 335 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index], |
| 336 | data->ppr, data->rpm_range)); | 336 | data->rpm_range)); |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | static ssize_t show_alarm(struct device *dev, | 339 | static ssize_t show_alarm(struct device *dev, |
| @@ -429,9 +429,9 @@ static int max6639_init_client(struct i2c_client *client) | |||
| 429 | struct max6639_data *data = i2c_get_clientdata(client); | 429 | struct max6639_data *data = i2c_get_clientdata(client); |
| 430 | struct max6639_platform_data *max6639_info = | 430 | struct max6639_platform_data *max6639_info = |
| 431 | client->dev.platform_data; | 431 | client->dev.platform_data; |
| 432 | int i = 0; | 432 | int i; |
| 433 | int rpm_range = 1; /* default: 4000 RPM */ | 433 | int rpm_range = 1; /* default: 4000 RPM */ |
| 434 | int err = 0; | 434 | int err; |
| 435 | 435 | ||
| 436 | /* Reset chip to default values, see below for GCONFIG setup */ | 436 | /* Reset chip to default values, see below for GCONFIG setup */ |
| 437 | err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG, | 437 | err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG, |
| @@ -446,11 +446,6 @@ static int max6639_init_client(struct i2c_client *client) | |||
| 446 | else | 446 | else |
| 447 | data->ppr = 2; | 447 | data->ppr = 2; |
| 448 | data->ppr -= 1; | 448 | data->ppr -= 1; |
| 449 | err = i2c_smbus_write_byte_data(client, | ||
| 450 | MAX6639_REG_FAN_PPR(i), | ||
| 451 | data->ppr << 5); | ||
| 452 | if (err) | ||
| 453 | goto exit; | ||
| 454 | 449 | ||
| 455 | if (max6639_info) | 450 | if (max6639_info) |
| 456 | rpm_range = rpm_range_to_reg(max6639_info->rpm_range); | 451 | rpm_range = rpm_range_to_reg(max6639_info->rpm_range); |
| @@ -458,6 +453,13 @@ static int max6639_init_client(struct i2c_client *client) | |||
| 458 | 453 | ||
| 459 | for (i = 0; i < 2; i++) { | 454 | for (i = 0; i < 2; i++) { |
| 460 | 455 | ||
| 456 | /* Set Fan pulse per revolution */ | ||
| 457 | err = i2c_smbus_write_byte_data(client, | ||
| 458 | MAX6639_REG_FAN_PPR(i), | ||
| 459 | data->ppr << 6); | ||
| 460 | if (err) | ||
| 461 | goto exit; | ||
| 462 | |||
| 461 | /* Fans config PWM, RPM */ | 463 | /* Fans config PWM, RPM */ |
| 462 | err = i2c_smbus_write_byte_data(client, | 464 | err = i2c_smbus_write_byte_data(client, |
| 463 | MAX6639_REG_FAN_CONFIG1(i), | 465 | MAX6639_REG_FAN_CONFIG1(i), |
diff --git a/drivers/hwmon/pmbus/max34440.c b/drivers/hwmon/pmbus/max34440.c index beaf5a8d9c45..9b97a5b3cf3d 100644 --- a/drivers/hwmon/pmbus/max34440.c +++ b/drivers/hwmon/pmbus/max34440.c | |||
| @@ -82,7 +82,7 @@ static int max34440_write_word_data(struct i2c_client *client, int page, | |||
| 82 | case PMBUS_VIRT_RESET_TEMP_HISTORY: | 82 | case PMBUS_VIRT_RESET_TEMP_HISTORY: |
| 83 | ret = pmbus_write_word_data(client, page, | 83 | ret = pmbus_write_word_data(client, page, |
| 84 | MAX34440_MFR_TEMPERATURE_PEAK, | 84 | MAX34440_MFR_TEMPERATURE_PEAK, |
| 85 | 0xffff); | 85 | 0x8000); |
| 86 | break; | 86 | break; |
| 87 | default: | 87 | default: |
| 88 | ret = -ENODATA; | 88 | ret = -ENODATA; |
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 58832e578fff..8d1ab6fa88e1 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
| @@ -196,7 +196,7 @@ static int i2c_imx_start(struct imx_i2c_struct *i2c_imx) | |||
| 196 | 196 | ||
| 197 | dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); | 197 | dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); |
| 198 | 198 | ||
| 199 | clk_enable(i2c_imx->clk); | 199 | clk_prepare_enable(i2c_imx->clk); |
| 200 | writeb(i2c_imx->ifdr, i2c_imx->base + IMX_I2C_IFDR); | 200 | writeb(i2c_imx->ifdr, i2c_imx->base + IMX_I2C_IFDR); |
| 201 | /* Enable I2C controller */ | 201 | /* Enable I2C controller */ |
| 202 | writeb(0, i2c_imx->base + IMX_I2C_I2SR); | 202 | writeb(0, i2c_imx->base + IMX_I2C_I2SR); |
| @@ -245,7 +245,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) | |||
| 245 | 245 | ||
| 246 | /* Disable I2C controller */ | 246 | /* Disable I2C controller */ |
| 247 | writeb(0, i2c_imx->base + IMX_I2C_I2CR); | 247 | writeb(0, i2c_imx->base + IMX_I2C_I2CR); |
| 248 | clk_disable(i2c_imx->clk); | 248 | clk_disable_unprepare(i2c_imx->clk); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, | 251 | static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, |
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 7e78f7c87857..3d471d56bf15 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c | |||
| @@ -72,6 +72,7 @@ | |||
| 72 | 72 | ||
| 73 | #define MXS_I2C_QUEUESTAT (0x70) | 73 | #define MXS_I2C_QUEUESTAT (0x70) |
| 74 | #define MXS_I2C_QUEUESTAT_RD_QUEUE_EMPTY 0x00002000 | 74 | #define MXS_I2C_QUEUESTAT_RD_QUEUE_EMPTY 0x00002000 |
| 75 | #define MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK 0x0000001F | ||
| 75 | 76 | ||
| 76 | #define MXS_I2C_QUEUECMD (0x80) | 77 | #define MXS_I2C_QUEUECMD (0x80) |
| 77 | 78 | ||
| @@ -219,14 +220,14 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, | |||
| 219 | int ret; | 220 | int ret; |
| 220 | int flags; | 221 | int flags; |
| 221 | 222 | ||
| 222 | init_completion(&i2c->cmd_complete); | ||
| 223 | |||
| 224 | dev_dbg(i2c->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n", | 223 | dev_dbg(i2c->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n", |
| 225 | msg->addr, msg->len, msg->flags, stop); | 224 | msg->addr, msg->len, msg->flags, stop); |
| 226 | 225 | ||
| 227 | if (msg->len == 0) | 226 | if (msg->len == 0) |
| 228 | return -EINVAL; | 227 | return -EINVAL; |
| 229 | 228 | ||
| 229 | init_completion(&i2c->cmd_complete); | ||
| 230 | |||
| 230 | flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0; | 231 | flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0; |
| 231 | 232 | ||
| 232 | if (msg->flags & I2C_M_RD) | 233 | if (msg->flags & I2C_M_RD) |
| @@ -286,6 +287,7 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id) | |||
| 286 | { | 287 | { |
| 287 | struct mxs_i2c_dev *i2c = dev_id; | 288 | struct mxs_i2c_dev *i2c = dev_id; |
| 288 | u32 stat = readl(i2c->regs + MXS_I2C_CTRL1) & MXS_I2C_IRQ_MASK; | 289 | u32 stat = readl(i2c->regs + MXS_I2C_CTRL1) & MXS_I2C_IRQ_MASK; |
| 290 | bool is_last_cmd; | ||
| 289 | 291 | ||
| 290 | if (!stat) | 292 | if (!stat) |
| 291 | return IRQ_NONE; | 293 | return IRQ_NONE; |
| @@ -300,9 +302,14 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id) | |||
| 300 | else | 302 | else |
| 301 | i2c->cmd_err = 0; | 303 | i2c->cmd_err = 0; |
| 302 | 304 | ||
| 303 | complete(&i2c->cmd_complete); | 305 | is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) & |
| 306 | MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0; | ||
| 307 | |||
| 308 | if (is_last_cmd || i2c->cmd_err) | ||
| 309 | complete(&i2c->cmd_complete); | ||
| 304 | 310 | ||
| 305 | writel(stat, i2c->regs + MXS_I2C_CTRL1_CLR); | 311 | writel(stat, i2c->regs + MXS_I2C_CTRL1_CLR); |
| 312 | |||
| 306 | return IRQ_HANDLED; | 313 | return IRQ_HANDLED; |
| 307 | } | 314 | } |
| 308 | 315 | ||
diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c index 288da5c1499d..103dbd92e256 100644 --- a/drivers/iommu/omap-iommu-debug.c +++ b/drivers/iommu/omap-iommu-debug.c | |||
| @@ -44,7 +44,8 @@ static ssize_t debug_read_ver(struct file *file, char __user *userbuf, | |||
| 44 | static ssize_t debug_read_regs(struct file *file, char __user *userbuf, | 44 | static ssize_t debug_read_regs(struct file *file, char __user *userbuf, |
| 45 | size_t count, loff_t *ppos) | 45 | size_t count, loff_t *ppos) |
| 46 | { | 46 | { |
| 47 | struct omap_iommu *obj = file->private_data; | 47 | struct device *dev = file->private_data; |
| 48 | struct omap_iommu *obj = dev_to_omap_iommu(dev); | ||
| 48 | char *p, *buf; | 49 | char *p, *buf; |
| 49 | ssize_t bytes; | 50 | ssize_t bytes; |
| 50 | 51 | ||
| @@ -67,7 +68,8 @@ static ssize_t debug_read_regs(struct file *file, char __user *userbuf, | |||
| 67 | static ssize_t debug_read_tlb(struct file *file, char __user *userbuf, | 68 | static ssize_t debug_read_tlb(struct file *file, char __user *userbuf, |
| 68 | size_t count, loff_t *ppos) | 69 | size_t count, loff_t *ppos) |
| 69 | { | 70 | { |
| 70 | struct omap_iommu *obj = file->private_data; | 71 | struct device *dev = file->private_data; |
| 72 | struct omap_iommu *obj = dev_to_omap_iommu(dev); | ||
| 71 | char *p, *buf; | 73 | char *p, *buf; |
| 72 | ssize_t bytes, rest; | 74 | ssize_t bytes, rest; |
| 73 | 75 | ||
| @@ -97,7 +99,8 @@ static ssize_t debug_write_pagetable(struct file *file, | |||
| 97 | struct iotlb_entry e; | 99 | struct iotlb_entry e; |
| 98 | struct cr_regs cr; | 100 | struct cr_regs cr; |
| 99 | int err; | 101 | int err; |
| 100 | struct omap_iommu *obj = file->private_data; | 102 | struct device *dev = file->private_data; |
| 103 | struct omap_iommu *obj = dev_to_omap_iommu(dev); | ||
| 101 | char buf[MAXCOLUMN], *p = buf; | 104 | char buf[MAXCOLUMN], *p = buf; |
| 102 | 105 | ||
| 103 | count = min(count, sizeof(buf)); | 106 | count = min(count, sizeof(buf)); |
| @@ -184,7 +187,8 @@ out: | |||
| 184 | static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf, | 187 | static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf, |
| 185 | size_t count, loff_t *ppos) | 188 | size_t count, loff_t *ppos) |
| 186 | { | 189 | { |
| 187 | struct omap_iommu *obj = file->private_data; | 190 | struct device *dev = file->private_data; |
| 191 | struct omap_iommu *obj = dev_to_omap_iommu(dev); | ||
| 188 | char *p, *buf; | 192 | char *p, *buf; |
| 189 | size_t bytes; | 193 | size_t bytes; |
| 190 | 194 | ||
| @@ -212,7 +216,8 @@ static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf, | |||
| 212 | static ssize_t debug_read_mmap(struct file *file, char __user *userbuf, | 216 | static ssize_t debug_read_mmap(struct file *file, char __user *userbuf, |
| 213 | size_t count, loff_t *ppos) | 217 | size_t count, loff_t *ppos) |
| 214 | { | 218 | { |
| 215 | struct omap_iommu *obj = file->private_data; | 219 | struct device *dev = file->private_data; |
| 220 | struct omap_iommu *obj = dev_to_omap_iommu(dev); | ||
| 216 | char *p, *buf; | 221 | char *p, *buf; |
| 217 | struct iovm_struct *tmp; | 222 | struct iovm_struct *tmp; |
| 218 | int uninitialized_var(i); | 223 | int uninitialized_var(i); |
| @@ -254,7 +259,7 @@ static ssize_t debug_read_mmap(struct file *file, char __user *userbuf, | |||
| 254 | static ssize_t debug_read_mem(struct file *file, char __user *userbuf, | 259 | static ssize_t debug_read_mem(struct file *file, char __user *userbuf, |
| 255 | size_t count, loff_t *ppos) | 260 | size_t count, loff_t *ppos) |
| 256 | { | 261 | { |
| 257 | struct omap_iommu *obj = file->private_data; | 262 | struct device *dev = file->private_data; |
| 258 | char *p, *buf; | 263 | char *p, *buf; |
| 259 | struct iovm_struct *area; | 264 | struct iovm_struct *area; |
| 260 | ssize_t bytes; | 265 | ssize_t bytes; |
| @@ -268,8 +273,8 @@ static ssize_t debug_read_mem(struct file *file, char __user *userbuf, | |||
| 268 | 273 | ||
| 269 | mutex_lock(&iommu_debug_lock); | 274 | mutex_lock(&iommu_debug_lock); |
| 270 | 275 | ||
| 271 | area = omap_find_iovm_area(obj, (u32)ppos); | 276 | area = omap_find_iovm_area(dev, (u32)ppos); |
| 272 | if (IS_ERR(area)) { | 277 | if (!area) { |
| 273 | bytes = -EINVAL; | 278 | bytes = -EINVAL; |
| 274 | goto err_out; | 279 | goto err_out; |
| 275 | } | 280 | } |
| @@ -287,7 +292,7 @@ err_out: | |||
| 287 | static ssize_t debug_write_mem(struct file *file, const char __user *userbuf, | 292 | static ssize_t debug_write_mem(struct file *file, const char __user *userbuf, |
| 288 | size_t count, loff_t *ppos) | 293 | size_t count, loff_t *ppos) |
| 289 | { | 294 | { |
| 290 | struct omap_iommu *obj = file->private_data; | 295 | struct device *dev = file->private_data; |
| 291 | struct iovm_struct *area; | 296 | struct iovm_struct *area; |
| 292 | char *p, *buf; | 297 | char *p, *buf; |
| 293 | 298 | ||
| @@ -305,8 +310,8 @@ static ssize_t debug_write_mem(struct file *file, const char __user *userbuf, | |||
| 305 | goto err_out; | 310 | goto err_out; |
| 306 | } | 311 | } |
| 307 | 312 | ||
| 308 | area = omap_find_iovm_area(obj, (u32)ppos); | 313 | area = omap_find_iovm_area(dev, (u32)ppos); |
| 309 | if (IS_ERR(area)) { | 314 | if (!area) { |
| 310 | count = -EINVAL; | 315 | count = -EINVAL; |
| 311 | goto err_out; | 316 | goto err_out; |
| 312 | } | 317 | } |
| @@ -350,7 +355,7 @@ DEBUG_FOPS(mem); | |||
| 350 | { \ | 355 | { \ |
| 351 | struct dentry *dent; \ | 356 | struct dentry *dent; \ |
| 352 | dent = debugfs_create_file(#attr, mode, parent, \ | 357 | dent = debugfs_create_file(#attr, mode, parent, \ |
| 353 | obj, &debug_##attr##_fops); \ | 358 | dev, &debug_##attr##_fops); \ |
| 354 | if (!dent) \ | 359 | if (!dent) \ |
| 355 | return -ENOMEM; \ | 360 | return -ENOMEM; \ |
| 356 | } | 361 | } |
| @@ -362,20 +367,29 @@ static int iommu_debug_register(struct device *dev, void *data) | |||
| 362 | { | 367 | { |
| 363 | struct platform_device *pdev = to_platform_device(dev); | 368 | struct platform_device *pdev = to_platform_device(dev); |
| 364 | struct omap_iommu *obj = platform_get_drvdata(pdev); | 369 | struct omap_iommu *obj = platform_get_drvdata(pdev); |
| 370 | struct omap_iommu_arch_data *arch_data; | ||
| 365 | struct dentry *d, *parent; | 371 | struct dentry *d, *parent; |
| 366 | 372 | ||
| 367 | if (!obj || !obj->dev) | 373 | if (!obj || !obj->dev) |
| 368 | return -EINVAL; | 374 | return -EINVAL; |
| 369 | 375 | ||
| 376 | arch_data = kzalloc(sizeof(*arch_data), GFP_KERNEL); | ||
| 377 | if (!arch_data) | ||
| 378 | return -ENOMEM; | ||
| 379 | |||
| 380 | arch_data->iommu_dev = obj; | ||
| 381 | |||
| 382 | dev->archdata.iommu = arch_data; | ||
| 383 | |||
| 370 | d = debugfs_create_dir(obj->name, iommu_debug_root); | 384 | d = debugfs_create_dir(obj->name, iommu_debug_root); |
| 371 | if (!d) | 385 | if (!d) |
| 372 | return -ENOMEM; | 386 | goto nomem; |
| 373 | parent = d; | 387 | parent = d; |
| 374 | 388 | ||
| 375 | d = debugfs_create_u8("nr_tlb_entries", 400, parent, | 389 | d = debugfs_create_u8("nr_tlb_entries", 400, parent, |
| 376 | (u8 *)&obj->nr_tlb_entries); | 390 | (u8 *)&obj->nr_tlb_entries); |
| 377 | if (!d) | 391 | if (!d) |
| 378 | return -ENOMEM; | 392 | goto nomem; |
| 379 | 393 | ||
| 380 | DEBUG_ADD_FILE_RO(ver); | 394 | DEBUG_ADD_FILE_RO(ver); |
| 381 | DEBUG_ADD_FILE_RO(regs); | 395 | DEBUG_ADD_FILE_RO(regs); |
| @@ -385,6 +399,22 @@ static int iommu_debug_register(struct device *dev, void *data) | |||
| 385 | DEBUG_ADD_FILE(mem); | 399 | DEBUG_ADD_FILE(mem); |
| 386 | 400 | ||
| 387 | return 0; | 401 | return 0; |
| 402 | |||
| 403 | nomem: | ||
| 404 | kfree(arch_data); | ||
| 405 | return -ENOMEM; | ||
| 406 | } | ||
| 407 | |||
| 408 | static int iommu_debug_unregister(struct device *dev, void *data) | ||
| 409 | { | ||
| 410 | if (!dev->archdata.iommu) | ||
| 411 | return 0; | ||
| 412 | |||
| 413 | kfree(dev->archdata.iommu); | ||
| 414 | |||
| 415 | dev->archdata.iommu = NULL; | ||
| 416 | |||
| 417 | return 0; | ||
| 388 | } | 418 | } |
| 389 | 419 | ||
| 390 | static int __init iommu_debug_init(void) | 420 | static int __init iommu_debug_init(void) |
| @@ -411,6 +441,7 @@ module_init(iommu_debug_init) | |||
| 411 | static void __exit iommu_debugfs_exit(void) | 441 | static void __exit iommu_debugfs_exit(void) |
| 412 | { | 442 | { |
| 413 | debugfs_remove_recursive(iommu_debug_root); | 443 | debugfs_remove_recursive(iommu_debug_root); |
| 444 | omap_foreach_iommu_device(NULL, iommu_debug_unregister); | ||
| 414 | } | 445 | } |
| 415 | module_exit(iommu_debugfs_exit) | 446 | module_exit(iommu_debugfs_exit) |
| 416 | 447 | ||
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index d8edd979d01b..6899dcd02dfa 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c | |||
| @@ -1223,7 +1223,8 @@ static int __init omap_iommu_init(void) | |||
| 1223 | 1223 | ||
| 1224 | return platform_driver_register(&omap_iommu_driver); | 1224 | return platform_driver_register(&omap_iommu_driver); |
| 1225 | } | 1225 | } |
| 1226 | module_init(omap_iommu_init); | 1226 | /* must be ready before omap3isp is probed */ |
| 1227 | subsys_initcall(omap_iommu_init); | ||
| 1227 | 1228 | ||
| 1228 | static void __exit omap_iommu_exit(void) | 1229 | static void __exit omap_iommu_exit(void) |
| 1229 | { | 1230 | { |
diff --git a/drivers/media/radio/wl128x/Kconfig b/drivers/media/radio/wl128x/Kconfig index 86b28579f0c7..ea1e6545df36 100644 --- a/drivers/media/radio/wl128x/Kconfig +++ b/drivers/media/radio/wl128x/Kconfig | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | menu "Texas Instruments WL128x FM driver (ST based)" | 4 | menu "Texas Instruments WL128x FM driver (ST based)" |
| 5 | config RADIO_WL128X | 5 | config RADIO_WL128X |
| 6 | tristate "Texas Instruments WL128x FM Radio" | 6 | tristate "Texas Instruments WL128x FM Radio" |
| 7 | depends on VIDEO_V4L2 && RFKILL | 7 | depends on VIDEO_V4L2 && RFKILL && GPIOLIB |
| 8 | select TI_ST if NET && GPIOLIB | 8 | select TI_ST if NET |
| 9 | help | 9 | help |
| 10 | Choose Y here if you have this FM radio chip. | 10 | Choose Y here if you have this FM radio chip. |
| 11 | 11 | ||
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 3aeb29a7ce11..7f26fdf2e54e 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c | |||
| @@ -47,7 +47,7 @@ | |||
| 47 | #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" | 47 | #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" |
| 48 | #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" | 48 | #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" |
| 49 | #define MOD_NAME "imon" | 49 | #define MOD_NAME "imon" |
| 50 | #define MOD_VERSION "0.9.3" | 50 | #define MOD_VERSION "0.9.4" |
| 51 | 51 | ||
| 52 | #define DISPLAY_MINOR_BASE 144 | 52 | #define DISPLAY_MINOR_BASE 144 |
| 53 | #define DEVICE_NAME "lcd%d" | 53 | #define DEVICE_NAME "lcd%d" |
| @@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb) | |||
| 1658 | return; | 1658 | return; |
| 1659 | 1659 | ||
| 1660 | ictx = (struct imon_context *)urb->context; | 1660 | ictx = (struct imon_context *)urb->context; |
| 1661 | if (!ictx || !ictx->dev_present_intf0) | 1661 | if (!ictx) |
| 1662 | return; | 1662 | return; |
| 1663 | 1663 | ||
| 1664 | /* | ||
| 1665 | * if we get a callback before we're done configuring the hardware, we | ||
| 1666 | * can't yet process the data, as there's nowhere to send it, but we | ||
| 1667 | * still need to submit a new rx URB to avoid wedging the hardware | ||
| 1668 | */ | ||
| 1669 | if (!ictx->dev_present_intf0) | ||
| 1670 | goto out; | ||
| 1671 | |||
| 1664 | switch (urb->status) { | 1672 | switch (urb->status) { |
| 1665 | case -ENOENT: /* usbcore unlink successful! */ | 1673 | case -ENOENT: /* usbcore unlink successful! */ |
| 1666 | return; | 1674 | return; |
| @@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb) | |||
| 1678 | break; | 1686 | break; |
| 1679 | } | 1687 | } |
| 1680 | 1688 | ||
| 1689 | out: | ||
| 1681 | usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC); | 1690 | usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC); |
| 1682 | } | 1691 | } |
| 1683 | 1692 | ||
| @@ -1690,9 +1699,17 @@ static void usb_rx_callback_intf1(struct urb *urb) | |||
| 1690 | return; | 1699 | return; |
| 1691 | 1700 | ||
| 1692 | ictx = (struct imon_context *)urb->context; | 1701 | ictx = (struct imon_context *)urb->context; |
| 1693 | if (!ictx || !ictx->dev_present_intf1) | 1702 | if (!ictx) |
| 1694 | return; | 1703 | return; |
| 1695 | 1704 | ||
| 1705 | /* | ||
| 1706 | * if we get a callback before we're done configuring the hardware, we | ||
| 1707 | * can't yet process the data, as there's nowhere to send it, but we | ||
| 1708 | * still need to submit a new rx URB to avoid wedging the hardware | ||
| 1709 | */ | ||
| 1710 | if (!ictx->dev_present_intf1) | ||
| 1711 | goto out; | ||
| 1712 | |||
| 1696 | switch (urb->status) { | 1713 | switch (urb->status) { |
| 1697 | case -ENOENT: /* usbcore unlink successful! */ | 1714 | case -ENOENT: /* usbcore unlink successful! */ |
| 1698 | return; | 1715 | return; |
| @@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb) | |||
| 1710 | break; | 1727 | break; |
| 1711 | } | 1728 | } |
| 1712 | 1729 | ||
| 1730 | out: | ||
| 1713 | usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC); | 1731 | usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC); |
| 1714 | } | 1732 | } |
| 1715 | 1733 | ||
| @@ -2242,7 +2260,7 @@ find_endpoint_failed: | |||
| 2242 | mutex_unlock(&ictx->lock); | 2260 | mutex_unlock(&ictx->lock); |
| 2243 | usb_free_urb(rx_urb); | 2261 | usb_free_urb(rx_urb); |
| 2244 | rx_urb_alloc_failed: | 2262 | rx_urb_alloc_failed: |
| 2245 | dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret); | 2263 | dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret); |
| 2246 | 2264 | ||
| 2247 | return NULL; | 2265 | return NULL; |
| 2248 | } | 2266 | } |
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c index e5eb56a5b618..6510110f53d0 100644 --- a/drivers/media/video/hdpvr/hdpvr-core.c +++ b/drivers/media/video/hdpvr/hdpvr-core.c | |||
| @@ -154,10 +154,20 @@ static int device_authorization(struct hdpvr_device *dev) | |||
| 154 | } | 154 | } |
| 155 | #endif | 155 | #endif |
| 156 | 156 | ||
| 157 | dev->fw_ver = dev->usbc_buf[1]; | ||
| 158 | |||
| 157 | v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", | 159 | v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", |
| 158 | dev->usbc_buf[1], &dev->usbc_buf[2]); | 160 | dev->fw_ver, &dev->usbc_buf[2]); |
| 161 | |||
| 162 | if (dev->fw_ver > 0x15) { | ||
| 163 | dev->options.brightness = 0x80; | ||
| 164 | dev->options.contrast = 0x40; | ||
| 165 | dev->options.hue = 0xf; | ||
| 166 | dev->options.saturation = 0x40; | ||
| 167 | dev->options.sharpness = 0x80; | ||
| 168 | } | ||
| 159 | 169 | ||
| 160 | switch (dev->usbc_buf[1]) { | 170 | switch (dev->fw_ver) { |
| 161 | case HDPVR_FIRMWARE_VERSION: | 171 | case HDPVR_FIRMWARE_VERSION: |
| 162 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; | 172 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; |
| 163 | break; | 173 | break; |
| @@ -169,7 +179,7 @@ static int device_authorization(struct hdpvr_device *dev) | |||
| 169 | default: | 179 | default: |
| 170 | v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might" | 180 | v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might" |
| 171 | " not work.\n"); | 181 | " not work.\n"); |
| 172 | if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3) | 182 | if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3) |
| 173 | dev->flags |= HDPVR_FLAG_AC3_CAP; | 183 | dev->flags |= HDPVR_FLAG_AC3_CAP; |
| 174 | else | 184 | else |
| 175 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; | 185 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; |
| @@ -270,6 +280,8 @@ static const struct hdpvr_options hdpvr_default_options = { | |||
| 270 | .bitrate_mode = HDPVR_CONSTANT, | 280 | .bitrate_mode = HDPVR_CONSTANT, |
| 271 | .gop_mode = HDPVR_SIMPLE_IDR_GOP, | 281 | .gop_mode = HDPVR_SIMPLE_IDR_GOP, |
| 272 | .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC, | 282 | .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC, |
| 283 | /* original picture controls for firmware version <= 0x15 */ | ||
| 284 | /* updated in device_authorization() for newer firmware */ | ||
| 273 | .brightness = 0x86, | 285 | .brightness = 0x86, |
| 274 | .contrast = 0x80, | 286 | .contrast = 0x80, |
| 275 | .hue = 0x80, | 287 | .hue = 0x80, |
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c index 087f7c08cb85..11ffe9cc1780 100644 --- a/drivers/media/video/hdpvr/hdpvr-video.c +++ b/drivers/media/video/hdpvr/hdpvr-video.c | |||
| @@ -283,12 +283,13 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev) | |||
| 283 | 283 | ||
| 284 | hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00); | 284 | hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00); |
| 285 | 285 | ||
| 286 | dev->status = STATUS_STREAMING; | ||
| 287 | |||
| 286 | INIT_WORK(&dev->worker, hdpvr_transmit_buffers); | 288 | INIT_WORK(&dev->worker, hdpvr_transmit_buffers); |
| 287 | queue_work(dev->workqueue, &dev->worker); | 289 | queue_work(dev->workqueue, &dev->worker); |
| 288 | 290 | ||
| 289 | v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev, | 291 | v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev, |
| 290 | "streaming started\n"); | 292 | "streaming started\n"); |
| 291 | dev->status = STATUS_STREAMING; | ||
| 292 | 293 | ||
| 293 | return 0; | 294 | return 0; |
| 294 | } | 295 | } |
| @@ -722,21 +723,39 @@ static const s32 supported_v4l2_ctrls[] = { | |||
| 722 | }; | 723 | }; |
| 723 | 724 | ||
| 724 | static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc, | 725 | static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc, |
| 725 | int ac3) | 726 | int ac3, int fw_ver) |
| 726 | { | 727 | { |
| 727 | int err; | 728 | int err; |
| 728 | 729 | ||
| 730 | if (fw_ver > 0x15) { | ||
| 731 | switch (qc->id) { | ||
| 732 | case V4L2_CID_BRIGHTNESS: | ||
| 733 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 734 | case V4L2_CID_CONTRAST: | ||
| 735 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40); | ||
| 736 | case V4L2_CID_SATURATION: | ||
| 737 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40); | ||
| 738 | case V4L2_CID_HUE: | ||
| 739 | return v4l2_ctrl_query_fill(qc, 0x0, 0x1e, 1, 0xf); | ||
| 740 | case V4L2_CID_SHARPNESS: | ||
| 741 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 742 | } | ||
| 743 | } else { | ||
| 744 | switch (qc->id) { | ||
| 745 | case V4L2_CID_BRIGHTNESS: | ||
| 746 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86); | ||
| 747 | case V4L2_CID_CONTRAST: | ||
| 748 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 749 | case V4L2_CID_SATURATION: | ||
| 750 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 751 | case V4L2_CID_HUE: | ||
| 752 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 753 | case V4L2_CID_SHARPNESS: | ||
| 754 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 755 | } | ||
| 756 | } | ||
| 757 | |||
| 729 | switch (qc->id) { | 758 | switch (qc->id) { |
| 730 | case V4L2_CID_BRIGHTNESS: | ||
| 731 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86); | ||
| 732 | case V4L2_CID_CONTRAST: | ||
| 733 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 734 | case V4L2_CID_SATURATION: | ||
| 735 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 736 | case V4L2_CID_HUE: | ||
| 737 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 738 | case V4L2_CID_SHARPNESS: | ||
| 739 | return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | ||
| 740 | case V4L2_CID_MPEG_AUDIO_ENCODING: | 759 | case V4L2_CID_MPEG_AUDIO_ENCODING: |
| 741 | return v4l2_ctrl_query_fill( | 760 | return v4l2_ctrl_query_fill( |
| 742 | qc, V4L2_MPEG_AUDIO_ENCODING_AAC, | 761 | qc, V4L2_MPEG_AUDIO_ENCODING_AAC, |
| @@ -794,7 +813,8 @@ static int vidioc_queryctrl(struct file *file, void *private_data, | |||
| 794 | 813 | ||
| 795 | if (qc->id == supported_v4l2_ctrls[i]) | 814 | if (qc->id == supported_v4l2_ctrls[i]) |
| 796 | return fill_queryctrl(&dev->options, qc, | 815 | return fill_queryctrl(&dev->options, qc, |
| 797 | dev->flags & HDPVR_FLAG_AC3_CAP); | 816 | dev->flags & HDPVR_FLAG_AC3_CAP, |
| 817 | dev->fw_ver); | ||
| 798 | 818 | ||
| 799 | if (qc->id < supported_v4l2_ctrls[i]) | 819 | if (qc->id < supported_v4l2_ctrls[i]) |
| 800 | break; | 820 | break; |
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h index d6439db1d18b..fea3c6926997 100644 --- a/drivers/media/video/hdpvr/hdpvr.h +++ b/drivers/media/video/hdpvr/hdpvr.h | |||
| @@ -113,6 +113,7 @@ struct hdpvr_device { | |||
| 113 | /* usb control transfer buffer and lock */ | 113 | /* usb control transfer buffer and lock */ |
| 114 | struct mutex usbc_mutex; | 114 | struct mutex usbc_mutex; |
| 115 | u8 *usbc_buf; | 115 | u8 *usbc_buf; |
| 116 | u8 fw_ver; | ||
| 116 | }; | 117 | }; |
| 117 | 118 | ||
| 118 | static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev) | 119 | static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev) |
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c index a74a79701d34..eaabc27f0fa2 100644 --- a/drivers/media/video/omap3isp/ispccdc.c +++ b/drivers/media/video/omap3isp/ispccdc.c | |||
| @@ -1407,7 +1407,7 @@ static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event) | |||
| 1407 | static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc) | 1407 | static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc) |
| 1408 | { | 1408 | { |
| 1409 | struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); | 1409 | struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); |
| 1410 | struct video_device *vdev = &ccdc->subdev.devnode; | 1410 | struct video_device *vdev = ccdc->subdev.devnode; |
| 1411 | struct v4l2_event event; | 1411 | struct v4l2_event event; |
| 1412 | 1412 | ||
| 1413 | memset(&event, 0, sizeof(event)); | 1413 | memset(&event, 0, sizeof(event)); |
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index f147395bac9a..1489c3540f96 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
| @@ -201,6 +201,7 @@ config MENELAUS | |||
| 201 | config TWL4030_CORE | 201 | config TWL4030_CORE |
| 202 | bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support" | 202 | bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support" |
| 203 | depends on I2C=y && GENERIC_HARDIRQS | 203 | depends on I2C=y && GENERIC_HARDIRQS |
| 204 | select IRQ_DOMAIN | ||
| 204 | help | 205 | help |
| 205 | Say yes here if you have TWL4030 / TWL6030 family chip on your board. | 206 | Say yes here if you have TWL4030 / TWL6030 family chip on your board. |
| 206 | This core driver provides register access and IRQ handling | 207 | This core driver provides register access and IRQ handling |
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 8ce3959c6919..4970d43952db 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
| @@ -149,7 +149,7 @@ | |||
| 149 | 149 | ||
| 150 | #define TWL_MODULE_LAST TWL4030_MODULE_LAST | 150 | #define TWL_MODULE_LAST TWL4030_MODULE_LAST |
| 151 | 151 | ||
| 152 | #define TWL4030_NR_IRQS 8 | 152 | #define TWL4030_NR_IRQS 34 /* core:8, power:8, gpio: 18 */ |
| 153 | #define TWL6030_NR_IRQS 20 | 153 | #define TWL6030_NR_IRQS 20 |
| 154 | 154 | ||
| 155 | /* Base Address defns for twl4030_map[] */ | 155 | /* Base Address defns for twl4030_map[] */ |
| @@ -263,10 +263,6 @@ struct twl_client { | |||
| 263 | 263 | ||
| 264 | static struct twl_client twl_modules[TWL_NUM_SLAVES]; | 264 | static struct twl_client twl_modules[TWL_NUM_SLAVES]; |
| 265 | 265 | ||
| 266 | #ifdef CONFIG_IRQ_DOMAIN | ||
| 267 | static struct irq_domain domain; | ||
| 268 | #endif | ||
| 269 | |||
| 270 | /* mapping the module id to slave id and base address */ | 266 | /* mapping the module id to slave id and base address */ |
| 271 | struct twl_mapping { | 267 | struct twl_mapping { |
| 272 | unsigned char sid; /* Slave ID */ | 268 | unsigned char sid; /* Slave ID */ |
| @@ -1227,14 +1223,8 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
| 1227 | 1223 | ||
| 1228 | pdata->irq_base = status; | 1224 | pdata->irq_base = status; |
| 1229 | pdata->irq_end = pdata->irq_base + nr_irqs; | 1225 | pdata->irq_end = pdata->irq_base + nr_irqs; |
| 1230 | 1226 | irq_domain_add_legacy(node, nr_irqs, pdata->irq_base, 0, | |
| 1231 | #ifdef CONFIG_IRQ_DOMAIN | 1227 | &irq_domain_simple_ops, NULL); |
| 1232 | domain.irq_base = pdata->irq_base; | ||
| 1233 | domain.nr_irq = nr_irqs; | ||
| 1234 | domain.of_node = of_node_get(node); | ||
| 1235 | domain.ops = &irq_domain_simple_ops; | ||
| 1236 | irq_domain_add(&domain); | ||
| 1237 | #endif | ||
| 1238 | 1228 | ||
| 1239 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { | 1229 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { |
| 1240 | dev_dbg(&client->dev, "can't talk I2C?\n"); | 1230 | dev_dbg(&client->dev, "can't talk I2C?\n"); |
| @@ -1315,11 +1305,10 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
| 1315 | twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); | 1305 | twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); |
| 1316 | } | 1306 | } |
| 1317 | 1307 | ||
| 1318 | #ifdef CONFIG_OF_DEVICE | 1308 | status = -ENODEV; |
| 1319 | if (node) | 1309 | if (node) |
| 1320 | status = of_platform_populate(node, NULL, NULL, &client->dev); | 1310 | status = of_platform_populate(node, NULL, NULL, &client->dev); |
| 1321 | else | 1311 | if (status) |
| 1322 | #endif | ||
| 1323 | status = add_children(pdata, id->driver_data); | 1312 | status = add_children(pdata, id->driver_data); |
| 1324 | 1313 | ||
| 1325 | fail: | 1314 | fail: |
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c index 947faa5d2ce4..efdb81d21c44 100644 --- a/drivers/mmc/host/at91_mci.c +++ b/drivers/mmc/host/at91_mci.c | |||
| @@ -86,7 +86,6 @@ static inline int at91mci_is_mci1rev2xx(void) | |||
| 86 | { | 86 | { |
| 87 | return ( cpu_is_at91sam9260() | 87 | return ( cpu_is_at91sam9260() |
| 88 | || cpu_is_at91sam9263() | 88 | || cpu_is_at91sam9263() |
| 89 | || cpu_is_at91cap9() | ||
| 90 | || cpu_is_at91sam9rl() | 89 | || cpu_is_at91sam9rl() |
| 91 | || cpu_is_at91sam9g10() | 90 | || cpu_is_at91sam9g10() |
| 92 | || cpu_is_at91sam9g20() | 91 | || cpu_is_at91sam9g20() |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 0d955ffaf44e..304f2f98b680 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
| @@ -1325,7 +1325,7 @@ static int __devinit mmci_probe(struct amba_device *dev, | |||
| 1325 | if (ret) | 1325 | if (ret) |
| 1326 | goto unmap; | 1326 | goto unmap; |
| 1327 | 1327 | ||
| 1328 | if (dev->irq[1] == NO_IRQ) | 1328 | if (dev->irq[1] == NO_IRQ || !dev->irq[1]) |
| 1329 | host->singleirq = true; | 1329 | host->singleirq = true; |
| 1330 | else { | 1330 | else { |
| 1331 | ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, | 1331 | ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, |
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index d601e41af282..f4e82d45cafa 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
| @@ -463,7 +463,7 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev) | |||
| 463 | err = PTR_ERR(clk); | 463 | err = PTR_ERR(clk); |
| 464 | goto err_clk_get; | 464 | goto err_clk_get; |
| 465 | } | 465 | } |
| 466 | clk_enable(clk); | 466 | clk_prepare_enable(clk); |
| 467 | pltfm_host->clk = clk; | 467 | pltfm_host->clk = clk; |
| 468 | 468 | ||
| 469 | if (!is_imx25_esdhc(imx_data)) | 469 | if (!is_imx25_esdhc(imx_data)) |
| @@ -558,7 +558,7 @@ no_card_detect_irq: | |||
| 558 | gpio_free(boarddata->wp_gpio); | 558 | gpio_free(boarddata->wp_gpio); |
| 559 | no_card_detect_pin: | 559 | no_card_detect_pin: |
| 560 | no_board_data: | 560 | no_board_data: |
| 561 | clk_disable(pltfm_host->clk); | 561 | clk_disable_unprepare(pltfm_host->clk); |
| 562 | clk_put(pltfm_host->clk); | 562 | clk_put(pltfm_host->clk); |
| 563 | err_clk_get: | 563 | err_clk_get: |
| 564 | kfree(imx_data); | 564 | kfree(imx_data); |
| @@ -585,7 +585,7 @@ static int __devexit sdhci_esdhc_imx_remove(struct platform_device *pdev) | |||
| 585 | gpio_free(boarddata->cd_gpio); | 585 | gpio_free(boarddata->cd_gpio); |
| 586 | } | 586 | } |
| 587 | 587 | ||
| 588 | clk_disable(pltfm_host->clk); | 588 | clk_disable_unprepare(pltfm_host->clk); |
| 589 | clk_put(pltfm_host->clk); | 589 | clk_put(pltfm_host->clk); |
| 590 | kfree(imx_data); | 590 | kfree(imx_data); |
| 591 | 591 | ||
diff --git a/drivers/net/Space.c b/drivers/net/Space.c index 068c3563e00f..88bbd8ffa7fe 100644 --- a/drivers/net/Space.c +++ b/drivers/net/Space.c | |||
| @@ -190,8 +190,10 @@ static struct devprobe2 isa_probes[] __initdata = { | |||
| 190 | {seeq8005_probe, 0}, | 190 | {seeq8005_probe, 0}, |
| 191 | #endif | 191 | #endif |
| 192 | #ifdef CONFIG_CS89x0 | 192 | #ifdef CONFIG_CS89x0 |
| 193 | #ifndef CONFIG_CS89x0_PLATFORM | ||
| 193 | {cs89x0_probe, 0}, | 194 | {cs89x0_probe, 0}, |
| 194 | #endif | 195 | #endif |
| 196 | #endif | ||
| 195 | #ifdef CONFIG_AT1700 | 197 | #ifdef CONFIG_AT1700 |
| 196 | {at1700_probe, 0}, | 198 | {at1700_probe, 0}, |
| 197 | #endif | 199 | #endif |
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index 04a3f1b756a8..192b0d118df4 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c | |||
| @@ -95,11 +95,16 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val) | |||
| 95 | spin_unlock_irqrestore(&priv->cmdreg_lock, flags); | 95 | spin_unlock_irqrestore(&priv->cmdreg_lock, flags); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | static int sja1000_is_absent(struct sja1000_priv *priv) | ||
| 99 | { | ||
| 100 | return (priv->read_reg(priv, REG_MOD) == 0xFF); | ||
| 101 | } | ||
| 102 | |||
| 98 | static int sja1000_probe_chip(struct net_device *dev) | 103 | static int sja1000_probe_chip(struct net_device *dev) |
| 99 | { | 104 | { |
| 100 | struct sja1000_priv *priv = netdev_priv(dev); | 105 | struct sja1000_priv *priv = netdev_priv(dev); |
| 101 | 106 | ||
| 102 | if (priv->reg_base && (priv->read_reg(priv, 0) == 0xFF)) { | 107 | if (priv->reg_base && sja1000_is_absent(priv)) { |
| 103 | printk(KERN_INFO "%s: probing @0x%lX failed\n", | 108 | printk(KERN_INFO "%s: probing @0x%lX failed\n", |
| 104 | DRV_NAME, dev->base_addr); | 109 | DRV_NAME, dev->base_addr); |
| 105 | return 0; | 110 | return 0; |
| @@ -493,6 +498,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) | |||
| 493 | while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) { | 498 | while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) { |
| 494 | n++; | 499 | n++; |
| 495 | status = priv->read_reg(priv, REG_SR); | 500 | status = priv->read_reg(priv, REG_SR); |
| 501 | /* check for absent controller due to hw unplug */ | ||
| 502 | if (status == 0xFF && sja1000_is_absent(priv)) | ||
| 503 | return IRQ_NONE; | ||
| 496 | 504 | ||
| 497 | if (isrc & IRQ_WUI) | 505 | if (isrc & IRQ_WUI) |
| 498 | dev_warn(dev->dev.parent, "wakeup interrupt\n"); | 506 | dev_warn(dev->dev.parent, "wakeup interrupt\n"); |
| @@ -509,6 +517,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) | |||
| 509 | while (status & SR_RBS) { | 517 | while (status & SR_RBS) { |
| 510 | sja1000_rx(dev); | 518 | sja1000_rx(dev); |
| 511 | status = priv->read_reg(priv, REG_SR); | 519 | status = priv->read_reg(priv, REG_SR); |
| 520 | /* check for absent controller */ | ||
| 521 | if (status == 0xFF && sja1000_is_absent(priv)) | ||
| 522 | return IRQ_NONE; | ||
| 512 | } | 523 | } |
| 513 | } | 524 | } |
| 514 | if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) { | 525 | if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) { |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index b8591246eb4c..1ff3c6df35a2 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
| @@ -2244,10 +2244,6 @@ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb, | |||
| 2244 | dev_info(&adapter->pdev->dev, "tx locked\n"); | 2244 | dev_info(&adapter->pdev->dev, "tx locked\n"); |
| 2245 | return NETDEV_TX_LOCKED; | 2245 | return NETDEV_TX_LOCKED; |
| 2246 | } | 2246 | } |
| 2247 | if (skb->mark == 0x01) | ||
| 2248 | type = atl1c_trans_high; | ||
| 2249 | else | ||
| 2250 | type = atl1c_trans_normal; | ||
| 2251 | 2247 | ||
| 2252 | if (atl1c_tpd_avail(adapter, type) < tpd_req) { | 2248 | if (atl1c_tpd_avail(adapter, type) < tpd_req) { |
| 2253 | /* no enough descriptor, just stop queue */ | 2249 | /* no enough descriptor, just stop queue */ |
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 3fb66d09ece5..cab87456a34a 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
| @@ -2339,7 +2339,7 @@ static inline int __init b44_pci_init(void) | |||
| 2339 | return err; | 2339 | return err; |
| 2340 | } | 2340 | } |
| 2341 | 2341 | ||
| 2342 | static inline void __exit b44_pci_exit(void) | 2342 | static inline void b44_pci_exit(void) |
| 2343 | { | 2343 | { |
| 2344 | #ifdef CONFIG_B44_PCI | 2344 | #ifdef CONFIG_B44_PCI |
| 2345 | ssb_pcihost_unregister(&b44_pci_driver); | 2345 | ssb_pcihost_unregister(&b44_pci_driver); |
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index dd3a0a232ea0..818a573669e6 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
| @@ -3584,7 +3584,11 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr, | |||
| 3584 | fl6.flowi6_oif = dst_addr->sin6_scope_id; | 3584 | fl6.flowi6_oif = dst_addr->sin6_scope_id; |
| 3585 | 3585 | ||
| 3586 | *dst = ip6_route_output(&init_net, NULL, &fl6); | 3586 | *dst = ip6_route_output(&init_net, NULL, &fl6); |
| 3587 | if (*dst) | 3587 | if ((*dst)->error) { |
| 3588 | dst_release(*dst); | ||
| 3589 | *dst = NULL; | ||
| 3590 | return -ENETUNREACH; | ||
| 3591 | } else | ||
| 3588 | return 0; | 3592 | return 0; |
| 3589 | #endif | 3593 | #endif |
| 3590 | 3594 | ||
diff --git a/drivers/net/ethernet/cirrus/Kconfig b/drivers/net/ethernet/cirrus/Kconfig index 1f8648f099c7..8388e36cf08f 100644 --- a/drivers/net/ethernet/cirrus/Kconfig +++ b/drivers/net/ethernet/cirrus/Kconfig | |||
| @@ -5,8 +5,7 @@ | |||
| 5 | config NET_VENDOR_CIRRUS | 5 | config NET_VENDOR_CIRRUS |
| 6 | bool "Cirrus devices" | 6 | bool "Cirrus devices" |
| 7 | default y | 7 | default y |
| 8 | depends on ISA || EISA || MACH_IXDP2351 || ARCH_IXDP2X01 \ | 8 | depends on ISA || EISA || ARM || MAC |
| 9 | || MACH_MX31ADS || MACH_QQ2440 || (ARM && ARCH_EP93XX) || MAC | ||
| 10 | ---help--- | 9 | ---help--- |
| 11 | If you have a network (Ethernet) card belonging to this class, say Y | 10 | If you have a network (Ethernet) card belonging to this class, say Y |
| 12 | and read the Ethernet-HOWTO, available from | 11 | and read the Ethernet-HOWTO, available from |
| @@ -21,8 +20,7 @@ if NET_VENDOR_CIRRUS | |||
| 21 | 20 | ||
| 22 | config CS89x0 | 21 | config CS89x0 |
| 23 | tristate "CS89x0 support" | 22 | tristate "CS89x0 support" |
| 24 | depends on (ISA || EISA || MACH_IXDP2351 \ | 23 | depends on ISA || EISA || ARM |
| 25 | || ARCH_IXDP2X01 || MACH_MX31ADS || MACH_QQ2440) | ||
| 26 | ---help--- | 24 | ---help--- |
| 27 | Support for CS89x0 chipset based Ethernet cards. If you have a | 25 | Support for CS89x0 chipset based Ethernet cards. If you have a |
| 28 | network (Ethernet) card of this type, say Y and read the | 26 | network (Ethernet) card of this type, say Y and read the |
| @@ -33,10 +31,15 @@ config CS89x0 | |||
| 33 | To compile this driver as a module, choose M here. The module | 31 | To compile this driver as a module, choose M here. The module |
| 34 | will be called cs89x0. | 32 | will be called cs89x0. |
| 35 | 33 | ||
| 36 | config CS89x0_NONISA_IRQ | 34 | config CS89x0_PLATFORM |
| 37 | def_bool y | 35 | bool "CS89x0 platform driver support" |
| 38 | depends on CS89x0 != n | 36 | depends on CS89x0 |
| 39 | depends on MACH_IXDP2351 || ARCH_IXDP2X01 || MACH_MX31ADS || MACH_QQ2440 | 37 | help |
| 38 | Say Y to compile the cs89x0 driver as a platform driver. This | ||
| 39 | makes this driver suitable for use on certain evaluation boards | ||
| 40 | such as the iMX21ADS. | ||
| 41 | |||
| 42 | If you are unsure, say N. | ||
| 40 | 43 | ||
| 41 | config EP93XX_ETH | 44 | config EP93XX_ETH |
| 42 | tristate "EP93xx Ethernet support" | 45 | tristate "EP93xx Ethernet support" |
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c index f328da24c8fa..7202ca951bf3 100644 --- a/drivers/net/ethernet/cirrus/cs89x0.c +++ b/drivers/net/ethernet/cirrus/cs89x0.c | |||
| @@ -100,9 +100,6 @@ | |||
| 100 | 100 | ||
| 101 | */ | 101 | */ |
| 102 | 102 | ||
| 103 | /* Always include 'config.h' first in case the user wants to turn on | ||
| 104 | or override something. */ | ||
| 105 | #include <linux/module.h> | ||
| 106 | 103 | ||
| 107 | /* | 104 | /* |
| 108 | * Set this to zero to disable DMA code | 105 | * Set this to zero to disable DMA code |
| @@ -131,9 +128,12 @@ | |||
| 131 | 128 | ||
| 132 | */ | 129 | */ |
| 133 | 130 | ||
| 131 | #include <linux/module.h> | ||
| 132 | #include <linux/printk.h> | ||
| 134 | #include <linux/errno.h> | 133 | #include <linux/errno.h> |
| 135 | #include <linux/netdevice.h> | 134 | #include <linux/netdevice.h> |
| 136 | #include <linux/etherdevice.h> | 135 | #include <linux/etherdevice.h> |
| 136 | #include <linux/platform_device.h> | ||
| 137 | #include <linux/kernel.h> | 137 | #include <linux/kernel.h> |
| 138 | #include <linux/types.h> | 138 | #include <linux/types.h> |
| 139 | #include <linux/fcntl.h> | 139 | #include <linux/fcntl.h> |
| @@ -151,6 +151,7 @@ | |||
| 151 | #include <asm/system.h> | 151 | #include <asm/system.h> |
| 152 | #include <asm/io.h> | 152 | #include <asm/io.h> |
| 153 | #include <asm/irq.h> | 153 | #include <asm/irq.h> |
| 154 | #include <linux/atomic.h> | ||
| 154 | #if ALLOW_DMA | 155 | #if ALLOW_DMA |
| 155 | #include <asm/dma.h> | 156 | #include <asm/dma.h> |
| 156 | #endif | 157 | #endif |
| @@ -174,26 +175,20 @@ static char version[] __initdata = | |||
| 174 | them to system IRQ numbers. This mapping is card specific and is set to | 175 | them to system IRQ numbers. This mapping is card specific and is set to |
| 175 | the configuration of the Cirrus Eval board for this chip. */ | 176 | the configuration of the Cirrus Eval board for this chip. */ |
| 176 | #if defined(CONFIG_MACH_IXDP2351) | 177 | #if defined(CONFIG_MACH_IXDP2351) |
| 178 | #define CS89x0_NONISA_IRQ | ||
| 177 | static unsigned int netcard_portlist[] __used __initdata = {IXDP2351_VIRT_CS8900_BASE, 0}; | 179 | static unsigned int netcard_portlist[] __used __initdata = {IXDP2351_VIRT_CS8900_BASE, 0}; |
| 178 | static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0}; | 180 | static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0}; |
| 179 | #elif defined(CONFIG_ARCH_IXDP2X01) | 181 | #elif defined(CONFIG_ARCH_IXDP2X01) |
| 182 | #define CS89x0_NONISA_IRQ | ||
| 180 | static unsigned int netcard_portlist[] __used __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; | 183 | static unsigned int netcard_portlist[] __used __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; |
| 181 | static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0}; | 184 | static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0}; |
| 182 | #elif defined(CONFIG_MACH_QQ2440) | ||
| 183 | #include <mach/qq2440.h> | ||
| 184 | static unsigned int netcard_portlist[] __used __initdata = { QQ2440_CS8900_VIRT_BASE + 0x300, 0 }; | ||
| 185 | static unsigned int cs8900_irq_map[] = { QQ2440_CS8900_IRQ, 0, 0, 0 }; | ||
| 186 | #elif defined(CONFIG_MACH_MX31ADS) | ||
| 187 | #include <mach/board-mx31ads.h> | ||
| 188 | static unsigned int netcard_portlist[] __used __initdata = { | ||
| 189 | PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0 | ||
| 190 | }; | ||
| 191 | static unsigned cs8900_irq_map[] = {EXPIO_INT_ENET_INT, 0, 0, 0}; | ||
| 192 | #else | 185 | #else |
| 186 | #ifndef CONFIG_CS89x0_PLATFORM | ||
| 193 | static unsigned int netcard_portlist[] __used __initdata = | 187 | static unsigned int netcard_portlist[] __used __initdata = |
| 194 | { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; | 188 | { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; |
| 195 | static unsigned int cs8900_irq_map[] = {10,11,12,5}; | 189 | static unsigned int cs8900_irq_map[] = {10,11,12,5}; |
| 196 | #endif | 190 | #endif |
| 191 | #endif | ||
| 197 | 192 | ||
| 198 | #if DEBUGGING | 193 | #if DEBUGGING |
| 199 | static unsigned int net_debug = DEBUGGING; | 194 | static unsigned int net_debug = DEBUGGING; |
| @@ -236,11 +231,16 @@ struct net_local { | |||
| 236 | unsigned char *end_dma_buff; /* points to the end of the buffer */ | 231 | unsigned char *end_dma_buff; /* points to the end of the buffer */ |
| 237 | unsigned char *rx_dma_ptr; /* points to the next packet */ | 232 | unsigned char *rx_dma_ptr; /* points to the next packet */ |
| 238 | #endif | 233 | #endif |
| 234 | #ifdef CONFIG_CS89x0_PLATFORM | ||
| 235 | void __iomem *virt_addr;/* Virtual address for accessing the CS89x0. */ | ||
| 236 | unsigned long phys_addr;/* Physical address for accessing the CS89x0. */ | ||
| 237 | unsigned long size; /* Length of CS89x0 memory region. */ | ||
| 238 | #endif | ||
| 239 | }; | 239 | }; |
| 240 | 240 | ||
| 241 | /* Index to functions, as function prototypes. */ | 241 | /* Index to functions, as function prototypes. */ |
| 242 | 242 | ||
| 243 | static int cs89x0_probe1(struct net_device *dev, int ioaddr, int modular); | 243 | static int cs89x0_probe1(struct net_device *dev, unsigned long ioaddr, int modular); |
| 244 | static int net_open(struct net_device *dev); | 244 | static int net_open(struct net_device *dev); |
| 245 | static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev); | 245 | static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev); |
| 246 | static irqreturn_t net_interrupt(int irq, void *dev_id); | 246 | static irqreturn_t net_interrupt(int irq, void *dev_id); |
| @@ -294,6 +294,7 @@ static int __init media_fn(char *str) | |||
| 294 | __setup("cs89x0_media=", media_fn); | 294 | __setup("cs89x0_media=", media_fn); |
| 295 | 295 | ||
| 296 | 296 | ||
| 297 | #ifndef CONFIG_CS89x0_PLATFORM | ||
| 297 | /* Check for a network adaptor of this type, and return '0' iff one exists. | 298 | /* Check for a network adaptor of this type, and return '0' iff one exists. |
| 298 | If dev->base_addr == 0, probe all likely locations. | 299 | If dev->base_addr == 0, probe all likely locations. |
| 299 | If dev->base_addr == 1, always return failure. | 300 | If dev->base_addr == 1, always return failure. |
| @@ -343,6 +344,7 @@ out: | |||
| 343 | return ERR_PTR(err); | 344 | return ERR_PTR(err); |
| 344 | } | 345 | } |
| 345 | #endif | 346 | #endif |
| 347 | #endif | ||
| 346 | 348 | ||
| 347 | #if defined(CONFIG_MACH_IXDP2351) | 349 | #if defined(CONFIG_MACH_IXDP2351) |
| 348 | static u16 | 350 | static u16 |
| @@ -504,7 +506,7 @@ static const struct net_device_ops net_ops = { | |||
| 504 | */ | 506 | */ |
| 505 | 507 | ||
| 506 | static int __init | 508 | static int __init |
| 507 | cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | 509 | cs89x0_probe1(struct net_device *dev, unsigned long ioaddr, int modular) |
| 508 | { | 510 | { |
| 509 | struct net_local *lp = netdev_priv(dev); | 511 | struct net_local *lp = netdev_priv(dev); |
| 510 | static unsigned version_printed; | 512 | static unsigned version_printed; |
| @@ -529,15 +531,12 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | |||
| 529 | lp->force = g_cs89x0_media__force; | 531 | lp->force = g_cs89x0_media__force; |
| 530 | #endif | 532 | #endif |
| 531 | 533 | ||
| 532 | #if defined(CONFIG_MACH_QQ2440) | ||
| 533 | lp->force |= FORCE_RJ45 | FORCE_FULL; | ||
| 534 | #endif | ||
| 535 | } | 534 | } |
| 536 | 535 | ||
| 537 | /* Grab the region so we can find another board if autoIRQ fails. */ | 536 | /* Grab the region so we can find another board if autoIRQ fails. */ |
| 538 | /* WTF is going on here? */ | 537 | /* WTF is going on here? */ |
| 539 | if (!request_region(ioaddr & ~3, NETCARD_IO_EXTENT, DRV_NAME)) { | 538 | if (!request_region(ioaddr & ~3, NETCARD_IO_EXTENT, DRV_NAME)) { |
| 540 | printk(KERN_ERR "%s: request_region(0x%x, 0x%x) failed\n", | 539 | printk(KERN_ERR "%s: request_region(0x%lx, 0x%x) failed\n", |
| 541 | DRV_NAME, ioaddr, NETCARD_IO_EXTENT); | 540 | DRV_NAME, ioaddr, NETCARD_IO_EXTENT); |
| 542 | retval = -EBUSY; | 541 | retval = -EBUSY; |
| 543 | goto out1; | 542 | goto out1; |
| @@ -549,7 +548,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | |||
| 549 | will skip the test for the ADD_PORT. */ | 548 | will skip the test for the ADD_PORT. */ |
| 550 | if (ioaddr & 1) { | 549 | if (ioaddr & 1) { |
| 551 | if (net_debug > 1) | 550 | if (net_debug > 1) |
| 552 | printk(KERN_INFO "%s: odd ioaddr 0x%x\n", dev->name, ioaddr); | 551 | printk(KERN_INFO "%s: odd ioaddr 0x%lx\n", dev->name, ioaddr); |
| 553 | if ((ioaddr & 2) != 2) | 552 | if ((ioaddr & 2) != 2) |
| 554 | if ((readword(ioaddr & ~3, ADD_PORT) & ADD_MASK) != ADD_SIG) { | 553 | if ((readword(ioaddr & ~3, ADD_PORT) & ADD_MASK) != ADD_SIG) { |
| 555 | printk(KERN_ERR "%s: bad signature 0x%x\n", | 554 | printk(KERN_ERR "%s: bad signature 0x%x\n", |
| @@ -560,13 +559,13 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | |||
| 560 | } | 559 | } |
| 561 | 560 | ||
| 562 | ioaddr &= ~3; | 561 | ioaddr &= ~3; |
| 563 | printk(KERN_DEBUG "PP_addr at %x[%x]: 0x%x\n", | 562 | printk(KERN_DEBUG "PP_addr at %lx[%x]: 0x%x\n", |
| 564 | ioaddr, ADD_PORT, readword(ioaddr, ADD_PORT)); | 563 | ioaddr, ADD_PORT, readword(ioaddr, ADD_PORT)); |
| 565 | writeword(ioaddr, ADD_PORT, PP_ChipID); | 564 | writeword(ioaddr, ADD_PORT, PP_ChipID); |
| 566 | 565 | ||
| 567 | tmp = readword(ioaddr, DATA_PORT); | 566 | tmp = readword(ioaddr, DATA_PORT); |
| 568 | if (tmp != CHIP_EISA_ID_SIG) { | 567 | if (tmp != CHIP_EISA_ID_SIG) { |
| 569 | printk(KERN_DEBUG "%s: incorrect signature at %x[%x]: 0x%x!=" | 568 | printk(KERN_DEBUG "%s: incorrect signature at %lx[%x]: 0x%x!=" |
| 570 | CHIP_EISA_ID_SIG_STR "\n", | 569 | CHIP_EISA_ID_SIG_STR "\n", |
| 571 | dev->name, ioaddr, DATA_PORT, tmp); | 570 | dev->name, ioaddr, DATA_PORT, tmp); |
| 572 | retval = -ENODEV; | 571 | retval = -ENODEV; |
| @@ -736,8 +735,9 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | |||
| 736 | dev->irq = i; | 735 | dev->irq = i; |
| 737 | } else { | 736 | } else { |
| 738 | i = lp->isa_config & INT_NO_MASK; | 737 | i = lp->isa_config & INT_NO_MASK; |
| 738 | #ifndef CONFIG_CS89x0_PLATFORM | ||
| 739 | if (lp->chip_type == CS8900) { | 739 | if (lp->chip_type == CS8900) { |
| 740 | #ifdef CONFIG_CS89x0_NONISA_IRQ | 740 | #ifdef CS89x0_NONISA_IRQ |
| 741 | i = cs8900_irq_map[0]; | 741 | i = cs8900_irq_map[0]; |
| 742 | #else | 742 | #else |
| 743 | /* Translate the IRQ using the IRQ mapping table. */ | 743 | /* Translate the IRQ using the IRQ mapping table. */ |
| @@ -758,6 +758,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | |||
| 758 | } | 758 | } |
| 759 | #endif | 759 | #endif |
| 760 | } | 760 | } |
| 761 | #endif | ||
| 761 | if (!dev->irq) | 762 | if (!dev->irq) |
| 762 | dev->irq = i; | 763 | dev->irq = i; |
| 763 | } | 764 | } |
| @@ -1168,6 +1169,7 @@ write_irq(struct net_device *dev, int chip_type, int irq) | |||
| 1168 | int i; | 1169 | int i; |
| 1169 | 1170 | ||
| 1170 | if (chip_type == CS8900) { | 1171 | if (chip_type == CS8900) { |
| 1172 | #ifndef CONFIG_CS89x0_PLATFORM | ||
| 1171 | /* Search the mapping table for the corresponding IRQ pin. */ | 1173 | /* Search the mapping table for the corresponding IRQ pin. */ |
| 1172 | for (i = 0; i != ARRAY_SIZE(cs8900_irq_map); i++) | 1174 | for (i = 0; i != ARRAY_SIZE(cs8900_irq_map); i++) |
| 1173 | if (cs8900_irq_map[i] == irq) | 1175 | if (cs8900_irq_map[i] == irq) |
| @@ -1175,6 +1177,10 @@ write_irq(struct net_device *dev, int chip_type, int irq) | |||
| 1175 | /* Not found */ | 1177 | /* Not found */ |
| 1176 | if (i == ARRAY_SIZE(cs8900_irq_map)) | 1178 | if (i == ARRAY_SIZE(cs8900_irq_map)) |
| 1177 | i = 3; | 1179 | i = 3; |
| 1180 | #else | ||
| 1181 | /* INTRQ0 pin is used for interrupt generation. */ | ||
| 1182 | i = 0; | ||
| 1183 | #endif | ||
| 1178 | writereg(dev, PP_CS8900_ISAINT, i); | 1184 | writereg(dev, PP_CS8900_ISAINT, i); |
| 1179 | } else { | 1185 | } else { |
| 1180 | writereg(dev, PP_CS8920_ISAINT, irq); | 1186 | writereg(dev, PP_CS8920_ISAINT, irq); |
| @@ -1228,7 +1234,7 @@ net_open(struct net_device *dev) | |||
| 1228 | } | 1234 | } |
| 1229 | else | 1235 | else |
| 1230 | { | 1236 | { |
| 1231 | #ifndef CONFIG_CS89x0_NONISA_IRQ | 1237 | #if !defined(CS89x0_NONISA_IRQ) && !defined(CONFIG_CS89x0_PLATFORM) |
| 1232 | if (((1 << dev->irq) & lp->irq_map) == 0) { | 1238 | if (((1 << dev->irq) & lp->irq_map) == 0) { |
| 1233 | printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n", | 1239 | printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n", |
| 1234 | dev->name, dev->irq, lp->irq_map); | 1240 | dev->name, dev->irq, lp->irq_map); |
| @@ -1746,7 +1752,7 @@ static int set_mac_address(struct net_device *dev, void *p) | |||
| 1746 | return 0; | 1752 | return 0; |
| 1747 | } | 1753 | } |
| 1748 | 1754 | ||
| 1749 | #ifdef MODULE | 1755 | #if defined(MODULE) && !defined(CONFIG_CS89x0_PLATFORM) |
| 1750 | 1756 | ||
| 1751 | static struct net_device *dev_cs89x0; | 1757 | static struct net_device *dev_cs89x0; |
| 1752 | 1758 | ||
| @@ -1900,7 +1906,97 @@ cleanup_module(void) | |||
| 1900 | release_region(dev_cs89x0->base_addr, NETCARD_IO_EXTENT); | 1906 | release_region(dev_cs89x0->base_addr, NETCARD_IO_EXTENT); |
| 1901 | free_netdev(dev_cs89x0); | 1907 | free_netdev(dev_cs89x0); |
| 1902 | } | 1908 | } |
| 1903 | #endif /* MODULE */ | 1909 | #endif /* MODULE && !CONFIG_CS89x0_PLATFORM */ |
| 1910 | |||
| 1911 | #ifdef CONFIG_CS89x0_PLATFORM | ||
| 1912 | static int __init cs89x0_platform_probe(struct platform_device *pdev) | ||
| 1913 | { | ||
| 1914 | struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); | ||
| 1915 | struct net_local *lp; | ||
| 1916 | struct resource *mem_res; | ||
| 1917 | int err; | ||
| 1918 | |||
| 1919 | if (!dev) | ||
| 1920 | return -ENOMEM; | ||
| 1921 | |||
| 1922 | lp = netdev_priv(dev); | ||
| 1923 | |||
| 1924 | mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 1925 | dev->irq = platform_get_irq(pdev, 0); | ||
| 1926 | if (mem_res == NULL || dev->irq <= 0) { | ||
| 1927 | dev_warn(&dev->dev, "memory/interrupt resource missing.\n"); | ||
| 1928 | err = -ENXIO; | ||
| 1929 | goto free; | ||
| 1930 | } | ||
| 1931 | |||
| 1932 | lp->phys_addr = mem_res->start; | ||
| 1933 | lp->size = resource_size(mem_res); | ||
| 1934 | if (!request_mem_region(lp->phys_addr, lp->size, DRV_NAME)) { | ||
| 1935 | dev_warn(&dev->dev, "request_mem_region() failed.\n"); | ||
| 1936 | err = -EBUSY; | ||
| 1937 | goto free; | ||
| 1938 | } | ||
| 1939 | |||
| 1940 | lp->virt_addr = ioremap(lp->phys_addr, lp->size); | ||
| 1941 | if (!lp->virt_addr) { | ||
| 1942 | dev_warn(&dev->dev, "ioremap() failed.\n"); | ||
| 1943 | err = -ENOMEM; | ||
| 1944 | goto release; | ||
| 1945 | } | ||
| 1946 | |||
| 1947 | err = cs89x0_probe1(dev, (unsigned long)lp->virt_addr, 0); | ||
| 1948 | if (err) { | ||
| 1949 | dev_warn(&dev->dev, "no cs8900 or cs8920 detected.\n"); | ||
| 1950 | goto unmap; | ||
| 1951 | } | ||
| 1952 | |||
| 1953 | platform_set_drvdata(pdev, dev); | ||
| 1954 | return 0; | ||
| 1955 | |||
| 1956 | unmap: | ||
| 1957 | iounmap(lp->virt_addr); | ||
| 1958 | release: | ||
| 1959 | release_mem_region(lp->phys_addr, lp->size); | ||
| 1960 | free: | ||
| 1961 | free_netdev(dev); | ||
| 1962 | return err; | ||
| 1963 | } | ||
| 1964 | |||
| 1965 | static int cs89x0_platform_remove(struct platform_device *pdev) | ||
| 1966 | { | ||
| 1967 | struct net_device *dev = platform_get_drvdata(pdev); | ||
| 1968 | struct net_local *lp = netdev_priv(dev); | ||
| 1969 | |||
| 1970 | unregister_netdev(dev); | ||
| 1971 | iounmap(lp->virt_addr); | ||
| 1972 | release_mem_region(lp->phys_addr, lp->size); | ||
| 1973 | free_netdev(dev); | ||
| 1974 | return 0; | ||
| 1975 | } | ||
| 1976 | |||
| 1977 | static struct platform_driver cs89x0_driver = { | ||
| 1978 | .driver = { | ||
| 1979 | .name = DRV_NAME, | ||
| 1980 | .owner = THIS_MODULE, | ||
| 1981 | }, | ||
| 1982 | .remove = cs89x0_platform_remove, | ||
| 1983 | }; | ||
| 1984 | |||
| 1985 | static int __init cs89x0_init(void) | ||
| 1986 | { | ||
| 1987 | return platform_driver_probe(&cs89x0_driver, cs89x0_platform_probe); | ||
| 1988 | } | ||
| 1989 | |||
| 1990 | module_init(cs89x0_init); | ||
| 1991 | |||
| 1992 | static void __exit cs89x0_cleanup(void) | ||
| 1993 | { | ||
| 1994 | platform_driver_unregister(&cs89x0_driver); | ||
| 1995 | } | ||
| 1996 | |||
| 1997 | module_exit(cs89x0_cleanup); | ||
| 1998 | |||
| 1999 | #endif /* CONFIG_CS89x0_PLATFORM */ | ||
| 1904 | 2000 | ||
| 1905 | /* | 2001 | /* |
| 1906 | * Local variables: | 2002 | * Local variables: |
diff --git a/drivers/net/ethernet/cisco/enic/cq_enet_desc.h b/drivers/net/ethernet/cisco/enic/cq_enet_desc.h index c2c0680a1146..ac37cacc6136 100644 --- a/drivers/net/ethernet/cisco/enic/cq_enet_desc.h +++ b/drivers/net/ethernet/cisco/enic/cq_enet_desc.h | |||
| @@ -157,7 +157,7 @@ static inline void cq_enet_rq_desc_dec(struct cq_enet_rq_desc *desc, | |||
| 157 | CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0; | 157 | CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0; |
| 158 | *fcoe_enc_error = (desc->flags & | 158 | *fcoe_enc_error = (desc->flags & |
| 159 | CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0; | 159 | CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0; |
| 160 | *fcoe_eof = (u8)((desc->checksum_fcoe >> | 160 | *fcoe_eof = (u8)((le16_to_cpu(desc->checksum_fcoe) >> |
| 161 | CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) & | 161 | CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) & |
| 162 | CQ_ENET_RQ_DESC_FCOE_EOF_MASK); | 162 | CQ_ENET_RQ_DESC_FCOE_EOF_MASK); |
| 163 | *checksum = 0; | 163 | *checksum = 0; |
diff --git a/drivers/net/ethernet/cisco/enic/enic_pp.c b/drivers/net/ethernet/cisco/enic/enic_pp.c index 22bf03a1829e..c347b6236f8f 100644 --- a/drivers/net/ethernet/cisco/enic/enic_pp.c +++ b/drivers/net/ethernet/cisco/enic/enic_pp.c | |||
| @@ -72,7 +72,7 @@ static int enic_set_port_profile(struct enic *enic, int vf) | |||
| 72 | struct enic_port_profile *pp; | 72 | struct enic_port_profile *pp; |
| 73 | struct vic_provinfo *vp; | 73 | struct vic_provinfo *vp; |
| 74 | const u8 oui[3] = VIC_PROVINFO_CISCO_OUI; | 74 | const u8 oui[3] = VIC_PROVINFO_CISCO_OUI; |
| 75 | const u16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); | 75 | const __be16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); |
| 76 | char uuid_str[38]; | 76 | char uuid_str[38]; |
| 77 | char client_mac_str[18]; | 77 | char client_mac_str[18]; |
| 78 | u8 *client_mac; | 78 | u8 *client_mac; |
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 27d651a80f3f..55cbf65512c3 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c | |||
| @@ -2328,19 +2328,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu) | |||
| 2328 | ((new_mtu) < IPV6_MIN_MTU)) | 2328 | ((new_mtu) < IPV6_MIN_MTU)) |
| 2329 | return -EINVAL; | 2329 | return -EINVAL; |
| 2330 | 2330 | ||
| 2331 | if (new_mtu > 4000) { | ||
| 2332 | jme->reg_rxcs &= ~RXCS_FIFOTHNP; | ||
| 2333 | jme->reg_rxcs |= RXCS_FIFOTHNP_64QW; | ||
| 2334 | jme_restart_rx_engine(jme); | ||
| 2335 | } else { | ||
| 2336 | jme->reg_rxcs &= ~RXCS_FIFOTHNP; | ||
| 2337 | jme->reg_rxcs |= RXCS_FIFOTHNP_128QW; | ||
| 2338 | jme_restart_rx_engine(jme); | ||
| 2339 | } | ||
| 2340 | 2331 | ||
| 2341 | netdev->mtu = new_mtu; | 2332 | netdev->mtu = new_mtu; |
| 2342 | netdev_update_features(netdev); | 2333 | netdev_update_features(netdev); |
| 2343 | 2334 | ||
| 2335 | jme_restart_rx_engine(jme); | ||
| 2344 | jme_reset_link(jme); | 2336 | jme_reset_link(jme); |
| 2345 | 2337 | ||
| 2346 | return 0; | 2338 | return 0; |
diff --git a/drivers/net/ethernet/jme.h b/drivers/net/ethernet/jme.h index 4304072bd3c5..3efc897c9913 100644 --- a/drivers/net/ethernet/jme.h +++ b/drivers/net/ethernet/jme.h | |||
| @@ -730,7 +730,7 @@ enum jme_rxcs_values { | |||
| 730 | RXCS_RETRYCNT_60 = 0x00000F00, | 730 | RXCS_RETRYCNT_60 = 0x00000F00, |
| 731 | 731 | ||
| 732 | RXCS_DEFAULT = RXCS_FIFOTHTP_128T | | 732 | RXCS_DEFAULT = RXCS_FIFOTHTP_128T | |
| 733 | RXCS_FIFOTHNP_128QW | | 733 | RXCS_FIFOTHNP_16QW | |
| 734 | RXCS_DMAREQSZ_128B | | 734 | RXCS_DMAREQSZ_128B | |
| 735 | RXCS_RETRYGAP_256ns | | 735 | RXCS_RETRYGAP_256ns | |
| 736 | RXCS_RETRYCNT_32, | 736 | RXCS_RETRYCNT_32, |
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 8fa41f3082cf..9129ace02560 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
| @@ -1036,7 +1036,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
| 1036 | struct mlx4_priv *priv = mlx4_priv(dev); | 1036 | struct mlx4_priv *priv = mlx4_priv(dev); |
| 1037 | int vec = 0, err = 0, i; | 1037 | int vec = 0, err = 0, i; |
| 1038 | 1038 | ||
| 1039 | spin_lock(&priv->msix_ctl.pool_lock); | 1039 | mutex_lock(&priv->msix_ctl.pool_lock); |
| 1040 | for (i = 0; !vec && i < dev->caps.comp_pool; i++) { | 1040 | for (i = 0; !vec && i < dev->caps.comp_pool; i++) { |
| 1041 | if (~priv->msix_ctl.pool_bm & 1ULL << i) { | 1041 | if (~priv->msix_ctl.pool_bm & 1ULL << i) { |
| 1042 | priv->msix_ctl.pool_bm |= 1ULL << i; | 1042 | priv->msix_ctl.pool_bm |= 1ULL << i; |
| @@ -1058,7 +1058,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
| 1058 | eq_set_ci(&priv->eq_table.eq[vec], 1); | 1058 | eq_set_ci(&priv->eq_table.eq[vec], 1); |
| 1059 | } | 1059 | } |
| 1060 | } | 1060 | } |
| 1061 | spin_unlock(&priv->msix_ctl.pool_lock); | 1061 | mutex_unlock(&priv->msix_ctl.pool_lock); |
| 1062 | 1062 | ||
| 1063 | if (vec) { | 1063 | if (vec) { |
| 1064 | *vector = vec; | 1064 | *vector = vec; |
| @@ -1079,13 +1079,13 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec) | |||
| 1079 | if (likely(i >= 0)) { | 1079 | if (likely(i >= 0)) { |
| 1080 | /*sanity check , making sure were not trying to free irq's | 1080 | /*sanity check , making sure were not trying to free irq's |
| 1081 | Belonging to a legacy EQ*/ | 1081 | Belonging to a legacy EQ*/ |
| 1082 | spin_lock(&priv->msix_ctl.pool_lock); | 1082 | mutex_lock(&priv->msix_ctl.pool_lock); |
| 1083 | if (priv->msix_ctl.pool_bm & 1ULL << i) { | 1083 | if (priv->msix_ctl.pool_bm & 1ULL << i) { |
| 1084 | free_irq(priv->eq_table.eq[vec].irq, | 1084 | free_irq(priv->eq_table.eq[vec].irq, |
| 1085 | &priv->eq_table.eq[vec]); | 1085 | &priv->eq_table.eq[vec]); |
| 1086 | priv->msix_ctl.pool_bm &= ~(1ULL << i); | 1086 | priv->msix_ctl.pool_bm &= ~(1ULL << i); |
| 1087 | } | 1087 | } |
| 1088 | spin_unlock(&priv->msix_ctl.pool_lock); | 1088 | mutex_unlock(&priv->msix_ctl.pool_lock); |
| 1089 | } | 1089 | } |
| 1090 | 1090 | ||
| 1091 | } | 1091 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 8a21e10952ea..9ea7cabcaf3c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
| @@ -685,7 +685,7 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, | |||
| 685 | return err; | 685 | return err; |
| 686 | } | 686 | } |
| 687 | 687 | ||
| 688 | static int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) | 688 | int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) |
| 689 | { | 689 | { |
| 690 | struct mlx4_cmd_mailbox *outbox = ptr; | 690 | struct mlx4_cmd_mailbox *outbox = ptr; |
| 691 | 691 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 678558b502fc..d498f049c74e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
| @@ -531,15 +531,14 @@ int mlx4_change_port_types(struct mlx4_dev *dev, | |||
| 531 | for (port = 0; port < dev->caps.num_ports; port++) { | 531 | for (port = 0; port < dev->caps.num_ports; port++) { |
| 532 | /* Change the port type only if the new type is different | 532 | /* Change the port type only if the new type is different |
| 533 | * from the current, and not set to Auto */ | 533 | * from the current, and not set to Auto */ |
| 534 | if (port_types[port] != dev->caps.port_type[port + 1]) { | 534 | if (port_types[port] != dev->caps.port_type[port + 1]) |
| 535 | change = 1; | 535 | change = 1; |
| 536 | dev->caps.port_type[port + 1] = port_types[port]; | ||
| 537 | } | ||
| 538 | } | 536 | } |
| 539 | if (change) { | 537 | if (change) { |
| 540 | mlx4_unregister_device(dev); | 538 | mlx4_unregister_device(dev); |
| 541 | for (port = 1; port <= dev->caps.num_ports; port++) { | 539 | for (port = 1; port <= dev->caps.num_ports; port++) { |
| 542 | mlx4_CLOSE_PORT(dev, port); | 540 | mlx4_CLOSE_PORT(dev, port); |
| 541 | dev->caps.port_type[port] = port_types[port - 1]; | ||
| 543 | err = mlx4_SET_PORT(dev, port); | 542 | err = mlx4_SET_PORT(dev, port); |
| 544 | if (err) { | 543 | if (err) { |
| 545 | mlx4_err(dev, "Failed to set port %d, " | 544 | mlx4_err(dev, "Failed to set port %d, " |
| @@ -986,6 +985,9 @@ static int map_bf_area(struct mlx4_dev *dev) | |||
| 986 | resource_size_t bf_len; | 985 | resource_size_t bf_len; |
| 987 | int err = 0; | 986 | int err = 0; |
| 988 | 987 | ||
| 988 | if (!dev->caps.bf_reg_size) | ||
| 989 | return -ENXIO; | ||
| 990 | |||
| 989 | bf_start = pci_resource_start(dev->pdev, 2) + | 991 | bf_start = pci_resource_start(dev->pdev, 2) + |
| 990 | (dev->caps.num_uars << PAGE_SHIFT); | 992 | (dev->caps.num_uars << PAGE_SHIFT); |
| 991 | bf_len = pci_resource_len(dev->pdev, 2) - | 993 | bf_len = pci_resource_len(dev->pdev, 2) - |
| @@ -1825,7 +1827,7 @@ slave_start: | |||
| 1825 | goto err_master_mfunc; | 1827 | goto err_master_mfunc; |
| 1826 | 1828 | ||
| 1827 | priv->msix_ctl.pool_bm = 0; | 1829 | priv->msix_ctl.pool_bm = 0; |
| 1828 | spin_lock_init(&priv->msix_ctl.pool_lock); | 1830 | mutex_init(&priv->msix_ctl.pool_lock); |
| 1829 | 1831 | ||
| 1830 | mlx4_enable_msi_x(dev); | 1832 | mlx4_enable_msi_x(dev); |
| 1831 | if ((mlx4_is_mfunc(dev)) && | 1833 | if ((mlx4_is_mfunc(dev)) && |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h index c92269f8c057..28f8251561f4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h | |||
| @@ -697,7 +697,7 @@ struct mlx4_sense { | |||
| 697 | 697 | ||
| 698 | struct mlx4_msix_ctl { | 698 | struct mlx4_msix_ctl { |
| 699 | u64 pool_bm; | 699 | u64 pool_bm; |
| 700 | spinlock_t pool_lock; | 700 | struct mutex pool_lock; |
| 701 | }; | 701 | }; |
| 702 | 702 | ||
| 703 | struct mlx4_steer { | 703 | struct mlx4_steer { |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c index 8deeef98280c..25a80d71fb2a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mr.c +++ b/drivers/net/ethernet/mellanox/mlx4/mr.c | |||
| @@ -304,7 +304,7 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox | |||
| 304 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); | 304 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, | 307 | int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, |
| 308 | u32 *base_mridx) | 308 | u32 *base_mridx) |
| 309 | { | 309 | { |
| 310 | struct mlx4_priv *priv = mlx4_priv(dev); | 310 | struct mlx4_priv *priv = mlx4_priv(dev); |
| @@ -320,14 +320,14 @@ static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, | |||
| 320 | } | 320 | } |
| 321 | EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range); | 321 | EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range); |
| 322 | 322 | ||
| 323 | static void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) | 323 | void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) |
| 324 | { | 324 | { |
| 325 | struct mlx4_priv *priv = mlx4_priv(dev); | 325 | struct mlx4_priv *priv = mlx4_priv(dev); |
| 326 | mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt); | 326 | mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt); |
| 327 | } | 327 | } |
| 328 | EXPORT_SYMBOL_GPL(mlx4_mr_release_range); | 328 | EXPORT_SYMBOL_GPL(mlx4_mr_release_range); |
| 329 | 329 | ||
| 330 | static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, | 330 | int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, |
| 331 | u64 iova, u64 size, u32 access, int npages, | 331 | u64 iova, u64 size, u32 access, int npages, |
| 332 | int page_shift, struct mlx4_mr *mr) | 332 | int page_shift, struct mlx4_mr *mr) |
| 333 | { | 333 | { |
| @@ -457,7 +457,7 @@ int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, | |||
| 457 | } | 457 | } |
| 458 | EXPORT_SYMBOL_GPL(mlx4_mr_alloc); | 458 | EXPORT_SYMBOL_GPL(mlx4_mr_alloc); |
| 459 | 459 | ||
| 460 | static void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) | 460 | void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) |
| 461 | { | 461 | { |
| 462 | int err; | 462 | int err; |
| 463 | 463 | ||
| @@ -852,7 +852,7 @@ err_free: | |||
| 852 | } | 852 | } |
| 853 | EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); | 853 | EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); |
| 854 | 854 | ||
| 855 | static int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, | 855 | int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, |
| 856 | u32 pd, u32 access, int max_pages, | 856 | u32 pd, u32 access, int max_pages, |
| 857 | int max_maps, u8 page_shift, struct mlx4_fmr *fmr) | 857 | int max_maps, u8 page_shift, struct mlx4_fmr *fmr) |
| 858 | { | 858 | { |
| @@ -954,7 +954,7 @@ int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr) | |||
| 954 | } | 954 | } |
| 955 | EXPORT_SYMBOL_GPL(mlx4_fmr_free); | 955 | EXPORT_SYMBOL_GPL(mlx4_fmr_free); |
| 956 | 956 | ||
| 957 | static int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) | 957 | int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) |
| 958 | { | 958 | { |
| 959 | if (fmr->maps) | 959 | if (fmr->maps) |
| 960 | return -EBUSY; | 960 | return -EBUSY; |
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c index 231176fcd2ba..2784bc706f1e 100644 --- a/drivers/net/ethernet/micrel/ks8851_mll.c +++ b/drivers/net/ethernet/micrel/ks8851_mll.c | |||
| @@ -1545,7 +1545,7 @@ static int __devinit ks8851_probe(struct platform_device *pdev) | |||
| 1545 | 1545 | ||
| 1546 | netdev->irq = platform_get_irq(pdev, 0); | 1546 | netdev->irq = platform_get_irq(pdev, 0); |
| 1547 | 1547 | ||
| 1548 | if (netdev->irq < 0) { | 1548 | if ((int)netdev->irq < 0) { |
| 1549 | err = netdev->irq; | 1549 | err = netdev->irq; |
| 1550 | goto err_get_irq; | 1550 | goto err_get_irq; |
| 1551 | } | 1551 | } |
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index aca349861767..fc52fca74193 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c | |||
| @@ -156,11 +156,10 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue) | |||
| 156 | if (unlikely(!skb)) | 156 | if (unlikely(!skb)) |
| 157 | return -ENOMEM; | 157 | return -ENOMEM; |
| 158 | 158 | ||
| 159 | /* Adjust the SKB for padding and checksum */ | 159 | /* Adjust the SKB for padding */ |
| 160 | skb_reserve(skb, NET_IP_ALIGN); | 160 | skb_reserve(skb, NET_IP_ALIGN); |
| 161 | rx_buf->len = skb_len - NET_IP_ALIGN; | 161 | rx_buf->len = skb_len - NET_IP_ALIGN; |
| 162 | rx_buf->is_page = false; | 162 | rx_buf->is_page = false; |
| 163 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
| 164 | 163 | ||
| 165 | rx_buf->dma_addr = pci_map_single(efx->pci_dev, | 164 | rx_buf->dma_addr = pci_map_single(efx->pci_dev, |
| 166 | skb->data, rx_buf->len, | 165 | skb->data, rx_buf->len, |
| @@ -496,6 +495,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel, | |||
| 496 | 495 | ||
| 497 | EFX_BUG_ON_PARANOID(!checksummed); | 496 | EFX_BUG_ON_PARANOID(!checksummed); |
| 498 | rx_buf->u.skb = NULL; | 497 | rx_buf->u.skb = NULL; |
| 498 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
| 499 | 499 | ||
| 500 | gro_result = napi_gro_receive(napi, skb); | 500 | gro_result = napi_gro_receive(napi, skb); |
| 501 | } | 501 | } |
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 4fa0bcb25dfc..4b2f54565f64 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
| @@ -1009,7 +1009,7 @@ static void emac_rx_handler(void *token, int len, int status) | |||
| 1009 | int ret; | 1009 | int ret; |
| 1010 | 1010 | ||
| 1011 | /* free and bail if we are shutting down */ | 1011 | /* free and bail if we are shutting down */ |
| 1012 | if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) { | 1012 | if (unlikely(!netif_running(ndev))) { |
| 1013 | dev_kfree_skb_any(skb); | 1013 | dev_kfree_skb_any(skb); |
| 1014 | return; | 1014 | return; |
| 1015 | } | 1015 | } |
| @@ -1038,7 +1038,9 @@ static void emac_rx_handler(void *token, int len, int status) | |||
| 1038 | recycle: | 1038 | recycle: |
| 1039 | ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, | 1039 | ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, |
| 1040 | skb_tailroom(skb), GFP_KERNEL); | 1040 | skb_tailroom(skb), GFP_KERNEL); |
| 1041 | if (WARN_ON(ret < 0)) | 1041 | |
| 1042 | WARN_ON(ret == -ENOMEM); | ||
| 1043 | if (unlikely(ret < 0)) | ||
| 1042 | dev_kfree_skb_any(skb); | 1044 | dev_kfree_skb_any(skb); |
| 1043 | } | 1045 | } |
| 1044 | 1046 | ||
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index c81f136ae670..0856e1b7a849 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c | |||
| @@ -30,16 +30,16 @@ | |||
| 30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
| 31 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
| 32 | 32 | ||
| 33 | MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IC1001 PHY drivers"); | 33 | MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers"); |
| 34 | MODULE_AUTHOR("Michael Barkowski"); | 34 | MODULE_AUTHOR("Michael Barkowski"); |
| 35 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |
| 36 | 36 | ||
| 37 | /* IP101A/IP1001 */ | 37 | /* IP101A/G - IP1001 */ |
| 38 | #define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ | 38 | #define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ |
| 39 | #define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ | 39 | #define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ |
| 40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ | 40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ |
| 41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ | 41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ |
| 42 | #define IP101A_APS_ON 2 /* IP101A APS Mode bit */ | 42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ |
| 43 | 43 | ||
| 44 | static int ip175c_config_init(struct phy_device *phydev) | 44 | static int ip175c_config_init(struct phy_device *phydev) |
| 45 | { | 45 | { |
| @@ -98,20 +98,24 @@ static int ip175c_config_init(struct phy_device *phydev) | |||
| 98 | 98 | ||
| 99 | static int ip1xx_reset(struct phy_device *phydev) | 99 | static int ip1xx_reset(struct phy_device *phydev) |
| 100 | { | 100 | { |
| 101 | int err, bmcr; | 101 | int bmcr; |
| 102 | 102 | ||
| 103 | /* Software Reset PHY */ | 103 | /* Software Reset PHY */ |
| 104 | bmcr = phy_read(phydev, MII_BMCR); | 104 | bmcr = phy_read(phydev, MII_BMCR); |
| 105 | if (bmcr < 0) | ||
| 106 | return bmcr; | ||
| 105 | bmcr |= BMCR_RESET; | 107 | bmcr |= BMCR_RESET; |
| 106 | err = phy_write(phydev, MII_BMCR, bmcr); | 108 | bmcr = phy_write(phydev, MII_BMCR, bmcr); |
| 107 | if (err < 0) | 109 | if (bmcr < 0) |
| 108 | return err; | 110 | return bmcr; |
| 109 | 111 | ||
| 110 | do { | 112 | do { |
| 111 | bmcr = phy_read(phydev, MII_BMCR); | 113 | bmcr = phy_read(phydev, MII_BMCR); |
| 114 | if (bmcr < 0) | ||
| 115 | return bmcr; | ||
| 112 | } while (bmcr & BMCR_RESET); | 116 | } while (bmcr & BMCR_RESET); |
| 113 | 117 | ||
| 114 | return err; | 118 | return 0; |
| 115 | } | 119 | } |
| 116 | 120 | ||
| 117 | static int ip1001_config_init(struct phy_device *phydev) | 121 | static int ip1001_config_init(struct phy_device *phydev) |
| @@ -124,7 +128,10 @@ static int ip1001_config_init(struct phy_device *phydev) | |||
| 124 | 128 | ||
| 125 | /* Enable Auto Power Saving mode */ | 129 | /* Enable Auto Power Saving mode */ |
| 126 | c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2); | 130 | c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2); |
| 131 | if (c < 0) | ||
| 132 | return c; | ||
| 127 | c |= IP1001_APS_ON; | 133 | c |= IP1001_APS_ON; |
| 134 | c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c); | ||
| 128 | if (c < 0) | 135 | if (c < 0) |
| 129 | return c; | 136 | return c; |
| 130 | 137 | ||
| @@ -132,14 +139,19 @@ static int ip1001_config_init(struct phy_device *phydev) | |||
| 132 | /* Additional delay (2ns) used to adjust RX clock phase | 139 | /* Additional delay (2ns) used to adjust RX clock phase |
| 133 | * at RGMII interface */ | 140 | * at RGMII interface */ |
| 134 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); | 141 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); |
| 142 | if (c < 0) | ||
| 143 | return c; | ||
| 144 | |||
| 135 | c |= IP1001_PHASE_SEL_MASK; | 145 | c |= IP1001_PHASE_SEL_MASK; |
| 136 | c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); | 146 | c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); |
| 147 | if (c < 0) | ||
| 148 | return c; | ||
| 137 | } | 149 | } |
| 138 | 150 | ||
| 139 | return c; | 151 | return 0; |
| 140 | } | 152 | } |
| 141 | 153 | ||
| 142 | static int ip101a_config_init(struct phy_device *phydev) | 154 | static int ip101a_g_config_init(struct phy_device *phydev) |
| 143 | { | 155 | { |
| 144 | int c; | 156 | int c; |
| 145 | 157 | ||
| @@ -149,7 +161,7 @@ static int ip101a_config_init(struct phy_device *phydev) | |||
| 149 | 161 | ||
| 150 | /* Enable Auto Power Saving mode */ | 162 | /* Enable Auto Power Saving mode */ |
| 151 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); | 163 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); |
| 152 | c |= IP101A_APS_ON; | 164 | c |= IP101A_G_APS_ON; |
| 153 | return c; | 165 | return c; |
| 154 | } | 166 | } |
| 155 | 167 | ||
| @@ -191,6 +203,7 @@ static struct phy_driver ip1001_driver = { | |||
| 191 | .phy_id_mask = 0x0ffffff0, | 203 | .phy_id_mask = 0x0ffffff0, |
| 192 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | | 204 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | |
| 193 | SUPPORTED_Asym_Pause, | 205 | SUPPORTED_Asym_Pause, |
| 206 | .flags = PHY_HAS_INTERRUPT, | ||
| 194 | .config_init = &ip1001_config_init, | 207 | .config_init = &ip1001_config_init, |
| 195 | .config_aneg = &genphy_config_aneg, | 208 | .config_aneg = &genphy_config_aneg, |
| 196 | .read_status = &genphy_read_status, | 209 | .read_status = &genphy_read_status, |
| @@ -199,13 +212,14 @@ static struct phy_driver ip1001_driver = { | |||
| 199 | .driver = { .owner = THIS_MODULE,}, | 212 | .driver = { .owner = THIS_MODULE,}, |
| 200 | }; | 213 | }; |
| 201 | 214 | ||
| 202 | static struct phy_driver ip101a_driver = { | 215 | static struct phy_driver ip101a_g_driver = { |
| 203 | .phy_id = 0x02430c54, | 216 | .phy_id = 0x02430c54, |
| 204 | .name = "ICPlus IP101A", | 217 | .name = "ICPlus IP101A/G", |
| 205 | .phy_id_mask = 0x0ffffff0, | 218 | .phy_id_mask = 0x0ffffff0, |
| 206 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | | 219 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | |
| 207 | SUPPORTED_Asym_Pause, | 220 | SUPPORTED_Asym_Pause, |
| 208 | .config_init = &ip101a_config_init, | 221 | .flags = PHY_HAS_INTERRUPT, |
| 222 | .config_init = &ip101a_g_config_init, | ||
| 209 | .config_aneg = &genphy_config_aneg, | 223 | .config_aneg = &genphy_config_aneg, |
| 210 | .read_status = &genphy_read_status, | 224 | .read_status = &genphy_read_status, |
| 211 | .suspend = genphy_suspend, | 225 | .suspend = genphy_suspend, |
| @@ -221,7 +235,7 @@ static int __init icplus_init(void) | |||
| 221 | if (ret < 0) | 235 | if (ret < 0) |
| 222 | return -ENODEV; | 236 | return -ENODEV; |
| 223 | 237 | ||
| 224 | ret = phy_driver_register(&ip101a_driver); | 238 | ret = phy_driver_register(&ip101a_g_driver); |
| 225 | if (ret < 0) | 239 | if (ret < 0) |
| 226 | return -ENODEV; | 240 | return -ENODEV; |
| 227 | 241 | ||
| @@ -231,7 +245,7 @@ static int __init icplus_init(void) | |||
| 231 | static void __exit icplus_exit(void) | 245 | static void __exit icplus_exit(void) |
| 232 | { | 246 | { |
| 233 | phy_driver_unregister(&ip1001_driver); | 247 | phy_driver_unregister(&ip1001_driver); |
| 234 | phy_driver_unregister(&ip101a_driver); | 248 | phy_driver_unregister(&ip101a_g_driver); |
| 235 | phy_driver_unregister(&ip175c_driver); | 249 | phy_driver_unregister(&ip175c_driver); |
| 236 | } | 250 | } |
| 237 | 251 | ||
| @@ -241,6 +255,7 @@ module_exit(icplus_exit); | |||
| 241 | static struct mdio_device_id __maybe_unused icplus_tbl[] = { | 255 | static struct mdio_device_id __maybe_unused icplus_tbl[] = { |
| 242 | { 0x02430d80, 0x0ffffff0 }, | 256 | { 0x02430d80, 0x0ffffff0 }, |
| 243 | { 0x02430d90, 0x0ffffff0 }, | 257 | { 0x02430d90, 0x0ffffff0 }, |
| 258 | { 0x02430c54, 0x0ffffff0 }, | ||
| 244 | { } | 259 | { } |
| 245 | }; | 260 | }; |
| 246 | 261 | ||
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index 50e8e5e74465..7189adf54bd1 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c | |||
| @@ -255,13 +255,13 @@ static inline int __init mdio_ofgpio_init(void) | |||
| 255 | return platform_driver_register(&mdio_ofgpio_driver); | 255 | return platform_driver_register(&mdio_ofgpio_driver); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | static inline void __exit mdio_ofgpio_exit(void) | 258 | static inline void mdio_ofgpio_exit(void) |
| 259 | { | 259 | { |
| 260 | platform_driver_unregister(&mdio_ofgpio_driver); | 260 | platform_driver_unregister(&mdio_ofgpio_driver); |
| 261 | } | 261 | } |
| 262 | #else | 262 | #else |
| 263 | static inline int __init mdio_ofgpio_init(void) { return 0; } | 263 | static inline int __init mdio_ofgpio_init(void) { return 0; } |
| 264 | static inline void __exit mdio_ofgpio_exit(void) { } | 264 | static inline void mdio_ofgpio_exit(void) { } |
| 265 | #endif /* CONFIG_OF_GPIO */ | 265 | #endif /* CONFIG_OF_GPIO */ |
| 266 | 266 | ||
| 267 | static struct platform_driver mdio_gpio_driver = { | 267 | static struct platform_driver mdio_gpio_driver = { |
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index edfa15d2e795..486b4048850d 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c | |||
| @@ -2024,14 +2024,22 @@ ppp_mp_reconstruct(struct ppp *ppp) | |||
| 2024 | continue; | 2024 | continue; |
| 2025 | } | 2025 | } |
| 2026 | if (PPP_MP_CB(p)->sequence != seq) { | 2026 | if (PPP_MP_CB(p)->sequence != seq) { |
| 2027 | u32 oldseq; | ||
| 2027 | /* Fragment `seq' is missing. If it is after | 2028 | /* Fragment `seq' is missing. If it is after |
| 2028 | minseq, it might arrive later, so stop here. */ | 2029 | minseq, it might arrive later, so stop here. */ |
| 2029 | if (seq_after(seq, minseq)) | 2030 | if (seq_after(seq, minseq)) |
| 2030 | break; | 2031 | break; |
| 2031 | /* Fragment `seq' is lost, keep going. */ | 2032 | /* Fragment `seq' is lost, keep going. */ |
| 2032 | lost = 1; | 2033 | lost = 1; |
| 2034 | oldseq = seq; | ||
| 2033 | seq = seq_before(minseq, PPP_MP_CB(p)->sequence)? | 2035 | seq = seq_before(minseq, PPP_MP_CB(p)->sequence)? |
| 2034 | minseq + 1: PPP_MP_CB(p)->sequence; | 2036 | minseq + 1: PPP_MP_CB(p)->sequence; |
| 2037 | |||
| 2038 | if (ppp->debug & 1) | ||
| 2039 | netdev_printk(KERN_DEBUG, ppp->dev, | ||
| 2040 | "lost frag %u..%u\n", | ||
| 2041 | oldseq, seq-1); | ||
| 2042 | |||
| 2035 | goto again; | 2043 | goto again; |
| 2036 | } | 2044 | } |
| 2037 | 2045 | ||
| @@ -2076,6 +2084,10 @@ ppp_mp_reconstruct(struct ppp *ppp) | |||
| 2076 | struct sk_buff *tmp2; | 2084 | struct sk_buff *tmp2; |
| 2077 | 2085 | ||
| 2078 | skb_queue_reverse_walk_from_safe(list, p, tmp2) { | 2086 | skb_queue_reverse_walk_from_safe(list, p, tmp2) { |
| 2087 | if (ppp->debug & 1) | ||
| 2088 | netdev_printk(KERN_DEBUG, ppp->dev, | ||
| 2089 | "discarding frag %u\n", | ||
| 2090 | PPP_MP_CB(p)->sequence); | ||
| 2079 | __skb_unlink(p, list); | 2091 | __skb_unlink(p, list); |
| 2080 | kfree_skb(p); | 2092 | kfree_skb(p); |
| 2081 | } | 2093 | } |
| @@ -2091,6 +2103,17 @@ ppp_mp_reconstruct(struct ppp *ppp) | |||
| 2091 | /* If we have discarded any fragments, | 2103 | /* If we have discarded any fragments, |
| 2092 | signal a receive error. */ | 2104 | signal a receive error. */ |
| 2093 | if (PPP_MP_CB(head)->sequence != ppp->nextseq) { | 2105 | if (PPP_MP_CB(head)->sequence != ppp->nextseq) { |
| 2106 | skb_queue_walk_safe(list, p, tmp) { | ||
| 2107 | if (p == head) | ||
| 2108 | break; | ||
| 2109 | if (ppp->debug & 1) | ||
| 2110 | netdev_printk(KERN_DEBUG, ppp->dev, | ||
| 2111 | "discarding frag %u\n", | ||
| 2112 | PPP_MP_CB(p)->sequence); | ||
| 2113 | __skb_unlink(p, list); | ||
| 2114 | kfree_skb(p); | ||
| 2115 | } | ||
| 2116 | |||
| 2094 | if (ppp->debug & 1) | 2117 | if (ppp->debug & 1) |
| 2095 | netdev_printk(KERN_DEBUG, ppp->dev, | 2118 | netdev_printk(KERN_DEBUG, ppp->dev, |
| 2096 | " missed pkts %u..%u\n", | 2119 | " missed pkts %u..%u\n", |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 41a61efc331e..90a30026a931 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
| @@ -573,6 +573,13 @@ static const struct usb_device_id products [] = { | |||
| 573 | .driver_info = 0, | 573 | .driver_info = 0, |
| 574 | }, | 574 | }, |
| 575 | 575 | ||
| 576 | /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */ | ||
| 577 | { | ||
| 578 | USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM, | ||
| 579 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
| 580 | .driver_info = 0, | ||
| 581 | }, | ||
| 582 | |||
| 576 | /* | 583 | /* |
| 577 | * WHITELIST!!! | 584 | * WHITELIST!!! |
| 578 | * | 585 | * |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 304fe78ff60e..e1324b4a0f66 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
| @@ -1632,7 +1632,7 @@ static int hso_get_count(struct tty_struct *tty, | |||
| 1632 | struct hso_serial *serial = get_serial_by_tty(tty); | 1632 | struct hso_serial *serial = get_serial_by_tty(tty); |
| 1633 | struct hso_tiocmget *tiocmget = serial->tiocmget; | 1633 | struct hso_tiocmget *tiocmget = serial->tiocmget; |
| 1634 | 1634 | ||
| 1635 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); | 1635 | memset(icount, 0, sizeof(struct serial_icounter_struct)); |
| 1636 | 1636 | ||
| 1637 | if (!tiocmget) | 1637 | if (!tiocmget) |
| 1638 | return -ENOENT; | 1638 | return -ENOENT; |
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c index f701d4127087..c3197ce0e2ad 100644 --- a/drivers/net/usb/zaurus.c +++ b/drivers/net/usb/zaurus.c | |||
| @@ -316,6 +316,11 @@ static const struct usb_device_id products [] = { | |||
| 316 | ZAURUS_MASTER_INTERFACE, | 316 | ZAURUS_MASTER_INTERFACE, |
| 317 | .driver_info = ZAURUS_PXA_INFO, | 317 | .driver_info = ZAURUS_PXA_INFO, |
| 318 | }, { | 318 | }, { |
| 319 | /* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */ | ||
| 320 | USB_DEVICE_AND_INTERFACE_INFO(0x04DD, 0x9031, USB_CLASS_COMM, | ||
| 321 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
| 322 | .driver_info = (unsigned long) &bogus_mdlm_info, | ||
| 323 | }, { | ||
| 319 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | 324 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO |
| 320 | | USB_DEVICE_ID_MATCH_DEVICE, | 325 | | USB_DEVICE_ID_MATCH_DEVICE, |
| 321 | .idVendor = 0x04DD, | 326 | .idVendor = 0x04DD, |
| @@ -349,6 +354,13 @@ static const struct usb_device_id products [] = { | |||
| 349 | ZAURUS_MASTER_INTERFACE, | 354 | ZAURUS_MASTER_INTERFACE, |
| 350 | .driver_info = OLYMPUS_MXL_INFO, | 355 | .driver_info = OLYMPUS_MXL_INFO, |
| 351 | }, | 356 | }, |
| 357 | |||
| 358 | /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */ | ||
| 359 | { | ||
| 360 | USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM, | ||
| 361 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
| 362 | .driver_info = (unsigned long) &bogus_mdlm_info, | ||
| 363 | }, | ||
| 352 | { }, // END | 364 | { }, // END |
| 353 | }; | 365 | }; |
| 354 | MODULE_DEVICE_TABLE(usb, products); | 366 | MODULE_DEVICE_TABLE(usb, products); |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index de7fc345148a..3dcd3857a36c 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
| @@ -843,8 +843,8 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, | |||
| 843 | /* for simplicity, don't copy L4 headers */ | 843 | /* for simplicity, don't copy L4 headers */ |
| 844 | ctx->l4_hdr_size = 0; | 844 | ctx->l4_hdr_size = 0; |
| 845 | } | 845 | } |
| 846 | ctx->copy_size = ctx->eth_ip_hdr_size + | 846 | ctx->copy_size = min(ctx->eth_ip_hdr_size + |
| 847 | ctx->l4_hdr_size; | 847 | ctx->l4_hdr_size, skb->len); |
| 848 | } else { | 848 | } else { |
| 849 | ctx->eth_ip_hdr_size = 0; | 849 | ctx->eth_ip_hdr_size = 0; |
| 850 | ctx->l4_hdr_size = 0; | 850 | ctx->l4_hdr_size = 0; |
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 635b592ad961..a427a16bb739 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
| @@ -1346,7 +1346,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband, | |||
| 1346 | fc = hdr->frame_control; | 1346 | fc = hdr->frame_control; |
| 1347 | for (i = 0; i < sc->hw->max_rates; i++) { | 1347 | for (i = 0; i < sc->hw->max_rates; i++) { |
| 1348 | struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; | 1348 | struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; |
| 1349 | if (!rate->count) | 1349 | if (rate->idx < 0 || !rate->count) |
| 1350 | break; | 1350 | break; |
| 1351 | 1351 | ||
| 1352 | final_ts_idx = i; | 1352 | final_ts_idx = i; |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index c3b6c4652cd6..5b2972b43b0e 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
| @@ -841,7 +841,12 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
| 841 | ret = mwifiex_set_rf_channel(priv, channel, | 841 | ret = mwifiex_set_rf_channel(priv, channel, |
| 842 | priv->adapter->channel_type); | 842 | priv->adapter->channel_type); |
| 843 | 843 | ||
| 844 | ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */ | 844 | /* As this is new association, clear locally stored |
| 845 | * keys and security related flags */ | ||
| 846 | priv->sec_info.wpa_enabled = false; | ||
| 847 | priv->sec_info.wpa2_enabled = false; | ||
| 848 | priv->wep_key_curr_index = 0; | ||
| 849 | ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); | ||
| 845 | 850 | ||
| 846 | if (mode == NL80211_IFTYPE_ADHOC) { | 851 | if (mode == NL80211_IFTYPE_ADHOC) { |
| 847 | /* "privacy" is set only for ad-hoc mode */ | 852 | /* "privacy" is set only for ad-hoc mode */ |
| @@ -886,6 +891,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
| 886 | dev_dbg(priv->adapter->dev, | 891 | dev_dbg(priv->adapter->dev, |
| 887 | "info: setting wep encryption" | 892 | "info: setting wep encryption" |
| 888 | " with key len %d\n", sme->key_len); | 893 | " with key len %d\n", sme->key_len); |
| 894 | priv->wep_key_curr_index = sme->key_idx; | ||
| 889 | ret = mwifiex_set_encode(priv, sme->key, sme->key_len, | 895 | ret = mwifiex_set_encode(priv, sme->key, sme->key_len, |
| 890 | sme->key_idx, 0); | 896 | sme->key_idx, 0); |
| 891 | } | 897 | } |
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 63b3ec48c203..343ad29e211c 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
| @@ -55,7 +55,7 @@ EXPORT_SYMBOL(of_find_device_by_node); | |||
| 55 | #include <asm/dcr.h> | 55 | #include <asm/dcr.h> |
| 56 | #endif | 56 | #endif |
| 57 | 57 | ||
| 58 | #if !defined(CONFIG_SPARC) | 58 | #ifdef CONFIG_OF_ADDRESS |
| 59 | /* | 59 | /* |
| 60 | * The following routines scan a subtree and registers a device for | 60 | * The following routines scan a subtree and registers a device for |
| 61 | * each applicable node. | 61 | * each applicable node. |
| @@ -253,7 +253,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node, | |||
| 253 | if (!of_device_is_available(node)) | 253 | if (!of_device_is_available(node)) |
| 254 | return NULL; | 254 | return NULL; |
| 255 | 255 | ||
| 256 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 256 | dev = amba_device_alloc(NULL, 0, 0); |
| 257 | if (!dev) | 257 | if (!dev) |
| 258 | return NULL; | 258 | return NULL; |
| 259 | 259 | ||
| @@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node, | |||
| 283 | if (ret) | 283 | if (ret) |
| 284 | goto err_free; | 284 | goto err_free; |
| 285 | 285 | ||
| 286 | ret = amba_device_register(dev, &iomem_resource); | 286 | ret = amba_device_add(dev, &iomem_resource); |
| 287 | if (ret) | 287 | if (ret) |
| 288 | goto err_free; | 288 | goto err_free; |
| 289 | 289 | ||
| 290 | return dev; | 290 | return dev; |
| 291 | 291 | ||
| 292 | err_free: | 292 | err_free: |
| 293 | kfree(dev); | 293 | amba_device_put(dev); |
| 294 | return NULL; | 294 | return NULL; |
| 295 | } | 295 | } |
| 296 | #else /* CONFIG_ARM_AMBA */ | 296 | #else /* CONFIG_ARM_AMBA */ |
| @@ -462,4 +462,4 @@ int of_platform_populate(struct device_node *root, | |||
| 462 | of_node_put(root); | 462 | of_node_put(root); |
| 463 | return rc; | 463 | return rc; |
| 464 | } | 464 | } |
| 465 | #endif /* !CONFIG_SPARC */ | 465 | #endif /* CONFIG_OF_ADDRESS */ |
diff --git a/drivers/parisc/iommu-helpers.h b/drivers/parisc/iommu-helpers.h index a9c46cc2db37..8c33491b21fe 100644 --- a/drivers/parisc/iommu-helpers.h +++ b/drivers/parisc/iommu-helpers.h | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | #include <linux/prefetch.h> | ||
| 2 | |||
| 1 | /** | 3 | /** |
| 2 | * iommu_fill_pdir - Insert coalesced scatter/gather chunks into the I/O Pdir. | 4 | * iommu_fill_pdir - Insert coalesced scatter/gather chunks into the I/O Pdir. |
| 3 | * @ioc: The I/O Controller. | 5 | * @ioc: The I/O Controller. |
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index a87e2728b2c3..64d433ec4fc6 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
| @@ -328,21 +328,15 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
| 328 | goto err1; | 328 | goto err1; |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | if (ret) { | 331 | pxa2xx_configure_sockets(&dev->dev); |
| 332 | while (--i >= 0) | 332 | dev_set_drvdata(&dev->dev, sinfo); |
| 333 | soc_pcmcia_remove_one(&sinfo->skt[i]); | ||
| 334 | kfree(sinfo); | ||
| 335 | clk_put(clk); | ||
| 336 | } else { | ||
| 337 | pxa2xx_configure_sockets(&dev->dev); | ||
| 338 | dev_set_drvdata(&dev->dev, sinfo); | ||
| 339 | } | ||
| 340 | 333 | ||
| 341 | return 0; | 334 | return 0; |
| 342 | 335 | ||
| 343 | err1: | 336 | err1: |
| 344 | while (--i >= 0) | 337 | while (--i >= 0) |
| 345 | soc_pcmcia_remove_one(&sinfo->skt[i]); | 338 | soc_pcmcia_remove_one(&sinfo->skt[i]); |
| 339 | clk_put(clk); | ||
| 346 | kfree(sinfo); | 340 | kfree(sinfo); |
| 347 | err0: | 341 | err0: |
| 348 | return ret; | 342 | return ret; |
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c index 42a7d603c870..7481146a5b47 100644 --- a/drivers/platform/x86/ibm_rtl.c +++ b/drivers/platform/x86/ibm_rtl.c | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
| 34 | #include <asm/bios_ebda.h> | 34 | #include <asm/bios_ebda.h> |
| 35 | 35 | ||
| 36 | #include <asm-generic/io-64-nonatomic-lo-hi.h> | ||
| 37 | |||
| 36 | static bool force; | 38 | static bool force; |
| 37 | module_param(force, bool, 0); | 39 | module_param(force, bool, 0); |
| 38 | MODULE_PARM_DESC(force, "Force driver load, ignore DMI data"); | 40 | MODULE_PARM_DESC(force, "Force driver load, ignore DMI data"); |
| @@ -83,19 +85,6 @@ static void __iomem *rtl_cmd_addr; | |||
| 83 | static u8 rtl_cmd_type; | 85 | static u8 rtl_cmd_type; |
| 84 | static u8 rtl_cmd_width; | 86 | static u8 rtl_cmd_width; |
| 85 | 87 | ||
| 86 | #ifndef readq | ||
| 87 | static inline __u64 readq(const volatile void __iomem *addr) | ||
| 88 | { | ||
| 89 | const volatile u32 __iomem *p = addr; | ||
| 90 | u32 low, high; | ||
| 91 | |||
| 92 | low = readl(p); | ||
| 93 | high = readl(p + 1); | ||
| 94 | |||
| 95 | return low + ((u64)high << 32); | ||
| 96 | } | ||
| 97 | #endif | ||
| 98 | |||
| 99 | static void __iomem *rtl_port_map(phys_addr_t addr, unsigned long len) | 88 | static void __iomem *rtl_port_map(phys_addr_t addr, unsigned long len) |
| 100 | { | 89 | { |
| 101 | if (rtl_cmd_type == RTL_ADDR_TYPE_MMIO) | 90 | if (rtl_cmd_type == RTL_ADDR_TYPE_MMIO) |
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 809a3ae943c6..88a98cff5a44 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
| @@ -77,6 +77,8 @@ | |||
| 77 | #include <asm/processor.h> | 77 | #include <asm/processor.h> |
| 78 | #include "intel_ips.h" | 78 | #include "intel_ips.h" |
| 79 | 79 | ||
| 80 | #include <asm-generic/io-64-nonatomic-lo-hi.h> | ||
| 81 | |||
| 80 | #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32 | 82 | #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32 |
| 81 | 83 | ||
| 82 | /* | 84 | /* |
| @@ -344,19 +346,6 @@ struct ips_driver { | |||
| 344 | static bool | 346 | static bool |
| 345 | ips_gpu_turbo_enabled(struct ips_driver *ips); | 347 | ips_gpu_turbo_enabled(struct ips_driver *ips); |
| 346 | 348 | ||
| 347 | #ifndef readq | ||
| 348 | static inline __u64 readq(const volatile void __iomem *addr) | ||
| 349 | { | ||
| 350 | const volatile u32 __iomem *p = addr; | ||
| 351 | u32 low, high; | ||
| 352 | |||
| 353 | low = readl(p); | ||
| 354 | high = readl(p + 1); | ||
| 355 | |||
| 356 | return low + ((u64)high << 32); | ||
| 357 | } | ||
| 358 | #endif | ||
| 359 | |||
| 360 | /** | 349 | /** |
| 361 | * ips_cpu_busy - is CPU busy? | 350 | * ips_cpu_busy - is CPU busy? |
| 362 | * @ips: IPS driver struct | 351 | * @ips: IPS driver struct |
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index df33530cec4a..28b81ae4cf7f 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c | |||
| @@ -196,7 +196,7 @@ static const unsigned int LDO12_suspend_table[] = { | |||
| 196 | }; | 196 | }; |
| 197 | 197 | ||
| 198 | static const unsigned int LDO13_table[] = { | 198 | static const unsigned int LDO13_table[] = { |
| 199 | 1300000, 1800000, 2000000, 2500000, 2800000, 3000000, 0, 0, | 199 | 1200000, 1300000, 1800000, 2000000, 2500000, 2800000, 3000000, 0, |
| 200 | }; | 200 | }; |
| 201 | 201 | ||
| 202 | static const unsigned int LDO13_suspend_table[] = { | 202 | static const unsigned int LDO13_suspend_table[] = { |
| @@ -389,10 +389,10 @@ static struct pm8607_regulator_info pm8607_regulator_info[] = { | |||
| 389 | PM8607_LDO( 7, LDO7, 0, 3, SUPPLIES_EN12, 1), | 389 | PM8607_LDO( 7, LDO7, 0, 3, SUPPLIES_EN12, 1), |
| 390 | PM8607_LDO( 8, LDO8, 0, 3, SUPPLIES_EN12, 2), | 390 | PM8607_LDO( 8, LDO8, 0, 3, SUPPLIES_EN12, 2), |
| 391 | PM8607_LDO( 9, LDO9, 0, 3, SUPPLIES_EN12, 3), | 391 | PM8607_LDO( 9, LDO9, 0, 3, SUPPLIES_EN12, 3), |
| 392 | PM8607_LDO(10, LDO10, 0, 3, SUPPLIES_EN12, 4), | 392 | PM8607_LDO(10, LDO10, 0, 4, SUPPLIES_EN12, 4), |
| 393 | PM8607_LDO(12, LDO12, 0, 4, SUPPLIES_EN12, 5), | 393 | PM8607_LDO(12, LDO12, 0, 4, SUPPLIES_EN12, 5), |
| 394 | PM8607_LDO(13, VIBRATOR_SET, 1, 3, VIBRATOR_SET, 0), | 394 | PM8607_LDO(13, VIBRATOR_SET, 1, 3, VIBRATOR_SET, 0), |
| 395 | PM8607_LDO(14, LDO14, 0, 4, SUPPLIES_EN12, 6), | 395 | PM8607_LDO(14, LDO14, 0, 3, SUPPLIES_EN12, 6), |
| 396 | }; | 396 | }; |
| 397 | 397 | ||
| 398 | static int __devinit pm8607_regulator_probe(struct platform_device *pdev) | 398 | static int __devinit pm8607_regulator_probe(struct platform_device *pdev) |
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 7a61b17ddd04..740f468ba65f 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig | |||
| @@ -74,14 +74,6 @@ config REGULATOR_GPIO | |||
| 74 | and the platform has to provide a mapping of GPIO-states | 74 | and the platform has to provide a mapping of GPIO-states |
| 75 | to target volts/amps. | 75 | to target volts/amps. |
| 76 | 76 | ||
| 77 | config REGULATOR_BQ24022 | ||
| 78 | tristate "TI bq24022 Dual Input 1-Cell Li-Ion Charger IC" | ||
| 79 | help | ||
| 80 | This driver controls a TI bq24022 Charger attached via | ||
| 81 | GPIOs. The provided current regulator can enable/disable | ||
| 82 | charging select between 100 mA and 500 mA charging current | ||
| 83 | limit. | ||
| 84 | |||
| 85 | config REGULATOR_MAX1586 | 77 | config REGULATOR_MAX1586 |
| 86 | tristate "Maxim 1586/1587 voltage regulator" | 78 | tristate "Maxim 1586/1587 voltage regulator" |
| 87 | depends on I2C | 79 | depends on I2C |
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 503bac87715e..f53cf8082c62 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile | |||
| @@ -11,7 +11,6 @@ obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o | |||
| 11 | 11 | ||
| 12 | obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o | 12 | obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o |
| 13 | obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o | 13 | obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o |
| 14 | obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o | ||
| 15 | obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o | 14 | obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o |
| 16 | obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o | 15 | obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o |
| 17 | obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o | 16 | obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o |
diff --git a/drivers/regulator/bq24022.c b/drivers/regulator/bq24022.c deleted file mode 100644 index 9fab6d1bbe80..000000000000 --- a/drivers/regulator/bq24022.c +++ /dev/null | |||
| @@ -1,162 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Support for TI bq24022 (bqTINY-II) Dual Input (USB/AC Adpater) | ||
| 3 | * 1-Cell Li-Ion Charger connected via GPIOs. | ||
| 4 | * | ||
| 5 | * Copyright (c) 2008 Philipp Zabel | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/kernel.h> | ||
| 14 | #include <linux/init.h> | ||
| 15 | #include <linux/platform_device.h> | ||
| 16 | #include <linux/err.h> | ||
| 17 | #include <linux/module.h> | ||
| 18 | #include <linux/gpio.h> | ||
| 19 | #include <linux/regulator/bq24022.h> | ||
| 20 | #include <linux/regulator/driver.h> | ||
| 21 | |||
| 22 | |||
| 23 | static int bq24022_set_current_limit(struct regulator_dev *rdev, | ||
| 24 | int min_uA, int max_uA) | ||
| 25 | { | ||
| 26 | struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev); | ||
| 27 | |||
| 28 | dev_dbg(rdev_get_dev(rdev), "setting current limit to %s mA\n", | ||
| 29 | max_uA >= 500000 ? "500" : "100"); | ||
| 30 | |||
| 31 | /* REVISIT: maybe return error if min_uA != 0 ? */ | ||
| 32 | gpio_set_value(pdata->gpio_iset2, max_uA >= 500000); | ||
| 33 | return 0; | ||
| 34 | } | ||
| 35 | |||
| 36 | static int bq24022_get_current_limit(struct regulator_dev *rdev) | ||
| 37 | { | ||
| 38 | struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev); | ||
| 39 | |||
| 40 | return gpio_get_value(pdata->gpio_iset2) ? 500000 : 100000; | ||
| 41 | } | ||
| 42 | |||
| 43 | static int bq24022_enable(struct regulator_dev *rdev) | ||
| 44 | { | ||
| 45 | struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev); | ||
| 46 | |||
| 47 | dev_dbg(rdev_get_dev(rdev), "enabling charger\n"); | ||
| 48 | |||
| 49 | gpio_set_value(pdata->gpio_nce, 0); | ||
| 50 | return 0; | ||
| 51 | } | ||
| 52 | |||
| 53 | static int bq24022_disable(struct regulator_dev *rdev) | ||
| 54 | { | ||
| 55 | struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev); | ||
| 56 | |||
| 57 | dev_dbg(rdev_get_dev(rdev), "disabling charger\n"); | ||
| 58 | |||
| 59 | gpio_set_value(pdata->gpio_nce, 1); | ||
| 60 | return 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | static int bq24022_is_enabled(struct regulator_dev *rdev) | ||
| 64 | { | ||
| 65 | struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev); | ||
| 66 | |||
| 67 | return !gpio_get_value(pdata->gpio_nce); | ||
| 68 | } | ||
| 69 | |||
| 70 | static struct regulator_ops bq24022_ops = { | ||
| 71 | .set_current_limit = bq24022_set_current_limit, | ||
| 72 | .get_current_limit = bq24022_get_current_limit, | ||
| 73 | .enable = bq24022_enable, | ||
| 74 | .disable = bq24022_disable, | ||
| 75 | .is_enabled = bq24022_is_enabled, | ||
| 76 | }; | ||
| 77 | |||
| 78 | static struct regulator_desc bq24022_desc = { | ||
| 79 | .name = "bq24022", | ||
| 80 | .ops = &bq24022_ops, | ||
| 81 | .type = REGULATOR_CURRENT, | ||
| 82 | .owner = THIS_MODULE, | ||
| 83 | }; | ||
| 84 | |||
| 85 | static int __init bq24022_probe(struct platform_device *pdev) | ||
| 86 | { | ||
| 87 | struct bq24022_mach_info *pdata = pdev->dev.platform_data; | ||
| 88 | struct regulator_dev *bq24022; | ||
| 89 | int ret; | ||
| 90 | |||
| 91 | if (!pdata || !pdata->gpio_nce || !pdata->gpio_iset2) | ||
| 92 | return -EINVAL; | ||
| 93 | |||
| 94 | ret = gpio_request(pdata->gpio_nce, "ncharge_en"); | ||
| 95 | if (ret) { | ||
| 96 | dev_dbg(&pdev->dev, "couldn't request nCE GPIO: %d\n", | ||
| 97 | pdata->gpio_nce); | ||
| 98 | goto err_ce; | ||
| 99 | } | ||
| 100 | ret = gpio_request(pdata->gpio_iset2, "charge_mode"); | ||
| 101 | if (ret) { | ||
| 102 | dev_dbg(&pdev->dev, "couldn't request ISET2 GPIO: %d\n", | ||
| 103 | pdata->gpio_iset2); | ||
| 104 | goto err_iset2; | ||
| 105 | } | ||
| 106 | ret = gpio_direction_output(pdata->gpio_iset2, 0); | ||
| 107 | ret = gpio_direction_output(pdata->gpio_nce, 1); | ||
| 108 | |||
| 109 | bq24022 = regulator_register(&bq24022_desc, &pdev->dev, | ||
| 110 | pdata->init_data, pdata, NULL); | ||
| 111 | if (IS_ERR(bq24022)) { | ||
| 112 | dev_dbg(&pdev->dev, "couldn't register regulator\n"); | ||
| 113 | ret = PTR_ERR(bq24022); | ||
| 114 | goto err_reg; | ||
| 115 | } | ||
| 116 | platform_set_drvdata(pdev, bq24022); | ||
| 117 | dev_dbg(&pdev->dev, "registered regulator\n"); | ||
| 118 | |||
| 119 | return 0; | ||
| 120 | err_reg: | ||
| 121 | gpio_free(pdata->gpio_iset2); | ||
| 122 | err_iset2: | ||
| 123 | gpio_free(pdata->gpio_nce); | ||
| 124 | err_ce: | ||
| 125 | return ret; | ||
| 126 | } | ||
| 127 | |||
| 128 | static int __devexit bq24022_remove(struct platform_device *pdev) | ||
| 129 | { | ||
| 130 | struct bq24022_mach_info *pdata = pdev->dev.platform_data; | ||
| 131 | struct regulator_dev *bq24022 = platform_get_drvdata(pdev); | ||
| 132 | |||
| 133 | regulator_unregister(bq24022); | ||
| 134 | gpio_free(pdata->gpio_iset2); | ||
| 135 | gpio_free(pdata->gpio_nce); | ||
| 136 | |||
| 137 | return 0; | ||
| 138 | } | ||
| 139 | |||
| 140 | static struct platform_driver bq24022_driver = { | ||
| 141 | .driver = { | ||
| 142 | .name = "bq24022", | ||
| 143 | }, | ||
| 144 | .remove = __devexit_p(bq24022_remove), | ||
| 145 | }; | ||
| 146 | |||
| 147 | static int __init bq24022_init(void) | ||
| 148 | { | ||
| 149 | return platform_driver_probe(&bq24022_driver, bq24022_probe); | ||
| 150 | } | ||
| 151 | |||
| 152 | static void __exit bq24022_exit(void) | ||
| 153 | { | ||
| 154 | platform_driver_unregister(&bq24022_driver); | ||
| 155 | } | ||
| 156 | |||
| 157 | module_init(bq24022_init); | ||
| 158 | module_exit(bq24022_exit); | ||
| 159 | |||
| 160 | MODULE_AUTHOR("Philipp Zabel"); | ||
| 161 | MODULE_DESCRIPTION("TI bq24022 Li-Ion Charger driver"); | ||
| 162 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 3a125b835546..59efc63c4e48 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
| @@ -773,8 +773,8 @@ config RTC_DRV_EP93XX | |||
| 773 | will be called rtc-ep93xx. | 773 | will be called rtc-ep93xx. |
| 774 | 774 | ||
| 775 | config RTC_DRV_SA1100 | 775 | config RTC_DRV_SA1100 |
| 776 | tristate "SA11x0/PXA2xx" | 776 | tristate "SA11x0/PXA2xx/PXA910" |
| 777 | depends on ARCH_SA1100 || ARCH_PXA | 777 | depends on ARCH_SA1100 || ARCH_PXA || ARCH_MMP |
| 778 | help | 778 | help |
| 779 | If you say Y here you will get access to the real time clock | 779 | If you say Y here you will get access to the real time clock |
| 780 | built into your SA11x0 or PXA2xx CPU. | 780 | built into your SA11x0 or PXA2xx CPU. |
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index aef40bd2957b..78951866f8ab 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | 35 | ||
| 36 | enum s3c_cpu_type { | 36 | enum s3c_cpu_type { |
| 37 | TYPE_S3C2410, | 37 | TYPE_S3C2410, |
| 38 | TYPE_S3C2416, | ||
| 39 | TYPE_S3C2443, | ||
| 38 | TYPE_S3C64XX, | 40 | TYPE_S3C64XX, |
| 39 | }; | 41 | }; |
| 40 | 42 | ||
| @@ -132,6 +134,7 @@ static int s3c_rtc_setfreq(struct device *dev, int freq) | |||
| 132 | struct platform_device *pdev = to_platform_device(dev); | 134 | struct platform_device *pdev = to_platform_device(dev); |
| 133 | struct rtc_device *rtc_dev = platform_get_drvdata(pdev); | 135 | struct rtc_device *rtc_dev = platform_get_drvdata(pdev); |
| 134 | unsigned int tmp = 0; | 136 | unsigned int tmp = 0; |
| 137 | int val; | ||
| 135 | 138 | ||
| 136 | if (!is_power_of_2(freq)) | 139 | if (!is_power_of_2(freq)) |
| 137 | return -EINVAL; | 140 | return -EINVAL; |
| @@ -139,12 +142,22 @@ static int s3c_rtc_setfreq(struct device *dev, int freq) | |||
| 139 | clk_enable(rtc_clk); | 142 | clk_enable(rtc_clk); |
| 140 | spin_lock_irq(&s3c_rtc_pie_lock); | 143 | spin_lock_irq(&s3c_rtc_pie_lock); |
| 141 | 144 | ||
| 142 | if (s3c_rtc_cpu_type == TYPE_S3C2410) { | 145 | if (s3c_rtc_cpu_type != TYPE_S3C64XX) { |
| 143 | tmp = readb(s3c_rtc_base + S3C2410_TICNT); | 146 | tmp = readb(s3c_rtc_base + S3C2410_TICNT); |
| 144 | tmp &= S3C2410_TICNT_ENABLE; | 147 | tmp &= S3C2410_TICNT_ENABLE; |
| 145 | } | 148 | } |
| 146 | 149 | ||
| 147 | tmp |= (rtc_dev->max_user_freq / freq)-1; | 150 | val = (rtc_dev->max_user_freq / freq) - 1; |
| 151 | |||
| 152 | if (s3c_rtc_cpu_type == TYPE_S3C2416 || s3c_rtc_cpu_type == TYPE_S3C2443) { | ||
| 153 | tmp |= S3C2443_TICNT_PART(val); | ||
| 154 | writel(S3C2443_TICNT1_PART(val), s3c_rtc_base + S3C2443_TICNT1); | ||
| 155 | |||
| 156 | if (s3c_rtc_cpu_type == TYPE_S3C2416) | ||
| 157 | writel(S3C2416_TICNT2_PART(val), s3c_rtc_base + S3C2416_TICNT2); | ||
| 158 | } else { | ||
| 159 | tmp |= val; | ||
| 160 | } | ||
| 148 | 161 | ||
| 149 | writel(tmp, s3c_rtc_base + S3C2410_TICNT); | 162 | writel(tmp, s3c_rtc_base + S3C2410_TICNT); |
| 150 | spin_unlock_irq(&s3c_rtc_pie_lock); | 163 | spin_unlock_irq(&s3c_rtc_pie_lock); |
| @@ -371,7 +384,7 @@ static void s3c_rtc_enable(struct platform_device *pdev, int en) | |||
| 371 | tmp &= ~S3C2410_RTCCON_RTCEN; | 384 | tmp &= ~S3C2410_RTCCON_RTCEN; |
| 372 | writew(tmp, base + S3C2410_RTCCON); | 385 | writew(tmp, base + S3C2410_RTCCON); |
| 373 | 386 | ||
| 374 | if (s3c_rtc_cpu_type == TYPE_S3C2410) { | 387 | if (s3c_rtc_cpu_type != TYPE_S3C64XX) { |
| 375 | tmp = readb(base + S3C2410_TICNT); | 388 | tmp = readb(base + S3C2410_TICNT); |
| 376 | tmp &= ~S3C2410_TICNT_ENABLE; | 389 | tmp &= ~S3C2410_TICNT_ENABLE; |
| 377 | writeb(tmp, base + S3C2410_TICNT); | 390 | writeb(tmp, base + S3C2410_TICNT); |
| @@ -428,12 +441,27 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev) | |||
| 428 | return 0; | 441 | return 0; |
| 429 | } | 442 | } |
| 430 | 443 | ||
| 444 | static const struct of_device_id s3c_rtc_dt_match[]; | ||
| 445 | |||
| 446 | static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) | ||
| 447 | { | ||
| 448 | #ifdef CONFIG_OF | ||
| 449 | if (pdev->dev.of_node) { | ||
| 450 | const struct of_device_id *match; | ||
| 451 | match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node); | ||
| 452 | return match->data; | ||
| 453 | } | ||
| 454 | #endif | ||
| 455 | return platform_get_device_id(pdev)->driver_data; | ||
| 456 | } | ||
| 457 | |||
| 431 | static int __devinit s3c_rtc_probe(struct platform_device *pdev) | 458 | static int __devinit s3c_rtc_probe(struct platform_device *pdev) |
| 432 | { | 459 | { |
| 433 | struct rtc_device *rtc; | 460 | struct rtc_device *rtc; |
| 434 | struct rtc_time rtc_tm; | 461 | struct rtc_time rtc_tm; |
| 435 | struct resource *res; | 462 | struct resource *res; |
| 436 | int ret; | 463 | int ret; |
| 464 | int tmp; | ||
| 437 | 465 | ||
| 438 | pr_debug("%s: probe=%p\n", __func__, pdev); | 466 | pr_debug("%s: probe=%p\n", __func__, pdev); |
| 439 | 467 | ||
| @@ -508,13 +536,7 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev) | |||
| 508 | goto err_nortc; | 536 | goto err_nortc; |
| 509 | } | 537 | } |
| 510 | 538 | ||
| 511 | #ifdef CONFIG_OF | 539 | s3c_rtc_cpu_type = s3c_rtc_get_driver_data(pdev); |
| 512 | if (pdev->dev.of_node) | ||
| 513 | s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node, | ||
| 514 | "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410; | ||
| 515 | else | ||
| 516 | #endif | ||
| 517 | s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data; | ||
| 518 | 540 | ||
| 519 | /* Check RTC Time */ | 541 | /* Check RTC Time */ |
| 520 | 542 | ||
| @@ -533,11 +555,17 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev) | |||
| 533 | dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n"); | 555 | dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n"); |
| 534 | } | 556 | } |
| 535 | 557 | ||
| 536 | if (s3c_rtc_cpu_type == TYPE_S3C64XX) | 558 | if (s3c_rtc_cpu_type != TYPE_S3C2410) |
| 537 | rtc->max_user_freq = 32768; | 559 | rtc->max_user_freq = 32768; |
| 538 | else | 560 | else |
| 539 | rtc->max_user_freq = 128; | 561 | rtc->max_user_freq = 128; |
| 540 | 562 | ||
| 563 | if (s3c_rtc_cpu_type == TYPE_S3C2416 || s3c_rtc_cpu_type == TYPE_S3C2443) { | ||
| 564 | tmp = readw(s3c_rtc_base + S3C2410_RTCCON); | ||
| 565 | tmp |= S3C2443_RTCCON_TICSEL; | ||
| 566 | writew(tmp, s3c_rtc_base + S3C2410_RTCCON); | ||
| 567 | } | ||
| 568 | |||
| 541 | platform_set_drvdata(pdev, rtc); | 569 | platform_set_drvdata(pdev, rtc); |
| 542 | 570 | ||
| 543 | s3c_rtc_setfreq(&pdev->dev, 1); | 571 | s3c_rtc_setfreq(&pdev->dev, 1); |
| @@ -638,8 +666,19 @@ static int s3c_rtc_resume(struct platform_device *pdev) | |||
| 638 | 666 | ||
| 639 | #ifdef CONFIG_OF | 667 | #ifdef CONFIG_OF |
| 640 | static const struct of_device_id s3c_rtc_dt_match[] = { | 668 | static const struct of_device_id s3c_rtc_dt_match[] = { |
| 641 | { .compatible = "samsung,s3c2410-rtc" }, | 669 | { |
| 642 | { .compatible = "samsung,s3c6410-rtc" }, | 670 | .compatible = "samsung,s3c2410-rtc" |
| 671 | .data = TYPE_S3C2410, | ||
| 672 | }, { | ||
| 673 | .compatible = "samsung,s3c2416-rtc" | ||
| 674 | .data = TYPE_S3C2416, | ||
| 675 | }, { | ||
| 676 | .compatible = "samsung,s3c2443-rtc" | ||
| 677 | .data = TYPE_S3C2443, | ||
| 678 | }, { | ||
| 679 | .compatible = "samsung,s3c6410-rtc" | ||
| 680 | .data = TYPE_S3C64XX, | ||
| 681 | }, | ||
| 643 | {}, | 682 | {}, |
| 644 | }; | 683 | }; |
| 645 | MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match); | 684 | MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match); |
| @@ -652,6 +691,12 @@ static struct platform_device_id s3c_rtc_driver_ids[] = { | |||
| 652 | .name = "s3c2410-rtc", | 691 | .name = "s3c2410-rtc", |
| 653 | .driver_data = TYPE_S3C2410, | 692 | .driver_data = TYPE_S3C2410, |
| 654 | }, { | 693 | }, { |
| 694 | .name = "s3c2416-rtc", | ||
| 695 | .driver_data = TYPE_S3C2416, | ||
| 696 | }, { | ||
| 697 | .name = "s3c2443-rtc", | ||
| 698 | .driver_data = TYPE_S3C2443, | ||
| 699 | }, { | ||
| 655 | .name = "s3c64xx-rtc", | 700 | .name = "s3c64xx-rtc", |
| 656 | .driver_data = TYPE_S3C64XX, | 701 | .driver_data = TYPE_S3C64XX, |
| 657 | }, | 702 | }, |
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index cb9a585312cc..e443b7850ede 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c | |||
| @@ -23,94 +23,44 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 26 | #include <linux/clk.h> | ||
| 26 | #include <linux/rtc.h> | 27 | #include <linux/rtc.h> |
| 27 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 28 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
| 29 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
| 31 | #include <linux/slab.h> | ||
| 30 | #include <linux/string.h> | 32 | #include <linux/string.h> |
| 33 | #include <linux/of.h> | ||
| 31 | #include <linux/pm.h> | 34 | #include <linux/pm.h> |
| 32 | #include <linux/bitops.h> | 35 | #include <linux/bitops.h> |
| 33 | 36 | ||
| 34 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
| 35 | #include <asm/irq.h> | 38 | #include <asm/irq.h> |
| 36 | 39 | ||
| 37 | #ifdef CONFIG_ARCH_PXA | 40 | #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP) |
| 38 | #include <mach/regs-rtc.h> | 41 | #include <mach/regs-rtc.h> |
| 39 | #endif | 42 | #endif |
| 40 | 43 | ||
| 41 | #define RTC_DEF_DIVIDER (32768 - 1) | 44 | #define RTC_DEF_DIVIDER (32768 - 1) |
| 42 | #define RTC_DEF_TRIM 0 | 45 | #define RTC_DEF_TRIM 0 |
| 43 | 46 | #define RTC_FREQ 1024 | |
| 44 | static const unsigned long RTC_FREQ = 1024; | 47 | |
| 45 | static struct rtc_time rtc_alarm; | 48 | struct sa1100_rtc { |
| 46 | static DEFINE_SPINLOCK(sa1100_rtc_lock); | 49 | spinlock_t lock; |
| 47 | 50 | int irq_1hz; | |
| 48 | static inline int rtc_periodic_alarm(struct rtc_time *tm) | 51 | int irq_alarm; |
| 49 | { | 52 | struct rtc_device *rtc; |
| 50 | return (tm->tm_year == -1) || | 53 | struct clk *clk; |
| 51 | ((unsigned)tm->tm_mon >= 12) || | 54 | }; |
| 52 | ((unsigned)(tm->tm_mday - 1) >= 31) || | ||
| 53 | ((unsigned)tm->tm_hour > 23) || | ||
| 54 | ((unsigned)tm->tm_min > 59) || | ||
| 55 | ((unsigned)tm->tm_sec > 59); | ||
| 56 | } | ||
| 57 | |||
| 58 | /* | ||
| 59 | * Calculate the next alarm time given the requested alarm time mask | ||
| 60 | * and the current time. | ||
| 61 | */ | ||
| 62 | static void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, | ||
| 63 | struct rtc_time *alrm) | ||
| 64 | { | ||
| 65 | unsigned long next_time; | ||
| 66 | unsigned long now_time; | ||
| 67 | |||
| 68 | next->tm_year = now->tm_year; | ||
| 69 | next->tm_mon = now->tm_mon; | ||
| 70 | next->tm_mday = now->tm_mday; | ||
| 71 | next->tm_hour = alrm->tm_hour; | ||
| 72 | next->tm_min = alrm->tm_min; | ||
| 73 | next->tm_sec = alrm->tm_sec; | ||
| 74 | |||
| 75 | rtc_tm_to_time(now, &now_time); | ||
| 76 | rtc_tm_to_time(next, &next_time); | ||
| 77 | |||
| 78 | if (next_time < now_time) { | ||
| 79 | /* Advance one day */ | ||
| 80 | next_time += 60 * 60 * 24; | ||
| 81 | rtc_time_to_tm(next_time, next); | ||
| 82 | } | ||
| 83 | } | ||
| 84 | |||
| 85 | static int rtc_update_alarm(struct rtc_time *alrm) | ||
| 86 | { | ||
| 87 | struct rtc_time alarm_tm, now_tm; | ||
| 88 | unsigned long now, time; | ||
| 89 | int ret; | ||
| 90 | |||
| 91 | do { | ||
| 92 | now = RCNR; | ||
| 93 | rtc_time_to_tm(now, &now_tm); | ||
| 94 | rtc_next_alarm_time(&alarm_tm, &now_tm, alrm); | ||
| 95 | ret = rtc_tm_to_time(&alarm_tm, &time); | ||
| 96 | if (ret != 0) | ||
| 97 | break; | ||
| 98 | |||
| 99 | RTSR = RTSR & (RTSR_HZE|RTSR_ALE|RTSR_AL); | ||
| 100 | RTAR = time; | ||
| 101 | } while (now != RCNR); | ||
| 102 | |||
| 103 | return ret; | ||
| 104 | } | ||
| 105 | 55 | ||
| 106 | static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id) | 56 | static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id) |
| 107 | { | 57 | { |
| 108 | struct platform_device *pdev = to_platform_device(dev_id); | 58 | struct sa1100_rtc *info = dev_get_drvdata(dev_id); |
| 109 | struct rtc_device *rtc = platform_get_drvdata(pdev); | 59 | struct rtc_device *rtc = info->rtc; |
| 110 | unsigned int rtsr; | 60 | unsigned int rtsr; |
| 111 | unsigned long events = 0; | 61 | unsigned long events = 0; |
| 112 | 62 | ||
| 113 | spin_lock(&sa1100_rtc_lock); | 63 | spin_lock(&info->lock); |
| 114 | 64 | ||
| 115 | rtsr = RTSR; | 65 | rtsr = RTSR; |
| 116 | /* clear interrupt sources */ | 66 | /* clear interrupt sources */ |
| @@ -146,30 +96,30 @@ static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id) | |||
| 146 | 96 | ||
| 147 | rtc_update_irq(rtc, 1, events); | 97 | rtc_update_irq(rtc, 1, events); |
| 148 | 98 | ||
| 149 | if (rtsr & RTSR_AL && rtc_periodic_alarm(&rtc_alarm)) | 99 | spin_unlock(&info->lock); |
| 150 | rtc_update_alarm(&rtc_alarm); | ||
| 151 | |||
| 152 | spin_unlock(&sa1100_rtc_lock); | ||
| 153 | 100 | ||
| 154 | return IRQ_HANDLED; | 101 | return IRQ_HANDLED; |
| 155 | } | 102 | } |
| 156 | 103 | ||
| 157 | static int sa1100_rtc_open(struct device *dev) | 104 | static int sa1100_rtc_open(struct device *dev) |
| 158 | { | 105 | { |
| 106 | struct sa1100_rtc *info = dev_get_drvdata(dev); | ||
| 107 | struct rtc_device *rtc = info->rtc; | ||
| 159 | int ret; | 108 | int ret; |
| 160 | struct platform_device *plat_dev = to_platform_device(dev); | ||
| 161 | struct rtc_device *rtc = platform_get_drvdata(plat_dev); | ||
| 162 | 109 | ||
| 163 | ret = request_irq(IRQ_RTC1Hz, sa1100_rtc_interrupt, IRQF_DISABLED, | 110 | ret = clk_prepare_enable(info->clk); |
| 111 | if (ret) | ||
| 112 | goto fail_clk; | ||
| 113 | ret = request_irq(info->irq_1hz, sa1100_rtc_interrupt, IRQF_DISABLED, | ||
| 164 | "rtc 1Hz", dev); | 114 | "rtc 1Hz", dev); |
| 165 | if (ret) { | 115 | if (ret) { |
| 166 | dev_err(dev, "IRQ %d already in use.\n", IRQ_RTC1Hz); | 116 | dev_err(dev, "IRQ %d already in use.\n", info->irq_1hz); |
| 167 | goto fail_ui; | 117 | goto fail_ui; |
| 168 | } | 118 | } |
| 169 | ret = request_irq(IRQ_RTCAlrm, sa1100_rtc_interrupt, IRQF_DISABLED, | 119 | ret = request_irq(info->irq_alarm, sa1100_rtc_interrupt, IRQF_DISABLED, |
| 170 | "rtc Alrm", dev); | 120 | "rtc Alrm", dev); |
| 171 | if (ret) { | 121 | if (ret) { |
| 172 | dev_err(dev, "IRQ %d already in use.\n", IRQ_RTCAlrm); | 122 | dev_err(dev, "IRQ %d already in use.\n", info->irq_alarm); |
| 173 | goto fail_ai; | 123 | goto fail_ai; |
| 174 | } | 124 | } |
| 175 | rtc->max_user_freq = RTC_FREQ; | 125 | rtc->max_user_freq = RTC_FREQ; |
| @@ -178,29 +128,36 @@ static int sa1100_rtc_open(struct device *dev) | |||
| 178 | return 0; | 128 | return 0; |
| 179 | 129 | ||
| 180 | fail_ai: | 130 | fail_ai: |
| 181 | free_irq(IRQ_RTC1Hz, dev); | 131 | free_irq(info->irq_1hz, dev); |
| 182 | fail_ui: | 132 | fail_ui: |
| 133 | clk_disable_unprepare(info->clk); | ||
| 134 | fail_clk: | ||
| 183 | return ret; | 135 | return ret; |
| 184 | } | 136 | } |
| 185 | 137 | ||
| 186 | static void sa1100_rtc_release(struct device *dev) | 138 | static void sa1100_rtc_release(struct device *dev) |
| 187 | { | 139 | { |
| 188 | spin_lock_irq(&sa1100_rtc_lock); | 140 | struct sa1100_rtc *info = dev_get_drvdata(dev); |
| 141 | |||
| 142 | spin_lock_irq(&info->lock); | ||
| 189 | RTSR = 0; | 143 | RTSR = 0; |
| 190 | spin_unlock_irq(&sa1100_rtc_lock); | 144 | spin_unlock_irq(&info->lock); |
| 191 | 145 | ||
| 192 | free_irq(IRQ_RTCAlrm, dev); | 146 | free_irq(info->irq_alarm, dev); |
| 193 | free_irq(IRQ_RTC1Hz, dev); | 147 | free_irq(info->irq_1hz, dev); |
| 148 | clk_disable_unprepare(info->clk); | ||
| 194 | } | 149 | } |
| 195 | 150 | ||
| 196 | static int sa1100_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) | 151 | static int sa1100_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) |
| 197 | { | 152 | { |
| 198 | spin_lock_irq(&sa1100_rtc_lock); | 153 | struct sa1100_rtc *info = dev_get_drvdata(dev); |
| 154 | |||
| 155 | spin_lock_irq(&info->lock); | ||
| 199 | if (enabled) | 156 | if (enabled) |
| 200 | RTSR |= RTSR_ALE; | 157 | RTSR |= RTSR_ALE; |
| 201 | else | 158 | else |
| 202 | RTSR &= ~RTSR_ALE; | 159 | RTSR &= ~RTSR_ALE; |
| 203 | spin_unlock_irq(&sa1100_rtc_lock); | 160 | spin_unlock_irq(&info->lock); |
| 204 | return 0; | 161 | return 0; |
| 205 | } | 162 | } |
| 206 | 163 | ||
| @@ -225,7 +182,6 @@ static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
| 225 | { | 182 | { |
| 226 | u32 rtsr; | 183 | u32 rtsr; |
| 227 | 184 | ||
| 228 | memcpy(&alrm->time, &rtc_alarm, sizeof(struct rtc_time)); | ||
| 229 | rtsr = RTSR; | 185 | rtsr = RTSR; |
| 230 | alrm->enabled = (rtsr & RTSR_ALE) ? 1 : 0; | 186 | alrm->enabled = (rtsr & RTSR_ALE) ? 1 : 0; |
| 231 | alrm->pending = (rtsr & RTSR_AL) ? 1 : 0; | 187 | alrm->pending = (rtsr & RTSR_AL) ? 1 : 0; |
| @@ -234,17 +190,22 @@ static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
| 234 | 190 | ||
| 235 | static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) | 191 | static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) |
| 236 | { | 192 | { |
| 193 | struct sa1100_rtc *info = dev_get_drvdata(dev); | ||
| 194 | unsigned long time; | ||
| 237 | int ret; | 195 | int ret; |
| 238 | 196 | ||
| 239 | spin_lock_irq(&sa1100_rtc_lock); | 197 | spin_lock_irq(&info->lock); |
| 240 | ret = rtc_update_alarm(&alrm->time); | 198 | ret = rtc_tm_to_time(&alrm->time, &time); |
| 241 | if (ret == 0) { | 199 | if (ret != 0) |
| 242 | if (alrm->enabled) | 200 | goto out; |
| 243 | RTSR |= RTSR_ALE; | 201 | RTSR = RTSR & (RTSR_HZE|RTSR_ALE|RTSR_AL); |
| 244 | else | 202 | RTAR = time; |
| 245 | RTSR &= ~RTSR_ALE; | 203 | if (alrm->enabled) |
| 246 | } | 204 | RTSR |= RTSR_ALE; |
| 247 | spin_unlock_irq(&sa1100_rtc_lock); | 205 | else |
| 206 | RTSR &= ~RTSR_ALE; | ||
| 207 | out: | ||
| 208 | spin_unlock_irq(&info->lock); | ||
| 248 | 209 | ||
| 249 | return ret; | 210 | return ret; |
| 250 | } | 211 | } |
| @@ -271,6 +232,27 @@ static const struct rtc_class_ops sa1100_rtc_ops = { | |||
| 271 | static int sa1100_rtc_probe(struct platform_device *pdev) | 232 | static int sa1100_rtc_probe(struct platform_device *pdev) |
| 272 | { | 233 | { |
| 273 | struct rtc_device *rtc; | 234 | struct rtc_device *rtc; |
| 235 | struct sa1100_rtc *info; | ||
| 236 | int irq_1hz, irq_alarm, ret = 0; | ||
| 237 | |||
| 238 | irq_1hz = platform_get_irq_byname(pdev, "rtc 1Hz"); | ||
| 239 | irq_alarm = platform_get_irq_byname(pdev, "rtc alarm"); | ||
| 240 | if (irq_1hz < 0 || irq_alarm < 0) | ||
| 241 | return -ENODEV; | ||
| 242 | |||
| 243 | info = kzalloc(sizeof(struct sa1100_rtc), GFP_KERNEL); | ||
| 244 | if (!info) | ||
| 245 | return -ENOMEM; | ||
| 246 | info->clk = clk_get(&pdev->dev, NULL); | ||
| 247 | if (IS_ERR(info->clk)) { | ||
| 248 | dev_err(&pdev->dev, "failed to find rtc clock source\n"); | ||
| 249 | ret = PTR_ERR(info->clk); | ||
| 250 | goto err_clk; | ||
| 251 | } | ||
| 252 | info->irq_1hz = irq_1hz; | ||
| 253 | info->irq_alarm = irq_alarm; | ||
| 254 | spin_lock_init(&info->lock); | ||
| 255 | platform_set_drvdata(pdev, info); | ||
| 274 | 256 | ||
| 275 | /* | 257 | /* |
| 276 | * According to the manual we should be able to let RTTR be zero | 258 | * According to the manual we should be able to let RTTR be zero |
| @@ -292,10 +274,11 @@ static int sa1100_rtc_probe(struct platform_device *pdev) | |||
| 292 | rtc = rtc_device_register(pdev->name, &pdev->dev, &sa1100_rtc_ops, | 274 | rtc = rtc_device_register(pdev->name, &pdev->dev, &sa1100_rtc_ops, |
| 293 | THIS_MODULE); | 275 | THIS_MODULE); |
| 294 | 276 | ||
| 295 | if (IS_ERR(rtc)) | 277 | if (IS_ERR(rtc)) { |
| 296 | return PTR_ERR(rtc); | 278 | ret = PTR_ERR(rtc); |
| 297 | 279 | goto err_dev; | |
| 298 | platform_set_drvdata(pdev, rtc); | 280 | } |
| 281 | info->rtc = rtc; | ||
| 299 | 282 | ||
| 300 | /* Fix for a nasty initialization problem the in SA11xx RTSR register. | 283 | /* Fix for a nasty initialization problem the in SA11xx RTSR register. |
| 301 | * See also the comments in sa1100_rtc_interrupt(). | 284 | * See also the comments in sa1100_rtc_interrupt(). |
| @@ -322,14 +305,24 @@ static int sa1100_rtc_probe(struct platform_device *pdev) | |||
| 322 | RTSR = RTSR_AL | RTSR_HZ; | 305 | RTSR = RTSR_AL | RTSR_HZ; |
| 323 | 306 | ||
| 324 | return 0; | 307 | return 0; |
| 308 | err_dev: | ||
| 309 | platform_set_drvdata(pdev, NULL); | ||
| 310 | clk_put(info->clk); | ||
| 311 | err_clk: | ||
| 312 | kfree(info); | ||
| 313 | return ret; | ||
| 325 | } | 314 | } |
| 326 | 315 | ||
| 327 | static int sa1100_rtc_remove(struct platform_device *pdev) | 316 | static int sa1100_rtc_remove(struct platform_device *pdev) |
| 328 | { | 317 | { |
| 329 | struct rtc_device *rtc = platform_get_drvdata(pdev); | 318 | struct sa1100_rtc *info = platform_get_drvdata(pdev); |
| 330 | 319 | ||
| 331 | if (rtc) | 320 | if (info) { |
| 332 | rtc_device_unregister(rtc); | 321 | rtc_device_unregister(info->rtc); |
| 322 | clk_put(info->clk); | ||
| 323 | platform_set_drvdata(pdev, NULL); | ||
| 324 | kfree(info); | ||
| 325 | } | ||
| 333 | 326 | ||
| 334 | return 0; | 327 | return 0; |
| 335 | } | 328 | } |
| @@ -337,15 +330,17 @@ static int sa1100_rtc_remove(struct platform_device *pdev) | |||
| 337 | #ifdef CONFIG_PM | 330 | #ifdef CONFIG_PM |
| 338 | static int sa1100_rtc_suspend(struct device *dev) | 331 | static int sa1100_rtc_suspend(struct device *dev) |
| 339 | { | 332 | { |
| 333 | struct sa1100_rtc *info = dev_get_drvdata(dev); | ||
| 340 | if (device_may_wakeup(dev)) | 334 | if (device_may_wakeup(dev)) |
| 341 | enable_irq_wake(IRQ_RTCAlrm); | 335 | enable_irq_wake(info->irq_alarm); |
| 342 | return 0; | 336 | return 0; |
| 343 | } | 337 | } |
| 344 | 338 | ||
| 345 | static int sa1100_rtc_resume(struct device *dev) | 339 | static int sa1100_rtc_resume(struct device *dev) |
| 346 | { | 340 | { |
| 341 | struct sa1100_rtc *info = dev_get_drvdata(dev); | ||
| 347 | if (device_may_wakeup(dev)) | 342 | if (device_may_wakeup(dev)) |
| 348 | disable_irq_wake(IRQ_RTCAlrm); | 343 | disable_irq_wake(info->irq_alarm); |
| 349 | return 0; | 344 | return 0; |
| 350 | } | 345 | } |
| 351 | 346 | ||
| @@ -355,6 +350,13 @@ static const struct dev_pm_ops sa1100_rtc_pm_ops = { | |||
| 355 | }; | 350 | }; |
| 356 | #endif | 351 | #endif |
| 357 | 352 | ||
| 353 | static struct of_device_id sa1100_rtc_dt_ids[] = { | ||
| 354 | { .compatible = "mrvl,sa1100-rtc", }, | ||
| 355 | { .compatible = "mrvl,mmp-rtc", }, | ||
| 356 | {} | ||
| 357 | }; | ||
| 358 | MODULE_DEVICE_TABLE(of, sa1100_rtc_dt_ids); | ||
| 359 | |||
| 358 | static struct platform_driver sa1100_rtc_driver = { | 360 | static struct platform_driver sa1100_rtc_driver = { |
| 359 | .probe = sa1100_rtc_probe, | 361 | .probe = sa1100_rtc_probe, |
| 360 | .remove = sa1100_rtc_remove, | 362 | .remove = sa1100_rtc_remove, |
| @@ -363,6 +365,7 @@ static struct platform_driver sa1100_rtc_driver = { | |||
| 363 | #ifdef CONFIG_PM | 365 | #ifdef CONFIG_PM |
| 364 | .pm = &sa1100_rtc_pm_ops, | 366 | .pm = &sa1100_rtc_pm_ops, |
| 365 | #endif | 367 | #endif |
| 368 | .of_match_table = sa1100_rtc_dt_ids, | ||
| 366 | }, | 369 | }, |
| 367 | }; | 370 | }; |
| 368 | 371 | ||
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 70880be26015..2617b1ed4709 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
| @@ -18,12 +18,12 @@ | |||
| 18 | #include <linux/hdreg.h> /* HDIO_GETGEO */ | 18 | #include <linux/hdreg.h> /* HDIO_GETGEO */ |
| 19 | #include <linux/bio.h> | 19 | #include <linux/bio.h> |
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/compat.h> | ||
| 21 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 22 | 23 | ||
| 23 | #include <asm/debug.h> | 24 | #include <asm/debug.h> |
| 24 | #include <asm/idals.h> | 25 | #include <asm/idals.h> |
| 25 | #include <asm/ebcdic.h> | 26 | #include <asm/ebcdic.h> |
| 26 | #include <asm/compat.h> | ||
| 27 | #include <asm/io.h> | 27 | #include <asm/io.h> |
| 28 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
| 29 | #include <asm/cio.h> | 29 | #include <asm/cio.h> |
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index f1a2016829fc..792c69e78fe2 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #define KMSG_COMPONENT "dasd" | 13 | #define KMSG_COMPONENT "dasd" |
| 14 | 14 | ||
| 15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
| 16 | #include <linux/compat.h> | ||
| 16 | #include <linux/major.h> | 17 | #include <linux/major.h> |
| 17 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
| 18 | #include <linux/blkpg.h> | 19 | #include <linux/blkpg.h> |
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 934458ad55e5..e71a50d4b221 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
| @@ -87,6 +87,7 @@ struct raw3215_info { | |||
| 87 | struct tty_struct *tty; /* pointer to tty structure if present */ | 87 | struct tty_struct *tty; /* pointer to tty structure if present */ |
| 88 | struct raw3215_req *queued_read; /* pointer to queued read requests */ | 88 | struct raw3215_req *queued_read; /* pointer to queued read requests */ |
| 89 | struct raw3215_req *queued_write;/* pointer to queued write requests */ | 89 | struct raw3215_req *queued_write;/* pointer to queued write requests */ |
| 90 | struct tasklet_struct tlet; /* tasklet to invoke tty_wakeup */ | ||
| 90 | wait_queue_head_t empty_wait; /* wait queue for flushing */ | 91 | wait_queue_head_t empty_wait; /* wait queue for flushing */ |
| 91 | struct timer_list timer; /* timer for delayed output */ | 92 | struct timer_list timer; /* timer for delayed output */ |
| 92 | int line_pos; /* position on the line (for tabs) */ | 93 | int line_pos; /* position on the line (for tabs) */ |
| @@ -334,19 +335,23 @@ static inline void raw3215_try_io(struct raw3215_info *raw) | |||
| 334 | } | 335 | } |
| 335 | 336 | ||
| 336 | /* | 337 | /* |
| 338 | * Call tty_wakeup from tasklet context | ||
| 339 | */ | ||
| 340 | static void raw3215_wakeup(unsigned long data) | ||
| 341 | { | ||
| 342 | struct raw3215_info *raw = (struct raw3215_info *) data; | ||
| 343 | tty_wakeup(raw->tty); | ||
| 344 | } | ||
| 345 | |||
| 346 | /* | ||
| 337 | * Try to start the next IO and wake up processes waiting on the tty. | 347 | * Try to start the next IO and wake up processes waiting on the tty. |
| 338 | */ | 348 | */ |
| 339 | static void raw3215_next_io(struct raw3215_info *raw) | 349 | static void raw3215_next_io(struct raw3215_info *raw) |
| 340 | { | 350 | { |
| 341 | struct tty_struct *tty; | ||
| 342 | |||
| 343 | raw3215_mk_write_req(raw); | 351 | raw3215_mk_write_req(raw); |
| 344 | raw3215_try_io(raw); | 352 | raw3215_try_io(raw); |
| 345 | tty = raw->tty; | 353 | if (raw->tty && RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE) |
| 346 | if (tty != NULL && | 354 | tasklet_schedule(&raw->tlet); |
| 347 | RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE) { | ||
| 348 | tty_wakeup(tty); | ||
| 349 | } | ||
| 350 | } | 355 | } |
| 351 | 356 | ||
| 352 | /* | 357 | /* |
| @@ -682,6 +687,7 @@ static int raw3215_probe (struct ccw_device *cdev) | |||
| 682 | return -ENOMEM; | 687 | return -ENOMEM; |
| 683 | } | 688 | } |
| 684 | init_waitqueue_head(&raw->empty_wait); | 689 | init_waitqueue_head(&raw->empty_wait); |
| 690 | tasklet_init(&raw->tlet, raw3215_wakeup, (unsigned long) raw); | ||
| 685 | 691 | ||
| 686 | dev_set_drvdata(&cdev->dev, raw); | 692 | dev_set_drvdata(&cdev->dev, raw); |
| 687 | cdev->handler = raw3215_irq; | 693 | cdev->handler = raw3215_irq; |
| @@ -901,6 +907,7 @@ static int __init con3215_init(void) | |||
| 901 | 907 | ||
| 902 | raw->flags |= RAW3215_FIXED; | 908 | raw->flags |= RAW3215_FIXED; |
| 903 | init_waitqueue_head(&raw->empty_wait); | 909 | init_waitqueue_head(&raw->empty_wait); |
| 910 | tasklet_init(&raw->tlet, raw3215_wakeup, (unsigned long) raw); | ||
| 904 | 911 | ||
| 905 | /* Request the console irq */ | 912 | /* Request the console irq */ |
| 906 | if (raw3215_startup(raw) != 0) { | 913 | if (raw3215_startup(raw) != 0) { |
| @@ -966,6 +973,7 @@ static void tty3215_close(struct tty_struct *tty, struct file * filp) | |||
| 966 | tty->closing = 1; | 973 | tty->closing = 1; |
| 967 | /* Shutdown the terminal */ | 974 | /* Shutdown the terminal */ |
| 968 | raw3215_shutdown(raw); | 975 | raw3215_shutdown(raw); |
| 976 | tasklet_kill(&raw->tlet); | ||
| 969 | tty->closing = 0; | 977 | tty->closing = 0; |
| 970 | raw->tty = NULL; | 978 | raw->tty = NULL; |
| 971 | } | 979 | } |
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index e71298158f9e..911704571b9c 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/console.h> | 11 | #include <linux/console.h> |
| 12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
| 13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
| 14 | #include <linux/compat.h> | ||
| 14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 15 | #include <linux/list.h> | 16 | #include <linux/list.h> |
| 16 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index 75bde6a8b7dc..89c03e6b1c0c 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | #include <linux/fs.h> | 14 | #include <linux/fs.h> |
| 15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 16 | #include <linux/compat.h> | ||
| 16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
| 17 | #include <linux/miscdevice.h> | 18 | #include <linux/miscdevice.h> |
| 18 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index 0c87b0fc7714..8f9a1a384496 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
| 11 | #include <linux/compat.h> | ||
| 11 | #include <linux/device.h> | 12 | #include <linux/device.h> |
| 12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 13 | #include <linux/uaccess.h> | 14 | #include <linux/uaccess.h> |
diff --git a/drivers/s390/scsi/zfcp_cfdc.c b/drivers/s390/scsi/zfcp_cfdc.c index 303dde09d294..fab2c2592a97 100644 --- a/drivers/s390/scsi/zfcp_cfdc.c +++ b/drivers/s390/scsi/zfcp_cfdc.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #define KMSG_COMPONENT "zfcp" | 11 | #define KMSG_COMPONENT "zfcp" |
| 12 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 12 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
| 13 | 13 | ||
| 14 | #include <linux/compat.h> | ||
| 14 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
| 15 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 16 | #include <linux/miscdevice.h> | 17 | #include <linux/miscdevice.h> |
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index 53a31c753cb1..20c4557f5abd 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c | |||
| @@ -364,10 +364,7 @@ static void release_controller(struct kref *kref) | |||
| 364 | struct rdac_controller *ctlr; | 364 | struct rdac_controller *ctlr; |
| 365 | ctlr = container_of(kref, struct rdac_controller, kref); | 365 | ctlr = container_of(kref, struct rdac_controller, kref); |
| 366 | 366 | ||
| 367 | flush_workqueue(kmpath_rdacd); | ||
| 368 | spin_lock(&list_lock); | ||
| 369 | list_del(&ctlr->node); | 367 | list_del(&ctlr->node); |
| 370 | spin_unlock(&list_lock); | ||
| 371 | kfree(ctlr); | 368 | kfree(ctlr); |
| 372 | } | 369 | } |
| 373 | 370 | ||
| @@ -376,20 +373,17 @@ static struct rdac_controller *get_controller(int index, char *array_name, | |||
| 376 | { | 373 | { |
| 377 | struct rdac_controller *ctlr, *tmp; | 374 | struct rdac_controller *ctlr, *tmp; |
| 378 | 375 | ||
| 379 | spin_lock(&list_lock); | ||
| 380 | |||
| 381 | list_for_each_entry(tmp, &ctlr_list, node) { | 376 | list_for_each_entry(tmp, &ctlr_list, node) { |
| 382 | if ((memcmp(tmp->array_id, array_id, UNIQUE_ID_LEN) == 0) && | 377 | if ((memcmp(tmp->array_id, array_id, UNIQUE_ID_LEN) == 0) && |
| 383 | (tmp->index == index) && | 378 | (tmp->index == index) && |
| 384 | (tmp->host == sdev->host)) { | 379 | (tmp->host == sdev->host)) { |
| 385 | kref_get(&tmp->kref); | 380 | kref_get(&tmp->kref); |
| 386 | spin_unlock(&list_lock); | ||
| 387 | return tmp; | 381 | return tmp; |
| 388 | } | 382 | } |
| 389 | } | 383 | } |
| 390 | ctlr = kmalloc(sizeof(*ctlr), GFP_ATOMIC); | 384 | ctlr = kmalloc(sizeof(*ctlr), GFP_ATOMIC); |
| 391 | if (!ctlr) | 385 | if (!ctlr) |
| 392 | goto done; | 386 | return NULL; |
| 393 | 387 | ||
| 394 | /* initialize fields of controller */ | 388 | /* initialize fields of controller */ |
| 395 | memcpy(ctlr->array_id, array_id, UNIQUE_ID_LEN); | 389 | memcpy(ctlr->array_id, array_id, UNIQUE_ID_LEN); |
| @@ -405,8 +399,7 @@ static struct rdac_controller *get_controller(int index, char *array_name, | |||
| 405 | INIT_WORK(&ctlr->ms_work, send_mode_select); | 399 | INIT_WORK(&ctlr->ms_work, send_mode_select); |
| 406 | INIT_LIST_HEAD(&ctlr->ms_head); | 400 | INIT_LIST_HEAD(&ctlr->ms_head); |
| 407 | list_add(&ctlr->node, &ctlr_list); | 401 | list_add(&ctlr->node, &ctlr_list); |
| 408 | done: | 402 | |
| 409 | spin_unlock(&list_lock); | ||
| 410 | return ctlr; | 403 | return ctlr; |
| 411 | } | 404 | } |
| 412 | 405 | ||
| @@ -517,9 +510,12 @@ static int initialize_controller(struct scsi_device *sdev, | |||
| 517 | index = 0; | 510 | index = 0; |
| 518 | else | 511 | else |
| 519 | index = 1; | 512 | index = 1; |
| 513 | |||
| 514 | spin_lock(&list_lock); | ||
| 520 | h->ctlr = get_controller(index, array_name, array_id, sdev); | 515 | h->ctlr = get_controller(index, array_name, array_id, sdev); |
| 521 | if (!h->ctlr) | 516 | if (!h->ctlr) |
| 522 | err = SCSI_DH_RES_TEMP_UNAVAIL; | 517 | err = SCSI_DH_RES_TEMP_UNAVAIL; |
| 518 | spin_unlock(&list_lock); | ||
| 523 | } | 519 | } |
| 524 | return err; | 520 | return err; |
| 525 | } | 521 | } |
| @@ -906,7 +902,9 @@ static int rdac_bus_attach(struct scsi_device *sdev) | |||
| 906 | return 0; | 902 | return 0; |
| 907 | 903 | ||
| 908 | clean_ctlr: | 904 | clean_ctlr: |
| 905 | spin_lock(&list_lock); | ||
| 909 | kref_put(&h->ctlr->kref, release_controller); | 906 | kref_put(&h->ctlr->kref, release_controller); |
| 907 | spin_unlock(&list_lock); | ||
| 910 | 908 | ||
| 911 | failed: | 909 | failed: |
| 912 | kfree(scsi_dh_data); | 910 | kfree(scsi_dh_data); |
| @@ -921,14 +919,19 @@ static void rdac_bus_detach( struct scsi_device *sdev ) | |||
| 921 | struct rdac_dh_data *h; | 919 | struct rdac_dh_data *h; |
| 922 | unsigned long flags; | 920 | unsigned long flags; |
| 923 | 921 | ||
| 924 | spin_lock_irqsave(sdev->request_queue->queue_lock, flags); | ||
| 925 | scsi_dh_data = sdev->scsi_dh_data; | 922 | scsi_dh_data = sdev->scsi_dh_data; |
| 923 | h = (struct rdac_dh_data *) scsi_dh_data->buf; | ||
| 924 | if (h->ctlr && h->ctlr->ms_queued) | ||
| 925 | flush_workqueue(kmpath_rdacd); | ||
| 926 | |||
| 927 | spin_lock_irqsave(sdev->request_queue->queue_lock, flags); | ||
| 926 | sdev->scsi_dh_data = NULL; | 928 | sdev->scsi_dh_data = NULL; |
| 927 | spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); | 929 | spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); |
| 928 | 930 | ||
| 929 | h = (struct rdac_dh_data *) scsi_dh_data->buf; | 931 | spin_lock(&list_lock); |
| 930 | if (h->ctlr) | 932 | if (h->ctlr) |
| 931 | kref_put(&h->ctlr->kref, release_controller); | 933 | kref_put(&h->ctlr->kref, release_controller); |
| 934 | spin_unlock(&list_lock); | ||
| 932 | kfree(scsi_dh_data); | 935 | kfree(scsi_dh_data); |
| 933 | module_put(THIS_MODULE); | 936 | module_put(THIS_MODULE); |
| 934 | sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", RDAC_NAME); | 937 | sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", RDAC_NAME); |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 67b169b7a5be..b538f0883fd2 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
| @@ -4613,11 +4613,13 @@ static int __ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd) | |||
| 4613 | ENTER; | 4613 | ENTER; |
| 4614 | ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata; | 4614 | ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata; |
| 4615 | 4615 | ||
| 4616 | dev_err(&ioa_cfg->pdev->dev, | 4616 | if (!ioa_cfg->in_reset_reload) { |
| 4617 | "Adapter being reset as a result of error recovery.\n"); | 4617 | dev_err(&ioa_cfg->pdev->dev, |
| 4618 | "Adapter being reset as a result of error recovery.\n"); | ||
| 4618 | 4619 | ||
| 4619 | if (WAIT_FOR_DUMP == ioa_cfg->sdt_state) | 4620 | if (WAIT_FOR_DUMP == ioa_cfg->sdt_state) |
| 4620 | ioa_cfg->sdt_state = GET_DUMP; | 4621 | ioa_cfg->sdt_state = GET_DUMP; |
| 4622 | } | ||
| 4621 | 4623 | ||
| 4622 | rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV); | 4624 | rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV); |
| 4623 | 4625 | ||
| @@ -4907,7 +4909,7 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd) | |||
| 4907 | struct ipr_ioa_cfg *ioa_cfg; | 4909 | struct ipr_ioa_cfg *ioa_cfg; |
| 4908 | struct ipr_resource_entry *res; | 4910 | struct ipr_resource_entry *res; |
| 4909 | struct ipr_cmd_pkt *cmd_pkt; | 4911 | struct ipr_cmd_pkt *cmd_pkt; |
| 4910 | u32 ioasc; | 4912 | u32 ioasc, int_reg; |
| 4911 | int op_found = 0; | 4913 | int op_found = 0; |
| 4912 | 4914 | ||
| 4913 | ENTER; | 4915 | ENTER; |
| @@ -4920,7 +4922,17 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd) | |||
| 4920 | */ | 4922 | */ |
| 4921 | if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead) | 4923 | if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead) |
| 4922 | return FAILED; | 4924 | return FAILED; |
| 4923 | if (!res || !ipr_is_gscsi(res)) | 4925 | if (!res) |
| 4926 | return FAILED; | ||
| 4927 | |||
| 4928 | /* | ||
| 4929 | * If we are aborting a timed out op, chances are that the timeout was caused | ||
| 4930 | * by a still not detected EEH error. In such cases, reading a register will | ||
| 4931 | * trigger the EEH recovery infrastructure. | ||
| 4932 | */ | ||
| 4933 | int_reg = readl(ioa_cfg->regs.sense_interrupt_reg); | ||
| 4934 | |||
| 4935 | if (!ipr_is_gscsi(res)) | ||
| 4924 | return FAILED; | 4936 | return FAILED; |
| 4925 | 4937 | ||
| 4926 | list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { | 4938 | list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { |
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index 1a65d6514237..418391b1c361 100644 --- a/drivers/scsi/isci/host.c +++ b/drivers/scsi/isci/host.c | |||
| @@ -1848,9 +1848,11 @@ static enum sci_status sci_oem_parameters_set(struct isci_host *ihost) | |||
| 1848 | if (state == SCIC_RESET || | 1848 | if (state == SCIC_RESET || |
| 1849 | state == SCIC_INITIALIZING || | 1849 | state == SCIC_INITIALIZING || |
| 1850 | state == SCIC_INITIALIZED) { | 1850 | state == SCIC_INITIALIZED) { |
| 1851 | u8 oem_version = pci_info->orom ? pci_info->orom->hdr.version : | ||
| 1852 | ISCI_ROM_VER_1_0; | ||
| 1851 | 1853 | ||
| 1852 | if (sci_oem_parameters_validate(&ihost->oem_parameters, | 1854 | if (sci_oem_parameters_validate(&ihost->oem_parameters, |
| 1853 | pci_info->orom->hdr.version)) | 1855 | oem_version)) |
| 1854 | return SCI_FAILURE_INVALID_PARAMETER_VALUE; | 1856 | return SCI_FAILURE_INVALID_PARAMETER_VALUE; |
| 1855 | 1857 | ||
| 1856 | return SCI_SUCCESS; | 1858 | return SCI_SUCCESS; |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 0b2c95583660..a78036f5e1a6 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
| @@ -4548,7 +4548,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
| 4548 | printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n", | 4548 | printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n", |
| 4549 | ioc->name, __func__); | 4549 | ioc->name, __func__); |
| 4550 | r = 0; | 4550 | r = 0; |
| 4551 | goto out; | 4551 | goto out_unlocked; |
| 4552 | } | 4552 | } |
| 4553 | 4553 | ||
| 4554 | if (mpt2sas_fwfault_debug) | 4554 | if (mpt2sas_fwfault_debug) |
| @@ -4604,6 +4604,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
| 4604 | spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); | 4604 | spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); |
| 4605 | mutex_unlock(&ioc->reset_in_progress_mutex); | 4605 | mutex_unlock(&ioc->reset_in_progress_mutex); |
| 4606 | 4606 | ||
| 4607 | out_unlocked: | ||
| 4607 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name, | 4608 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name, |
| 4608 | __func__)); | 4609 | __func__)); |
| 4609 | return r; | 4610 | return r; |
diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c index b31a8e3841d7..d4ed9eb52657 100644 --- a/drivers/scsi/osd/osd_uld.c +++ b/drivers/scsi/osd/osd_uld.c | |||
| @@ -69,10 +69,10 @@ | |||
| 69 | #ifndef SCSI_OSD_MAJOR | 69 | #ifndef SCSI_OSD_MAJOR |
| 70 | # define SCSI_OSD_MAJOR 260 | 70 | # define SCSI_OSD_MAJOR 260 |
| 71 | #endif | 71 | #endif |
| 72 | #define SCSI_OSD_MAX_MINOR 64 | 72 | #define SCSI_OSD_MAX_MINOR MINORMASK |
| 73 | 73 | ||
| 74 | static const char osd_name[] = "osd"; | 74 | static const char osd_name[] = "osd"; |
| 75 | static const char *osd_version_string = "open-osd 0.2.0"; | 75 | static const char *osd_version_string = "open-osd 0.2.1"; |
| 76 | 76 | ||
| 77 | MODULE_AUTHOR("Boaz Harrosh <bharrosh@panasas.com>"); | 77 | MODULE_AUTHOR("Boaz Harrosh <bharrosh@panasas.com>"); |
| 78 | MODULE_DESCRIPTION("open-osd Upper-Layer-Driver osd.ko"); | 78 | MODULE_DESCRIPTION("open-osd Upper-Layer-Driver osd.ko"); |
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index a2f1b3043dfb..9f41b3b4358f 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
| @@ -1036,8 +1036,7 @@ qla2x00_link_state_show(struct device *dev, struct device_attribute *attr, | |||
| 1036 | vha->device_flags & DFLG_NO_CABLE) | 1036 | vha->device_flags & DFLG_NO_CABLE) |
| 1037 | len = snprintf(buf, PAGE_SIZE, "Link Down\n"); | 1037 | len = snprintf(buf, PAGE_SIZE, "Link Down\n"); |
| 1038 | else if (atomic_read(&vha->loop_state) != LOOP_READY || | 1038 | else if (atomic_read(&vha->loop_state) != LOOP_READY || |
| 1039 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | 1039 | qla2x00_reset_active(vha)) |
| 1040 | test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) | ||
| 1041 | len = snprintf(buf, PAGE_SIZE, "Unknown Link State\n"); | 1040 | len = snprintf(buf, PAGE_SIZE, "Unknown Link State\n"); |
| 1042 | else { | 1041 | else { |
| 1043 | len = snprintf(buf, PAGE_SIZE, "Link Up - "); | 1042 | len = snprintf(buf, PAGE_SIZE, "Link Up - "); |
| @@ -1359,8 +1358,7 @@ qla2x00_thermal_temp_show(struct device *dev, | |||
| 1359 | return snprintf(buf, PAGE_SIZE, "\n"); | 1358 | return snprintf(buf, PAGE_SIZE, "\n"); |
| 1360 | 1359 | ||
| 1361 | temp = frac = 0; | 1360 | temp = frac = 0; |
| 1362 | if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | 1361 | if (qla2x00_reset_active(vha)) |
| 1363 | test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) | ||
| 1364 | ql_log(ql_log_warn, vha, 0x707b, | 1362 | ql_log(ql_log_warn, vha, 0x707b, |
| 1365 | "ISP reset active.\n"); | 1363 | "ISP reset active.\n"); |
| 1366 | else if (!vha->hw->flags.eeh_busy) | 1364 | else if (!vha->hw->flags.eeh_busy) |
| @@ -1379,8 +1377,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, | |||
| 1379 | int rval = QLA_FUNCTION_FAILED; | 1377 | int rval = QLA_FUNCTION_FAILED; |
| 1380 | uint16_t state[5]; | 1378 | uint16_t state[5]; |
| 1381 | 1379 | ||
| 1382 | if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | 1380 | if (qla2x00_reset_active(vha)) |
| 1383 | test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) | ||
| 1384 | ql_log(ql_log_warn, vha, 0x707c, | 1381 | ql_log(ql_log_warn, vha, 0x707c, |
| 1385 | "ISP reset active.\n"); | 1382 | "ISP reset active.\n"); |
| 1386 | else if (!vha->hw->flags.eeh_busy) | 1383 | else if (!vha->hw->flags.eeh_busy) |
| @@ -1693,9 +1690,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) | |||
| 1693 | if (IS_FWI2_CAPABLE(ha)) { | 1690 | if (IS_FWI2_CAPABLE(ha)) { |
| 1694 | rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma); | 1691 | rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma); |
| 1695 | } else if (atomic_read(&base_vha->loop_state) == LOOP_READY && | 1692 | } else if (atomic_read(&base_vha->loop_state) == LOOP_READY && |
| 1696 | !test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) && | 1693 | !qla2x00_reset_active(vha) && !ha->dpc_active) { |
| 1697 | !test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) && | ||
| 1698 | !ha->dpc_active) { | ||
| 1699 | /* Must be in a 'READY' state for statistics retrieval. */ | 1694 | /* Must be in a 'READY' state for statistics retrieval. */ |
| 1700 | rval = qla2x00_get_link_status(base_vha, base_vha->loop_id, | 1695 | rval = qla2x00_get_link_status(base_vha, base_vha->loop_id, |
| 1701 | stats, stats_dma); | 1696 | stats, stats_dma); |
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index b1d0f936bf2d..1682e2e4201d 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c | |||
| @@ -108,13 +108,6 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job) | |||
| 108 | goto exit_fcp_prio_cfg; | 108 | goto exit_fcp_prio_cfg; |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || | ||
| 112 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | ||
| 113 | test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { | ||
| 114 | ret = -EBUSY; | ||
| 115 | goto exit_fcp_prio_cfg; | ||
| 116 | } | ||
| 117 | |||
| 118 | /* Get the sub command */ | 111 | /* Get the sub command */ |
| 119 | oper = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1]; | 112 | oper = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1]; |
| 120 | 113 | ||
| @@ -646,13 +639,6 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job) | |||
| 646 | dma_addr_t rsp_data_dma; | 639 | dma_addr_t rsp_data_dma; |
| 647 | uint32_t rsp_data_len; | 640 | uint32_t rsp_data_len; |
| 648 | 641 | ||
| 649 | if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || | ||
| 650 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | ||
| 651 | test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { | ||
| 652 | ql_log(ql_log_warn, vha, 0x7018, "Abort active or needed.\n"); | ||
| 653 | return -EBUSY; | ||
| 654 | } | ||
| 655 | |||
| 656 | if (!vha->flags.online) { | 642 | if (!vha->flags.online) { |
| 657 | ql_log(ql_log_warn, vha, 0x7019, "Host is not online.\n"); | 643 | ql_log(ql_log_warn, vha, 0x7019, "Host is not online.\n"); |
| 658 | return -EIO; | 644 | return -EIO; |
| @@ -874,13 +860,6 @@ qla84xx_reset(struct fc_bsg_job *bsg_job) | |||
| 874 | int rval = 0; | 860 | int rval = 0; |
| 875 | uint32_t flag; | 861 | uint32_t flag; |
| 876 | 862 | ||
| 877 | if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || | ||
| 878 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | ||
| 879 | test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { | ||
| 880 | ql_log(ql_log_warn, vha, 0x702e, "Abort active or needed.\n"); | ||
| 881 | return -EBUSY; | ||
| 882 | } | ||
| 883 | |||
| 884 | if (!IS_QLA84XX(ha)) { | 863 | if (!IS_QLA84XX(ha)) { |
| 885 | ql_dbg(ql_dbg_user, vha, 0x702f, "Not 84xx, exiting.\n"); | 864 | ql_dbg(ql_dbg_user, vha, 0x702f, "Not 84xx, exiting.\n"); |
| 886 | return -EINVAL; | 865 | return -EINVAL; |
| @@ -922,11 +901,6 @@ qla84xx_updatefw(struct fc_bsg_job *bsg_job) | |||
| 922 | uint32_t flag; | 901 | uint32_t flag; |
| 923 | uint32_t fw_ver; | 902 | uint32_t fw_ver; |
| 924 | 903 | ||
| 925 | if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || | ||
| 926 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | ||
| 927 | test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) | ||
| 928 | return -EBUSY; | ||
| 929 | |||
| 930 | if (!IS_QLA84XX(ha)) { | 904 | if (!IS_QLA84XX(ha)) { |
| 931 | ql_dbg(ql_dbg_user, vha, 0x7032, | 905 | ql_dbg(ql_dbg_user, vha, 0x7032, |
| 932 | "Not 84xx, exiting.\n"); | 906 | "Not 84xx, exiting.\n"); |
| @@ -1036,14 +1010,6 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job) | |||
| 1036 | uint32_t data_len = 0; | 1010 | uint32_t data_len = 0; |
| 1037 | uint32_t dma_direction = DMA_NONE; | 1011 | uint32_t dma_direction = DMA_NONE; |
| 1038 | 1012 | ||
| 1039 | if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || | ||
| 1040 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | ||
| 1041 | test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { | ||
| 1042 | ql_log(ql_log_warn, vha, 0x7039, | ||
| 1043 | "Abort active or needed.\n"); | ||
| 1044 | return -EBUSY; | ||
| 1045 | } | ||
| 1046 | |||
| 1047 | if (!IS_QLA84XX(ha)) { | 1013 | if (!IS_QLA84XX(ha)) { |
| 1048 | ql_log(ql_log_warn, vha, 0x703a, | 1014 | ql_log(ql_log_warn, vha, 0x703a, |
| 1049 | "Not 84xx, exiting.\n"); | 1015 | "Not 84xx, exiting.\n"); |
| @@ -1246,13 +1212,6 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job) | |||
| 1246 | 1212 | ||
| 1247 | bsg_job->reply->reply_payload_rcv_len = 0; | 1213 | bsg_job->reply->reply_payload_rcv_len = 0; |
| 1248 | 1214 | ||
| 1249 | if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || | ||
| 1250 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | ||
| 1251 | test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { | ||
| 1252 | ql_log(ql_log_warn, vha, 0x7045, "abort active or needed.\n"); | ||
| 1253 | return -EBUSY; | ||
| 1254 | } | ||
| 1255 | |||
| 1256 | if (!IS_IIDMA_CAPABLE(vha->hw)) { | 1215 | if (!IS_IIDMA_CAPABLE(vha->hw)) { |
| 1257 | ql_log(ql_log_info, vha, 0x7046, "iiDMA not supported.\n"); | 1216 | ql_log(ql_log_info, vha, 0x7046, "iiDMA not supported.\n"); |
| 1258 | return -EINVAL; | 1217 | return -EINVAL; |
| @@ -1668,6 +1627,15 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job) | |||
| 1668 | vha = shost_priv(host); | 1627 | vha = shost_priv(host); |
| 1669 | } | 1628 | } |
| 1670 | 1629 | ||
| 1630 | if (qla2x00_reset_active(vha)) { | ||
| 1631 | ql_dbg(ql_dbg_user, vha, 0x709f, | ||
| 1632 | "BSG: ISP abort active/needed -- cmd=%d.\n", | ||
| 1633 | bsg_job->request->msgcode); | ||
| 1634 | bsg_job->reply->result = (DID_ERROR << 16); | ||
| 1635 | bsg_job->job_done(bsg_job); | ||
| 1636 | return -EBUSY; | ||
| 1637 | } | ||
| 1638 | |||
| 1671 | ql_dbg(ql_dbg_user, vha, 0x7000, | 1639 | ql_dbg(ql_dbg_user, vha, 0x7000, |
| 1672 | "Entered %s msgcode=0x%x.\n", __func__, bsg_job->request->msgcode); | 1640 | "Entered %s msgcode=0x%x.\n", __func__, bsg_job->request->msgcode); |
| 1673 | 1641 | ||
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 7c54624b5b13..45cbf0ba624d 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
| @@ -19,7 +19,8 @@ | |||
| 19 | * | DPC Thread | 0x401c | | | 19 | * | DPC Thread | 0x401c | | |
| 20 | * | Async Events | 0x5057 | 0x5052 | | 20 | * | Async Events | 0x5057 | 0x5052 | |
| 21 | * | Timer Routines | 0x6011 | 0x600e,0x600f | | 21 | * | Timer Routines | 0x6011 | 0x600e,0x600f | |
| 22 | * | User Space Interactions | 0x709e | | | 22 | * | User Space Interactions | 0x709e | 0x7018,0x702e | |
| 23 | * | | | 0x7039,0x7045 | | ||
| 23 | * | Task Management | 0x803c | 0x8025-0x8026 | | 24 | * | Task Management | 0x803c | 0x8025-0x8026 | |
| 24 | * | | | 0x800b,0x8039 | | 25 | * | | | 0x800b,0x8039 | |
| 25 | * | AER/EEH | 0x900f | | | 26 | * | AER/EEH | 0x900f | | |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index a6a4eebce4a8..af1003f9de1e 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | * ISP2100 HBAs. | 44 | * ISP2100 HBAs. |
| 45 | */ | 45 | */ |
| 46 | #define MAILBOX_REGISTER_COUNT_2100 8 | 46 | #define MAILBOX_REGISTER_COUNT_2100 8 |
| 47 | #define MAILBOX_REGISTER_COUNT_2200 24 | ||
| 47 | #define MAILBOX_REGISTER_COUNT 32 | 48 | #define MAILBOX_REGISTER_COUNT 32 |
| 48 | 49 | ||
| 49 | #define QLA2200A_RISC_ROM_VER 4 | 50 | #define QLA2200A_RISC_ROM_VER 4 |
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index 9902834e0b74..7cc4f36cd539 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h | |||
| @@ -131,3 +131,16 @@ qla2x00_hba_err_chk_enabled(srb_t *sp) | |||
| 131 | } | 131 | } |
| 132 | return 0; | 132 | return 0; |
| 133 | } | 133 | } |
| 134 | |||
| 135 | static inline int | ||
| 136 | qla2x00_reset_active(scsi_qla_host_t *vha) | ||
| 137 | { | ||
| 138 | scsi_qla_host_t *base_vha = pci_get_drvdata(vha->hw->pdev); | ||
| 139 | |||
| 140 | /* Test appropriate base-vha and vha flags. */ | ||
| 141 | return test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) || | ||
| 142 | test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) || | ||
| 143 | test_bit(ISP_ABORT_RETRY, &base_vha->dpc_flags) || | ||
| 144 | test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) || | ||
| 145 | test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); | ||
| 146 | } | ||
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index e804585cc59c..349843ea32f6 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
| @@ -2090,7 +2090,6 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, | |||
| 2090 | break; | 2090 | break; |
| 2091 | case CT_IOCB_TYPE: | 2091 | case CT_IOCB_TYPE: |
| 2092 | qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE); | 2092 | qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE); |
| 2093 | clear_bit(MBX_INTERRUPT, &vha->hw->mbx_cmd_flags); | ||
| 2094 | break; | 2093 | break; |
| 2095 | case ELS_IOCB_TYPE: | 2094 | case ELS_IOCB_TYPE: |
| 2096 | qla24xx_els_ct_entry(vha, rsp->req, pkt, ELS_IOCB_TYPE); | 2095 | qla24xx_els_ct_entry(vha, rsp->req, pkt, ELS_IOCB_TYPE); |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 34344d3f8658..08f1d01bdc1c 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
| @@ -342,6 +342,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) | |||
| 342 | 342 | ||
| 343 | set_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); | 343 | set_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); |
| 344 | clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); | 344 | clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); |
| 345 | /* Allow next mbx cmd to come in. */ | ||
| 346 | complete(&ha->mbx_cmd_comp); | ||
| 345 | if (ha->isp_ops->abort_isp(vha)) { | 347 | if (ha->isp_ops->abort_isp(vha)) { |
| 346 | /* Failed. retry later. */ | 348 | /* Failed. retry later. */ |
| 347 | set_bit(ISP_ABORT_NEEDED, | 349 | set_bit(ISP_ABORT_NEEDED, |
| @@ -350,6 +352,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) | |||
| 350 | clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); | 352 | clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); |
| 351 | ql_dbg(ql_dbg_mbx, base_vha, 0x101f, | 353 | ql_dbg(ql_dbg_mbx, base_vha, 0x101f, |
| 352 | "Finished abort_isp.\n"); | 354 | "Finished abort_isp.\n"); |
| 355 | goto mbx_done; | ||
| 353 | } | 356 | } |
| 354 | } | 357 | } |
| 355 | } | 358 | } |
| @@ -358,6 +361,7 @@ premature_exit: | |||
| 358 | /* Allow next mbx cmd to come in. */ | 361 | /* Allow next mbx cmd to come in. */ |
| 359 | complete(&ha->mbx_cmd_comp); | 362 | complete(&ha->mbx_cmd_comp); |
| 360 | 363 | ||
| 364 | mbx_done: | ||
| 361 | if (rval) { | 365 | if (rval) { |
| 362 | ql_dbg(ql_dbg_mbx, base_vha, 0x1020, | 366 | ql_dbg(ql_dbg_mbx, base_vha, 0x1020, |
| 363 | "**** Failed mbx[0]=%x, mb[1]=%x, mb[2]=%x, cmd=%x ****.\n", | 367 | "**** Failed mbx[0]=%x, mb[1]=%x, mb[2]=%x, cmd=%x ****.\n", |
| @@ -2581,7 +2585,8 @@ qla2x00_stop_firmware(scsi_qla_host_t *vha) | |||
| 2581 | ql_dbg(ql_dbg_mbx, vha, 0x10a1, "Entered %s.\n", __func__); | 2585 | ql_dbg(ql_dbg_mbx, vha, 0x10a1, "Entered %s.\n", __func__); |
| 2582 | 2586 | ||
| 2583 | mcp->mb[0] = MBC_STOP_FIRMWARE; | 2587 | mcp->mb[0] = MBC_STOP_FIRMWARE; |
| 2584 | mcp->out_mb = MBX_0; | 2588 | mcp->mb[1] = 0; |
| 2589 | mcp->out_mb = MBX_1|MBX_0; | ||
| 2585 | mcp->in_mb = MBX_0; | 2590 | mcp->in_mb = MBX_0; |
| 2586 | mcp->tov = 5; | 2591 | mcp->tov = 5; |
| 2587 | mcp->flags = 0; | 2592 | mcp->flags = 0; |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 1cd46cd7ff90..270ba3130fde 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
| @@ -1165,19 +1165,6 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha) | |||
| 1165 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff); | 1165 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff); |
| 1166 | else | 1166 | else |
| 1167 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff); | 1167 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff); |
| 1168 | |||
| 1169 | /* reset ms */ | ||
| 1170 | val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4); | ||
| 1171 | val |= (1 << 1); | ||
| 1172 | qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val); | ||
| 1173 | msleep(20); | ||
| 1174 | |||
| 1175 | /* unreset ms */ | ||
| 1176 | val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4); | ||
| 1177 | val &= ~(1 << 1); | ||
| 1178 | qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val); | ||
| 1179 | msleep(20); | ||
| 1180 | |||
| 1181 | qla82xx_rom_unlock(ha); | 1168 | qla82xx_rom_unlock(ha); |
| 1182 | 1169 | ||
| 1183 | /* Read the signature value from the flash. | 1170 | /* Read the signature value from the flash. |
| @@ -3392,7 +3379,7 @@ void qla82xx_watchdog(scsi_qla_host_t *vha) | |||
| 3392 | QLA82XX_CRB_PEG_NET_3 + 0x3c), | 3379 | QLA82XX_CRB_PEG_NET_3 + 0x3c), |
| 3393 | qla82xx_rd_32(ha, | 3380 | qla82xx_rd_32(ha, |
| 3394 | QLA82XX_CRB_PEG_NET_4 + 0x3c)); | 3381 | QLA82XX_CRB_PEG_NET_4 + 0x3c)); |
| 3395 | if (LSW(MSB(halt_status)) == 0x67) | 3382 | if (((halt_status & 0x1fffff00) >> 8) == 0x67) |
| 3396 | ql_log(ql_log_warn, vha, 0xb052, | 3383 | ql_log(ql_log_warn, vha, 0xb052, |
| 3397 | "Firmware aborted with " | 3384 | "Firmware aborted with " |
| 3398 | "error code 0x00006700. Device is " | 3385 | "error code 0x00006700. Device is " |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 4ed1e4a96b95..036030c95339 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
| @@ -625,6 +625,12 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) | |||
| 625 | cmd->result = DID_NO_CONNECT << 16; | 625 | cmd->result = DID_NO_CONNECT << 16; |
| 626 | goto qc24_fail_command; | 626 | goto qc24_fail_command; |
| 627 | } | 627 | } |
| 628 | |||
| 629 | if (!fcport) { | ||
| 630 | cmd->result = DID_NO_CONNECT << 16; | ||
| 631 | goto qc24_fail_command; | ||
| 632 | } | ||
| 633 | |||
| 628 | if (atomic_read(&fcport->state) != FCS_ONLINE) { | 634 | if (atomic_read(&fcport->state) != FCS_ONLINE) { |
| 629 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || | 635 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || |
| 630 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { | 636 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { |
| @@ -877,6 +883,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) | |||
| 877 | 883 | ||
| 878 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 884 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
| 879 | if (ha->isp_ops->abort_command(sp)) { | 885 | if (ha->isp_ops->abort_command(sp)) { |
| 886 | ret = FAILED; | ||
| 880 | ql_dbg(ql_dbg_taskm, vha, 0x8003, | 887 | ql_dbg(ql_dbg_taskm, vha, 0x8003, |
| 881 | "Abort command mbx failed cmd=%p.\n", cmd); | 888 | "Abort command mbx failed cmd=%p.\n", cmd); |
| 882 | } else { | 889 | } else { |
| @@ -1124,7 +1131,6 @@ static int | |||
| 1124 | qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) | 1131 | qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) |
| 1125 | { | 1132 | { |
| 1126 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); | 1133 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); |
| 1127 | fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; | ||
| 1128 | struct qla_hw_data *ha = vha->hw; | 1134 | struct qla_hw_data *ha = vha->hw; |
| 1129 | int ret = FAILED; | 1135 | int ret = FAILED; |
| 1130 | unsigned int id, lun; | 1136 | unsigned int id, lun; |
| @@ -1133,15 +1139,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) | |||
| 1133 | id = cmd->device->id; | 1139 | id = cmd->device->id; |
| 1134 | lun = cmd->device->lun; | 1140 | lun = cmd->device->lun; |
| 1135 | 1141 | ||
| 1136 | if (!fcport) { | ||
| 1137 | return ret; | ||
| 1138 | } | ||
| 1139 | |||
| 1140 | ret = fc_block_scsi_eh(cmd); | ||
| 1141 | if (ret != 0) | ||
| 1142 | return ret; | ||
| 1143 | ret = FAILED; | ||
| 1144 | |||
| 1145 | ql_log(ql_log_info, vha, 0x8018, | 1142 | ql_log(ql_log_info, vha, 0x8018, |
| 1146 | "ADAPTER RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun); | 1143 | "ADAPTER RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun); |
| 1147 | 1144 | ||
| @@ -2047,7 +2044,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 2047 | ha->nvram_data_off = ~0; | 2044 | ha->nvram_data_off = ~0; |
| 2048 | ha->isp_ops = &qla2100_isp_ops; | 2045 | ha->isp_ops = &qla2100_isp_ops; |
| 2049 | } else if (IS_QLA2200(ha)) { | 2046 | } else if (IS_QLA2200(ha)) { |
| 2050 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | 2047 | ha->mbx_count = MAILBOX_REGISTER_COUNT_2200; |
| 2051 | req_length = REQUEST_ENTRY_CNT_2200; | 2048 | req_length = REQUEST_ENTRY_CNT_2200; |
| 2052 | rsp_length = RESPONSE_ENTRY_CNT_2100; | 2049 | rsp_length = RESPONSE_ENTRY_CNT_2100; |
| 2053 | ha->max_loop_id = SNS_LAST_LOOP_ID_2100; | 2050 | ha->max_loop_id = SNS_LAST_LOOP_ID_2100; |
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 23f33a6d52d7..29d780c38040 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | /* | 7 | /* |
| 8 | * Driver version | 8 | * Driver version |
| 9 | */ | 9 | */ |
| 10 | #define QLA2XXX_VERSION "8.03.07.12-k" | 10 | #define QLA2XXX_VERSION "8.03.07.13-k" |
| 11 | 11 | ||
| 12 | #define QLA_DRIVER_MAJOR_VER 8 | 12 | #define QLA_DRIVER_MAJOR_VER 8 |
| 13 | #define QLA_DRIVER_MINOR_VER 3 | 13 | #define QLA_DRIVER_MINOR_VER 3 |
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c index 78f1111158d7..65253dfbe962 100644 --- a/drivers/scsi/qla4xxx/ql4_nx.c +++ b/drivers/scsi/qla4xxx/ql4_nx.c | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | #include "ql4_def.h" | 10 | #include "ql4_def.h" |
| 11 | #include "ql4_glbl.h" | 11 | #include "ql4_glbl.h" |
| 12 | 12 | ||
| 13 | #include <asm-generic/io-64-nonatomic-lo-hi.h> | ||
| 14 | |||
| 13 | #define MASK(n) DMA_BIT_MASK(n) | 15 | #define MASK(n) DMA_BIT_MASK(n) |
| 14 | #define MN_WIN(addr) (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff)) | 16 | #define MN_WIN(addr) (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff)) |
| 15 | #define OCM_WIN(addr) (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff)) | 17 | #define OCM_WIN(addr) (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff)) |
| @@ -655,27 +657,6 @@ static int qla4_8xxx_pci_is_same_window(struct scsi_qla_host *ha, | |||
| 655 | return 0; | 657 | return 0; |
| 656 | } | 658 | } |
| 657 | 659 | ||
| 658 | #ifndef readq | ||
| 659 | static inline __u64 readq(const volatile void __iomem *addr) | ||
| 660 | { | ||
| 661 | const volatile u32 __iomem *p = addr; | ||
| 662 | u32 low, high; | ||
| 663 | |||
| 664 | low = readl(p); | ||
| 665 | high = readl(p + 1); | ||
| 666 | |||
| 667 | return low + ((u64)high << 32); | ||
| 668 | } | ||
| 669 | #endif | ||
| 670 | |||
| 671 | #ifndef writeq | ||
| 672 | static inline void writeq(__u64 val, volatile void __iomem *addr) | ||
| 673 | { | ||
| 674 | writel(val, addr); | ||
| 675 | writel(val >> 32, addr+4); | ||
| 676 | } | ||
| 677 | #endif | ||
| 678 | |||
| 679 | static int qla4_8xxx_pci_mem_read_direct(struct scsi_qla_host *ha, | 660 | static int qla4_8xxx_pci_mem_read_direct(struct scsi_qla_host *ha, |
| 680 | u64 off, void *data, int size) | 661 | u64 off, void *data, int size) |
| 681 | { | 662 | { |
diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c index bf8bf79e6a1f..c4670642d023 100644 --- a/drivers/scsi/scsi_pm.c +++ b/drivers/scsi/scsi_pm.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #include <linux/pm_runtime.h> | 8 | #include <linux/pm_runtime.h> |
| 9 | #include <linux/export.h> | 9 | #include <linux/export.h> |
| 10 | #include <linux/async.h> | ||
| 10 | 11 | ||
| 11 | #include <scsi/scsi.h> | 12 | #include <scsi/scsi.h> |
| 12 | #include <scsi/scsi_device.h> | 13 | #include <scsi/scsi_device.h> |
| @@ -92,6 +93,19 @@ static int scsi_bus_resume_common(struct device *dev) | |||
| 92 | return err; | 93 | return err; |
| 93 | } | 94 | } |
| 94 | 95 | ||
| 96 | static int scsi_bus_prepare(struct device *dev) | ||
| 97 | { | ||
| 98 | if (scsi_is_sdev_device(dev)) { | ||
| 99 | /* sd probing uses async_schedule. Wait until it finishes. */ | ||
| 100 | async_synchronize_full(); | ||
| 101 | |||
| 102 | } else if (scsi_is_host_device(dev)) { | ||
| 103 | /* Wait until async scanning is finished */ | ||
| 104 | scsi_complete_async_scans(); | ||
| 105 | } | ||
| 106 | return 0; | ||
| 107 | } | ||
| 108 | |||
| 95 | static int scsi_bus_suspend(struct device *dev) | 109 | static int scsi_bus_suspend(struct device *dev) |
| 96 | { | 110 | { |
| 97 | return scsi_bus_suspend_common(dev, PMSG_SUSPEND); | 111 | return scsi_bus_suspend_common(dev, PMSG_SUSPEND); |
| @@ -110,6 +124,7 @@ static int scsi_bus_poweroff(struct device *dev) | |||
| 110 | #else /* CONFIG_PM_SLEEP */ | 124 | #else /* CONFIG_PM_SLEEP */ |
| 111 | 125 | ||
| 112 | #define scsi_bus_resume_common NULL | 126 | #define scsi_bus_resume_common NULL |
| 127 | #define scsi_bus_prepare NULL | ||
| 113 | #define scsi_bus_suspend NULL | 128 | #define scsi_bus_suspend NULL |
| 114 | #define scsi_bus_freeze NULL | 129 | #define scsi_bus_freeze NULL |
| 115 | #define scsi_bus_poweroff NULL | 130 | #define scsi_bus_poweroff NULL |
| @@ -218,6 +233,7 @@ void scsi_autopm_put_host(struct Scsi_Host *shost) | |||
| 218 | #endif /* CONFIG_PM_RUNTIME */ | 233 | #endif /* CONFIG_PM_RUNTIME */ |
| 219 | 234 | ||
| 220 | const struct dev_pm_ops scsi_bus_pm_ops = { | 235 | const struct dev_pm_ops scsi_bus_pm_ops = { |
| 236 | .prepare = scsi_bus_prepare, | ||
| 221 | .suspend = scsi_bus_suspend, | 237 | .suspend = scsi_bus_suspend, |
| 222 | .resume = scsi_bus_resume_common, | 238 | .resume = scsi_bus_resume_common, |
| 223 | .freeze = scsi_bus_freeze, | 239 | .freeze = scsi_bus_freeze, |
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 68eadd1c67fd..be4fa6d179b1 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h | |||
| @@ -109,6 +109,7 @@ extern void scsi_exit_procfs(void); | |||
| 109 | #endif /* CONFIG_PROC_FS */ | 109 | #endif /* CONFIG_PROC_FS */ |
| 110 | 110 | ||
| 111 | /* scsi_scan.c */ | 111 | /* scsi_scan.c */ |
| 112 | extern int scsi_complete_async_scans(void); | ||
| 112 | extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int, | 113 | extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int, |
| 113 | unsigned int, unsigned int, int); | 114 | unsigned int, unsigned int, int); |
| 114 | extern void scsi_forget_host(struct Scsi_Host *); | 115 | extern void scsi_forget_host(struct Scsi_Host *); |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 89da43f73c00..29c4c0480976 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
| @@ -1815,6 +1815,7 @@ static void scsi_finish_async_scan(struct async_scan_data *data) | |||
| 1815 | } | 1815 | } |
| 1816 | spin_unlock(&async_scan_lock); | 1816 | spin_unlock(&async_scan_lock); |
| 1817 | 1817 | ||
| 1818 | scsi_autopm_put_host(shost); | ||
| 1818 | scsi_host_put(shost); | 1819 | scsi_host_put(shost); |
| 1819 | kfree(data); | 1820 | kfree(data); |
| 1820 | } | 1821 | } |
| @@ -1841,7 +1842,6 @@ static int do_scan_async(void *_data) | |||
| 1841 | 1842 | ||
| 1842 | do_scsi_scan_host(shost); | 1843 | do_scsi_scan_host(shost); |
| 1843 | scsi_finish_async_scan(data); | 1844 | scsi_finish_async_scan(data); |
| 1844 | scsi_autopm_put_host(shost); | ||
| 1845 | return 0; | 1845 | return 0; |
| 1846 | } | 1846 | } |
| 1847 | 1847 | ||
| @@ -1869,7 +1869,7 @@ void scsi_scan_host(struct Scsi_Host *shost) | |||
| 1869 | p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no); | 1869 | p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no); |
| 1870 | if (IS_ERR(p)) | 1870 | if (IS_ERR(p)) |
| 1871 | do_scan_async(data); | 1871 | do_scan_async(data); |
| 1872 | /* scsi_autopm_put_host(shost) is called in do_scan_async() */ | 1872 | /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */ |
| 1873 | } | 1873 | } |
| 1874 | EXPORT_SYMBOL(scsi_scan_host); | 1874 | EXPORT_SYMBOL(scsi_scan_host); |
| 1875 | 1875 | ||
diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c index 45fee368b092..92d314a73f69 100644 --- a/drivers/sh/clk/cpg.c +++ b/drivers/sh/clk/cpg.c | |||
| @@ -190,7 +190,7 @@ static int __init sh_clk_init_parent(struct clk *clk) | |||
| 190 | return -EINVAL; | 190 | return -EINVAL; |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | clk->parent = clk->parent_table[val]; | 193 | clk_reparent(clk, clk->parent_table[val]); |
| 194 | if (!clk->parent) { | 194 | if (!clk->parent) { |
| 195 | pr_err("sh_clk_init_parent: unable to set parent"); | 195 | pr_err("sh_clk_init_parent: unable to set parent"); |
| 196 | return -EINVAL; | 196 | return -EINVAL; |
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 0b7fed746b27..e7feceeebc2f 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
| @@ -1508,7 +1508,7 @@ static int serial_imx_probe(struct platform_device *pdev) | |||
| 1508 | ret = PTR_ERR(sport->clk); | 1508 | ret = PTR_ERR(sport->clk); |
| 1509 | goto unmap; | 1509 | goto unmap; |
| 1510 | } | 1510 | } |
| 1511 | clk_enable(sport->clk); | 1511 | clk_prepare_enable(sport->clk); |
| 1512 | 1512 | ||
| 1513 | sport->port.uartclk = clk_get_rate(sport->clk); | 1513 | sport->port.uartclk = clk_get_rate(sport->clk); |
| 1514 | 1514 | ||
| @@ -1531,8 +1531,8 @@ deinit: | |||
| 1531 | if (pdata && pdata->exit) | 1531 | if (pdata && pdata->exit) |
| 1532 | pdata->exit(pdev); | 1532 | pdata->exit(pdev); |
| 1533 | clkput: | 1533 | clkput: |
| 1534 | clk_disable_unprepare(sport->clk); | ||
| 1534 | clk_put(sport->clk); | 1535 | clk_put(sport->clk); |
| 1535 | clk_disable(sport->clk); | ||
| 1536 | unmap: | 1536 | unmap: |
| 1537 | iounmap(sport->port.membase); | 1537 | iounmap(sport->port.membase); |
| 1538 | free: | 1538 | free: |
| @@ -1552,11 +1552,10 @@ static int serial_imx_remove(struct platform_device *pdev) | |||
| 1552 | 1552 | ||
| 1553 | if (sport) { | 1553 | if (sport) { |
| 1554 | uart_remove_one_port(&imx_reg, &sport->port); | 1554 | uart_remove_one_port(&imx_reg, &sport->port); |
| 1555 | clk_disable_unprepare(sport->clk); | ||
| 1555 | clk_put(sport->clk); | 1556 | clk_put(sport->clk); |
| 1556 | } | 1557 | } |
| 1557 | 1558 | ||
| 1558 | clk_disable(sport->clk); | ||
| 1559 | |||
| 1560 | if (pdata && pdata->exit) | 1559 | if (pdata && pdata->exit) |
| 1561 | pdata->exit(pdev); | 1560 | pdata->exit(pdev); |
| 1562 | 1561 | ||
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index d136b8f4c8a7..81e2c0d9c17d 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
| @@ -187,7 +187,10 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 187 | return -ENODEV; | 187 | return -ENODEV; |
| 188 | dev->current_state = PCI_D0; | 188 | dev->current_state = PCI_D0; |
| 189 | 189 | ||
| 190 | if (!dev->irq) { | 190 | /* The xHCI driver supports MSI and MSI-X, |
| 191 | * so don't fail if the BIOS doesn't provide a legacy IRQ. | ||
| 192 | */ | ||
| 193 | if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) { | ||
| 191 | dev_err(&dev->dev, | 194 | dev_err(&dev->dev, |
| 192 | "Found HC with no IRQ. Check BIOS/PCI %s setup!\n", | 195 | "Found HC with no IRQ. Check BIOS/PCI %s setup!\n", |
| 193 | pci_name(dev)); | 196 | pci_name(dev)); |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index eb19cba34ac9..e1282328fc27 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
| @@ -2447,8 +2447,10 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
| 2447 | && device_can_wakeup(&hcd->self.root_hub->dev)) | 2447 | && device_can_wakeup(&hcd->self.root_hub->dev)) |
| 2448 | dev_dbg(hcd->self.controller, "supports USB remote wakeup\n"); | 2448 | dev_dbg(hcd->self.controller, "supports USB remote wakeup\n"); |
| 2449 | 2449 | ||
| 2450 | /* enable irqs just before we start the controller */ | 2450 | /* enable irqs just before we start the controller, |
| 2451 | if (usb_hcd_is_primary_hcd(hcd)) { | 2451 | * if the BIOS provides legacy PCI irqs. |
| 2452 | */ | ||
| 2453 | if (usb_hcd_is_primary_hcd(hcd) && irqnum) { | ||
| 2452 | retval = usb_hcd_request_irqs(hcd, irqnum, irqflags); | 2454 | retval = usb_hcd_request_irqs(hcd, irqnum, irqflags); |
| 2453 | if (retval) | 2455 | if (retval) |
| 2454 | goto err_request_irq; | 2456 | goto err_request_irq; |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index a0613d8f9be7..265c2f675d04 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -705,10 +705,26 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) | |||
| 705 | if (type == HUB_INIT3) | 705 | if (type == HUB_INIT3) |
| 706 | goto init3; | 706 | goto init3; |
| 707 | 707 | ||
| 708 | /* After a resume, port power should still be on. | 708 | /* The superspeed hub except for root hub has to use Hub Depth |
| 709 | * value as an offset into the route string to locate the bits | ||
| 710 | * it uses to determine the downstream port number. So hub driver | ||
| 711 | * should send a set hub depth request to superspeed hub after | ||
| 712 | * the superspeed hub is set configuration in initialization or | ||
| 713 | * reset procedure. | ||
| 714 | * | ||
| 715 | * After a resume, port power should still be on. | ||
| 709 | * For any other type of activation, turn it on. | 716 | * For any other type of activation, turn it on. |
| 710 | */ | 717 | */ |
| 711 | if (type != HUB_RESUME) { | 718 | if (type != HUB_RESUME) { |
| 719 | if (hdev->parent && hub_is_superspeed(hdev)) { | ||
| 720 | ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), | ||
| 721 | HUB_SET_DEPTH, USB_RT_HUB, | ||
| 722 | hdev->level - 1, 0, NULL, 0, | ||
| 723 | USB_CTRL_SET_TIMEOUT); | ||
| 724 | if (ret < 0) | ||
| 725 | dev_err(hub->intfdev, | ||
| 726 | "set hub depth failed\n"); | ||
| 727 | } | ||
| 712 | 728 | ||
| 713 | /* Speed up system boot by using a delayed_work for the | 729 | /* Speed up system boot by using a delayed_work for the |
| 714 | * hub's initial power-up delays. This is pretty awkward | 730 | * hub's initial power-up delays. This is pretty awkward |
| @@ -987,18 +1003,6 @@ static int hub_configure(struct usb_hub *hub, | |||
| 987 | goto fail; | 1003 | goto fail; |
| 988 | } | 1004 | } |
| 989 | 1005 | ||
| 990 | if (hub_is_superspeed(hdev) && (hdev->parent != NULL)) { | ||
| 991 | ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), | ||
| 992 | HUB_SET_DEPTH, USB_RT_HUB, | ||
| 993 | hdev->level - 1, 0, NULL, 0, | ||
| 994 | USB_CTRL_SET_TIMEOUT); | ||
| 995 | |||
| 996 | if (ret < 0) { | ||
| 997 | message = "can't set hub depth"; | ||
| 998 | goto fail; | ||
| 999 | } | ||
| 1000 | } | ||
| 1001 | |||
| 1002 | /* Request the entire hub descriptor. | 1006 | /* Request the entire hub descriptor. |
| 1003 | * hub->descriptor can handle USB_MAXCHILDREN ports, | 1007 | * hub->descriptor can handle USB_MAXCHILDREN ports, |
| 1004 | * but the hub can/will return fewer bytes here. | 1008 | * but the hub can/will return fewer bytes here. |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 7ecb68a67411..85ae4b46bb68 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
| @@ -137,7 +137,7 @@ choice | |||
| 137 | 137 | ||
| 138 | config USB_AT91 | 138 | config USB_AT91 |
| 139 | tristate "Atmel AT91 USB Device Port" | 139 | tristate "Atmel AT91 USB Device Port" |
| 140 | depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91CAP9 && !ARCH_AT91SAM9G45 | 140 | depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91SAM9G45 |
| 141 | help | 141 | help |
| 142 | Many Atmel AT91 processors (such as the AT91RM2000) have a | 142 | Many Atmel AT91 processors (such as the AT91RM2000) have a |
| 143 | full speed USB Device Port with support for five configurable | 143 | full speed USB Device Port with support for five configurable |
| @@ -150,7 +150,7 @@ config USB_AT91 | |||
| 150 | config USB_ATMEL_USBA | 150 | config USB_ATMEL_USBA |
| 151 | tristate "Atmel USBA" | 151 | tristate "Atmel USBA" |
| 152 | select USB_GADGET_DUALSPEED | 152 | select USB_GADGET_DUALSPEED |
| 153 | depends on AVR32 || ARCH_AT91CAP9 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 | 153 | depends on AVR32 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 |
| 154 | help | 154 | help |
| 155 | USBA is the integrated high-speed USB Device controller on | 155 | USBA is the integrated high-speed USB Device controller on |
| 156 | the AT32AP700x, some AT91SAM9 and AT91CAP9 processors from Atmel. | 156 | the AT32AP700x, some AT91SAM9 and AT91CAP9 processors from Atmel. |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index ac53a662a6a3..7732d69e49e0 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
| @@ -872,7 +872,17 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev) | |||
| 872 | */ | 872 | */ |
| 873 | if (pdev->vendor == 0x184e) /* vendor Netlogic */ | 873 | if (pdev->vendor == 0x184e) /* vendor Netlogic */ |
| 874 | return; | 874 | return; |
| 875 | if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI && | ||
| 876 | pdev->class != PCI_CLASS_SERIAL_USB_OHCI && | ||
| 877 | pdev->class != PCI_CLASS_SERIAL_USB_EHCI && | ||
| 878 | pdev->class != PCI_CLASS_SERIAL_USB_XHCI) | ||
| 879 | return; | ||
| 875 | 880 | ||
| 881 | if (pci_enable_device(pdev) < 0) { | ||
| 882 | dev_warn(&pdev->dev, "Can't enable PCI device, " | ||
| 883 | "BIOS handoff failed.\n"); | ||
| 884 | return; | ||
| 885 | } | ||
| 876 | if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI) | 886 | if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI) |
| 877 | quirk_usb_handoff_uhci(pdev); | 887 | quirk_usb_handoff_uhci(pdev); |
| 878 | else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI) | 888 | else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI) |
| @@ -881,5 +891,6 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev) | |||
| 881 | quirk_usb_disable_ehci(pdev); | 891 | quirk_usb_disable_ehci(pdev); |
| 882 | else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI) | 892 | else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI) |
| 883 | quirk_usb_handoff_xhci(pdev); | 893 | quirk_usb_handoff_xhci(pdev); |
| 894 | pci_disable_device(pdev); | ||
| 884 | } | 895 | } |
| 885 | DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff); | 896 | DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff); |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 35e257f79c7b..557b6f32db86 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
| @@ -93,7 +93,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, | |||
| 93 | */ | 93 | */ |
| 94 | memset(port_removable, 0, sizeof(port_removable)); | 94 | memset(port_removable, 0, sizeof(port_removable)); |
| 95 | for (i = 0; i < ports; i++) { | 95 | for (i = 0; i < ports; i++) { |
| 96 | portsc = xhci_readl(xhci, xhci->usb3_ports[i]); | 96 | portsc = xhci_readl(xhci, xhci->usb2_ports[i]); |
| 97 | /* If a device is removable, PORTSC reports a 0, same as in the | 97 | /* If a device is removable, PORTSC reports a 0, same as in the |
| 98 | * hub descriptor DeviceRemovable bits. | 98 | * hub descriptor DeviceRemovable bits. |
| 99 | */ | 99 | */ |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 36cbe2226a44..383fc857491c 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
| @@ -1126,26 +1126,42 @@ static unsigned int xhci_parse_exponent_interval(struct usb_device *udev, | |||
| 1126 | } | 1126 | } |
| 1127 | 1127 | ||
| 1128 | /* | 1128 | /* |
| 1129 | * Convert bInterval expressed in frames (in 1-255 range) to exponent of | 1129 | * Convert bInterval expressed in microframes (in 1-255 range) to exponent of |
| 1130 | * microframes, rounded down to nearest power of 2. | 1130 | * microframes, rounded down to nearest power of 2. |
| 1131 | */ | 1131 | */ |
| 1132 | static unsigned int xhci_parse_frame_interval(struct usb_device *udev, | 1132 | static unsigned int xhci_microframes_to_exponent(struct usb_device *udev, |
| 1133 | struct usb_host_endpoint *ep) | 1133 | struct usb_host_endpoint *ep, unsigned int desc_interval, |
| 1134 | unsigned int min_exponent, unsigned int max_exponent) | ||
| 1134 | { | 1135 | { |
| 1135 | unsigned int interval; | 1136 | unsigned int interval; |
| 1136 | 1137 | ||
| 1137 | interval = fls(8 * ep->desc.bInterval) - 1; | 1138 | interval = fls(desc_interval) - 1; |
| 1138 | interval = clamp_val(interval, 3, 10); | 1139 | interval = clamp_val(interval, min_exponent, max_exponent); |
| 1139 | if ((1 << interval) != 8 * ep->desc.bInterval) | 1140 | if ((1 << interval) != desc_interval) |
| 1140 | dev_warn(&udev->dev, | 1141 | dev_warn(&udev->dev, |
| 1141 | "ep %#x - rounding interval to %d microframes, ep desc says %d microframes\n", | 1142 | "ep %#x - rounding interval to %d microframes, ep desc says %d microframes\n", |
| 1142 | ep->desc.bEndpointAddress, | 1143 | ep->desc.bEndpointAddress, |
| 1143 | 1 << interval, | 1144 | 1 << interval, |
| 1144 | 8 * ep->desc.bInterval); | 1145 | desc_interval); |
| 1145 | 1146 | ||
| 1146 | return interval; | 1147 | return interval; |
| 1147 | } | 1148 | } |
| 1148 | 1149 | ||
| 1150 | static unsigned int xhci_parse_microframe_interval(struct usb_device *udev, | ||
| 1151 | struct usb_host_endpoint *ep) | ||
| 1152 | { | ||
| 1153 | return xhci_microframes_to_exponent(udev, ep, | ||
| 1154 | ep->desc.bInterval, 0, 15); | ||
| 1155 | } | ||
| 1156 | |||
| 1157 | |||
| 1158 | static unsigned int xhci_parse_frame_interval(struct usb_device *udev, | ||
| 1159 | struct usb_host_endpoint *ep) | ||
| 1160 | { | ||
| 1161 | return xhci_microframes_to_exponent(udev, ep, | ||
| 1162 | ep->desc.bInterval * 8, 3, 10); | ||
| 1163 | } | ||
| 1164 | |||
| 1149 | /* Return the polling or NAK interval. | 1165 | /* Return the polling or NAK interval. |
| 1150 | * | 1166 | * |
| 1151 | * The polling interval is expressed in "microframes". If xHCI's Interval field | 1167 | * The polling interval is expressed in "microframes". If xHCI's Interval field |
| @@ -1164,7 +1180,7 @@ static unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
| 1164 | /* Max NAK rate */ | 1180 | /* Max NAK rate */ |
| 1165 | if (usb_endpoint_xfer_control(&ep->desc) || | 1181 | if (usb_endpoint_xfer_control(&ep->desc) || |
| 1166 | usb_endpoint_xfer_bulk(&ep->desc)) { | 1182 | usb_endpoint_xfer_bulk(&ep->desc)) { |
| 1167 | interval = ep->desc.bInterval; | 1183 | interval = xhci_parse_microframe_interval(udev, ep); |
| 1168 | break; | 1184 | break; |
| 1169 | } | 1185 | } |
| 1170 | /* Fall through - SS and HS isoc/int have same decoding */ | 1186 | /* Fall through - SS and HS isoc/int have same decoding */ |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 6bbe3c3a7111..c939f5fdef9e 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -352,6 +352,11 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd) | |||
| 352 | /* hcd->irq is -1, we have MSI */ | 352 | /* hcd->irq is -1, we have MSI */ |
| 353 | return 0; | 353 | return 0; |
| 354 | 354 | ||
| 355 | if (!pdev->irq) { | ||
| 356 | xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n"); | ||
| 357 | return -EINVAL; | ||
| 358 | } | ||
| 359 | |||
| 355 | /* fall back to legacy interrupt*/ | 360 | /* fall back to legacy interrupt*/ |
| 356 | ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, | 361 | ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, |
| 357 | hcd->irq_descr, hcd); | 362 | hcd->irq_descr, hcd); |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 8dbf51a43c45..08a5575724cd 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
| @@ -136,6 +136,8 @@ static const struct usb_device_id id_table[] = { | |||
| 136 | { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ | 136 | { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ |
| 137 | { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */ | 137 | { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */ |
| 138 | { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ | 138 | { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ |
| 139 | { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */ | ||
| 140 | { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */ | ||
| 139 | { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ | 141 | { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ |
| 140 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | 142 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
| 141 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | 143 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 39ed1f46cec0..b54afceb9611 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -788,7 +788,6 @@ static const struct usb_device_id option_ids[] = { | |||
| 788 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff), | 788 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff), |
| 789 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, | 789 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, |
| 790 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) }, | 790 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) }, |
| 791 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, | ||
| 792 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) }, | 791 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) }, |
| 793 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) }, | 792 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) }, |
| 794 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff), | 793 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff), |
| @@ -803,7 +802,6 @@ static const struct usb_device_id option_ids[] = { | |||
| 803 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) }, | 802 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) }, |
| 804 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff), | 803 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff), |
| 805 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, | 804 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, |
| 806 | /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */ | ||
| 807 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) }, | 805 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) }, |
| 808 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) }, | 806 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) }, |
| 809 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) }, | 807 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) }, |
| @@ -828,7 +826,6 @@ static const struct usb_device_id option_ids[] = { | |||
| 828 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) }, | 826 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) }, |
| 829 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff), | 827 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff), |
| 830 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 828 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| 831 | /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */ | ||
| 832 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) }, | 829 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) }, |
| 833 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff), | 830 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff), |
| 834 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, | 831 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, |
| @@ -836,7 +833,6 @@ static const struct usb_device_id option_ids[] = { | |||
| 836 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) }, | 833 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) }, |
| 837 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff), | 834 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff), |
| 838 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 835 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| 839 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, | ||
| 840 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) }, | 836 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) }, |
| 841 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) }, | 837 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) }, |
| 842 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff), | 838 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff), |
| @@ -846,7 +842,6 @@ static const struct usb_device_id option_ids[] = { | |||
| 846 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) }, | 842 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) }, |
| 847 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) }, | 843 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) }, |
| 848 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) }, | 844 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) }, |
| 849 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, | ||
| 850 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) }, | 845 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) }, |
| 851 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) }, | 846 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) }, |
| 852 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) }, | 847 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) }, |
| @@ -865,8 +860,6 @@ static const struct usb_device_id option_ids[] = { | |||
| 865 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0095, 0xff, 0xff, 0xff) }, | 860 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0095, 0xff, 0xff, 0xff) }, |
| 866 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0096, 0xff, 0xff, 0xff) }, | 861 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0096, 0xff, 0xff, 0xff) }, |
| 867 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0097, 0xff, 0xff, 0xff) }, | 862 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0097, 0xff, 0xff, 0xff) }, |
| 868 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0098, 0xff, 0xff, 0xff) }, | ||
| 869 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0099, 0xff, 0xff, 0xff) }, | ||
| 870 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff), | 863 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff), |
| 871 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 864 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| 872 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) }, | 865 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) }, |
| @@ -887,28 +880,18 @@ static const struct usb_device_id option_ids[] = { | |||
| 887 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) }, | 880 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) }, |
| 888 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) }, | 881 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) }, |
| 889 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0145, 0xff, 0xff, 0xff) }, | 882 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0145, 0xff, 0xff, 0xff) }, |
| 890 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0146, 0xff, 0xff, 0xff) }, | ||
| 891 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) }, | ||
| 892 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0148, 0xff, 0xff, 0xff) }, | 883 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0148, 0xff, 0xff, 0xff) }, |
| 893 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0149, 0xff, 0xff, 0xff) }, | ||
| 894 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0150, 0xff, 0xff, 0xff) }, | ||
| 895 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) }, | 884 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) }, |
| 896 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) }, | ||
| 897 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) }, | 885 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) }, |
| 898 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) }, | 886 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) }, |
| 899 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) }, | 887 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) }, |
| 900 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) }, | 888 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) }, |
| 901 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) }, | 889 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) }, |
| 902 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) }, | 890 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) }, |
| 903 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) }, | ||
| 904 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) }, | 891 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) }, |
| 905 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) }, | 892 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) }, |
| 906 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0164, 0xff, 0xff, 0xff) }, | 893 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0164, 0xff, 0xff, 0xff) }, |
| 907 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, | 894 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, |
| 908 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) }, | ||
| 909 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) }, | ||
| 910 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) }, | ||
| 911 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) }, | ||
| 912 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) }, | 895 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) }, |
| 913 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) }, | 896 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) }, |
| 914 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, | 897 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, |
| @@ -1083,127 +1066,27 @@ static const struct usb_device_id option_ids[] = { | |||
| 1083 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, | 1066 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, |
| 1084 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, | 1067 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, |
| 1085 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, | 1068 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, |
| 1086 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff) }, | 1069 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, |
| 1087 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff) }, | 1070 | 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, |
| 1088 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1403, 0xff, 0xff, 0xff) }, | 1071 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, |
| 1089 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1404, 0xff, 0xff, 0xff) }, | 1072 | |
| 1090 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1405, 0xff, 0xff, 0xff) }, | ||
| 1091 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1406, 0xff, 0xff, 0xff) }, | ||
| 1092 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1407, 0xff, 0xff, 0xff) }, | ||
| 1093 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1408, 0xff, 0xff, 0xff) }, | ||
| 1094 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1409, 0xff, 0xff, 0xff) }, | ||
| 1095 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1410, 0xff, 0xff, 0xff) }, | ||
| 1096 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1411, 0xff, 0xff, 0xff) }, | ||
| 1097 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1412, 0xff, 0xff, 0xff) }, | ||
| 1098 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1413, 0xff, 0xff, 0xff) }, | ||
| 1099 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1414, 0xff, 0xff, 0xff) }, | ||
| 1100 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1415, 0xff, 0xff, 0xff) }, | ||
| 1101 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1416, 0xff, 0xff, 0xff) }, | ||
| 1102 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1417, 0xff, 0xff, 0xff) }, | ||
| 1103 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1418, 0xff, 0xff, 0xff) }, | ||
| 1104 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1419, 0xff, 0xff, 0xff) }, | ||
| 1105 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1420, 0xff, 0xff, 0xff) }, | ||
| 1106 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1421, 0xff, 0xff, 0xff) }, | ||
| 1107 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1422, 0xff, 0xff, 0xff) }, | ||
| 1108 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1423, 0xff, 0xff, 0xff) }, | ||
| 1109 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1424, 0xff, 0xff, 0xff) }, | ||
| 1110 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1425, 0xff, 0xff, 0xff) }, | ||
| 1111 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff) }, | ||
| 1112 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1427, 0xff, 0xff, 0xff) }, | ||
| 1113 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xff) }, | ||
| 1114 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1429, 0xff, 0xff, 0xff) }, | ||
| 1115 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1430, 0xff, 0xff, 0xff) }, | ||
| 1116 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1431, 0xff, 0xff, 0xff) }, | ||
| 1117 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1432, 0xff, 0xff, 0xff) }, | ||
| 1118 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1433, 0xff, 0xff, 0xff) }, | ||
| 1119 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1434, 0xff, 0xff, 0xff) }, | ||
| 1120 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1435, 0xff, 0xff, 0xff) }, | ||
| 1121 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1436, 0xff, 0xff, 0xff) }, | ||
| 1122 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1437, 0xff, 0xff, 0xff) }, | ||
| 1123 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1438, 0xff, 0xff, 0xff) }, | ||
| 1124 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1439, 0xff, 0xff, 0xff) }, | ||
| 1125 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1440, 0xff, 0xff, 0xff) }, | ||
| 1126 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1441, 0xff, 0xff, 0xff) }, | ||
| 1127 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1442, 0xff, 0xff, 0xff) }, | ||
| 1128 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1443, 0xff, 0xff, 0xff) }, | ||
| 1129 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1444, 0xff, 0xff, 0xff) }, | ||
| 1130 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1445, 0xff, 0xff, 0xff) }, | ||
| 1131 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1446, 0xff, 0xff, 0xff) }, | ||
| 1132 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1447, 0xff, 0xff, 0xff) }, | ||
| 1133 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1448, 0xff, 0xff, 0xff) }, | ||
| 1134 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1449, 0xff, 0xff, 0xff) }, | ||
| 1135 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1450, 0xff, 0xff, 0xff) }, | ||
| 1136 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1451, 0xff, 0xff, 0xff) }, | ||
| 1137 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1452, 0xff, 0xff, 0xff) }, | ||
| 1138 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1453, 0xff, 0xff, 0xff) }, | ||
| 1139 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1454, 0xff, 0xff, 0xff) }, | ||
| 1140 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1455, 0xff, 0xff, 0xff) }, | ||
| 1141 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1456, 0xff, 0xff, 0xff) }, | ||
| 1142 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1457, 0xff, 0xff, 0xff) }, | ||
| 1143 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1458, 0xff, 0xff, 0xff) }, | ||
| 1144 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1459, 0xff, 0xff, 0xff) }, | ||
| 1145 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1460, 0xff, 0xff, 0xff) }, | ||
| 1146 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1461, 0xff, 0xff, 0xff) }, | ||
| 1147 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1462, 0xff, 0xff, 0xff) }, | ||
| 1148 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1463, 0xff, 0xff, 0xff) }, | ||
| 1149 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1464, 0xff, 0xff, 0xff) }, | ||
| 1150 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1465, 0xff, 0xff, 0xff) }, | ||
| 1151 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1466, 0xff, 0xff, 0xff) }, | ||
| 1152 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1467, 0xff, 0xff, 0xff) }, | ||
| 1153 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1468, 0xff, 0xff, 0xff) }, | ||
| 1154 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1469, 0xff, 0xff, 0xff) }, | ||
| 1155 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1470, 0xff, 0xff, 0xff) }, | ||
| 1156 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1471, 0xff, 0xff, 0xff) }, | ||
| 1157 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1472, 0xff, 0xff, 0xff) }, | ||
| 1158 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1473, 0xff, 0xff, 0xff) }, | ||
| 1159 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1474, 0xff, 0xff, 0xff) }, | ||
| 1160 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1475, 0xff, 0xff, 0xff) }, | ||
| 1161 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1476, 0xff, 0xff, 0xff) }, | ||
| 1162 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1477, 0xff, 0xff, 0xff) }, | ||
| 1163 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1478, 0xff, 0xff, 0xff) }, | ||
| 1164 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1479, 0xff, 0xff, 0xff) }, | ||
| 1165 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1480, 0xff, 0xff, 0xff) }, | ||
| 1166 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0xff, 0xff) }, | ||
| 1167 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1482, 0xff, 0xff, 0xff) }, | ||
| 1168 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1483, 0xff, 0xff, 0xff) }, | ||
| 1169 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1484, 0xff, 0xff, 0xff) }, | ||
| 1170 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xff) }, | ||
| 1171 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1486, 0xff, 0xff, 0xff) }, | ||
| 1172 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1487, 0xff, 0xff, 0xff) }, | ||
| 1173 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1488, 0xff, 0xff, 0xff) }, | ||
| 1174 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1489, 0xff, 0xff, 0xff) }, | ||
| 1175 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1490, 0xff, 0xff, 0xff) }, | ||
| 1176 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1491, 0xff, 0xff, 0xff) }, | ||
| 1177 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1492, 0xff, 0xff, 0xff) }, | ||
| 1178 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1493, 0xff, 0xff, 0xff) }, | ||
| 1179 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1494, 0xff, 0xff, 0xff) }, | ||
| 1180 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1495, 0xff, 0xff, 0xff) }, | ||
| 1181 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1496, 0xff, 0xff, 0xff) }, | ||
| 1182 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1497, 0xff, 0xff, 0xff) }, | ||
| 1183 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1498, 0xff, 0xff, 0xff) }, | ||
| 1184 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1499, 0xff, 0xff, 0xff) }, | ||
| 1185 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1500, 0xff, 0xff, 0xff) }, | ||
| 1186 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1501, 0xff, 0xff, 0xff) }, | ||
| 1187 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1502, 0xff, 0xff, 0xff) }, | ||
| 1188 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1503, 0xff, 0xff, 0xff) }, | ||
| 1189 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1504, 0xff, 0xff, 0xff) }, | ||
| 1190 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1505, 0xff, 0xff, 0xff) }, | ||
| 1191 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1506, 0xff, 0xff, 0xff) }, | ||
| 1192 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1507, 0xff, 0xff, 0xff) }, | ||
| 1193 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1508, 0xff, 0xff, 0xff) }, | ||
| 1194 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1509, 0xff, 0xff, 0xff) }, | ||
| 1195 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1510, 0xff, 0xff, 0xff) }, | ||
| 1196 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */ | 1073 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */ |
| 1197 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) }, | 1074 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) }, |
| 1198 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, | 1075 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, |
| 1199 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) }, | 1076 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) }, |
| 1200 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, | 1077 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, |
| 1201 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) }, | 1078 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) }, |
| 1079 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) }, | ||
| 1202 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) }, | 1080 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) }, |
| 1081 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff) }, | ||
| 1203 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) }, | 1082 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) }, |
| 1204 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, | 1083 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) }, |
| 1205 | 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, | 1084 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) }, |
| 1206 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, | 1085 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) }, |
| 1086 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) }, | ||
| 1087 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) }, | ||
| 1088 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) }, | ||
| 1089 | |||
| 1207 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, | 1090 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, |
| 1208 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, | 1091 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, |
| 1209 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, | 1092 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 8468eb769a29..75b838eff178 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
| @@ -165,7 +165,7 @@ static unsigned int product_5052_count; | |||
| 165 | /* the array dimension is the number of default entries plus */ | 165 | /* the array dimension is the number of default entries plus */ |
| 166 | /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ | 166 | /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ |
| 167 | /* null entry */ | 167 | /* null entry */ |
| 168 | static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = { | 168 | static struct usb_device_id ti_id_table_3410[14+TI_EXTRA_VID_PID_COUNT+1] = { |
| 169 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, | 169 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, |
| 170 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, | 170 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, |
| 171 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, | 171 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, |
| @@ -179,6 +179,7 @@ static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = { | |||
| 179 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, | 179 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, |
| 180 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, | 180 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, |
| 181 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, | 181 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, |
| 182 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, | ||
| 182 | }; | 183 | }; |
| 183 | 184 | ||
| 184 | static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = { | 185 | static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = { |
| @@ -188,7 +189,7 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = { | |||
| 188 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, | 189 | { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, |
| 189 | }; | 190 | }; |
| 190 | 191 | ||
| 191 | static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1] = { | 192 | static struct usb_device_id ti_id_table_combined[18+2*TI_EXTRA_VID_PID_COUNT+1] = { |
| 192 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, | 193 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, |
| 193 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, | 194 | { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) }, |
| 194 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, | 195 | { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) }, |
| @@ -206,6 +207,7 @@ static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1] | |||
| 206 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, | 207 | { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, |
| 207 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, | 208 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) }, |
| 208 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, | 209 | { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) }, |
| 210 | { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, | ||
| 209 | { } | 211 | { } |
| 210 | }; | 212 | }; |
| 211 | 213 | ||
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h index 2aac1953993b..f140f1b9d5c0 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.h +++ b/drivers/usb/serial/ti_usb_3410_5052.h | |||
| @@ -49,6 +49,10 @@ | |||
| 49 | #define MTS_MT9234ZBA_PRODUCT_ID 0xF115 | 49 | #define MTS_MT9234ZBA_PRODUCT_ID 0xF115 |
| 50 | #define MTS_MT9234ZBAOLD_PRODUCT_ID 0x0319 | 50 | #define MTS_MT9234ZBAOLD_PRODUCT_ID 0x0319 |
| 51 | 51 | ||
| 52 | /* Abbott Diabetics vendor and product ids */ | ||
| 53 | #define ABBOTT_VENDOR_ID 0x1a61 | ||
| 54 | #define ABBOTT_PRODUCT_ID 0x3410 | ||
| 55 | |||
| 52 | /* Commands */ | 56 | /* Commands */ |
| 53 | #define TI_GET_VERSION 0x01 | 57 | #define TI_GET_VERSION 0x01 |
| 54 | #define TI_GET_PORT_STATUS 0x02 | 58 | #define TI_GET_PORT_STATUS 0x02 |
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 3dd7da9fd504..db51ba16dc07 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
| @@ -788,15 +788,19 @@ static void quiesce_and_remove_host(struct us_data *us) | |||
| 788 | struct Scsi_Host *host = us_to_host(us); | 788 | struct Scsi_Host *host = us_to_host(us); |
| 789 | 789 | ||
| 790 | /* If the device is really gone, cut short reset delays */ | 790 | /* If the device is really gone, cut short reset delays */ |
| 791 | if (us->pusb_dev->state == USB_STATE_NOTATTACHED) | 791 | if (us->pusb_dev->state == USB_STATE_NOTATTACHED) { |
| 792 | set_bit(US_FLIDX_DISCONNECTING, &us->dflags); | 792 | set_bit(US_FLIDX_DISCONNECTING, &us->dflags); |
| 793 | wake_up(&us->delay_wait); | ||
| 794 | } | ||
| 793 | 795 | ||
| 794 | /* Prevent SCSI-scanning (if it hasn't started yet) | 796 | /* Prevent SCSI scanning (if it hasn't started yet) |
| 795 | * and wait for the SCSI-scanning thread to stop. | 797 | * or wait for the SCSI-scanning routine to stop. |
| 796 | */ | 798 | */ |
| 797 | set_bit(US_FLIDX_DONT_SCAN, &us->dflags); | 799 | cancel_delayed_work_sync(&us->scan_dwork); |
| 798 | wake_up(&us->delay_wait); | 800 | |
| 799 | wait_for_completion(&us->scanning_done); | 801 | /* Balance autopm calls if scanning was cancelled */ |
| 802 | if (test_bit(US_FLIDX_SCAN_PENDING, &us->dflags)) | ||
| 803 | usb_autopm_put_interface_no_suspend(us->pusb_intf); | ||
| 800 | 804 | ||
| 801 | /* Removing the host will perform an orderly shutdown: caches | 805 | /* Removing the host will perform an orderly shutdown: caches |
| 802 | * synchronized, disks spun down, etc. | 806 | * synchronized, disks spun down, etc. |
| @@ -823,53 +827,28 @@ static void release_everything(struct us_data *us) | |||
| 823 | scsi_host_put(us_to_host(us)); | 827 | scsi_host_put(us_to_host(us)); |
| 824 | } | 828 | } |
| 825 | 829 | ||
| 826 | /* Thread to carry out delayed SCSI-device scanning */ | 830 | /* Delayed-work routine to carry out SCSI-device scanning */ |
| 827 | static int usb_stor_scan_thread(void * __us) | 831 | static void usb_stor_scan_dwork(struct work_struct *work) |
| 828 | { | 832 | { |
| 829 | struct us_data *us = (struct us_data *)__us; | 833 | struct us_data *us = container_of(work, struct us_data, |
| 834 | scan_dwork.work); | ||
| 830 | struct device *dev = &us->pusb_intf->dev; | 835 | struct device *dev = &us->pusb_intf->dev; |
| 831 | 836 | ||
| 832 | dev_dbg(dev, "device found\n"); | 837 | dev_dbg(dev, "starting scan\n"); |
| 833 | |||
| 834 | set_freezable(); | ||
| 835 | 838 | ||
| 836 | /* | 839 | /* For bulk-only devices, determine the max LUN value */ |
| 837 | * Wait for the timeout to expire or for a disconnect | 840 | if (us->protocol == USB_PR_BULK && !(us->fflags & US_FL_SINGLE_LUN)) { |
| 838 | * | 841 | mutex_lock(&us->dev_mutex); |
| 839 | * We can't freeze in this thread or we risk causing khubd to | 842 | us->max_lun = usb_stor_Bulk_max_lun(us); |
| 840 | * fail to freeze, but we can't be non-freezable either. Nor can | 843 | mutex_unlock(&us->dev_mutex); |
| 841 | * khubd freeze while waiting for scanning to complete as it may | ||
| 842 | * hold the device lock, causing a hang when suspending devices. | ||
| 843 | * So instead of using wait_event_freezable(), explicitly test | ||
| 844 | * for (DONT_SCAN || freezing) in interruptible wait and proceed | ||
| 845 | * if any of DONT_SCAN, freezing or timeout has happened. | ||
| 846 | */ | ||
| 847 | if (delay_use > 0) { | ||
| 848 | dev_dbg(dev, "waiting for device to settle " | ||
| 849 | "before scanning\n"); | ||
| 850 | wait_event_interruptible_timeout(us->delay_wait, | ||
| 851 | test_bit(US_FLIDX_DONT_SCAN, &us->dflags) || | ||
| 852 | freezing(current), delay_use * HZ); | ||
| 853 | } | 844 | } |
| 845 | scsi_scan_host(us_to_host(us)); | ||
| 846 | dev_dbg(dev, "scan complete\n"); | ||
| 854 | 847 | ||
| 855 | /* If the device is still connected, perform the scanning */ | 848 | /* Should we unbind if no devices were detected? */ |
| 856 | if (!test_bit(US_FLIDX_DONT_SCAN, &us->dflags)) { | ||
| 857 | |||
| 858 | /* For bulk-only devices, determine the max LUN value */ | ||
| 859 | if (us->protocol == USB_PR_BULK && | ||
| 860 | !(us->fflags & US_FL_SINGLE_LUN)) { | ||
| 861 | mutex_lock(&us->dev_mutex); | ||
| 862 | us->max_lun = usb_stor_Bulk_max_lun(us); | ||
| 863 | mutex_unlock(&us->dev_mutex); | ||
| 864 | } | ||
| 865 | scsi_scan_host(us_to_host(us)); | ||
| 866 | dev_dbg(dev, "scan complete\n"); | ||
| 867 | |||
| 868 | /* Should we unbind if no devices were detected? */ | ||
| 869 | } | ||
| 870 | 849 | ||
| 871 | usb_autopm_put_interface(us->pusb_intf); | 850 | usb_autopm_put_interface(us->pusb_intf); |
| 872 | complete_and_exit(&us->scanning_done, 0); | 851 | clear_bit(US_FLIDX_SCAN_PENDING, &us->dflags); |
| 873 | } | 852 | } |
| 874 | 853 | ||
| 875 | static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf) | 854 | static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf) |
| @@ -916,7 +895,7 @@ int usb_stor_probe1(struct us_data **pus, | |||
| 916 | init_completion(&us->cmnd_ready); | 895 | init_completion(&us->cmnd_ready); |
| 917 | init_completion(&(us->notify)); | 896 | init_completion(&(us->notify)); |
| 918 | init_waitqueue_head(&us->delay_wait); | 897 | init_waitqueue_head(&us->delay_wait); |
| 919 | init_completion(&us->scanning_done); | 898 | INIT_DELAYED_WORK(&us->scan_dwork, usb_stor_scan_dwork); |
| 920 | 899 | ||
| 921 | /* Associate the us_data structure with the USB device */ | 900 | /* Associate the us_data structure with the USB device */ |
| 922 | result = associate_dev(us, intf); | 901 | result = associate_dev(us, intf); |
| @@ -947,7 +926,6 @@ EXPORT_SYMBOL_GPL(usb_stor_probe1); | |||
| 947 | /* Second part of general USB mass-storage probing */ | 926 | /* Second part of general USB mass-storage probing */ |
| 948 | int usb_stor_probe2(struct us_data *us) | 927 | int usb_stor_probe2(struct us_data *us) |
| 949 | { | 928 | { |
| 950 | struct task_struct *th; | ||
| 951 | int result; | 929 | int result; |
| 952 | struct device *dev = &us->pusb_intf->dev; | 930 | struct device *dev = &us->pusb_intf->dev; |
| 953 | 931 | ||
| @@ -988,20 +966,14 @@ int usb_stor_probe2(struct us_data *us) | |||
| 988 | goto BadDevice; | 966 | goto BadDevice; |
| 989 | } | 967 | } |
| 990 | 968 | ||
| 991 | /* Start up the thread for delayed SCSI-device scanning */ | 969 | /* Submit the delayed_work for SCSI-device scanning */ |
| 992 | th = kthread_create(usb_stor_scan_thread, us, "usb-stor-scan"); | ||
| 993 | if (IS_ERR(th)) { | ||
| 994 | dev_warn(dev, | ||
| 995 | "Unable to start the device-scanning thread\n"); | ||
| 996 | complete(&us->scanning_done); | ||
| 997 | quiesce_and_remove_host(us); | ||
| 998 | result = PTR_ERR(th); | ||
| 999 | goto BadDevice; | ||
| 1000 | } | ||
| 1001 | |||
| 1002 | usb_autopm_get_interface_no_resume(us->pusb_intf); | 970 | usb_autopm_get_interface_no_resume(us->pusb_intf); |
| 1003 | wake_up_process(th); | 971 | set_bit(US_FLIDX_SCAN_PENDING, &us->dflags); |
| 1004 | 972 | ||
| 973 | if (delay_use > 0) | ||
| 974 | dev_dbg(dev, "waiting for device to settle before scanning\n"); | ||
| 975 | queue_delayed_work(system_freezable_wq, &us->scan_dwork, | ||
| 976 | delay_use * HZ); | ||
| 1005 | return 0; | 977 | return 0; |
| 1006 | 978 | ||
| 1007 | /* We come here if there are any problems */ | 979 | /* We come here if there are any problems */ |
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h index 7b0f2113632e..75f70f04f37b 100644 --- a/drivers/usb/storage/usb.h +++ b/drivers/usb/storage/usb.h | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #include <linux/blkdev.h> | 47 | #include <linux/blkdev.h> |
| 48 | #include <linux/completion.h> | 48 | #include <linux/completion.h> |
| 49 | #include <linux/mutex.h> | 49 | #include <linux/mutex.h> |
| 50 | #include <linux/workqueue.h> | ||
| 50 | #include <scsi/scsi_host.h> | 51 | #include <scsi/scsi_host.h> |
| 51 | 52 | ||
| 52 | struct us_data; | 53 | struct us_data; |
| @@ -72,7 +73,7 @@ struct us_unusual_dev { | |||
| 72 | #define US_FLIDX_DISCONNECTING 3 /* disconnect in progress */ | 73 | #define US_FLIDX_DISCONNECTING 3 /* disconnect in progress */ |
| 73 | #define US_FLIDX_RESETTING 4 /* device reset in progress */ | 74 | #define US_FLIDX_RESETTING 4 /* device reset in progress */ |
| 74 | #define US_FLIDX_TIMED_OUT 5 /* SCSI midlayer timed out */ | 75 | #define US_FLIDX_TIMED_OUT 5 /* SCSI midlayer timed out */ |
| 75 | #define US_FLIDX_DONT_SCAN 6 /* don't scan (disconnect) */ | 76 | #define US_FLIDX_SCAN_PENDING 6 /* scanning not yet done */ |
| 76 | #define US_FLIDX_REDO_READ10 7 /* redo READ(10) command */ | 77 | #define US_FLIDX_REDO_READ10 7 /* redo READ(10) command */ |
| 77 | #define US_FLIDX_READ10_WORKED 8 /* previous READ(10) succeeded */ | 78 | #define US_FLIDX_READ10_WORKED 8 /* previous READ(10) succeeded */ |
| 78 | 79 | ||
| @@ -147,8 +148,8 @@ struct us_data { | |||
| 147 | /* mutual exclusion and synchronization structures */ | 148 | /* mutual exclusion and synchronization structures */ |
| 148 | struct completion cmnd_ready; /* to sleep thread on */ | 149 | struct completion cmnd_ready; /* to sleep thread on */ |
| 149 | struct completion notify; /* thread begin/end */ | 150 | struct completion notify; /* thread begin/end */ |
| 150 | wait_queue_head_t delay_wait; /* wait during scan, reset */ | 151 | wait_queue_head_t delay_wait; /* wait during reset */ |
| 151 | struct completion scanning_done; /* wait for scan thread */ | 152 | struct delayed_work scan_dwork; /* for async scanning */ |
| 152 | 153 | ||
| 153 | /* subdriver information */ | 154 | /* subdriver information */ |
| 154 | void *extra; /* Any extra data */ | 155 | void *extra; /* Any extra data */ |
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 74d29b552901..408a9927be92 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig | |||
| @@ -12,7 +12,7 @@ config PANEL_GENERIC_DPI | |||
| 12 | 12 | ||
| 13 | config PANEL_DVI | 13 | config PANEL_DVI |
| 14 | tristate "DVI output" | 14 | tristate "DVI output" |
| 15 | depends on OMAP2_DSS_DPI | 15 | depends on OMAP2_DSS_DPI && I2C |
| 16 | help | 16 | help |
| 17 | Driver for external monitors, connected via DVI. The driver uses i2c | 17 | Driver for external monitors, connected via DVI. The driver uses i2c |
| 18 | to read EDID information from the monitor. | 18 | to read EDID information from the monitor. |
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 052dc874cd3d..87b3e25294cf 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
| @@ -1276,6 +1276,9 @@ int dss_ovl_enable(struct omap_overlay *ovl) | |||
| 1276 | 1276 | ||
| 1277 | spin_unlock_irqrestore(&data_lock, flags); | 1277 | spin_unlock_irqrestore(&data_lock, flags); |
| 1278 | 1278 | ||
| 1279 | /* wait for overlay to be enabled */ | ||
| 1280 | wait_pending_extra_info_updates(); | ||
| 1281 | |||
| 1279 | mutex_unlock(&apply_lock); | 1282 | mutex_unlock(&apply_lock); |
| 1280 | 1283 | ||
| 1281 | return 0; | 1284 | return 0; |
| @@ -1313,6 +1316,9 @@ int dss_ovl_disable(struct omap_overlay *ovl) | |||
| 1313 | 1316 | ||
| 1314 | spin_unlock_irqrestore(&data_lock, flags); | 1317 | spin_unlock_irqrestore(&data_lock, flags); |
| 1315 | 1318 | ||
| 1319 | /* wait for the overlay to be disabled */ | ||
| 1320 | wait_pending_extra_info_updates(); | ||
| 1321 | |||
| 1316 | mutex_unlock(&apply_lock); | 1322 | mutex_unlock(&apply_lock); |
| 1317 | 1323 | ||
| 1318 | return 0; | 1324 | return 0; |
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index d7aa3b056529..a36b934b2db4 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
| @@ -165,9 +165,25 @@ static int hdmi_runtime_get(void) | |||
| 165 | 165 | ||
| 166 | DSSDBG("hdmi_runtime_get\n"); | 166 | DSSDBG("hdmi_runtime_get\n"); |
| 167 | 167 | ||
| 168 | /* | ||
| 169 | * HACK: Add dss_runtime_get() to ensure DSS clock domain is enabled. | ||
| 170 | * This should be removed later. | ||
| 171 | */ | ||
| 172 | r = dss_runtime_get(); | ||
| 173 | if (r < 0) | ||
| 174 | goto err_get_dss; | ||
| 175 | |||
| 168 | r = pm_runtime_get_sync(&hdmi.pdev->dev); | 176 | r = pm_runtime_get_sync(&hdmi.pdev->dev); |
| 169 | WARN_ON(r < 0); | 177 | WARN_ON(r < 0); |
| 170 | return r < 0 ? r : 0; | 178 | if (r < 0) |
| 179 | goto err_get_hdmi; | ||
| 180 | |||
| 181 | return 0; | ||
| 182 | |||
| 183 | err_get_hdmi: | ||
| 184 | dss_runtime_put(); | ||
| 185 | err_get_dss: | ||
| 186 | return r; | ||
| 171 | } | 187 | } |
| 172 | 188 | ||
| 173 | static void hdmi_runtime_put(void) | 189 | static void hdmi_runtime_put(void) |
| @@ -178,6 +194,12 @@ static void hdmi_runtime_put(void) | |||
| 178 | 194 | ||
| 179 | r = pm_runtime_put_sync(&hdmi.pdev->dev); | 195 | r = pm_runtime_put_sync(&hdmi.pdev->dev); |
| 180 | WARN_ON(r < 0); | 196 | WARN_ON(r < 0); |
| 197 | |||
| 198 | /* | ||
| 199 | * HACK: This is added to complement the dss_runtime_get() call in | ||
| 200 | * hdmi_runtime_get(). This should be removed later. | ||
| 201 | */ | ||
| 202 | dss_runtime_put(); | ||
| 181 | } | 203 | } |
| 182 | 204 | ||
| 183 | int hdmi_init_display(struct omap_dss_device *dssdev) | 205 | int hdmi_init_display(struct omap_dss_device *dssdev) |
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c index 2d72334ca3da..6847a478b459 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | |||
| @@ -479,14 +479,7 @@ int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, | |||
| 479 | 479 | ||
| 480 | bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data) | 480 | bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data) |
| 481 | { | 481 | { |
| 482 | int r; | 482 | return gpio_get_value(ip_data->hpd_gpio); |
| 483 | |||
| 484 | void __iomem *base = hdmi_core_sys_base(ip_data); | ||
| 485 | |||
| 486 | /* HPD */ | ||
| 487 | r = REG_GET(base, HDMI_CORE_SYS_SYS_STAT, 1, 1); | ||
| 488 | |||
| 489 | return r == 1; | ||
| 490 | } | 483 | } |
| 491 | 484 | ||
| 492 | static void hdmi_core_init(struct hdmi_core_video_config *video_cfg, | 485 | static void hdmi_core_init(struct hdmi_core_video_config *video_cfg, |
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c index f9975100d56d..3a3fdc62c75b 100644 --- a/drivers/video/pvr2fb.c +++ b/drivers/video/pvr2fb.c | |||
| @@ -1061,7 +1061,7 @@ static struct pvr2_board { | |||
| 1061 | int (*init)(void); | 1061 | int (*init)(void); |
| 1062 | void (*exit)(void); | 1062 | void (*exit)(void); |
| 1063 | char name[16]; | 1063 | char name[16]; |
| 1064 | } board_driver[] = { | 1064 | } board_driver[] __refdata = { |
| 1065 | #ifdef CONFIG_SH_DREAMCAST | 1065 | #ifdef CONFIG_SH_DREAMCAST |
| 1066 | { pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" }, | 1066 | { pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" }, |
| 1067 | #endif | 1067 | #endif |
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index d5aaca9cfa7e..8497727d66de 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
| @@ -1810,7 +1810,11 @@ static void hw_init(void) | |||
| 1810 | break; | 1810 | break; |
| 1811 | } | 1811 | } |
| 1812 | 1812 | ||
| 1813 | /* magic required on VX900 for correct modesetting on IGA1 */ | ||
| 1814 | via_write_reg_mask(VIACR, 0x45, 0x00, 0x01); | ||
| 1815 | |||
| 1813 | /* probably this should go to the scaling code one day */ | 1816 | /* probably this should go to the scaling code one day */ |
| 1817 | via_write_reg_mask(VIACR, 0xFD, 0, 0x80); /* VX900 hw scale on IGA2 */ | ||
| 1814 | viafb_write_regx(scaling_parameters, ARRAY_SIZE(scaling_parameters)); | 1818 | viafb_write_regx(scaling_parameters, ARRAY_SIZE(scaling_parameters)); |
| 1815 | 1819 | ||
| 1816 | /* Fill VPIT Parameters */ | 1820 | /* Fill VPIT Parameters */ |
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 95aeedf198f8..958e5129c601 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
| @@ -367,29 +367,45 @@ static void __devexit virtballoon_remove(struct virtio_device *vdev) | |||
| 367 | #ifdef CONFIG_PM | 367 | #ifdef CONFIG_PM |
| 368 | static int virtballoon_freeze(struct virtio_device *vdev) | 368 | static int virtballoon_freeze(struct virtio_device *vdev) |
| 369 | { | 369 | { |
| 370 | struct virtio_balloon *vb = vdev->priv; | ||
| 371 | |||
| 370 | /* | 372 | /* |
| 371 | * The kthread is already frozen by the PM core before this | 373 | * The kthread is already frozen by the PM core before this |
| 372 | * function is called. | 374 | * function is called. |
| 373 | */ | 375 | */ |
| 374 | 376 | ||
| 377 | while (vb->num_pages) | ||
| 378 | leak_balloon(vb, vb->num_pages); | ||
| 379 | update_balloon_size(vb); | ||
| 380 | |||
| 375 | /* Ensure we don't get any more requests from the host */ | 381 | /* Ensure we don't get any more requests from the host */ |
| 376 | vdev->config->reset(vdev); | 382 | vdev->config->reset(vdev); |
| 377 | vdev->config->del_vqs(vdev); | 383 | vdev->config->del_vqs(vdev); |
| 378 | return 0; | 384 | return 0; |
| 379 | } | 385 | } |
| 380 | 386 | ||
| 387 | static int restore_common(struct virtio_device *vdev) | ||
| 388 | { | ||
| 389 | struct virtio_balloon *vb = vdev->priv; | ||
| 390 | int ret; | ||
| 391 | |||
| 392 | ret = init_vqs(vdev->priv); | ||
| 393 | if (ret) | ||
| 394 | return ret; | ||
| 395 | |||
| 396 | fill_balloon(vb, towards_target(vb)); | ||
| 397 | update_balloon_size(vb); | ||
| 398 | return 0; | ||
| 399 | } | ||
| 400 | |||
| 381 | static int virtballoon_thaw(struct virtio_device *vdev) | 401 | static int virtballoon_thaw(struct virtio_device *vdev) |
| 382 | { | 402 | { |
| 383 | return init_vqs(vdev->priv); | 403 | return restore_common(vdev); |
| 384 | } | 404 | } |
| 385 | 405 | ||
| 386 | static int virtballoon_restore(struct virtio_device *vdev) | 406 | static int virtballoon_restore(struct virtio_device *vdev) |
| 387 | { | 407 | { |
| 388 | struct virtio_balloon *vb = vdev->priv; | 408 | struct virtio_balloon *vb = vdev->priv; |
| 389 | struct page *page, *page2; | ||
| 390 | |||
| 391 | /* We're starting from a clean slate */ | ||
| 392 | vb->num_pages = 0; | ||
| 393 | 409 | ||
| 394 | /* | 410 | /* |
| 395 | * If a request wasn't complete at the time of freezing, this | 411 | * If a request wasn't complete at the time of freezing, this |
| @@ -397,12 +413,7 @@ static int virtballoon_restore(struct virtio_device *vdev) | |||
| 397 | */ | 413 | */ |
| 398 | vb->need_stats_update = 0; | 414 | vb->need_stats_update = 0; |
| 399 | 415 | ||
| 400 | /* We don't have these pages in the balloon anymore! */ | 416 | return restore_common(vdev); |
| 401 | list_for_each_entry_safe(page, page2, &vb->pages, lru) { | ||
| 402 | list_del(&page->lru); | ||
| 403 | totalram_pages++; | ||
| 404 | } | ||
| 405 | return init_vqs(vdev->priv); | ||
| 406 | } | 417 | } |
| 407 | #endif | 418 | #endif |
| 408 | 419 | ||
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 877b107f77a7..df9e8f0e327d 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
| @@ -1098,7 +1098,7 @@ config BOOKE_WDT_DEFAULT_TIMEOUT | |||
| 1098 | For Freescale Book-E processors, this is a number between 0 and 63. | 1098 | For Freescale Book-E processors, this is a number between 0 and 63. |
| 1099 | For other Book-E processors, this is a number between 0 and 3. | 1099 | For other Book-E processors, this is a number between 0 and 3. |
| 1100 | 1100 | ||
| 1101 | The value can be overidden by the wdt_period command-line parameter. | 1101 | The value can be overridden by the wdt_period command-line parameter. |
| 1102 | 1102 | ||
| 1103 | # PPC64 Architecture | 1103 | # PPC64 Architecture |
| 1104 | 1104 | ||
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c index 337265b47305..7c0fdfca2646 100644 --- a/drivers/watchdog/booke_wdt.c +++ b/drivers/watchdog/booke_wdt.c | |||
| @@ -198,9 +198,13 @@ static long booke_wdt_ioctl(struct file *file, | |||
| 198 | booke_wdt_period = tmp; | 198 | booke_wdt_period = tmp; |
| 199 | #endif | 199 | #endif |
| 200 | booke_wdt_set(); | 200 | booke_wdt_set(); |
| 201 | return 0; | 201 | /* Fall */ |
| 202 | case WDIOC_GETTIMEOUT: | 202 | case WDIOC_GETTIMEOUT: |
| 203 | #ifdef CONFIG_FSL_BOOKE | ||
| 204 | return put_user(period_to_sec(booke_wdt_period), p); | ||
| 205 | #else | ||
| 203 | return put_user(booke_wdt_period, p); | 206 | return put_user(booke_wdt_period, p); |
| 207 | #endif | ||
| 204 | default: | 208 | default: |
| 205 | return -ENOTTY; | 209 | return -ENOTTY; |
| 206 | } | 210 | } |
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 8464ea1c36a1..3c166d3f4e55 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
| @@ -231,7 +231,7 @@ static int __devinit cru_detect(unsigned long map_entry, | |||
| 231 | 231 | ||
| 232 | cmn_regs.u1.reax = CRU_BIOS_SIGNATURE_VALUE; | 232 | cmn_regs.u1.reax = CRU_BIOS_SIGNATURE_VALUE; |
| 233 | 233 | ||
| 234 | set_memory_x((unsigned long)bios32_entrypoint, (2 * PAGE_SIZE)); | 234 | set_memory_x((unsigned long)bios32_map, 2); |
| 235 | asminline_call(&cmn_regs, bios32_entrypoint); | 235 | asminline_call(&cmn_regs, bios32_entrypoint); |
| 236 | 236 | ||
| 237 | if (cmn_regs.u1.ral != 0) { | 237 | if (cmn_regs.u1.ral != 0) { |
| @@ -250,7 +250,8 @@ static int __devinit cru_detect(unsigned long map_entry, | |||
| 250 | cru_rom_addr = | 250 | cru_rom_addr = |
| 251 | ioremap(cru_physical_address, cru_length); | 251 | ioremap(cru_physical_address, cru_length); |
| 252 | if (cru_rom_addr) { | 252 | if (cru_rom_addr) { |
| 253 | set_memory_x((unsigned long)cru_rom_addr, cru_length); | 253 | set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK, |
| 254 | (cru_length + PAGE_SIZE - 1) >> PAGE_SHIFT); | ||
| 254 | retval = 0; | 255 | retval = 0; |
| 255 | } | 256 | } |
| 256 | } | 257 | } |
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index 8e210aafdfd0..dfae030a7ef2 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c | |||
| @@ -264,7 +264,7 @@ static int __devinit pnx4008_wdt_probe(struct platform_device *pdev) | |||
| 264 | wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 264 | wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 265 | if (wdt_mem == NULL) { | 265 | if (wdt_mem == NULL) { |
| 266 | printk(KERN_INFO MODULE_NAME | 266 | printk(KERN_INFO MODULE_NAME |
| 267 | "failed to get memory region resouce\n"); | 267 | "failed to get memory region resource\n"); |
| 268 | return -ENOENT; | 268 | return -ENOENT; |
| 269 | } | 269 | } |
| 270 | 270 | ||
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 4bc3744e14e4..404172f02c9b 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c | |||
| @@ -312,18 +312,26 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | |||
| 312 | dev = &pdev->dev; | 312 | dev = &pdev->dev; |
| 313 | wdt_dev = &pdev->dev; | 313 | wdt_dev = &pdev->dev; |
| 314 | 314 | ||
| 315 | /* get the memory region for the watchdog timer */ | ||
| 316 | |||
| 317 | wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 315 | wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 318 | if (wdt_mem == NULL) { | 316 | if (wdt_mem == NULL) { |
| 319 | dev_err(dev, "no memory resource specified\n"); | 317 | dev_err(dev, "no memory resource specified\n"); |
| 320 | return -ENOENT; | 318 | return -ENOENT; |
| 321 | } | 319 | } |
| 322 | 320 | ||
| 321 | wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | ||
| 322 | if (wdt_irq == NULL) { | ||
| 323 | dev_err(dev, "no irq resource specified\n"); | ||
| 324 | ret = -ENOENT; | ||
| 325 | goto err; | ||
| 326 | } | ||
| 327 | |||
| 328 | /* get the memory region for the watchdog timer */ | ||
| 329 | |||
| 323 | size = resource_size(wdt_mem); | 330 | size = resource_size(wdt_mem); |
| 324 | if (!request_mem_region(wdt_mem->start, size, pdev->name)) { | 331 | if (!request_mem_region(wdt_mem->start, size, pdev->name)) { |
| 325 | dev_err(dev, "failed to get memory region\n"); | 332 | dev_err(dev, "failed to get memory region\n"); |
| 326 | return -EBUSY; | 333 | ret = -EBUSY; |
| 334 | goto err; | ||
| 327 | } | 335 | } |
| 328 | 336 | ||
| 329 | wdt_base = ioremap(wdt_mem->start, size); | 337 | wdt_base = ioremap(wdt_mem->start, size); |
| @@ -335,29 +343,17 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | |||
| 335 | 343 | ||
| 336 | DBG("probe: mapped wdt_base=%p\n", wdt_base); | 344 | DBG("probe: mapped wdt_base=%p\n", wdt_base); |
| 337 | 345 | ||
| 338 | wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | ||
| 339 | if (wdt_irq == NULL) { | ||
| 340 | dev_err(dev, "no irq resource specified\n"); | ||
| 341 | ret = -ENOENT; | ||
| 342 | goto err_map; | ||
| 343 | } | ||
| 344 | |||
| 345 | ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev); | ||
| 346 | if (ret != 0) { | ||
| 347 | dev_err(dev, "failed to install irq (%d)\n", ret); | ||
| 348 | goto err_map; | ||
| 349 | } | ||
| 350 | |||
| 351 | wdt_clock = clk_get(&pdev->dev, "watchdog"); | 346 | wdt_clock = clk_get(&pdev->dev, "watchdog"); |
| 352 | if (IS_ERR(wdt_clock)) { | 347 | if (IS_ERR(wdt_clock)) { |
| 353 | dev_err(dev, "failed to find watchdog clock source\n"); | 348 | dev_err(dev, "failed to find watchdog clock source\n"); |
| 354 | ret = PTR_ERR(wdt_clock); | 349 | ret = PTR_ERR(wdt_clock); |
| 355 | goto err_irq; | 350 | goto err_map; |
| 356 | } | 351 | } |
| 357 | 352 | ||
| 358 | clk_enable(wdt_clock); | 353 | clk_enable(wdt_clock); |
| 359 | 354 | ||
| 360 | if (s3c2410wdt_cpufreq_register() < 0) { | 355 | ret = s3c2410wdt_cpufreq_register(); |
| 356 | if (ret < 0) { | ||
| 361 | printk(KERN_ERR PFX "failed to register cpufreq\n"); | 357 | printk(KERN_ERR PFX "failed to register cpufreq\n"); |
| 362 | goto err_clk; | 358 | goto err_clk; |
| 363 | } | 359 | } |
| @@ -378,12 +374,18 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | |||
| 378 | "cannot start\n"); | 374 | "cannot start\n"); |
| 379 | } | 375 | } |
| 380 | 376 | ||
| 377 | ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev); | ||
| 378 | if (ret != 0) { | ||
| 379 | dev_err(dev, "failed to install irq (%d)\n", ret); | ||
| 380 | goto err_cpufreq; | ||
| 381 | } | ||
| 382 | |||
| 381 | watchdog_set_nowayout(&s3c2410_wdd, nowayout); | 383 | watchdog_set_nowayout(&s3c2410_wdd, nowayout); |
| 382 | 384 | ||
| 383 | ret = watchdog_register_device(&s3c2410_wdd); | 385 | ret = watchdog_register_device(&s3c2410_wdd); |
| 384 | if (ret) { | 386 | if (ret) { |
| 385 | dev_err(dev, "cannot register watchdog (%d)\n", ret); | 387 | dev_err(dev, "cannot register watchdog (%d)\n", ret); |
| 386 | goto err_cpufreq; | 388 | goto err_irq; |
| 387 | } | 389 | } |
| 388 | 390 | ||
| 389 | if (tmr_atboot && started == 0) { | 391 | if (tmr_atboot && started == 0) { |
| @@ -408,23 +410,26 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | |||
| 408 | 410 | ||
| 409 | return 0; | 411 | return 0; |
| 410 | 412 | ||
| 413 | err_irq: | ||
| 414 | free_irq(wdt_irq->start, pdev); | ||
| 415 | |||
| 411 | err_cpufreq: | 416 | err_cpufreq: |
| 412 | s3c2410wdt_cpufreq_deregister(); | 417 | s3c2410wdt_cpufreq_deregister(); |
| 413 | 418 | ||
| 414 | err_clk: | 419 | err_clk: |
| 415 | clk_disable(wdt_clock); | 420 | clk_disable(wdt_clock); |
| 416 | clk_put(wdt_clock); | 421 | clk_put(wdt_clock); |
| 417 | 422 | wdt_clock = NULL; | |
| 418 | err_irq: | ||
| 419 | free_irq(wdt_irq->start, pdev); | ||
| 420 | 423 | ||
| 421 | err_map: | 424 | err_map: |
| 422 | iounmap(wdt_base); | 425 | iounmap(wdt_base); |
| 423 | 426 | ||
| 424 | err_req: | 427 | err_req: |
| 425 | release_mem_region(wdt_mem->start, size); | 428 | release_mem_region(wdt_mem->start, size); |
| 426 | wdt_mem = NULL; | ||
| 427 | 429 | ||
| 430 | err: | ||
| 431 | wdt_irq = NULL; | ||
| 432 | wdt_mem = NULL; | ||
| 428 | return ret; | 433 | return ret; |
| 429 | } | 434 | } |
| 430 | 435 | ||
| @@ -432,18 +437,18 @@ static int __devexit s3c2410wdt_remove(struct platform_device *dev) | |||
| 432 | { | 437 | { |
| 433 | watchdog_unregister_device(&s3c2410_wdd); | 438 | watchdog_unregister_device(&s3c2410_wdd); |
| 434 | 439 | ||
| 440 | free_irq(wdt_irq->start, dev); | ||
| 441 | |||
| 435 | s3c2410wdt_cpufreq_deregister(); | 442 | s3c2410wdt_cpufreq_deregister(); |
| 436 | 443 | ||
| 437 | clk_disable(wdt_clock); | 444 | clk_disable(wdt_clock); |
| 438 | clk_put(wdt_clock); | 445 | clk_put(wdt_clock); |
| 439 | wdt_clock = NULL; | 446 | wdt_clock = NULL; |
| 440 | 447 | ||
| 441 | free_irq(wdt_irq->start, dev); | ||
| 442 | wdt_irq = NULL; | ||
| 443 | |||
| 444 | iounmap(wdt_base); | 448 | iounmap(wdt_base); |
| 445 | 449 | ||
| 446 | release_mem_region(wdt_mem->start, resource_size(wdt_mem)); | 450 | release_mem_region(wdt_mem->start, resource_size(wdt_mem)); |
| 451 | wdt_irq = NULL; | ||
| 447 | wdt_mem = NULL; | 452 | wdt_mem = NULL; |
| 448 | return 0; | 453 | return 0; |
| 449 | } | 454 | } |
