diff options
Diffstat (limited to 'drivers')
74 files changed, 410 insertions, 219 deletions
diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index 78efb0306a44..34d94c762a1e 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c | |||
@@ -250,7 +250,7 @@ int __init dma_declare_contiguous(struct device *dev, unsigned long size, | |||
250 | return -EINVAL; | 250 | return -EINVAL; |
251 | 251 | ||
252 | /* Sanitise input arguments */ | 252 | /* Sanitise input arguments */ |
253 | alignment = PAGE_SIZE << max(MAX_ORDER, pageblock_order); | 253 | alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); |
254 | base = ALIGN(base, alignment); | 254 | base = ALIGN(base, alignment); |
255 | size = ALIGN(size, alignment); | 255 | size = ALIGN(size, alignment); |
256 | limit &= ~(alignment - 1); | 256 | limit &= ~(alignment - 1); |
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index b16c8a72a2e2..ba7926f5c099 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -294,7 +294,7 @@ config GPIO_MAX732X_IRQ | |||
294 | 294 | ||
295 | config GPIO_MC9S08DZ60 | 295 | config GPIO_MC9S08DZ60 |
296 | bool "MX35 3DS BOARD MC9S08DZ60 GPIO functions" | 296 | bool "MX35 3DS BOARD MC9S08DZ60 GPIO functions" |
297 | depends on I2C && MACH_MX35_3DS | 297 | depends on I2C=y && MACH_MX35_3DS |
298 | help | 298 | help |
299 | Select this to enable the MC9S08DZ60 GPIO driver | 299 | Select this to enable the MC9S08DZ60 GPIO driver |
300 | 300 | ||
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index ae37181798b3..ec48ed512628 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c | |||
@@ -247,9 +247,9 @@ static int __devinit em_gio_irq_domain_init(struct em_gio_priv *p) | |||
247 | 247 | ||
248 | p->irq_base = irq_alloc_descs(pdata->irq_base, 0, | 248 | p->irq_base = irq_alloc_descs(pdata->irq_base, 0, |
249 | pdata->number_of_pins, numa_node_id()); | 249 | pdata->number_of_pins, numa_node_id()); |
250 | if (IS_ERR_VALUE(p->irq_base)) { | 250 | if (p->irq_base < 0) { |
251 | dev_err(&pdev->dev, "cannot get irq_desc\n"); | 251 | dev_err(&pdev->dev, "cannot get irq_desc\n"); |
252 | return -ENXIO; | 252 | return p->irq_base; |
253 | } | 253 | } |
254 | pr_debug("gio: hw base = %d, nr = %d, sw base = %d\n", | 254 | pr_debug("gio: hw base = %d, nr = %d, sw base = %d\n", |
255 | pdata->gpio_base, pdata->number_of_pins, p->irq_base); | 255 | pdata->gpio_base, pdata->number_of_pins, p->irq_base); |
diff --git a/drivers/gpio/gpio-rdc321x.c b/drivers/gpio/gpio-rdc321x.c index e97016af6443..b62d443e9a59 100644 --- a/drivers/gpio/gpio-rdc321x.c +++ b/drivers/gpio/gpio-rdc321x.c | |||
@@ -170,6 +170,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev) | |||
170 | rdc321x_gpio_dev->reg2_data_base = r->start + 0x4; | 170 | rdc321x_gpio_dev->reg2_data_base = r->start + 0x4; |
171 | 171 | ||
172 | rdc321x_gpio_dev->chip.label = "rdc321x-gpio"; | 172 | rdc321x_gpio_dev->chip.label = "rdc321x-gpio"; |
173 | rdc321x_gpio_dev->chip.owner = THIS_MODULE; | ||
173 | rdc321x_gpio_dev->chip.direction_input = rdc_gpio_direction_input; | 174 | rdc321x_gpio_dev->chip.direction_input = rdc_gpio_direction_input; |
174 | rdc321x_gpio_dev->chip.direction_output = rdc_gpio_config; | 175 | rdc321x_gpio_dev->chip.direction_output = rdc_gpio_config; |
175 | rdc321x_gpio_dev->chip.get = rdc_gpio_get_value; | 176 | rdc321x_gpio_dev->chip.get = rdc_gpio_get_value; |
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index a18c4aa68b1e..f1a45997aea8 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
@@ -82,7 +82,7 @@ int of_get_named_gpio_flags(struct device_node *np, const char *propname, | |||
82 | gpiochip_find(&gg_data, of_gpiochip_find_and_xlate); | 82 | gpiochip_find(&gg_data, of_gpiochip_find_and_xlate); |
83 | 83 | ||
84 | of_node_put(gg_data.gpiospec.np); | 84 | of_node_put(gg_data.gpiospec.np); |
85 | pr_debug("%s exited with status %d\n", __func__, ret); | 85 | pr_debug("%s exited with status %d\n", __func__, gg_data.out_gpio); |
86 | return gg_data.out_gpio; | 86 | return gg_data.out_gpio; |
87 | } | 87 | } |
88 | EXPORT_SYMBOL(of_get_named_gpio_flags); | 88 | EXPORT_SYMBOL(of_get_named_gpio_flags); |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8bf8a64e5115..8bcd168fffae 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -996,7 +996,8 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field, | |||
996 | struct hid_driver *hdrv = hid->driver; | 996 | struct hid_driver *hdrv = hid->driver; |
997 | int ret; | 997 | int ret; |
998 | 998 | ||
999 | hid_dump_input(hid, usage, value); | 999 | if (!list_empty(&hid->debug_list)) |
1000 | hid_dump_input(hid, usage, value); | ||
1000 | 1001 | ||
1001 | if (hdrv && hdrv->event && hid_match_usage(hid, usage)) { | 1002 | if (hdrv && hdrv->event && hid_match_usage(hid, usage)) { |
1002 | ret = hdrv->event(hid, field, usage, value); | 1003 | ret = hdrv->event(hid, field, usage, value); |
@@ -1558,7 +1559,9 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1558 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) }, | 1559 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) }, |
1559 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, | 1560 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, |
1560 | { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) }, | 1561 | { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) }, |
1561 | { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) }, | 1562 | #if IS_ENABLED(CONFIG_HID_LENOVO_TPKBD) |
1563 | { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) }, | ||
1564 | #endif | ||
1562 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, | 1565 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, |
1563 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, | 1566 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, |
1564 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) }, | 1567 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) }, |
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 0f9c146fc00d..4d524b5f52f5 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c | |||
@@ -439,7 +439,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) | |||
439 | struct dj_report *dj_report; | 439 | struct dj_report *dj_report; |
440 | int retval; | 440 | int retval; |
441 | 441 | ||
442 | dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL); | 442 | dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL); |
443 | if (!dj_report) | 443 | if (!dj_report) |
444 | return -ENOMEM; | 444 | return -ENOMEM; |
445 | dj_report->report_id = REPORT_ID_DJ_SHORT; | 445 | dj_report->report_id = REPORT_ID_DJ_SHORT; |
@@ -456,7 +456,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, | |||
456 | struct dj_report *dj_report; | 456 | struct dj_report *dj_report; |
457 | int retval; | 457 | int retval; |
458 | 458 | ||
459 | dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL); | 459 | dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL); |
460 | if (!dj_report) | 460 | if (!dj_report) |
461 | return -ENOMEM; | 461 | return -ENOMEM; |
462 | dj_report->report_id = REPORT_ID_DJ_SHORT; | 462 | dj_report->report_id = REPORT_ID_DJ_SHORT; |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 903eef3d3e10..991e85c7325c 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -70,6 +70,7 @@ static const struct hid_blacklist { | |||
70 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, | 70 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, |
71 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, | 71 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, |
72 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, | 72 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, |
73 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, | ||
73 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS }, | 74 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS }, |
74 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS }, | 75 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS }, |
75 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS }, | 76 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS }, |
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index ff4c0a87a25f..ce68e361558c 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c | |||
@@ -358,6 +358,7 @@ static void imx_keypad_inhibit(struct imx_keypad *keypad) | |||
358 | /* Inhibit KDI and KRI interrupts. */ | 358 | /* Inhibit KDI and KRI interrupts. */ |
359 | reg_val = readw(keypad->mmio_base + KPSR); | 359 | reg_val = readw(keypad->mmio_base + KPSR); |
360 | reg_val &= ~(KBD_STAT_KRIE | KBD_STAT_KDIE); | 360 | reg_val &= ~(KBD_STAT_KRIE | KBD_STAT_KDIE); |
361 | reg_val |= KBD_STAT_KPKR | KBD_STAT_KPKD; | ||
361 | writew(reg_val, keypad->mmio_base + KPSR); | 362 | writew(reg_val, keypad->mmio_base + KPSR); |
362 | 363 | ||
363 | /* Colums as open drain and disable all rows */ | 364 | /* Colums as open drain and disable all rows */ |
@@ -515,7 +516,9 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev) | |||
515 | input_set_drvdata(input_dev, keypad); | 516 | input_set_drvdata(input_dev, keypad); |
516 | 517 | ||
517 | /* Ensure that the keypad will stay dormant until opened */ | 518 | /* Ensure that the keypad will stay dormant until opened */ |
519 | clk_enable(keypad->clk); | ||
518 | imx_keypad_inhibit(keypad); | 520 | imx_keypad_inhibit(keypad); |
521 | clk_disable(keypad->clk); | ||
519 | 522 | ||
520 | error = request_irq(irq, imx_keypad_irq_handler, 0, | 523 | error = request_irq(irq, imx_keypad_irq_handler, 0, |
521 | pdev->name, keypad); | 524 | pdev->name, keypad); |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 5ec774d6c82b..6918773ce024 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -177,6 +177,20 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { | |||
177 | }, | 177 | }, |
178 | }, | 178 | }, |
179 | { | 179 | { |
180 | /* Gigabyte T1005 - defines wrong chassis type ("Other") */ | ||
181 | .matches = { | ||
182 | DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), | ||
183 | DMI_MATCH(DMI_PRODUCT_NAME, "T1005"), | ||
184 | }, | ||
185 | }, | ||
186 | { | ||
187 | /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */ | ||
188 | .matches = { | ||
189 | DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), | ||
190 | DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"), | ||
191 | }, | ||
192 | }, | ||
193 | { | ||
180 | .matches = { | 194 | .matches = { |
181 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | 195 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), |
182 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"), | 196 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"), |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 002041975de9..532d067a9e07 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -1848,7 +1848,10 @@ static const struct wacom_features wacom_features_0x2A = | |||
1848 | { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, | 1848 | { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, |
1849 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1849 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
1850 | static const struct wacom_features wacom_features_0xF4 = | 1850 | static const struct wacom_features wacom_features_0xF4 = |
1851 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, | 1851 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, |
1852 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | ||
1853 | static const struct wacom_features wacom_features_0xF8 = | ||
1854 | { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, | ||
1852 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1855 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
1853 | static const struct wacom_features wacom_features_0x3F = | 1856 | static const struct wacom_features wacom_features_0x3F = |
1854 | { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, | 1857 | { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, |
@@ -2091,6 +2094,7 @@ const struct usb_device_id wacom_ids[] = { | |||
2091 | { USB_DEVICE_WACOM(0xEF) }, | 2094 | { USB_DEVICE_WACOM(0xEF) }, |
2092 | { USB_DEVICE_WACOM(0x47) }, | 2095 | { USB_DEVICE_WACOM(0x47) }, |
2093 | { USB_DEVICE_WACOM(0xF4) }, | 2096 | { USB_DEVICE_WACOM(0xF4) }, |
2097 | { USB_DEVICE_WACOM(0xF8) }, | ||
2094 | { USB_DEVICE_WACOM(0xFA) }, | 2098 | { USB_DEVICE_WACOM(0xFA) }, |
2095 | { USB_DEVICE_LENOVO(0x6004) }, | 2099 | { USB_DEVICE_LENOVO(0x6004) }, |
2096 | { } | 2100 | { } |
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 9afc777a40a7..b06a5e3a665e 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c | |||
@@ -602,6 +602,7 @@ edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) | |||
602 | { | 602 | { |
603 | if (tsdata->debug_dir) | 603 | if (tsdata->debug_dir) |
604 | debugfs_remove_recursive(tsdata->debug_dir); | 604 | debugfs_remove_recursive(tsdata->debug_dir); |
605 | kfree(tsdata->raw_buffer); | ||
605 | } | 606 | } |
606 | 607 | ||
607 | #else | 608 | #else |
@@ -843,7 +844,6 @@ static int __devexit edt_ft5x06_ts_remove(struct i2c_client *client) | |||
843 | if (gpio_is_valid(pdata->reset_pin)) | 844 | if (gpio_is_valid(pdata->reset_pin)) |
844 | gpio_free(pdata->reset_pin); | 845 | gpio_free(pdata->reset_pin); |
845 | 846 | ||
846 | kfree(tsdata->raw_buffer); | ||
847 | kfree(tsdata); | 847 | kfree(tsdata); |
848 | 848 | ||
849 | return 0; | 849 | return 0; |
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index f1c84decb192..172a768036d8 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -1411,7 +1411,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
1411 | /* complete ongoing async transfer before issuing discard */ | 1411 | /* complete ongoing async transfer before issuing discard */ |
1412 | if (card->host->areq) | 1412 | if (card->host->areq) |
1413 | mmc_blk_issue_rw_rq(mq, NULL); | 1413 | mmc_blk_issue_rw_rq(mq, NULL); |
1414 | if (req->cmd_flags & REQ_SECURE) | 1414 | if (req->cmd_flags & REQ_SECURE && |
1415 | !(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN)) | ||
1415 | ret = mmc_blk_issue_secdiscard_rq(mq, req); | 1416 | ret = mmc_blk_issue_secdiscard_rq(mq, req); |
1416 | else | 1417 | else |
1417 | ret = mmc_blk_issue_discard_rq(mq, req); | 1418 | ret = mmc_blk_issue_discard_rq(mq, req); |
@@ -1716,6 +1717,7 @@ force_ro_fail: | |||
1716 | #define CID_MANFID_SANDISK 0x2 | 1717 | #define CID_MANFID_SANDISK 0x2 |
1717 | #define CID_MANFID_TOSHIBA 0x11 | 1718 | #define CID_MANFID_TOSHIBA 0x11 |
1718 | #define CID_MANFID_MICRON 0x13 | 1719 | #define CID_MANFID_MICRON 0x13 |
1720 | #define CID_MANFID_SAMSUNG 0x15 | ||
1719 | 1721 | ||
1720 | static const struct mmc_fixup blk_fixups[] = | 1722 | static const struct mmc_fixup blk_fixups[] = |
1721 | { | 1723 | { |
@@ -1752,6 +1754,28 @@ static const struct mmc_fixup blk_fixups[] = | |||
1752 | MMC_FIXUP(CID_NAME_ANY, CID_MANFID_MICRON, 0x200, add_quirk_mmc, | 1754 | MMC_FIXUP(CID_NAME_ANY, CID_MANFID_MICRON, 0x200, add_quirk_mmc, |
1753 | MMC_QUIRK_LONG_READ_TIME), | 1755 | MMC_QUIRK_LONG_READ_TIME), |
1754 | 1756 | ||
1757 | /* | ||
1758 | * On these Samsung MoviNAND parts, performing secure erase or | ||
1759 | * secure trim can result in unrecoverable corruption due to a | ||
1760 | * firmware bug. | ||
1761 | */ | ||
1762 | MMC_FIXUP("M8G2FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc, | ||
1763 | MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), | ||
1764 | MMC_FIXUP("MAG4FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc, | ||
1765 | MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), | ||
1766 | MMC_FIXUP("MBG8FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc, | ||
1767 | MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), | ||
1768 | MMC_FIXUP("MCGAFA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc, | ||
1769 | MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), | ||
1770 | MMC_FIXUP("VAL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc, | ||
1771 | MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), | ||
1772 | MMC_FIXUP("VYL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc, | ||
1773 | MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), | ||
1774 | MMC_FIXUP("KYL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc, | ||
1775 | MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), | ||
1776 | MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc, | ||
1777 | MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), | ||
1778 | |||
1755 | END_FIXUP | 1779 | END_FIXUP |
1756 | }; | 1780 | }; |
1757 | 1781 | ||
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 322412cec4ee..a53c7c478e05 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -81,6 +81,7 @@ struct atmel_mci_caps { | |||
81 | bool has_bad_data_ordering; | 81 | bool has_bad_data_ordering; |
82 | bool need_reset_after_xfer; | 82 | bool need_reset_after_xfer; |
83 | bool need_blksz_mul_4; | 83 | bool need_blksz_mul_4; |
84 | bool need_notbusy_for_read_ops; | ||
84 | }; | 85 | }; |
85 | 86 | ||
86 | struct atmel_mci_dma { | 87 | struct atmel_mci_dma { |
@@ -1625,7 +1626,8 @@ static void atmci_tasklet_func(unsigned long priv) | |||
1625 | __func__); | 1626 | __func__); |
1626 | atmci_set_completed(host, EVENT_XFER_COMPLETE); | 1627 | atmci_set_completed(host, EVENT_XFER_COMPLETE); |
1627 | 1628 | ||
1628 | if (host->data->flags & MMC_DATA_WRITE) { | 1629 | if (host->caps.need_notbusy_for_read_ops || |
1630 | (host->data->flags & MMC_DATA_WRITE)) { | ||
1629 | atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY); | 1631 | atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY); |
1630 | state = STATE_WAITING_NOTBUSY; | 1632 | state = STATE_WAITING_NOTBUSY; |
1631 | } else if (host->mrq->stop) { | 1633 | } else if (host->mrq->stop) { |
@@ -2218,6 +2220,7 @@ static void __init atmci_get_cap(struct atmel_mci *host) | |||
2218 | host->caps.has_bad_data_ordering = 1; | 2220 | host->caps.has_bad_data_ordering = 1; |
2219 | host->caps.need_reset_after_xfer = 1; | 2221 | host->caps.need_reset_after_xfer = 1; |
2220 | host->caps.need_blksz_mul_4 = 1; | 2222 | host->caps.need_blksz_mul_4 = 1; |
2223 | host->caps.need_notbusy_for_read_ops = 0; | ||
2221 | 2224 | ||
2222 | /* keep only major version number */ | 2225 | /* keep only major version number */ |
2223 | switch (version & 0xf00) { | 2226 | switch (version & 0xf00) { |
@@ -2238,6 +2241,7 @@ static void __init atmci_get_cap(struct atmel_mci *host) | |||
2238 | case 0x200: | 2241 | case 0x200: |
2239 | host->caps.has_rwproof = 1; | 2242 | host->caps.has_rwproof = 1; |
2240 | host->caps.need_blksz_mul_4 = 0; | 2243 | host->caps.need_blksz_mul_4 = 0; |
2244 | host->caps.need_notbusy_for_read_ops = 1; | ||
2241 | case 0x100: | 2245 | case 0x100: |
2242 | host->caps.has_bad_data_ordering = 0; | 2246 | host->caps.has_bad_data_ordering = 0; |
2243 | host->caps.need_reset_after_xfer = 0; | 2247 | host->caps.need_reset_after_xfer = 0; |
diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c index 03666174ca48..a17dd7363ceb 100644 --- a/drivers/mmc/host/bfin_sdh.c +++ b/drivers/mmc/host/bfin_sdh.c | |||
@@ -49,13 +49,6 @@ | |||
49 | #define bfin_write_SDH_CFG bfin_write_RSI_CFG | 49 | #define bfin_write_SDH_CFG bfin_write_RSI_CFG |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | struct dma_desc_array { | ||
53 | unsigned long start_addr; | ||
54 | unsigned short cfg; | ||
55 | unsigned short x_count; | ||
56 | short x_modify; | ||
57 | } __packed; | ||
58 | |||
59 | struct sdh_host { | 52 | struct sdh_host { |
60 | struct mmc_host *mmc; | 53 | struct mmc_host *mmc; |
61 | spinlock_t lock; | 54 | spinlock_t lock; |
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 72dc3cde646d..af40d227bece 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -627,6 +627,7 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot) | |||
627 | { | 627 | { |
628 | struct dw_mci *host = slot->host; | 628 | struct dw_mci *host = slot->host; |
629 | u32 div; | 629 | u32 div; |
630 | u32 clk_en_a; | ||
630 | 631 | ||
631 | if (slot->clock != host->current_speed) { | 632 | if (slot->clock != host->current_speed) { |
632 | div = host->bus_hz / slot->clock; | 633 | div = host->bus_hz / slot->clock; |
@@ -659,9 +660,11 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot) | |||
659 | mci_send_cmd(slot, | 660 | mci_send_cmd(slot, |
660 | SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0); | 661 | SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0); |
661 | 662 | ||
662 | /* enable clock */ | 663 | /* enable clock; only low power if no SDIO */ |
663 | mci_writel(host, CLKENA, ((SDMMC_CLKEN_ENABLE | | 664 | clk_en_a = SDMMC_CLKEN_ENABLE << slot->id; |
664 | SDMMC_CLKEN_LOW_PWR) << slot->id)); | 665 | if (!(mci_readl(host, INTMASK) & SDMMC_INT_SDIO(slot->id))) |
666 | clk_en_a |= SDMMC_CLKEN_LOW_PWR << slot->id; | ||
667 | mci_writel(host, CLKENA, clk_en_a); | ||
665 | 668 | ||
666 | /* inform CIU */ | 669 | /* inform CIU */ |
667 | mci_send_cmd(slot, | 670 | mci_send_cmd(slot, |
@@ -862,6 +865,30 @@ static int dw_mci_get_cd(struct mmc_host *mmc) | |||
862 | return present; | 865 | return present; |
863 | } | 866 | } |
864 | 867 | ||
868 | /* | ||
869 | * Disable lower power mode. | ||
870 | * | ||
871 | * Low power mode will stop the card clock when idle. According to the | ||
872 | * description of the CLKENA register we should disable low power mode | ||
873 | * for SDIO cards if we need SDIO interrupts to work. | ||
874 | * | ||
875 | * This function is fast if low power mode is already disabled. | ||
876 | */ | ||
877 | static void dw_mci_disable_low_power(struct dw_mci_slot *slot) | ||
878 | { | ||
879 | struct dw_mci *host = slot->host; | ||
880 | u32 clk_en_a; | ||
881 | const u32 clken_low_pwr = SDMMC_CLKEN_LOW_PWR << slot->id; | ||
882 | |||
883 | clk_en_a = mci_readl(host, CLKENA); | ||
884 | |||
885 | if (clk_en_a & clken_low_pwr) { | ||
886 | mci_writel(host, CLKENA, clk_en_a & ~clken_low_pwr); | ||
887 | mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | | ||
888 | SDMMC_CMD_PRV_DAT_WAIT, 0); | ||
889 | } | ||
890 | } | ||
891 | |||
865 | static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb) | 892 | static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb) |
866 | { | 893 | { |
867 | struct dw_mci_slot *slot = mmc_priv(mmc); | 894 | struct dw_mci_slot *slot = mmc_priv(mmc); |
@@ -871,6 +898,14 @@ static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb) | |||
871 | /* Enable/disable Slot Specific SDIO interrupt */ | 898 | /* Enable/disable Slot Specific SDIO interrupt */ |
872 | int_mask = mci_readl(host, INTMASK); | 899 | int_mask = mci_readl(host, INTMASK); |
873 | if (enb) { | 900 | if (enb) { |
901 | /* | ||
902 | * Turn off low power mode if it was enabled. This is a bit of | ||
903 | * a heavy operation and we disable / enable IRQs a lot, so | ||
904 | * we'll leave low power mode disabled and it will get | ||
905 | * re-enabled again in dw_mci_setup_bus(). | ||
906 | */ | ||
907 | dw_mci_disable_low_power(slot); | ||
908 | |||
874 | mci_writel(host, INTMASK, | 909 | mci_writel(host, INTMASK, |
875 | (int_mask | SDMMC_INT_SDIO(slot->id))); | 910 | (int_mask | SDMMC_INT_SDIO(slot->id))); |
876 | } else { | 911 | } else { |
@@ -1429,22 +1464,10 @@ static void dw_mci_read_data_pio(struct dw_mci *host) | |||
1429 | nbytes += len; | 1464 | nbytes += len; |
1430 | remain -= len; | 1465 | remain -= len; |
1431 | } while (remain); | 1466 | } while (remain); |
1432 | sg_miter->consumed = offset; | ||
1433 | 1467 | ||
1468 | sg_miter->consumed = offset; | ||
1434 | status = mci_readl(host, MINTSTS); | 1469 | status = mci_readl(host, MINTSTS); |
1435 | mci_writel(host, RINTSTS, SDMMC_INT_RXDR); | 1470 | mci_writel(host, RINTSTS, SDMMC_INT_RXDR); |
1436 | if (status & DW_MCI_DATA_ERROR_FLAGS) { | ||
1437 | host->data_status = status; | ||
1438 | data->bytes_xfered += nbytes; | ||
1439 | sg_miter_stop(sg_miter); | ||
1440 | host->sg = NULL; | ||
1441 | smp_wmb(); | ||
1442 | |||
1443 | set_bit(EVENT_DATA_ERROR, &host->pending_events); | ||
1444 | |||
1445 | tasklet_schedule(&host->tasklet); | ||
1446 | return; | ||
1447 | } | ||
1448 | } while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/ | 1471 | } while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/ |
1449 | data->bytes_xfered += nbytes; | 1472 | data->bytes_xfered += nbytes; |
1450 | 1473 | ||
@@ -1497,23 +1520,10 @@ static void dw_mci_write_data_pio(struct dw_mci *host) | |||
1497 | nbytes += len; | 1520 | nbytes += len; |
1498 | remain -= len; | 1521 | remain -= len; |
1499 | } while (remain); | 1522 | } while (remain); |
1500 | sg_miter->consumed = offset; | ||
1501 | 1523 | ||
1524 | sg_miter->consumed = offset; | ||
1502 | status = mci_readl(host, MINTSTS); | 1525 | status = mci_readl(host, MINTSTS); |
1503 | mci_writel(host, RINTSTS, SDMMC_INT_TXDR); | 1526 | mci_writel(host, RINTSTS, SDMMC_INT_TXDR); |
1504 | if (status & DW_MCI_DATA_ERROR_FLAGS) { | ||
1505 | host->data_status = status; | ||
1506 | data->bytes_xfered += nbytes; | ||
1507 | sg_miter_stop(sg_miter); | ||
1508 | host->sg = NULL; | ||
1509 | |||
1510 | smp_wmb(); | ||
1511 | |||
1512 | set_bit(EVENT_DATA_ERROR, &host->pending_events); | ||
1513 | |||
1514 | tasklet_schedule(&host->tasklet); | ||
1515 | return; | ||
1516 | } | ||
1517 | } while (status & SDMMC_INT_TXDR); /* if TXDR write again */ | 1527 | } while (status & SDMMC_INT_TXDR); /* if TXDR write again */ |
1518 | data->bytes_xfered += nbytes; | 1528 | data->bytes_xfered += nbytes; |
1519 | 1529 | ||
@@ -1547,12 +1557,11 @@ static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status) | |||
1547 | static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) | 1557 | static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) |
1548 | { | 1558 | { |
1549 | struct dw_mci *host = dev_id; | 1559 | struct dw_mci *host = dev_id; |
1550 | u32 status, pending; | 1560 | u32 pending; |
1551 | unsigned int pass_count = 0; | 1561 | unsigned int pass_count = 0; |
1552 | int i; | 1562 | int i; |
1553 | 1563 | ||
1554 | do { | 1564 | do { |
1555 | status = mci_readl(host, RINTSTS); | ||
1556 | pending = mci_readl(host, MINTSTS); /* read-only mask reg */ | 1565 | pending = mci_readl(host, MINTSTS); /* read-only mask reg */ |
1557 | 1566 | ||
1558 | /* | 1567 | /* |
@@ -1570,7 +1579,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) | |||
1570 | 1579 | ||
1571 | if (pending & DW_MCI_CMD_ERROR_FLAGS) { | 1580 | if (pending & DW_MCI_CMD_ERROR_FLAGS) { |
1572 | mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS); | 1581 | mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS); |
1573 | host->cmd_status = status; | 1582 | host->cmd_status = pending; |
1574 | smp_wmb(); | 1583 | smp_wmb(); |
1575 | set_bit(EVENT_CMD_COMPLETE, &host->pending_events); | 1584 | set_bit(EVENT_CMD_COMPLETE, &host->pending_events); |
1576 | } | 1585 | } |
@@ -1578,18 +1587,16 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) | |||
1578 | if (pending & DW_MCI_DATA_ERROR_FLAGS) { | 1587 | if (pending & DW_MCI_DATA_ERROR_FLAGS) { |
1579 | /* if there is an error report DATA_ERROR */ | 1588 | /* if there is an error report DATA_ERROR */ |
1580 | mci_writel(host, RINTSTS, DW_MCI_DATA_ERROR_FLAGS); | 1589 | mci_writel(host, RINTSTS, DW_MCI_DATA_ERROR_FLAGS); |
1581 | host->data_status = status; | 1590 | host->data_status = pending; |
1582 | smp_wmb(); | 1591 | smp_wmb(); |
1583 | set_bit(EVENT_DATA_ERROR, &host->pending_events); | 1592 | set_bit(EVENT_DATA_ERROR, &host->pending_events); |
1584 | if (!(pending & (SDMMC_INT_DTO | SDMMC_INT_DCRC | | 1593 | tasklet_schedule(&host->tasklet); |
1585 | SDMMC_INT_SBE | SDMMC_INT_EBE))) | ||
1586 | tasklet_schedule(&host->tasklet); | ||
1587 | } | 1594 | } |
1588 | 1595 | ||
1589 | if (pending & SDMMC_INT_DATA_OVER) { | 1596 | if (pending & SDMMC_INT_DATA_OVER) { |
1590 | mci_writel(host, RINTSTS, SDMMC_INT_DATA_OVER); | 1597 | mci_writel(host, RINTSTS, SDMMC_INT_DATA_OVER); |
1591 | if (!host->data_status) | 1598 | if (!host->data_status) |
1592 | host->data_status = status; | 1599 | host->data_status = pending; |
1593 | smp_wmb(); | 1600 | smp_wmb(); |
1594 | if (host->dir_status == DW_MCI_RECV_STATUS) { | 1601 | if (host->dir_status == DW_MCI_RECV_STATUS) { |
1595 | if (host->sg != NULL) | 1602 | if (host->sg != NULL) |
@@ -1613,7 +1620,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) | |||
1613 | 1620 | ||
1614 | if (pending & SDMMC_INT_CMD_DONE) { | 1621 | if (pending & SDMMC_INT_CMD_DONE) { |
1615 | mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE); | 1622 | mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE); |
1616 | dw_mci_cmd_interrupt(host, status); | 1623 | dw_mci_cmd_interrupt(host, pending); |
1617 | } | 1624 | } |
1618 | 1625 | ||
1619 | if (pending & SDMMC_INT_CD) { | 1626 | if (pending & SDMMC_INT_CD) { |
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index a51f9309ffbb..ad3fcea1269e 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c | |||
@@ -285,11 +285,11 @@ static irqreturn_t mxs_mmc_irq_handler(int irq, void *dev_id) | |||
285 | writel(stat & MXS_MMC_IRQ_BITS, | 285 | writel(stat & MXS_MMC_IRQ_BITS, |
286 | host->base + HW_SSP_CTRL1(host) + STMP_OFFSET_REG_CLR); | 286 | host->base + HW_SSP_CTRL1(host) + STMP_OFFSET_REG_CLR); |
287 | 287 | ||
288 | spin_unlock(&host->lock); | ||
289 | |||
288 | if ((stat & BM_SSP_CTRL1_SDIO_IRQ) && (stat & BM_SSP_CTRL1_SDIO_IRQ_EN)) | 290 | if ((stat & BM_SSP_CTRL1_SDIO_IRQ) && (stat & BM_SSP_CTRL1_SDIO_IRQ_EN)) |
289 | mmc_signal_sdio_irq(host->mmc); | 291 | mmc_signal_sdio_irq(host->mmc); |
290 | 292 | ||
291 | spin_unlock(&host->lock); | ||
292 | |||
293 | if (stat & BM_SSP_CTRL1_RESP_TIMEOUT_IRQ) | 293 | if (stat & BM_SSP_CTRL1_RESP_TIMEOUT_IRQ) |
294 | cmd->error = -ETIMEDOUT; | 294 | cmd->error = -ETIMEDOUT; |
295 | else if (stat & BM_SSP_CTRL1_RESP_ERR_IRQ) | 295 | else if (stat & BM_SSP_CTRL1_RESP_ERR_IRQ) |
@@ -644,11 +644,6 @@ static void mxs_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) | |||
644 | host->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET); | 644 | host->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET); |
645 | writel(BM_SSP_CTRL1_SDIO_IRQ_EN, | 645 | writel(BM_SSP_CTRL1_SDIO_IRQ_EN, |
646 | host->base + HW_SSP_CTRL1(host) + STMP_OFFSET_REG_SET); | 646 | host->base + HW_SSP_CTRL1(host) + STMP_OFFSET_REG_SET); |
647 | |||
648 | if (readl(host->base + HW_SSP_STATUS(host)) & | ||
649 | BM_SSP_STATUS_SDIO_IRQ) | ||
650 | mmc_signal_sdio_irq(host->mmc); | ||
651 | |||
652 | } else { | 647 | } else { |
653 | writel(BM_SSP_CTRL0_SDIO_IRQ_CHECK, | 648 | writel(BM_SSP_CTRL0_SDIO_IRQ_CHECK, |
654 | host->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR); | 649 | host->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR); |
@@ -657,6 +652,11 @@ static void mxs_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) | |||
657 | } | 652 | } |
658 | 653 | ||
659 | spin_unlock_irqrestore(&host->lock, flags); | 654 | spin_unlock_irqrestore(&host->lock, flags); |
655 | |||
656 | if (enable && readl(host->base + HW_SSP_STATUS(host)) & | ||
657 | BM_SSP_STATUS_SDIO_IRQ) | ||
658 | mmc_signal_sdio_irq(host->mmc); | ||
659 | |||
660 | } | 660 | } |
661 | 661 | ||
662 | static const struct mmc_host_ops mxs_mmc_ops = { | 662 | static const struct mmc_host_ops mxs_mmc_ops = { |
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 50e08f03aa65..87c0293a1eef 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <asm/io.h> | 33 | #include <asm/io.h> |
34 | #include <asm/irq.h> | 34 | #include <asm/irq.h> |
35 | 35 | ||
36 | #include <plat/board.h> | ||
37 | #include <plat/mmc.h> | 36 | #include <plat/mmc.h> |
38 | #include <asm/gpio.h> | 37 | #include <asm/gpio.h> |
39 | #include <plat/dma.h> | 38 | #include <plat/dma.h> |
@@ -668,7 +667,7 @@ mmc_omap_clk_timer(unsigned long data) | |||
668 | static void | 667 | static void |
669 | mmc_omap_xfer_data(struct mmc_omap_host *host, int write) | 668 | mmc_omap_xfer_data(struct mmc_omap_host *host, int write) |
670 | { | 669 | { |
671 | int n; | 670 | int n, nwords; |
672 | 671 | ||
673 | if (host->buffer_bytes_left == 0) { | 672 | if (host->buffer_bytes_left == 0) { |
674 | host->sg_idx++; | 673 | host->sg_idx++; |
@@ -678,15 +677,23 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int write) | |||
678 | n = 64; | 677 | n = 64; |
679 | if (n > host->buffer_bytes_left) | 678 | if (n > host->buffer_bytes_left) |
680 | n = host->buffer_bytes_left; | 679 | n = host->buffer_bytes_left; |
680 | |||
681 | nwords = n / 2; | ||
682 | nwords += n & 1; /* handle odd number of bytes to transfer */ | ||
683 | |||
681 | host->buffer_bytes_left -= n; | 684 | host->buffer_bytes_left -= n; |
682 | host->total_bytes_left -= n; | 685 | host->total_bytes_left -= n; |
683 | host->data->bytes_xfered += n; | 686 | host->data->bytes_xfered += n; |
684 | 687 | ||
685 | if (write) { | 688 | if (write) { |
686 | __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); | 689 | __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), |
690 | host->buffer, nwords); | ||
687 | } else { | 691 | } else { |
688 | __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); | 692 | __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), |
693 | host->buffer, nwords); | ||
689 | } | 694 | } |
695 | |||
696 | host->buffer += nwords; | ||
690 | } | 697 | } |
691 | 698 | ||
692 | static inline void mmc_omap_report_irq(u16 status) | 699 | static inline void mmc_omap_report_irq(u16 status) |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 3a09f93cc3b6..f871b31ece5a 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <linux/regulator/consumer.h> | 40 | #include <linux/regulator/consumer.h> |
41 | #include <linux/pm_runtime.h> | 41 | #include <linux/pm_runtime.h> |
42 | #include <mach/hardware.h> | 42 | #include <mach/hardware.h> |
43 | #include <plat/board.h> | ||
44 | #include <plat/mmc.h> | 43 | #include <plat/mmc.h> |
45 | #include <plat/cpu.h> | 44 | #include <plat/cpu.h> |
46 | 45 | ||
diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index b97b2f5dafdb..d25f9ab9a54d 100644 --- a/drivers/mmc/host/sdhci-esdhc.h +++ b/drivers/mmc/host/sdhci-esdhc.h | |||
@@ -48,14 +48,14 @@ static inline void esdhc_set_clock(struct sdhci_host *host, unsigned int clock) | |||
48 | int div = 1; | 48 | int div = 1; |
49 | u32 temp; | 49 | u32 temp; |
50 | 50 | ||
51 | if (clock == 0) | ||
52 | goto out; | ||
53 | |||
51 | temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL); | 54 | temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL); |
52 | temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN | 55 | temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN |
53 | | ESDHC_CLOCK_MASK); | 56 | | ESDHC_CLOCK_MASK); |
54 | sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL); | 57 | sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL); |
55 | 58 | ||
56 | if (clock == 0) | ||
57 | goto out; | ||
58 | |||
59 | while (host->max_clk / pre_div / 16 > clock && pre_div < 256) | 59 | while (host->max_clk / pre_div / 16 > clock && pre_div < 256) |
60 | pre_div *= 2; | 60 | pre_div *= 2; |
61 | 61 | ||
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index 3ff893d4e6ce..108ab1ab6606 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c | |||
@@ -44,8 +44,6 @@ | |||
44 | 44 | ||
45 | #include <plat/dma.h> | 45 | #include <plat/dma.h> |
46 | 46 | ||
47 | #include <plat/board.h> | ||
48 | |||
49 | #define DRIVER_NAME "omap2-onenand" | 47 | #define DRIVER_NAME "omap2-onenand" |
50 | 48 | ||
51 | #define ONENAND_BUFRAM_SIZE (1024 * 5) | 49 | #define ONENAND_BUFRAM_SIZE (1024 * 5) |
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 437bc193e170..568307cc7caf 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
@@ -340,7 +340,7 @@ retry: | |||
340 | * of this LEB as it will be deleted and freed in 'ubi_add_to_av()'. | 340 | * of this LEB as it will be deleted and freed in 'ubi_add_to_av()'. |
341 | */ | 341 | */ |
342 | err = ubi_add_to_av(ubi, ai, new_aeb->pnum, new_aeb->ec, vid_hdr, 0); | 342 | err = ubi_add_to_av(ubi, ai, new_aeb->pnum, new_aeb->ec, vid_hdr, 0); |
343 | kfree(new_aeb); | 343 | kmem_cache_free(ai->aeb_slab_cache, new_aeb); |
344 | ubi_free_vid_hdr(ubi, vid_hdr); | 344 | ubi_free_vid_hdr(ubi, vid_hdr); |
345 | return err; | 345 | return err; |
346 | 346 | ||
@@ -353,7 +353,7 @@ write_error: | |||
353 | list_add(&new_aeb->u.list, &ai->erase); | 353 | list_add(&new_aeb->u.list, &ai->erase); |
354 | goto retry; | 354 | goto retry; |
355 | } | 355 | } |
356 | kfree(new_aeb); | 356 | kmem_cache_free(ai->aeb_slab_cache, new_aeb); |
357 | out_free: | 357 | out_free: |
358 | ubi_free_vid_hdr(ubi, vid_hdr); | 358 | ubi_free_vid_hdr(ubi, vid_hdr); |
359 | return err; | 359 | return err; |
diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c index 4f50145f6483..662c5f7eb0c5 100644 --- a/drivers/net/can/sja1000/sja1000_platform.c +++ b/drivers/net/can/sja1000/sja1000_platform.c | |||
@@ -109,7 +109,9 @@ static int sp_probe(struct platform_device *pdev) | |||
109 | priv = netdev_priv(dev); | 109 | priv = netdev_priv(dev); |
110 | 110 | ||
111 | dev->irq = res_irq->start; | 111 | dev->irq = res_irq->start; |
112 | priv->irq_flags = res_irq->flags & (IRQF_TRIGGER_MASK | IRQF_SHARED); | 112 | priv->irq_flags = res_irq->flags & IRQF_TRIGGER_MASK; |
113 | if (res_irq->flags & IORESOURCE_IRQ_SHAREABLE) | ||
114 | priv->irq_flags |= IRQF_SHARED; | ||
113 | priv->reg_base = addr; | 115 | priv->reg_base = addr; |
114 | /* The CAN clock frequency is half the oscillator clock frequency */ | 116 | /* The CAN clock frequency is half the oscillator clock frequency */ |
115 | priv->can.clock.freq = pdata->osc_freq / 2; | 117 | priv->can.clock.freq = pdata->osc_freq / 2; |
diff --git a/drivers/net/can/softing/softing_fw.c b/drivers/net/can/softing/softing_fw.c index 310596175676..b595d3422b9f 100644 --- a/drivers/net/can/softing/softing_fw.c +++ b/drivers/net/can/softing/softing_fw.c | |||
@@ -150,7 +150,7 @@ int softing_load_fw(const char *file, struct softing *card, | |||
150 | const uint8_t *mem, *end, *dat; | 150 | const uint8_t *mem, *end, *dat; |
151 | uint16_t type, len; | 151 | uint16_t type, len; |
152 | uint32_t addr; | 152 | uint32_t addr; |
153 | uint8_t *buf = NULL; | 153 | uint8_t *buf = NULL, *new_buf; |
154 | int buflen = 0; | 154 | int buflen = 0; |
155 | int8_t type_end = 0; | 155 | int8_t type_end = 0; |
156 | 156 | ||
@@ -199,11 +199,12 @@ int softing_load_fw(const char *file, struct softing *card, | |||
199 | if (len > buflen) { | 199 | if (len > buflen) { |
200 | /* align buflen */ | 200 | /* align buflen */ |
201 | buflen = (len + (1024-1)) & ~(1024-1); | 201 | buflen = (len + (1024-1)) & ~(1024-1); |
202 | buf = krealloc(buf, buflen, GFP_KERNEL); | 202 | new_buf = krealloc(buf, buflen, GFP_KERNEL); |
203 | if (!buf) { | 203 | if (!new_buf) { |
204 | ret = -ENOMEM; | 204 | ret = -ENOMEM; |
205 | goto failed; | 205 | goto failed; |
206 | } | 206 | } |
207 | buf = new_buf; | ||
207 | } | 208 | } |
208 | /* verify record data */ | 209 | /* verify record data */ |
209 | memcpy_fromio(buf, &dpram[addr + offset], len); | 210 | memcpy_fromio(buf, &dpram[addr + offset], len); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index 463b9ec57d80..6d1a24acb77e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -1708,9 +1708,6 @@ struct bnx2x_func_init_params { | |||
1708 | continue; \ | 1708 | continue; \ |
1709 | else | 1709 | else |
1710 | 1710 | ||
1711 | #define for_each_napi_rx_queue(bp, var) \ | ||
1712 | for ((var) = 0; (var) < bp->num_napi_queues; (var)++) | ||
1713 | |||
1714 | /* Skip OOO FP */ | 1711 | /* Skip OOO FP */ |
1715 | #define for_each_tx_queue(bp, var) \ | 1712 | #define for_each_tx_queue(bp, var) \ |
1716 | for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \ | 1713 | for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index e879e19eb0d6..af20c6ee2cd9 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -2046,6 +2046,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
2046 | */ | 2046 | */ |
2047 | bnx2x_setup_tc(bp->dev, bp->max_cos); | 2047 | bnx2x_setup_tc(bp->dev, bp->max_cos); |
2048 | 2048 | ||
2049 | /* Add all NAPI objects */ | ||
2050 | bnx2x_add_all_napi(bp); | ||
2049 | bnx2x_napi_enable(bp); | 2051 | bnx2x_napi_enable(bp); |
2050 | 2052 | ||
2051 | /* set pf load just before approaching the MCP */ | 2053 | /* set pf load just before approaching the MCP */ |
@@ -2408,6 +2410,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode) | |||
2408 | 2410 | ||
2409 | /* Disable HW interrupts, NAPI */ | 2411 | /* Disable HW interrupts, NAPI */ |
2410 | bnx2x_netif_stop(bp, 1); | 2412 | bnx2x_netif_stop(bp, 1); |
2413 | /* Delete all NAPI objects */ | ||
2414 | bnx2x_del_all_napi(bp); | ||
2411 | 2415 | ||
2412 | /* Release IRQs */ | 2416 | /* Release IRQs */ |
2413 | bnx2x_free_irq(bp); | 2417 | bnx2x_free_irq(bp); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index dfa757e74296..21b553229ea4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -792,7 +792,7 @@ static inline void bnx2x_add_all_napi(struct bnx2x *bp) | |||
792 | bp->num_napi_queues = bp->num_queues; | 792 | bp->num_napi_queues = bp->num_queues; |
793 | 793 | ||
794 | /* Add NAPI objects */ | 794 | /* Add NAPI objects */ |
795 | for_each_napi_rx_queue(bp, i) | 795 | for_each_rx_queue(bp, i) |
796 | netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi), | 796 | netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi), |
797 | bnx2x_poll, BNX2X_NAPI_WEIGHT); | 797 | bnx2x_poll, BNX2X_NAPI_WEIGHT); |
798 | } | 798 | } |
@@ -801,7 +801,7 @@ static inline void bnx2x_del_all_napi(struct bnx2x *bp) | |||
801 | { | 801 | { |
802 | int i; | 802 | int i; |
803 | 803 | ||
804 | for_each_napi_rx_queue(bp, i) | 804 | for_each_rx_queue(bp, i) |
805 | netif_napi_del(&bnx2x_fp(bp, i, napi)); | 805 | netif_napi_del(&bnx2x_fp(bp, i, napi)); |
806 | } | 806 | } |
807 | 807 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index fc4e0e3885b0..c37a68d68090 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -2888,11 +2888,9 @@ static void bnx2x_get_channels(struct net_device *dev, | |||
2888 | */ | 2888 | */ |
2889 | static void bnx2x_change_num_queues(struct bnx2x *bp, int num_rss) | 2889 | static void bnx2x_change_num_queues(struct bnx2x *bp, int num_rss) |
2890 | { | 2890 | { |
2891 | bnx2x_del_all_napi(bp); | ||
2892 | bnx2x_disable_msi(bp); | 2891 | bnx2x_disable_msi(bp); |
2893 | BNX2X_NUM_QUEUES(bp) = num_rss + NON_ETH_CONTEXT_USE; | 2892 | BNX2X_NUM_QUEUES(bp) = num_rss + NON_ETH_CONTEXT_USE; |
2894 | bnx2x_set_int_mode(bp); | 2893 | bnx2x_set_int_mode(bp); |
2895 | bnx2x_add_all_napi(bp); | ||
2896 | } | 2894 | } |
2897 | 2895 | ||
2898 | /** | 2896 | /** |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 02b5a343b195..21054987257a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -8427,6 +8427,8 @@ unload_error: | |||
8427 | 8427 | ||
8428 | /* Disable HW interrupts, NAPI */ | 8428 | /* Disable HW interrupts, NAPI */ |
8429 | bnx2x_netif_stop(bp, 1); | 8429 | bnx2x_netif_stop(bp, 1); |
8430 | /* Delete all NAPI objects */ | ||
8431 | bnx2x_del_all_napi(bp); | ||
8430 | 8432 | ||
8431 | /* Release IRQs */ | 8433 | /* Release IRQs */ |
8432 | bnx2x_free_irq(bp); | 8434 | bnx2x_free_irq(bp); |
@@ -11229,10 +11231,12 @@ static int bnx2x_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
11229 | static void poll_bnx2x(struct net_device *dev) | 11231 | static void poll_bnx2x(struct net_device *dev) |
11230 | { | 11232 | { |
11231 | struct bnx2x *bp = netdev_priv(dev); | 11233 | struct bnx2x *bp = netdev_priv(dev); |
11234 | int i; | ||
11232 | 11235 | ||
11233 | disable_irq(bp->pdev->irq); | 11236 | for_each_eth_queue(bp, i) { |
11234 | bnx2x_interrupt(bp->pdev->irq, dev); | 11237 | struct bnx2x_fastpath *fp = &bp->fp[i]; |
11235 | enable_irq(bp->pdev->irq); | 11238 | napi_schedule(&bnx2x_fp(bp, fp->index, napi)); |
11239 | } | ||
11236 | } | 11240 | } |
11237 | #endif | 11241 | #endif |
11238 | 11242 | ||
@@ -11899,9 +11903,6 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
11899 | */ | 11903 | */ |
11900 | bnx2x_set_int_mode(bp); | 11904 | bnx2x_set_int_mode(bp); |
11901 | 11905 | ||
11902 | /* Add all NAPI objects */ | ||
11903 | bnx2x_add_all_napi(bp); | ||
11904 | |||
11905 | rc = register_netdev(dev); | 11906 | rc = register_netdev(dev); |
11906 | if (rc) { | 11907 | if (rc) { |
11907 | dev_err(&pdev->dev, "Cannot register net device\n"); | 11908 | dev_err(&pdev->dev, "Cannot register net device\n"); |
@@ -11976,9 +11977,6 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev) | |||
11976 | 11977 | ||
11977 | unregister_netdev(dev); | 11978 | unregister_netdev(dev); |
11978 | 11979 | ||
11979 | /* Delete all NAPI objects */ | ||
11980 | bnx2x_del_all_napi(bp); | ||
11981 | |||
11982 | /* Power on: we can't let PCI layer write to us while we are in D3 */ | 11980 | /* Power on: we can't let PCI layer write to us while we are in D3 */ |
11983 | bnx2x_set_power_state(bp, PCI_D0); | 11981 | bnx2x_set_power_state(bp, PCI_D0); |
11984 | 11982 | ||
@@ -12025,6 +12023,8 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) | |||
12025 | bnx2x_tx_disable(bp); | 12023 | bnx2x_tx_disable(bp); |
12026 | 12024 | ||
12027 | bnx2x_netif_stop(bp, 0); | 12025 | bnx2x_netif_stop(bp, 0); |
12026 | /* Delete all NAPI objects */ | ||
12027 | bnx2x_del_all_napi(bp); | ||
12028 | 12028 | ||
12029 | del_timer_sync(&bp->timer); | 12029 | del_timer_sync(&bp->timer); |
12030 | 12030 | ||
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c index 845b2020f291..138446957786 100644 --- a/drivers/net/ethernet/cirrus/cs89x0.c +++ b/drivers/net/ethernet/cirrus/cs89x0.c | |||
@@ -1243,6 +1243,7 @@ static void set_multicast_list(struct net_device *dev) | |||
1243 | { | 1243 | { |
1244 | struct net_local *lp = netdev_priv(dev); | 1244 | struct net_local *lp = netdev_priv(dev); |
1245 | unsigned long flags; | 1245 | unsigned long flags; |
1246 | u16 cfg; | ||
1246 | 1247 | ||
1247 | spin_lock_irqsave(&lp->lock, flags); | 1248 | spin_lock_irqsave(&lp->lock, flags); |
1248 | if (dev->flags & IFF_PROMISC) | 1249 | if (dev->flags & IFF_PROMISC) |
@@ -1260,11 +1261,10 @@ static void set_multicast_list(struct net_device *dev) | |||
1260 | /* in promiscuous mode, we accept errored packets, | 1261 | /* in promiscuous mode, we accept errored packets, |
1261 | * so we have to enable interrupts on them also | 1262 | * so we have to enable interrupts on them also |
1262 | */ | 1263 | */ |
1263 | writereg(dev, PP_RxCFG, | 1264 | cfg = lp->curr_rx_cfg; |
1264 | (lp->curr_rx_cfg | | 1265 | if (lp->rx_mode == RX_ALL_ACCEPT) |
1265 | (lp->rx_mode == RX_ALL_ACCEPT) | 1266 | cfg |= RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL; |
1266 | ? (RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL) | 1267 | writereg(dev, PP_RxCFG, cfg); |
1267 | : 0)); | ||
1268 | spin_unlock_irqrestore(&lp->lock, flags); | 1268 | spin_unlock_irqrestore(&lp->lock, flags); |
1269 | } | 1269 | } |
1270 | 1270 | ||
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index 7fac97b4bb59..8c63d06ab12b 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -259,7 +259,7 @@ int be_process_mcc(struct be_adapter *adapter) | |||
259 | int num = 0, status = 0; | 259 | int num = 0, status = 0; |
260 | struct be_mcc_obj *mcc_obj = &adapter->mcc_obj; | 260 | struct be_mcc_obj *mcc_obj = &adapter->mcc_obj; |
261 | 261 | ||
262 | spin_lock_bh(&adapter->mcc_cq_lock); | 262 | spin_lock(&adapter->mcc_cq_lock); |
263 | while ((compl = be_mcc_compl_get(adapter))) { | 263 | while ((compl = be_mcc_compl_get(adapter))) { |
264 | if (compl->flags & CQE_FLAGS_ASYNC_MASK) { | 264 | if (compl->flags & CQE_FLAGS_ASYNC_MASK) { |
265 | /* Interpret flags as an async trailer */ | 265 | /* Interpret flags as an async trailer */ |
@@ -280,7 +280,7 @@ int be_process_mcc(struct be_adapter *adapter) | |||
280 | if (num) | 280 | if (num) |
281 | be_cq_notify(adapter, mcc_obj->cq.id, mcc_obj->rearm_cq, num); | 281 | be_cq_notify(adapter, mcc_obj->cq.id, mcc_obj->rearm_cq, num); |
282 | 282 | ||
283 | spin_unlock_bh(&adapter->mcc_cq_lock); | 283 | spin_unlock(&adapter->mcc_cq_lock); |
284 | return status; | 284 | return status; |
285 | } | 285 | } |
286 | 286 | ||
@@ -295,7 +295,9 @@ static int be_mcc_wait_compl(struct be_adapter *adapter) | |||
295 | if (be_error(adapter)) | 295 | if (be_error(adapter)) |
296 | return -EIO; | 296 | return -EIO; |
297 | 297 | ||
298 | local_bh_disable(); | ||
298 | status = be_process_mcc(adapter); | 299 | status = be_process_mcc(adapter); |
300 | local_bh_enable(); | ||
299 | 301 | ||
300 | if (atomic_read(&mcc_obj->q.used) == 0) | 302 | if (atomic_read(&mcc_obj->q.used) == 0) |
301 | break; | 303 | break; |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 90a903d83d87..78b8aa8069f0 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -3763,7 +3763,9 @@ static void be_worker(struct work_struct *work) | |||
3763 | /* when interrupts are not yet enabled, just reap any pending | 3763 | /* when interrupts are not yet enabled, just reap any pending |
3764 | * mcc completions */ | 3764 | * mcc completions */ |
3765 | if (!netif_running(adapter->netdev)) { | 3765 | if (!netif_running(adapter->netdev)) { |
3766 | local_bh_disable(); | ||
3766 | be_process_mcc(adapter); | 3767 | be_process_mcc(adapter); |
3768 | local_bh_enable(); | ||
3767 | goto reschedule; | 3769 | goto reschedule; |
3768 | } | 3770 | } |
3769 | 3771 | ||
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 4605f7246687..d3233f59a82e 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -1041,7 +1041,7 @@ static int gfar_probe(struct platform_device *ofdev) | |||
1041 | 1041 | ||
1042 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) { | 1042 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) { |
1043 | dev->hw_features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 1043 | dev->hw_features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
1044 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 1044 | dev->features |= NETIF_F_HW_VLAN_RX; |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_EXTENDED_HASH) { | 1047 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_EXTENDED_HASH) { |
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index cd153326c3cf..cb3356c9af80 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h | |||
@@ -310,6 +310,7 @@ struct e1000_adapter { | |||
310 | */ | 310 | */ |
311 | struct e1000_ring *tx_ring /* One per active queue */ | 311 | struct e1000_ring *tx_ring /* One per active queue */ |
312 | ____cacheline_aligned_in_smp; | 312 | ____cacheline_aligned_in_smp; |
313 | u32 tx_fifo_limit; | ||
313 | 314 | ||
314 | struct napi_struct napi; | 315 | struct napi_struct napi; |
315 | 316 | ||
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 46c3b1f9ff89..d01a099475a1 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -3517,6 +3517,15 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
3517 | } | 3517 | } |
3518 | 3518 | ||
3519 | /* | 3519 | /* |
3520 | * Alignment of Tx data is on an arbitrary byte boundary with the | ||
3521 | * maximum size per Tx descriptor limited only to the transmit | ||
3522 | * allocation of the packet buffer minus 96 bytes with an upper | ||
3523 | * limit of 24KB due to receive synchronization limitations. | ||
3524 | */ | ||
3525 | adapter->tx_fifo_limit = min_t(u32, ((er32(PBA) >> 16) << 10) - 96, | ||
3526 | 24 << 10); | ||
3527 | |||
3528 | /* | ||
3520 | * Disable Adaptive Interrupt Moderation if 2 full packets cannot | 3529 | * Disable Adaptive Interrupt Moderation if 2 full packets cannot |
3521 | * fit in receive buffer. | 3530 | * fit in receive buffer. |
3522 | */ | 3531 | */ |
@@ -4785,12 +4794,9 @@ static bool e1000_tx_csum(struct e1000_ring *tx_ring, struct sk_buff *skb) | |||
4785 | return 1; | 4794 | return 1; |
4786 | } | 4795 | } |
4787 | 4796 | ||
4788 | #define E1000_MAX_PER_TXD 8192 | ||
4789 | #define E1000_MAX_TXD_PWR 12 | ||
4790 | |||
4791 | static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb, | 4797 | static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb, |
4792 | unsigned int first, unsigned int max_per_txd, | 4798 | unsigned int first, unsigned int max_per_txd, |
4793 | unsigned int nr_frags, unsigned int mss) | 4799 | unsigned int nr_frags) |
4794 | { | 4800 | { |
4795 | struct e1000_adapter *adapter = tx_ring->adapter; | 4801 | struct e1000_adapter *adapter = tx_ring->adapter; |
4796 | struct pci_dev *pdev = adapter->pdev; | 4802 | struct pci_dev *pdev = adapter->pdev; |
@@ -5023,20 +5029,19 @@ static int __e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size) | |||
5023 | 5029 | ||
5024 | static int e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size) | 5030 | static int e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size) |
5025 | { | 5031 | { |
5032 | BUG_ON(size > tx_ring->count); | ||
5033 | |||
5026 | if (e1000_desc_unused(tx_ring) >= size) | 5034 | if (e1000_desc_unused(tx_ring) >= size) |
5027 | return 0; | 5035 | return 0; |
5028 | return __e1000_maybe_stop_tx(tx_ring, size); | 5036 | return __e1000_maybe_stop_tx(tx_ring, size); |
5029 | } | 5037 | } |
5030 | 5038 | ||
5031 | #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1) | ||
5032 | static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | 5039 | static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, |
5033 | struct net_device *netdev) | 5040 | struct net_device *netdev) |
5034 | { | 5041 | { |
5035 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5042 | struct e1000_adapter *adapter = netdev_priv(netdev); |
5036 | struct e1000_ring *tx_ring = adapter->tx_ring; | 5043 | struct e1000_ring *tx_ring = adapter->tx_ring; |
5037 | unsigned int first; | 5044 | unsigned int first; |
5038 | unsigned int max_per_txd = E1000_MAX_PER_TXD; | ||
5039 | unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; | ||
5040 | unsigned int tx_flags = 0; | 5045 | unsigned int tx_flags = 0; |
5041 | unsigned int len = skb_headlen(skb); | 5046 | unsigned int len = skb_headlen(skb); |
5042 | unsigned int nr_frags; | 5047 | unsigned int nr_frags; |
@@ -5056,18 +5061,8 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
5056 | } | 5061 | } |
5057 | 5062 | ||
5058 | mss = skb_shinfo(skb)->gso_size; | 5063 | mss = skb_shinfo(skb)->gso_size; |
5059 | /* | ||
5060 | * The controller does a simple calculation to | ||
5061 | * make sure there is enough room in the FIFO before | ||
5062 | * initiating the DMA for each buffer. The calc is: | ||
5063 | * 4 = ceil(buffer len/mss). To make sure we don't | ||
5064 | * overrun the FIFO, adjust the max buffer len if mss | ||
5065 | * drops. | ||
5066 | */ | ||
5067 | if (mss) { | 5064 | if (mss) { |
5068 | u8 hdr_len; | 5065 | u8 hdr_len; |
5069 | max_per_txd = min(mss << 2, max_per_txd); | ||
5070 | max_txd_pwr = fls(max_per_txd) - 1; | ||
5071 | 5066 | ||
5072 | /* | 5067 | /* |
5073 | * TSO Workaround for 82571/2/3 Controllers -- if skb->data | 5068 | * TSO Workaround for 82571/2/3 Controllers -- if skb->data |
@@ -5097,12 +5092,12 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
5097 | count++; | 5092 | count++; |
5098 | count++; | 5093 | count++; |
5099 | 5094 | ||
5100 | count += TXD_USE_COUNT(len, max_txd_pwr); | 5095 | count += DIV_ROUND_UP(len, adapter->tx_fifo_limit); |
5101 | 5096 | ||
5102 | nr_frags = skb_shinfo(skb)->nr_frags; | 5097 | nr_frags = skb_shinfo(skb)->nr_frags; |
5103 | for (f = 0; f < nr_frags; f++) | 5098 | for (f = 0; f < nr_frags; f++) |
5104 | count += TXD_USE_COUNT(skb_frag_size(&skb_shinfo(skb)->frags[f]), | 5099 | count += DIV_ROUND_UP(skb_frag_size(&skb_shinfo(skb)->frags[f]), |
5105 | max_txd_pwr); | 5100 | adapter->tx_fifo_limit); |
5106 | 5101 | ||
5107 | if (adapter->hw.mac.tx_pkt_filtering) | 5102 | if (adapter->hw.mac.tx_pkt_filtering) |
5108 | e1000_transfer_dhcp_info(adapter, skb); | 5103 | e1000_transfer_dhcp_info(adapter, skb); |
@@ -5144,15 +5139,18 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
5144 | tx_flags |= E1000_TX_FLAGS_NO_FCS; | 5139 | tx_flags |= E1000_TX_FLAGS_NO_FCS; |
5145 | 5140 | ||
5146 | /* if count is 0 then mapping error has occurred */ | 5141 | /* if count is 0 then mapping error has occurred */ |
5147 | count = e1000_tx_map(tx_ring, skb, first, max_per_txd, nr_frags, mss); | 5142 | count = e1000_tx_map(tx_ring, skb, first, adapter->tx_fifo_limit, |
5143 | nr_frags); | ||
5148 | if (count) { | 5144 | if (count) { |
5149 | skb_tx_timestamp(skb); | 5145 | skb_tx_timestamp(skb); |
5150 | 5146 | ||
5151 | netdev_sent_queue(netdev, skb->len); | 5147 | netdev_sent_queue(netdev, skb->len); |
5152 | e1000_tx_queue(tx_ring, tx_flags, count); | 5148 | e1000_tx_queue(tx_ring, tx_flags, count); |
5153 | /* Make sure there is space in the ring for the next send. */ | 5149 | /* Make sure there is space in the ring for the next send. */ |
5154 | e1000_maybe_stop_tx(tx_ring, MAX_SKB_FRAGS + 2); | 5150 | e1000_maybe_stop_tx(tx_ring, |
5155 | 5151 | (MAX_SKB_FRAGS * | |
5152 | DIV_ROUND_UP(PAGE_SIZE, | ||
5153 | adapter->tx_fifo_limit) + 2)); | ||
5156 | } else { | 5154 | } else { |
5157 | dev_kfree_skb_any(skb); | 5155 | dev_kfree_skb_any(skb); |
5158 | tx_ring->buffer_info[first].time_stamp = 0; | 5156 | tx_ring->buffer_info[first].time_stamp = 0; |
@@ -6327,8 +6325,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
6327 | adapter->hw.phy.autoneg_advertised = 0x2f; | 6325 | adapter->hw.phy.autoneg_advertised = 0x2f; |
6328 | 6326 | ||
6329 | /* ring size defaults */ | 6327 | /* ring size defaults */ |
6330 | adapter->rx_ring->count = 256; | 6328 | adapter->rx_ring->count = E1000_DEFAULT_RXD; |
6331 | adapter->tx_ring->count = 256; | 6329 | adapter->tx_ring->count = E1000_DEFAULT_TXD; |
6332 | 6330 | ||
6333 | /* | 6331 | /* |
6334 | * Initial Wake on LAN setting - If APM wake is enabled in | 6332 | * Initial Wake on LAN setting - If APM wake is enabled in |
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c index 8cba2df82b18..5faedd855b77 100644 --- a/drivers/net/ethernet/sfc/ethtool.c +++ b/drivers/net/ethernet/sfc/ethtool.c | |||
@@ -863,8 +863,8 @@ static int efx_ethtool_get_class_rule(struct efx_nic *efx, | |||
863 | &ip_entry->ip4dst, &ip_entry->pdst); | 863 | &ip_entry->ip4dst, &ip_entry->pdst); |
864 | if (rc != 0) { | 864 | if (rc != 0) { |
865 | rc = efx_filter_get_ipv4_full( | 865 | rc = efx_filter_get_ipv4_full( |
866 | &spec, &proto, &ip_entry->ip4src, &ip_entry->psrc, | 866 | &spec, &proto, &ip_entry->ip4dst, &ip_entry->pdst, |
867 | &ip_entry->ip4dst, &ip_entry->pdst); | 867 | &ip_entry->ip4src, &ip_entry->psrc); |
868 | EFX_WARN_ON_PARANOID(rc); | 868 | EFX_WARN_ON_PARANOID(rc); |
869 | ip_mask->ip4src = ~0; | 869 | ip_mask->ip4src = ~0; |
870 | ip_mask->psrc = ~0; | 870 | ip_mask->psrc = ~0; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index e2d083228f3a..719be3912aa9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h | |||
@@ -22,6 +22,9 @@ | |||
22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
23 | *******************************************************************************/ | 23 | *******************************************************************************/ |
24 | 24 | ||
25 | #ifndef __COMMON_H__ | ||
26 | #define __COMMON_H__ | ||
27 | |||
25 | #include <linux/etherdevice.h> | 28 | #include <linux/etherdevice.h> |
26 | #include <linux/netdevice.h> | 29 | #include <linux/netdevice.h> |
27 | #include <linux/phy.h> | 30 | #include <linux/phy.h> |
@@ -366,3 +369,5 @@ extern void stmmac_set_mac(void __iomem *ioaddr, bool enable); | |||
366 | 369 | ||
367 | extern void dwmac_dma_flush_tx_fifo(void __iomem *ioaddr); | 370 | extern void dwmac_dma_flush_tx_fifo(void __iomem *ioaddr); |
368 | extern const struct stmmac_ring_mode_ops ring_mode_ops; | 371 | extern const struct stmmac_ring_mode_ops ring_mode_ops; |
372 | |||
373 | #endif /* __COMMON_H__ */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/descs.h b/drivers/net/ethernet/stmicro/stmmac/descs.h index 9820ec842cc0..223adf95fd03 100644 --- a/drivers/net/ethernet/stmicro/stmmac/descs.h +++ b/drivers/net/ethernet/stmicro/stmmac/descs.h | |||
@@ -20,6 +20,10 @@ | |||
20 | 20 | ||
21 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 21 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
22 | *******************************************************************************/ | 22 | *******************************************************************************/ |
23 | |||
24 | #ifndef __DESCS_H__ | ||
25 | #define __DESCS_H__ | ||
26 | |||
23 | struct dma_desc { | 27 | struct dma_desc { |
24 | /* Receive descriptor */ | 28 | /* Receive descriptor */ |
25 | union { | 29 | union { |
@@ -166,3 +170,5 @@ enum tdes_csum_insertion { | |||
166 | * is not calculated */ | 170 | * is not calculated */ |
167 | cic_full = 3, /* IP header and pseudoheader */ | 171 | cic_full = 3, /* IP header and pseudoheader */ |
168 | }; | 172 | }; |
173 | |||
174 | #endif /* __DESCS_H__ */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/descs_com.h b/drivers/net/ethernet/stmicro/stmmac/descs_com.h index dd8d6e19dff6..7ee9499a6e38 100644 --- a/drivers/net/ethernet/stmicro/stmmac/descs_com.h +++ b/drivers/net/ethernet/stmicro/stmmac/descs_com.h | |||
@@ -27,6 +27,9 @@ | |||
27 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 27 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
28 | *******************************************************************************/ | 28 | *******************************************************************************/ |
29 | 29 | ||
30 | #ifndef __DESC_COM_H__ | ||
31 | #define __DESC_COM_H__ | ||
32 | |||
30 | #if defined(CONFIG_STMMAC_RING) | 33 | #if defined(CONFIG_STMMAC_RING) |
31 | static inline void ehn_desc_rx_set_on_ring_chain(struct dma_desc *p, int end) | 34 | static inline void ehn_desc_rx_set_on_ring_chain(struct dma_desc *p, int end) |
32 | { | 35 | { |
@@ -124,3 +127,5 @@ static inline void norm_set_tx_desc_len(struct dma_desc *p, int len) | |||
124 | p->des01.tx.buffer1_size = len; | 127 | p->des01.tx.buffer1_size = len; |
125 | } | 128 | } |
126 | #endif | 129 | #endif |
130 | |||
131 | #endif /* __DESC_COM_H__ */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100.h b/drivers/net/ethernet/stmicro/stmmac/dwmac100.h index 7c6d857a9cc7..2ec6aeae349e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac100.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100.h | |||
@@ -22,6 +22,9 @@ | |||
22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
23 | *******************************************************************************/ | 23 | *******************************************************************************/ |
24 | 24 | ||
25 | #ifndef __DWMAC100_H__ | ||
26 | #define __DWMAC100_H__ | ||
27 | |||
25 | #include <linux/phy.h> | 28 | #include <linux/phy.h> |
26 | #include "common.h" | 29 | #include "common.h" |
27 | 30 | ||
@@ -119,3 +122,5 @@ enum ttc_control { | |||
119 | #define DMA_MISSED_FRAME_M_CNTR 0x0000ffff /* Missed Frame Couinter */ | 122 | #define DMA_MISSED_FRAME_M_CNTR 0x0000ffff /* Missed Frame Couinter */ |
120 | 123 | ||
121 | extern const struct stmmac_dma_ops dwmac100_dma_ops; | 124 | extern const struct stmmac_dma_ops dwmac100_dma_ops; |
125 | |||
126 | #endif /* __DWMAC100_H__ */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h index f90fcb5f9573..0e4cacedc1f0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | |||
@@ -19,6 +19,8 @@ | |||
19 | 19 | ||
20 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 20 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
21 | *******************************************************************************/ | 21 | *******************************************************************************/ |
22 | #ifndef __DWMAC1000_H__ | ||
23 | #define __DWMAC1000_H__ | ||
22 | 24 | ||
23 | #include <linux/phy.h> | 25 | #include <linux/phy.h> |
24 | #include "common.h" | 26 | #include "common.h" |
@@ -229,6 +231,7 @@ enum rtc_control { | |||
229 | #define GMAC_MMC_RX_CSUM_OFFLOAD 0x208 | 231 | #define GMAC_MMC_RX_CSUM_OFFLOAD 0x208 |
230 | 232 | ||
231 | /* Synopsys Core versions */ | 233 | /* Synopsys Core versions */ |
232 | #define DWMAC_CORE_3_40 34 | 234 | #define DWMAC_CORE_3_40 0x34 |
233 | 235 | ||
234 | extern const struct stmmac_dma_ops dwmac1000_dma_ops; | 236 | extern const struct stmmac_dma_ops dwmac1000_dma_ops; |
237 | #endif /* __DWMAC1000_H__ */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h index e678ce39d014..e49c9a0fd6ff 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h | |||
@@ -22,6 +22,9 @@ | |||
22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
23 | *******************************************************************************/ | 23 | *******************************************************************************/ |
24 | 24 | ||
25 | #ifndef __DWMAC_DMA_H__ | ||
26 | #define __DWMAC_DMA_H__ | ||
27 | |||
25 | /* DMA CRS Control and Status Register Mapping */ | 28 | /* DMA CRS Control and Status Register Mapping */ |
26 | #define DMA_BUS_MODE 0x00001000 /* Bus Mode */ | 29 | #define DMA_BUS_MODE 0x00001000 /* Bus Mode */ |
27 | #define DMA_XMT_POLL_DEMAND 0x00001004 /* Transmit Poll Demand */ | 30 | #define DMA_XMT_POLL_DEMAND 0x00001004 /* Transmit Poll Demand */ |
@@ -109,3 +112,5 @@ extern void dwmac_dma_start_rx(void __iomem *ioaddr); | |||
109 | extern void dwmac_dma_stop_rx(void __iomem *ioaddr); | 112 | extern void dwmac_dma_stop_rx(void __iomem *ioaddr); |
110 | extern int dwmac_dma_interrupt(void __iomem *ioaddr, | 113 | extern int dwmac_dma_interrupt(void __iomem *ioaddr, |
111 | struct stmmac_extra_stats *x); | 114 | struct stmmac_extra_stats *x); |
115 | |||
116 | #endif /* __DWMAC_DMA_H__ */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc.h b/drivers/net/ethernet/stmicro/stmmac/mmc.h index a38352024cb8..67995ef25251 100644 --- a/drivers/net/ethernet/stmicro/stmmac/mmc.h +++ b/drivers/net/ethernet/stmicro/stmmac/mmc.h | |||
@@ -22,6 +22,9 @@ | |||
22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
23 | *******************************************************************************/ | 23 | *******************************************************************************/ |
24 | 24 | ||
25 | #ifndef __MMC_H__ | ||
26 | #define __MMC_H__ | ||
27 | |||
25 | /* MMC control register */ | 28 | /* MMC control register */ |
26 | /* When set, all counter are reset */ | 29 | /* When set, all counter are reset */ |
27 | #define MMC_CNTRL_COUNTER_RESET 0x1 | 30 | #define MMC_CNTRL_COUNTER_RESET 0x1 |
@@ -129,3 +132,5 @@ struct stmmac_counters { | |||
129 | extern void dwmac_mmc_ctrl(void __iomem *ioaddr, unsigned int mode); | 132 | extern void dwmac_mmc_ctrl(void __iomem *ioaddr, unsigned int mode); |
130 | extern void dwmac_mmc_intr_all_mask(void __iomem *ioaddr); | 133 | extern void dwmac_mmc_intr_all_mask(void __iomem *ioaddr); |
131 | extern void dwmac_mmc_read(void __iomem *ioaddr, struct stmmac_counters *mmc); | 134 | extern void dwmac_mmc_read(void __iomem *ioaddr, struct stmmac_counters *mmc); |
135 | |||
136 | #endif /* __MMC_H__ */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c index c07cfe989f6e..0c74a702d461 100644 --- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #define MMC_TX_INTR 0x00000108 /* MMC TX Interrupt */ | 33 | #define MMC_TX_INTR 0x00000108 /* MMC TX Interrupt */ |
34 | #define MMC_RX_INTR_MASK 0x0000010c /* MMC Interrupt Mask */ | 34 | #define MMC_RX_INTR_MASK 0x0000010c /* MMC Interrupt Mask */ |
35 | #define MMC_TX_INTR_MASK 0x00000110 /* MMC Interrupt Mask */ | 35 | #define MMC_TX_INTR_MASK 0x00000110 /* MMC Interrupt Mask */ |
36 | #define MMC_DEFAUL_MASK 0xffffffff | 36 | #define MMC_DEFAULT_MASK 0xffffffff |
37 | 37 | ||
38 | /* MMC TX counter registers */ | 38 | /* MMC TX counter registers */ |
39 | 39 | ||
@@ -147,8 +147,8 @@ void dwmac_mmc_ctrl(void __iomem *ioaddr, unsigned int mode) | |||
147 | /* To mask all all interrupts.*/ | 147 | /* To mask all all interrupts.*/ |
148 | void dwmac_mmc_intr_all_mask(void __iomem *ioaddr) | 148 | void dwmac_mmc_intr_all_mask(void __iomem *ioaddr) |
149 | { | 149 | { |
150 | writel(MMC_DEFAUL_MASK, ioaddr + MMC_RX_INTR_MASK); | 150 | writel(MMC_DEFAULT_MASK, ioaddr + MMC_RX_INTR_MASK); |
151 | writel(MMC_DEFAUL_MASK, ioaddr + MMC_TX_INTR_MASK); | 151 | writel(MMC_DEFAULT_MASK, ioaddr + MMC_TX_INTR_MASK); |
152 | } | 152 | } |
153 | 153 | ||
154 | /* This reads the MAC core counters (if actaully supported). | 154 | /* This reads the MAC core counters (if actaully supported). |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index f2d3665430ad..e872e1da3137 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h | |||
@@ -20,6 +20,9 @@ | |||
20 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 20 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
21 | *******************************************************************************/ | 21 | *******************************************************************************/ |
22 | 22 | ||
23 | #ifndef __STMMAC_H__ | ||
24 | #define __STMMAC_H__ | ||
25 | |||
23 | #define STMMAC_RESOURCE_NAME "stmmaceth" | 26 | #define STMMAC_RESOURCE_NAME "stmmaceth" |
24 | #define DRV_MODULE_VERSION "March_2012" | 27 | #define DRV_MODULE_VERSION "March_2012" |
25 | 28 | ||
@@ -166,3 +169,5 @@ static inline void stmmac_unregister_pci(void) | |||
166 | { | 169 | { |
167 | } | 170 | } |
168 | #endif /* CONFIG_STMMAC_PCI */ | 171 | #endif /* CONFIG_STMMAC_PCI */ |
172 | |||
173 | #endif /* __STMMAC_H__ */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.h index 6863590d184b..aea9b14cdfbe 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.h | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 22 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
23 | *******************************************************************************/ | 23 | *******************************************************************************/ |
24 | #ifndef __STMMAC_TIMER_H__ | ||
25 | #define __STMMAC_TIMER_H__ | ||
24 | 26 | ||
25 | struct stmmac_timer { | 27 | struct stmmac_timer { |
26 | void (*timer_start) (unsigned int new_freq); | 28 | void (*timer_start) (unsigned int new_freq); |
@@ -40,3 +42,5 @@ void stmmac_schedule(struct net_device *dev); | |||
40 | extern int tmu2_register_user(void *fnt, void *data); | 42 | extern int tmu2_register_user(void *fnt, void *data); |
41 | extern void tmu2_unregister_user(void); | 43 | extern void tmu2_unregister_user(void); |
42 | #endif | 44 | #endif |
45 | |||
46 | #endif /* __STMMAC_TIMER_H__ */ | ||
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index cd7ee204e94a..a9ca4a03d31b 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c | |||
@@ -394,8 +394,10 @@ static int __devexit davinci_mdio_remove(struct platform_device *pdev) | |||
394 | struct device *dev = &pdev->dev; | 394 | struct device *dev = &pdev->dev; |
395 | struct davinci_mdio_data *data = dev_get_drvdata(dev); | 395 | struct davinci_mdio_data *data = dev_get_drvdata(dev); |
396 | 396 | ||
397 | if (data->bus) | 397 | if (data->bus) { |
398 | mdiobus_unregister(data->bus); | ||
398 | mdiobus_free(data->bus); | 399 | mdiobus_free(data->bus); |
400 | } | ||
399 | 401 | ||
400 | if (data->clk) | 402 | if (data->clk) |
401 | clk_put(data->clk); | 403 | clk_put(data->clk); |
diff --git a/drivers/net/fddi/skfp/pmf.c b/drivers/net/fddi/skfp/pmf.c index 24d8566cfd8b..441b4dc79450 100644 --- a/drivers/net/fddi/skfp/pmf.c +++ b/drivers/net/fddi/skfp/pmf.c | |||
@@ -673,7 +673,7 @@ void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para, | |||
673 | sm_pm_get_ls(smc,port_to_mib(smc,port))) ; | 673 | sm_pm_get_ls(smc,port_to_mib(smc,port))) ; |
674 | break ; | 674 | break ; |
675 | case SMT_P_REASON : | 675 | case SMT_P_REASON : |
676 | * (u_long *) to = 0 ; | 676 | *(u32 *)to = 0 ; |
677 | sp_len = 4 ; | 677 | sp_len = 4 ; |
678 | goto sp_done ; | 678 | goto sp_done ; |
679 | case SMT_P1033 : /* time stamp */ | 679 | case SMT_P1033 : /* time stamp */ |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 328397c66730..adfab3fc5478 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -413,7 +413,9 @@ static const struct usb_device_id products[] = { | |||
413 | 413 | ||
414 | /* 5. Gobi 2000 and 3000 devices */ | 414 | /* 5. Gobi 2000 and 3000 devices */ |
415 | {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | 415 | {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ |
416 | {QMI_GOBI_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */ | ||
416 | {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ | 417 | {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ |
418 | {QMI_GOBI_DEVICE(0x05c6, 0x920d)}, /* Gobi 3000 Composite */ | ||
417 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ | 419 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ |
418 | {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ | 420 | {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ |
419 | {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ | 421 | {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ |
@@ -441,6 +443,8 @@ static const struct usb_device_id products[] = { | |||
441 | {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ | 443 | {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ |
442 | {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ | 444 | {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ |
443 | {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ | 445 | {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ |
446 | {QMI_GOBI_DEVICE(0x12d1, 0x14f1)}, /* Sony Gobi 3000 Composite */ | ||
447 | {QMI_GOBI_DEVICE(0x1410, 0xa021)}, /* Foxconn Gobi 3000 Modem device (Novatel E396) */ | ||
444 | 448 | ||
445 | { } /* END */ | 449 | { } /* END */ |
446 | }; | 450 | }; |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 8531c1caac28..fd4b26d46fd5 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1573,7 +1573,7 @@ int usbnet_resume (struct usb_interface *intf) | |||
1573 | netif_device_present(dev->net) && | 1573 | netif_device_present(dev->net) && |
1574 | !timer_pending(&dev->delay) && | 1574 | !timer_pending(&dev->delay) && |
1575 | !test_bit(EVENT_RX_HALT, &dev->flags)) | 1575 | !test_bit(EVENT_RX_HALT, &dev->flags)) |
1576 | rx_alloc_submit(dev, GFP_KERNEL); | 1576 | rx_alloc_submit(dev, GFP_NOIO); |
1577 | 1577 | ||
1578 | if (!(dev->txq.qlen >= TX_QLEN(dev))) | 1578 | if (!(dev->txq.qlen >= TX_QLEN(dev))) |
1579 | netif_tx_wake_all_queues(dev->net); | 1579 | netif_tx_wake_all_queues(dev->net); |
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 4026c906cc7b..b7e0258887e7 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c | |||
@@ -1482,7 +1482,7 @@ ath5k_eeprom_read_target_rate_pwr_info(struct ath5k_hw *ah, unsigned int mode) | |||
1482 | case AR5K_EEPROM_MODE_11A: | 1482 | case AR5K_EEPROM_MODE_11A: |
1483 | offset += AR5K_EEPROM_TARGET_PWR_OFF_11A(ee->ee_version); | 1483 | offset += AR5K_EEPROM_TARGET_PWR_OFF_11A(ee->ee_version); |
1484 | rate_pcal_info = ee->ee_rate_tpwr_a; | 1484 | rate_pcal_info = ee->ee_rate_tpwr_a; |
1485 | ee->ee_rate_target_pwr_num[mode] = AR5K_EEPROM_N_5GHZ_CHAN; | 1485 | ee->ee_rate_target_pwr_num[mode] = AR5K_EEPROM_N_5GHZ_RATE_CHAN; |
1486 | break; | 1486 | break; |
1487 | case AR5K_EEPROM_MODE_11B: | 1487 | case AR5K_EEPROM_MODE_11B: |
1488 | offset += AR5K_EEPROM_TARGET_PWR_OFF_11B(ee->ee_version); | 1488 | offset += AR5K_EEPROM_TARGET_PWR_OFF_11B(ee->ee_version); |
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h index dc2bcfeadeb4..94a9bbea6874 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.h +++ b/drivers/net/wireless/ath/ath5k/eeprom.h | |||
@@ -182,6 +182,7 @@ | |||
182 | #define AR5K_EEPROM_EEP_DELTA 10 | 182 | #define AR5K_EEPROM_EEP_DELTA 10 |
183 | #define AR5K_EEPROM_N_MODES 3 | 183 | #define AR5K_EEPROM_N_MODES 3 |
184 | #define AR5K_EEPROM_N_5GHZ_CHAN 10 | 184 | #define AR5K_EEPROM_N_5GHZ_CHAN 10 |
185 | #define AR5K_EEPROM_N_5GHZ_RATE_CHAN 8 | ||
185 | #define AR5K_EEPROM_N_2GHZ_CHAN 3 | 186 | #define AR5K_EEPROM_N_2GHZ_CHAN 3 |
186 | #define AR5K_EEPROM_N_2GHZ_CHAN_2413 4 | 187 | #define AR5K_EEPROM_N_2GHZ_CHAN_2413 4 |
187 | #define AR5K_EEPROM_N_2GHZ_CHAN_MAX 4 | 188 | #define AR5K_EEPROM_N_2GHZ_CHAN_MAX 4 |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c index 192ad5c1fcc8..a5edebeb0b4f 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | |||
@@ -1233,6 +1233,9 @@ uint brcms_reset(struct brcms_info *wl) | |||
1233 | /* dpc will not be rescheduled */ | 1233 | /* dpc will not be rescheduled */ |
1234 | wl->resched = false; | 1234 | wl->resched = false; |
1235 | 1235 | ||
1236 | /* inform publicly that interface is down */ | ||
1237 | wl->pub->up = false; | ||
1238 | |||
1236 | return 0; | 1239 | return 0; |
1237 | } | 1240 | } |
1238 | 1241 | ||
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 95aa8e1683ec..83324b321652 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -2042,7 +2042,8 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status) | |||
2042 | return; | 2042 | return; |
2043 | } | 2043 | } |
2044 | len = ETH_ALEN; | 2044 | len = ETH_ALEN; |
2045 | ipw2100_get_ordinal(priv, IPW_ORD_STAT_ASSN_AP_BSSID, &bssid, &len); | 2045 | ret = ipw2100_get_ordinal(priv, IPW_ORD_STAT_ASSN_AP_BSSID, bssid, |
2046 | &len); | ||
2046 | if (ret) { | 2047 | if (ret) { |
2047 | IPW_DEBUG_INFO("failed querying ordinals at line %d\n", | 2048 | IPW_DEBUG_INFO("failed querying ordinals at line %d\n", |
2048 | __LINE__); | 2049 | __LINE__); |
diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c index 46782f1102ac..a47b306b522c 100644 --- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c | |||
@@ -124,6 +124,9 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, | |||
124 | const struct fw_img *img; | 124 | const struct fw_img *img; |
125 | size_t bufsz; | 125 | size_t bufsz; |
126 | 126 | ||
127 | if (!iwl_is_ready_rf(priv)) | ||
128 | return -EAGAIN; | ||
129 | |||
127 | /* default is to dump the entire data segment */ | 130 | /* default is to dump the entire data segment */ |
128 | if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) { | 131 | if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) { |
129 | priv->dbgfs_sram_offset = 0x800000; | 132 | priv->dbgfs_sram_offset = 0x800000; |
diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h index d9694c58208c..4ffc18dc3a57 100644 --- a/drivers/net/wireless/iwlwifi/pcie/internal.h +++ b/drivers/net/wireless/iwlwifi/pcie/internal.h | |||
@@ -350,7 +350,7 @@ int iwl_queue_space(const struct iwl_queue *q); | |||
350 | /***************************************************** | 350 | /***************************************************** |
351 | * Error handling | 351 | * Error handling |
352 | ******************************************************/ | 352 | ******************************************************/ |
353 | int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display); | 353 | int iwl_dump_fh(struct iwl_trans *trans, char **buf); |
354 | void iwl_dump_csr(struct iwl_trans *trans); | 354 | void iwl_dump_csr(struct iwl_trans *trans); |
355 | 355 | ||
356 | /***************************************************** | 356 | /***************************************************** |
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index 39a6ca1f009c..d1a61ba6247a 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c | |||
@@ -555,7 +555,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans) | |||
555 | } | 555 | } |
556 | 556 | ||
557 | iwl_dump_csr(trans); | 557 | iwl_dump_csr(trans); |
558 | iwl_dump_fh(trans, NULL, false); | 558 | iwl_dump_fh(trans, NULL); |
559 | 559 | ||
560 | iwl_op_mode_nic_error(trans->op_mode); | 560 | iwl_op_mode_nic_error(trans->op_mode); |
561 | } | 561 | } |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 939c2f78df58..1e86ea2266d4 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -1649,13 +1649,9 @@ static const char *get_fh_string(int cmd) | |||
1649 | #undef IWL_CMD | 1649 | #undef IWL_CMD |
1650 | } | 1650 | } |
1651 | 1651 | ||
1652 | int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display) | 1652 | int iwl_dump_fh(struct iwl_trans *trans, char **buf) |
1653 | { | 1653 | { |
1654 | int i; | 1654 | int i; |
1655 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1656 | int pos = 0; | ||
1657 | size_t bufsz = 0; | ||
1658 | #endif | ||
1659 | static const u32 fh_tbl[] = { | 1655 | static const u32 fh_tbl[] = { |
1660 | FH_RSCSR_CHNL0_STTS_WPTR_REG, | 1656 | FH_RSCSR_CHNL0_STTS_WPTR_REG, |
1661 | FH_RSCSR_CHNL0_RBDCB_BASE_REG, | 1657 | FH_RSCSR_CHNL0_RBDCB_BASE_REG, |
@@ -1667,29 +1663,35 @@ int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display) | |||
1667 | FH_TSSR_TX_STATUS_REG, | 1663 | FH_TSSR_TX_STATUS_REG, |
1668 | FH_TSSR_TX_ERROR_REG | 1664 | FH_TSSR_TX_ERROR_REG |
1669 | }; | 1665 | }; |
1670 | #ifdef CONFIG_IWLWIFI_DEBUG | 1666 | |
1671 | if (display) { | 1667 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
1672 | bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40; | 1668 | if (buf) { |
1669 | int pos = 0; | ||
1670 | size_t bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40; | ||
1671 | |||
1673 | *buf = kmalloc(bufsz, GFP_KERNEL); | 1672 | *buf = kmalloc(bufsz, GFP_KERNEL); |
1674 | if (!*buf) | 1673 | if (!*buf) |
1675 | return -ENOMEM; | 1674 | return -ENOMEM; |
1675 | |||
1676 | pos += scnprintf(*buf + pos, bufsz - pos, | 1676 | pos += scnprintf(*buf + pos, bufsz - pos, |
1677 | "FH register values:\n"); | 1677 | "FH register values:\n"); |
1678 | for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) { | 1678 | |
1679 | for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) | ||
1679 | pos += scnprintf(*buf + pos, bufsz - pos, | 1680 | pos += scnprintf(*buf + pos, bufsz - pos, |
1680 | " %34s: 0X%08x\n", | 1681 | " %34s: 0X%08x\n", |
1681 | get_fh_string(fh_tbl[i]), | 1682 | get_fh_string(fh_tbl[i]), |
1682 | iwl_read_direct32(trans, fh_tbl[i])); | 1683 | iwl_read_direct32(trans, fh_tbl[i])); |
1683 | } | 1684 | |
1684 | return pos; | 1685 | return pos; |
1685 | } | 1686 | } |
1686 | #endif | 1687 | #endif |
1688 | |||
1687 | IWL_ERR(trans, "FH register values:\n"); | 1689 | IWL_ERR(trans, "FH register values:\n"); |
1688 | for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) { | 1690 | for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) |
1689 | IWL_ERR(trans, " %34s: 0X%08x\n", | 1691 | IWL_ERR(trans, " %34s: 0X%08x\n", |
1690 | get_fh_string(fh_tbl[i]), | 1692 | get_fh_string(fh_tbl[i]), |
1691 | iwl_read_direct32(trans, fh_tbl[i])); | 1693 | iwl_read_direct32(trans, fh_tbl[i])); |
1692 | } | 1694 | |
1693 | return 0; | 1695 | return 0; |
1694 | } | 1696 | } |
1695 | 1697 | ||
@@ -1982,11 +1984,11 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file, | |||
1982 | size_t count, loff_t *ppos) | 1984 | size_t count, loff_t *ppos) |
1983 | { | 1985 | { |
1984 | struct iwl_trans *trans = file->private_data; | 1986 | struct iwl_trans *trans = file->private_data; |
1985 | char *buf; | 1987 | char *buf = NULL; |
1986 | int pos = 0; | 1988 | int pos = 0; |
1987 | ssize_t ret = -EFAULT; | 1989 | ssize_t ret = -EFAULT; |
1988 | 1990 | ||
1989 | ret = pos = iwl_dump_fh(trans, &buf, true); | 1991 | ret = pos = iwl_dump_fh(trans, &buf); |
1990 | if (buf) { | 1992 | if (buf) { |
1991 | ret = simple_read_from_buffer(user_buf, | 1993 | ret = simple_read_from_buffer(user_buf, |
1992 | count, ppos, buf, pos); | 1994 | count, ppos, buf, pos); |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 30899901aef5..650f79a1f2bd 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -57,8 +57,7 @@ | |||
57 | static const struct ethtool_ops xennet_ethtool_ops; | 57 | static const struct ethtool_ops xennet_ethtool_ops; |
58 | 58 | ||
59 | struct netfront_cb { | 59 | struct netfront_cb { |
60 | struct page *page; | 60 | int pull_to; |
61 | unsigned offset; | ||
62 | }; | 61 | }; |
63 | 62 | ||
64 | #define NETFRONT_SKB_CB(skb) ((struct netfront_cb *)((skb)->cb)) | 63 | #define NETFRONT_SKB_CB(skb) ((struct netfront_cb *)((skb)->cb)) |
@@ -867,15 +866,9 @@ static int handle_incoming_queue(struct net_device *dev, | |||
867 | struct sk_buff *skb; | 866 | struct sk_buff *skb; |
868 | 867 | ||
869 | while ((skb = __skb_dequeue(rxq)) != NULL) { | 868 | while ((skb = __skb_dequeue(rxq)) != NULL) { |
870 | struct page *page = NETFRONT_SKB_CB(skb)->page; | 869 | int pull_to = NETFRONT_SKB_CB(skb)->pull_to; |
871 | void *vaddr = page_address(page); | ||
872 | unsigned offset = NETFRONT_SKB_CB(skb)->offset; | ||
873 | |||
874 | memcpy(skb->data, vaddr + offset, | ||
875 | skb_headlen(skb)); | ||
876 | 870 | ||
877 | if (page != skb_frag_page(&skb_shinfo(skb)->frags[0])) | 871 | __pskb_pull_tail(skb, pull_to - skb_headlen(skb)); |
878 | __free_page(page); | ||
879 | 872 | ||
880 | /* Ethernet work: Delayed to here as it peeks the header. */ | 873 | /* Ethernet work: Delayed to here as it peeks the header. */ |
881 | skb->protocol = eth_type_trans(skb, dev); | 874 | skb->protocol = eth_type_trans(skb, dev); |
@@ -913,7 +906,6 @@ static int xennet_poll(struct napi_struct *napi, int budget) | |||
913 | struct sk_buff_head errq; | 906 | struct sk_buff_head errq; |
914 | struct sk_buff_head tmpq; | 907 | struct sk_buff_head tmpq; |
915 | unsigned long flags; | 908 | unsigned long flags; |
916 | unsigned int len; | ||
917 | int err; | 909 | int err; |
918 | 910 | ||
919 | spin_lock(&np->rx_lock); | 911 | spin_lock(&np->rx_lock); |
@@ -955,24 +947,13 @@ err: | |||
955 | } | 947 | } |
956 | } | 948 | } |
957 | 949 | ||
958 | NETFRONT_SKB_CB(skb)->page = | 950 | NETFRONT_SKB_CB(skb)->pull_to = rx->status; |
959 | skb_frag_page(&skb_shinfo(skb)->frags[0]); | 951 | if (NETFRONT_SKB_CB(skb)->pull_to > RX_COPY_THRESHOLD) |
960 | NETFRONT_SKB_CB(skb)->offset = rx->offset; | 952 | NETFRONT_SKB_CB(skb)->pull_to = RX_COPY_THRESHOLD; |
961 | |||
962 | len = rx->status; | ||
963 | if (len > RX_COPY_THRESHOLD) | ||
964 | len = RX_COPY_THRESHOLD; | ||
965 | skb_put(skb, len); | ||
966 | 953 | ||
967 | if (rx->status > len) { | 954 | skb_shinfo(skb)->frags[0].page_offset = rx->offset; |
968 | skb_shinfo(skb)->frags[0].page_offset = | 955 | skb_frag_size_set(&skb_shinfo(skb)->frags[0], rx->status); |
969 | rx->offset + len; | 956 | skb->data_len = rx->status; |
970 | skb_frag_size_set(&skb_shinfo(skb)->frags[0], rx->status - len); | ||
971 | skb->data_len = rx->status - len; | ||
972 | } else { | ||
973 | __skb_fill_page_desc(skb, 0, NULL, 0, 0); | ||
974 | skb_shinfo(skb)->nr_frags = 0; | ||
975 | } | ||
976 | 957 | ||
977 | i = xennet_fill_frags(np, skb, &tmpq); | 958 | i = xennet_fill_frags(np, skb, &tmpq); |
978 | 959 | ||
@@ -999,7 +980,7 @@ err: | |||
999 | * receive throughout using the standard receive | 980 | * receive throughout using the standard receive |
1000 | * buffer size was cut by 25%(!!!). | 981 | * buffer size was cut by 25%(!!!). |
1001 | */ | 982 | */ |
1002 | skb->truesize += skb->data_len - (RX_COPY_THRESHOLD - len); | 983 | skb->truesize += skb->data_len - RX_COPY_THRESHOLD; |
1003 | skb->len += skb->data_len; | 984 | skb->len += skb->data_len; |
1004 | 985 | ||
1005 | if (rx->flags & XEN_NETRXF_csum_blank) | 986 | if (rx->flags & XEN_NETRXF_csum_blank) |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 5270f1a99328..d6fd6b6d9d4b 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -280,8 +280,12 @@ static long local_pci_probe(void *_ddi) | |||
280 | { | 280 | { |
281 | struct drv_dev_and_id *ddi = _ddi; | 281 | struct drv_dev_and_id *ddi = _ddi; |
282 | struct device *dev = &ddi->dev->dev; | 282 | struct device *dev = &ddi->dev->dev; |
283 | struct device *parent = dev->parent; | ||
283 | int rc; | 284 | int rc; |
284 | 285 | ||
286 | /* The parent bridge must be in active state when probing */ | ||
287 | if (parent) | ||
288 | pm_runtime_get_sync(parent); | ||
285 | /* Unbound PCI devices are always set to disabled and suspended. | 289 | /* Unbound PCI devices are always set to disabled and suspended. |
286 | * During probe, the device is set to enabled and active and the | 290 | * During probe, the device is set to enabled and active and the |
287 | * usage count is incremented. If the driver supports runtime PM, | 291 | * usage count is incremented. If the driver supports runtime PM, |
@@ -298,6 +302,8 @@ static long local_pci_probe(void *_ddi) | |||
298 | pm_runtime_set_suspended(dev); | 302 | pm_runtime_set_suspended(dev); |
299 | pm_runtime_put_noidle(dev); | 303 | pm_runtime_put_noidle(dev); |
300 | } | 304 | } |
305 | if (parent) | ||
306 | pm_runtime_put(parent); | ||
301 | return rc; | 307 | return rc; |
302 | } | 308 | } |
303 | 309 | ||
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 6869009c7393..02d107b15281 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -458,6 +458,40 @@ boot_vga_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
458 | } | 458 | } |
459 | struct device_attribute vga_attr = __ATTR_RO(boot_vga); | 459 | struct device_attribute vga_attr = __ATTR_RO(boot_vga); |
460 | 460 | ||
461 | static void | ||
462 | pci_config_pm_runtime_get(struct pci_dev *pdev) | ||
463 | { | ||
464 | struct device *dev = &pdev->dev; | ||
465 | struct device *parent = dev->parent; | ||
466 | |||
467 | if (parent) | ||
468 | pm_runtime_get_sync(parent); | ||
469 | pm_runtime_get_noresume(dev); | ||
470 | /* | ||
471 | * pdev->current_state is set to PCI_D3cold during suspending, | ||
472 | * so wait until suspending completes | ||
473 | */ | ||
474 | pm_runtime_barrier(dev); | ||
475 | /* | ||
476 | * Only need to resume devices in D3cold, because config | ||
477 | * registers are still accessible for devices suspended but | ||
478 | * not in D3cold. | ||
479 | */ | ||
480 | if (pdev->current_state == PCI_D3cold) | ||
481 | pm_runtime_resume(dev); | ||
482 | } | ||
483 | |||
484 | static void | ||
485 | pci_config_pm_runtime_put(struct pci_dev *pdev) | ||
486 | { | ||
487 | struct device *dev = &pdev->dev; | ||
488 | struct device *parent = dev->parent; | ||
489 | |||
490 | pm_runtime_put(dev); | ||
491 | if (parent) | ||
492 | pm_runtime_put_sync(parent); | ||
493 | } | ||
494 | |||
461 | static ssize_t | 495 | static ssize_t |
462 | pci_read_config(struct file *filp, struct kobject *kobj, | 496 | pci_read_config(struct file *filp, struct kobject *kobj, |
463 | struct bin_attribute *bin_attr, | 497 | struct bin_attribute *bin_attr, |
@@ -484,6 +518,8 @@ pci_read_config(struct file *filp, struct kobject *kobj, | |||
484 | size = count; | 518 | size = count; |
485 | } | 519 | } |
486 | 520 | ||
521 | pci_config_pm_runtime_get(dev); | ||
522 | |||
487 | if ((off & 1) && size) { | 523 | if ((off & 1) && size) { |
488 | u8 val; | 524 | u8 val; |
489 | pci_user_read_config_byte(dev, off, &val); | 525 | pci_user_read_config_byte(dev, off, &val); |
@@ -529,6 +565,8 @@ pci_read_config(struct file *filp, struct kobject *kobj, | |||
529 | --size; | 565 | --size; |
530 | } | 566 | } |
531 | 567 | ||
568 | pci_config_pm_runtime_put(dev); | ||
569 | |||
532 | return count; | 570 | return count; |
533 | } | 571 | } |
534 | 572 | ||
@@ -549,6 +587,8 @@ pci_write_config(struct file* filp, struct kobject *kobj, | |||
549 | count = size; | 587 | count = size; |
550 | } | 588 | } |
551 | 589 | ||
590 | pci_config_pm_runtime_get(dev); | ||
591 | |||
552 | if ((off & 1) && size) { | 592 | if ((off & 1) && size) { |
553 | pci_user_write_config_byte(dev, off, data[off - init_off]); | 593 | pci_user_write_config_byte(dev, off, data[off - init_off]); |
554 | off++; | 594 | off++; |
@@ -587,6 +627,8 @@ pci_write_config(struct file* filp, struct kobject *kobj, | |||
587 | --size; | 627 | --size; |
588 | } | 628 | } |
589 | 629 | ||
630 | pci_config_pm_runtime_put(dev); | ||
631 | |||
590 | return count; | 632 | return count; |
591 | } | 633 | } |
592 | 634 | ||
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f3ea977a5b1b..ab4bf5a4c2f1 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1941,6 +1941,7 @@ void pci_pm_init(struct pci_dev *dev) | |||
1941 | dev->pm_cap = pm; | 1941 | dev->pm_cap = pm; |
1942 | dev->d3_delay = PCI_PM_D3_WAIT; | 1942 | dev->d3_delay = PCI_PM_D3_WAIT; |
1943 | dev->d3cold_delay = PCI_PM_D3COLD_WAIT; | 1943 | dev->d3cold_delay = PCI_PM_D3COLD_WAIT; |
1944 | dev->d3cold_allowed = true; | ||
1944 | 1945 | ||
1945 | dev->d1_support = false; | 1946 | dev->d1_support = false; |
1946 | dev->d2_support = false; | 1947 | dev->d2_support = false; |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 3a7eefcb270a..e76b44777dbf 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -140,9 +140,17 @@ static int pcie_port_runtime_resume(struct device *dev) | |||
140 | { | 140 | { |
141 | return 0; | 141 | return 0; |
142 | } | 142 | } |
143 | |||
144 | static int pcie_port_runtime_idle(struct device *dev) | ||
145 | { | ||
146 | /* Delay for a short while to prevent too frequent suspend/resume */ | ||
147 | pm_schedule_suspend(dev, 10); | ||
148 | return -EBUSY; | ||
149 | } | ||
143 | #else | 150 | #else |
144 | #define pcie_port_runtime_suspend NULL | 151 | #define pcie_port_runtime_suspend NULL |
145 | #define pcie_port_runtime_resume NULL | 152 | #define pcie_port_runtime_resume NULL |
153 | #define pcie_port_runtime_idle NULL | ||
146 | #endif | 154 | #endif |
147 | 155 | ||
148 | static const struct dev_pm_ops pcie_portdrv_pm_ops = { | 156 | static const struct dev_pm_ops pcie_portdrv_pm_ops = { |
@@ -155,6 +163,7 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = { | |||
155 | .resume_noirq = pcie_port_resume_noirq, | 163 | .resume_noirq = pcie_port_resume_noirq, |
156 | .runtime_suspend = pcie_port_runtime_suspend, | 164 | .runtime_suspend = pcie_port_runtime_suspend, |
157 | .runtime_resume = pcie_port_runtime_resume, | 165 | .runtime_resume = pcie_port_runtime_resume, |
166 | .runtime_idle = pcie_port_runtime_idle, | ||
158 | }; | 167 | }; |
159 | 168 | ||
160 | #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops) | 169 | #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops) |
@@ -200,6 +209,11 @@ static int __devinit pcie_portdrv_probe(struct pci_dev *dev, | |||
200 | return status; | 209 | return status; |
201 | 210 | ||
202 | pci_save_state(dev); | 211 | pci_save_state(dev); |
212 | /* | ||
213 | * D3cold may not work properly on some PCIe port, so disable | ||
214 | * it by default. | ||
215 | */ | ||
216 | dev->d3cold_allowed = false; | ||
203 | if (!pci_match_id(port_runtime_pm_black_list, dev)) | 217 | if (!pci_match_id(port_runtime_pm_black_list, dev)) |
204 | pm_runtime_put_noidle(&dev->dev); | 218 | pm_runtime_put_noidle(&dev->dev); |
205 | 219 | ||
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 6c143b4497ca..9f8a6b79a8ec 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -144,15 +144,13 @@ static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar) | |||
144 | case PCI_BASE_ADDRESS_MEM_TYPE_32: | 144 | case PCI_BASE_ADDRESS_MEM_TYPE_32: |
145 | break; | 145 | break; |
146 | case PCI_BASE_ADDRESS_MEM_TYPE_1M: | 146 | case PCI_BASE_ADDRESS_MEM_TYPE_1M: |
147 | dev_info(&dev->dev, "1M mem BAR treated as 32-bit BAR\n"); | 147 | /* 1M mem BAR treated as 32-bit BAR */ |
148 | break; | 148 | break; |
149 | case PCI_BASE_ADDRESS_MEM_TYPE_64: | 149 | case PCI_BASE_ADDRESS_MEM_TYPE_64: |
150 | flags |= IORESOURCE_MEM_64; | 150 | flags |= IORESOURCE_MEM_64; |
151 | break; | 151 | break; |
152 | default: | 152 | default: |
153 | dev_warn(&dev->dev, | 153 | /* mem unknown type treated as 32-bit BAR */ |
154 | "mem unknown type %x treated as 32-bit BAR\n", | ||
155 | mem_type); | ||
156 | break; | 154 | break; |
157 | } | 155 | } |
158 | return flags; | 156 | return flags; |
@@ -173,9 +171,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
173 | u32 l, sz, mask; | 171 | u32 l, sz, mask; |
174 | u16 orig_cmd; | 172 | u16 orig_cmd; |
175 | struct pci_bus_region region; | 173 | struct pci_bus_region region; |
174 | bool bar_too_big = false, bar_disabled = false; | ||
176 | 175 | ||
177 | mask = type ? PCI_ROM_ADDRESS_MASK : ~0; | 176 | mask = type ? PCI_ROM_ADDRESS_MASK : ~0; |
178 | 177 | ||
178 | /* No printks while decoding is disabled! */ | ||
179 | if (!dev->mmio_always_on) { | 179 | if (!dev->mmio_always_on) { |
180 | pci_read_config_word(dev, PCI_COMMAND, &orig_cmd); | 180 | pci_read_config_word(dev, PCI_COMMAND, &orig_cmd); |
181 | pci_write_config_word(dev, PCI_COMMAND, | 181 | pci_write_config_word(dev, PCI_COMMAND, |
@@ -240,8 +240,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
240 | goto fail; | 240 | goto fail; |
241 | 241 | ||
242 | if ((sizeof(resource_size_t) < 8) && (sz64 > 0x100000000ULL)) { | 242 | if ((sizeof(resource_size_t) < 8) && (sz64 > 0x100000000ULL)) { |
243 | dev_err(&dev->dev, "reg %x: can't handle 64-bit BAR\n", | 243 | bar_too_big = true; |
244 | pos); | ||
245 | goto fail; | 244 | goto fail; |
246 | } | 245 | } |
247 | 246 | ||
@@ -252,12 +251,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
252 | region.start = 0; | 251 | region.start = 0; |
253 | region.end = sz64; | 252 | region.end = sz64; |
254 | pcibios_bus_to_resource(dev, res, ®ion); | 253 | pcibios_bus_to_resource(dev, res, ®ion); |
254 | bar_disabled = true; | ||
255 | } else { | 255 | } else { |
256 | region.start = l64; | 256 | region.start = l64; |
257 | region.end = l64 + sz64; | 257 | region.end = l64 + sz64; |
258 | pcibios_bus_to_resource(dev, res, ®ion); | 258 | pcibios_bus_to_resource(dev, res, ®ion); |
259 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", | ||
260 | pos, res); | ||
261 | } | 259 | } |
262 | } else { | 260 | } else { |
263 | sz = pci_size(l, sz, mask); | 261 | sz = pci_size(l, sz, mask); |
@@ -268,18 +266,23 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
268 | region.start = l; | 266 | region.start = l; |
269 | region.end = l + sz; | 267 | region.end = l + sz; |
270 | pcibios_bus_to_resource(dev, res, ®ion); | 268 | pcibios_bus_to_resource(dev, res, ®ion); |
271 | |||
272 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res); | ||
273 | } | 269 | } |
274 | 270 | ||
275 | out: | 271 | goto out; |
272 | |||
273 | |||
274 | fail: | ||
275 | res->flags = 0; | ||
276 | out: | ||
276 | if (!dev->mmio_always_on) | 277 | if (!dev->mmio_always_on) |
277 | pci_write_config_word(dev, PCI_COMMAND, orig_cmd); | 278 | pci_write_config_word(dev, PCI_COMMAND, orig_cmd); |
278 | 279 | ||
280 | if (bar_too_big) | ||
281 | dev_err(&dev->dev, "reg %x: can't handle 64-bit BAR\n", pos); | ||
282 | if (res->flags && !bar_disabled) | ||
283 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res); | ||
284 | |||
279 | return (res->flags & IORESOURCE_MEM_64) ? 1 : 0; | 285 | return (res->flags & IORESOURCE_MEM_64) ? 1 : 0; |
280 | fail: | ||
281 | res->flags = 0; | ||
282 | goto out; | ||
283 | } | 286 | } |
284 | 287 | ||
285 | static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) | 288 | static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) |
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c index 831868904e02..1dd61f402b04 100644 --- a/drivers/rtc/rtc-at91sam9.c +++ b/drivers/rtc/rtc-at91sam9.c | |||
@@ -58,6 +58,7 @@ struct sam9_rtc { | |||
58 | struct rtc_device *rtcdev; | 58 | struct rtc_device *rtcdev; |
59 | u32 imr; | 59 | u32 imr; |
60 | void __iomem *gpbr; | 60 | void __iomem *gpbr; |
61 | int irq; | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | #define rtt_readl(rtc, field) \ | 64 | #define rtt_readl(rtc, field) \ |
@@ -292,7 +293,7 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) | |||
292 | { | 293 | { |
293 | struct resource *r, *r_gpbr; | 294 | struct resource *r, *r_gpbr; |
294 | struct sam9_rtc *rtc; | 295 | struct sam9_rtc *rtc; |
295 | int ret; | 296 | int ret, irq; |
296 | u32 mr; | 297 | u32 mr; |
297 | 298 | ||
298 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 299 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -302,10 +303,18 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) | |||
302 | return -ENODEV; | 303 | return -ENODEV; |
303 | } | 304 | } |
304 | 305 | ||
306 | irq = platform_get_irq(pdev, 0); | ||
307 | if (irq < 0) { | ||
308 | dev_err(&pdev->dev, "failed to get interrupt resource\n"); | ||
309 | return irq; | ||
310 | } | ||
311 | |||
305 | rtc = kzalloc(sizeof *rtc, GFP_KERNEL); | 312 | rtc = kzalloc(sizeof *rtc, GFP_KERNEL); |
306 | if (!rtc) | 313 | if (!rtc) |
307 | return -ENOMEM; | 314 | return -ENOMEM; |
308 | 315 | ||
316 | rtc->irq = irq; | ||
317 | |||
309 | /* platform setup code should have handled this; sigh */ | 318 | /* platform setup code should have handled this; sigh */ |
310 | if (!device_can_wakeup(&pdev->dev)) | 319 | if (!device_can_wakeup(&pdev->dev)) |
311 | device_init_wakeup(&pdev->dev, 1); | 320 | device_init_wakeup(&pdev->dev, 1); |
@@ -345,11 +354,10 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) | |||
345 | } | 354 | } |
346 | 355 | ||
347 | /* register irq handler after we know what name we'll use */ | 356 | /* register irq handler after we know what name we'll use */ |
348 | ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt, | 357 | ret = request_irq(rtc->irq, at91_rtc_interrupt, IRQF_SHARED, |
349 | IRQF_SHARED, | ||
350 | dev_name(&rtc->rtcdev->dev), rtc); | 358 | dev_name(&rtc->rtcdev->dev), rtc); |
351 | if (ret) { | 359 | if (ret) { |
352 | dev_dbg(&pdev->dev, "can't share IRQ %d?\n", AT91_ID_SYS); | 360 | dev_dbg(&pdev->dev, "can't share IRQ %d?\n", rtc->irq); |
353 | rtc_device_unregister(rtc->rtcdev); | 361 | rtc_device_unregister(rtc->rtcdev); |
354 | goto fail_register; | 362 | goto fail_register; |
355 | } | 363 | } |
@@ -386,7 +394,7 @@ static int __devexit at91_rtc_remove(struct platform_device *pdev) | |||
386 | 394 | ||
387 | /* disable all interrupts */ | 395 | /* disable all interrupts */ |
388 | rtt_writel(rtc, MR, mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN)); | 396 | rtt_writel(rtc, MR, mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN)); |
389 | free_irq(AT91_ID_SYS, rtc); | 397 | free_irq(rtc->irq, rtc); |
390 | 398 | ||
391 | rtc_device_unregister(rtc->rtcdev); | 399 | rtc_device_unregister(rtc->rtcdev); |
392 | 400 | ||
@@ -423,7 +431,7 @@ static int at91_rtc_suspend(struct platform_device *pdev, | |||
423 | rtc->imr = mr & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN); | 431 | rtc->imr = mr & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN); |
424 | if (rtc->imr) { | 432 | if (rtc->imr) { |
425 | if (device_may_wakeup(&pdev->dev) && (mr & AT91_RTT_ALMIEN)) { | 433 | if (device_may_wakeup(&pdev->dev) && (mr & AT91_RTT_ALMIEN)) { |
426 | enable_irq_wake(AT91_ID_SYS); | 434 | enable_irq_wake(rtc->irq); |
427 | /* don't let RTTINC cause wakeups */ | 435 | /* don't let RTTINC cause wakeups */ |
428 | if (mr & AT91_RTT_RTTINCIEN) | 436 | if (mr & AT91_RTT_RTTINCIEN) |
429 | rtt_writel(rtc, MR, mr & ~AT91_RTT_RTTINCIEN); | 437 | rtt_writel(rtc, MR, mr & ~AT91_RTT_RTTINCIEN); |
@@ -441,7 +449,7 @@ static int at91_rtc_resume(struct platform_device *pdev) | |||
441 | 449 | ||
442 | if (rtc->imr) { | 450 | if (rtc->imr) { |
443 | if (device_may_wakeup(&pdev->dev)) | 451 | if (device_may_wakeup(&pdev->dev)) |
444 | disable_irq_wake(AT91_ID_SYS); | 452 | disable_irq_wake(rtc->irq); |
445 | mr = rtt_readl(rtc, MR); | 453 | mr = rtt_readl(rtc, MR); |
446 | rtt_writel(rtc, MR, mr | rtc->imr); | 454 | rtt_writel(rtc, MR, mr | rtc->imr); |
447 | } | 455 | } |
diff --git a/drivers/video/auo_k190x.c b/drivers/video/auo_k190x.c index 77da6a2f43dc..c03ecdd31e4c 100644 --- a/drivers/video/auo_k190x.c +++ b/drivers/video/auo_k190x.c | |||
@@ -987,7 +987,6 @@ err_regfb: | |||
987 | fb_dealloc_cmap(&info->cmap); | 987 | fb_dealloc_cmap(&info->cmap); |
988 | err_cmap: | 988 | err_cmap: |
989 | fb_deferred_io_cleanup(info); | 989 | fb_deferred_io_cleanup(info); |
990 | kfree(info->fbdefio); | ||
991 | err_defio: | 990 | err_defio: |
992 | vfree((void *)info->screen_base); | 991 | vfree((void *)info->screen_base); |
993 | err_irq: | 992 | err_irq: |
@@ -1022,7 +1021,6 @@ int __devexit auok190x_common_remove(struct platform_device *pdev) | |||
1022 | fb_dealloc_cmap(&info->cmap); | 1021 | fb_dealloc_cmap(&info->cmap); |
1023 | 1022 | ||
1024 | fb_deferred_io_cleanup(info); | 1023 | fb_deferred_io_cleanup(info); |
1025 | kfree(info->fbdefio); | ||
1026 | 1024 | ||
1027 | vfree((void *)info->screen_base); | 1025 | vfree((void *)info->screen_base); |
1028 | 1026 | ||
diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index bfdc5fbeaa11..92257ef19403 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c | |||
@@ -27,9 +27,9 @@ | |||
27 | #include <linux/fb.h> | 27 | #include <linux/fb.h> |
28 | #include <linux/backlight.h> | 28 | #include <linux/backlight.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/platform_data/omap1_bl.h> | ||
30 | 31 | ||
31 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
32 | #include <plat/board.h> | ||
33 | #include <plat/mux.h> | 33 | #include <plat/mux.h> |
34 | 34 | ||
35 | #define OMAPBL_MAX_INTENSITY 0xff | 35 | #define OMAPBL_MAX_INTENSITY 0xff |
diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c index 28b1a834906b..61b182bf32a2 100644 --- a/drivers/video/console/bitblit.c +++ b/drivers/video/console/bitblit.c | |||
@@ -162,7 +162,7 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info, | |||
162 | image.depth = 1; | 162 | image.depth = 1; |
163 | 163 | ||
164 | if (attribute) { | 164 | if (attribute) { |
165 | buf = kmalloc(cellsize, GFP_KERNEL); | 165 | buf = kmalloc(cellsize, GFP_ATOMIC); |
166 | if (!buf) | 166 | if (!buf) |
167 | return; | 167 | return; |
168 | } | 168 | } |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 88e92041d8f0..fdefa8fd72c4 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -449,7 +449,7 @@ static int __init fb_console_setup(char *this_opt) | |||
449 | 449 | ||
450 | while ((options = strsep(&this_opt, ",")) != NULL) { | 450 | while ((options = strsep(&this_opt, ",")) != NULL) { |
451 | if (!strncmp(options, "font:", 5)) | 451 | if (!strncmp(options, "font:", 5)) |
452 | strcpy(fontname, options + 5); | 452 | strlcpy(fontname, options + 5, sizeof(fontname)); |
453 | 453 | ||
454 | if (!strncmp(options, "scrollback:", 11)) { | 454 | if (!strncmp(options, "scrollback:", 11)) { |
455 | options += 11; | 455 | options += 11; |
diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c index 00ce1f34b496..57d940be5f3d 100644 --- a/drivers/video/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/mb862xx/mb862xxfbdrv.c | |||
@@ -328,6 +328,8 @@ static int mb862xxfb_ioctl(struct fb_info *fbi, unsigned int cmd, | |||
328 | case MB862XX_L1_SET_CFG: | 328 | case MB862XX_L1_SET_CFG: |
329 | if (copy_from_user(l1_cfg, argp, sizeof(*l1_cfg))) | 329 | if (copy_from_user(l1_cfg, argp, sizeof(*l1_cfg))) |
330 | return -EFAULT; | 330 | return -EFAULT; |
331 | if (l1_cfg->dh == 0 || l1_cfg->dw == 0) | ||
332 | return -EINVAL; | ||
331 | if ((l1_cfg->sw >= l1_cfg->dw) && (l1_cfg->sh >= l1_cfg->dh)) { | 333 | if ((l1_cfg->sw >= l1_cfg->dw) && (l1_cfg->sh >= l1_cfg->dh)) { |
332 | /* downscaling */ | 334 | /* downscaling */ |
333 | outreg(cap, GC_CAP_CSC, | 335 | outreg(cap, GC_CAP_CSC, |
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 5d31699fbd3c..f43bfe17b3b6 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
@@ -105,6 +105,20 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
105 | 105 | ||
106 | sdi_config_lcd_manager(dssdev); | 106 | sdi_config_lcd_manager(dssdev); |
107 | 107 | ||
108 | /* | ||
109 | * LCLK and PCLK divisors are located in shadow registers, and we | ||
110 | * normally write them to DISPC registers when enabling the output. | ||
111 | * However, SDI uses pck-free as source clock for its PLL, and pck-free | ||
112 | * is affected by the divisors. And as we need the PLL before enabling | ||
113 | * the output, we need to write the divisors early. | ||
114 | * | ||
115 | * It seems just writing to the DISPC register is enough, and we don't | ||
116 | * need to care about the shadow register mechanism for pck-free. The | ||
117 | * exact reason for this is unknown. | ||
118 | */ | ||
119 | dispc_mgr_set_clock_div(dssdev->manager->id, | ||
120 | &sdi.mgr_config.clock_info); | ||
121 | |||
108 | dss_sdi_init(dssdev->phy.sdi.datapairs); | 122 | dss_sdi_init(dssdev->phy.sdi.datapairs); |
109 | r = dss_sdi_enable(); | 123 | r = dss_sdi_enable(); |
110 | if (r) | 124 | if (r) |
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 08ec1a7103f2..fc671d3d8004 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -1192,7 +1192,7 @@ static int _setcolreg(struct fb_info *fbi, u_int regno, u_int red, u_int green, | |||
1192 | break; | 1192 | break; |
1193 | 1193 | ||
1194 | if (regno < 16) { | 1194 | if (regno < 16) { |
1195 | u16 pal; | 1195 | u32 pal; |
1196 | pal = ((red >> (16 - var->red.length)) << | 1196 | pal = ((red >> (16 - var->red.length)) << |
1197 | var->red.offset) | | 1197 | var->red.offset) | |
1198 | ((green >> (16 - var->green.length)) << | 1198 | ((green >> (16 - var->green.length)) << |
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 1afb4fba11b4..4d519488d304 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c | |||
@@ -232,7 +232,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | |||
232 | return ret; | 232 | return ret; |
233 | 233 | ||
234 | if (hwdev && hwdev->coherent_dma_mask) | 234 | if (hwdev && hwdev->coherent_dma_mask) |
235 | dma_mask = hwdev->coherent_dma_mask; | 235 | dma_mask = dma_alloc_coherent_mask(hwdev, flags); |
236 | 236 | ||
237 | phys = virt_to_phys(ret); | 237 | phys = virt_to_phys(ret); |
238 | dev_addr = xen_phys_to_bus(phys); | 238 | dev_addr = xen_phys_to_bus(phys); |
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index 097e536e8672..03342728bf23 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c | |||
@@ -353,16 +353,16 @@ static int __devinit pcistub_init_device(struct pci_dev *dev) | |||
353 | if (err) | 353 | if (err) |
354 | goto config_release; | 354 | goto config_release; |
355 | 355 | ||
356 | dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n"); | ||
357 | __pci_reset_function_locked(dev); | ||
358 | |||
359 | /* We need the device active to save the state. */ | 356 | /* We need the device active to save the state. */ |
360 | dev_dbg(&dev->dev, "save state of device\n"); | 357 | dev_dbg(&dev->dev, "save state of device\n"); |
361 | pci_save_state(dev); | 358 | pci_save_state(dev); |
362 | dev_data->pci_saved_state = pci_store_saved_state(dev); | 359 | dev_data->pci_saved_state = pci_store_saved_state(dev); |
363 | if (!dev_data->pci_saved_state) | 360 | if (!dev_data->pci_saved_state) |
364 | dev_err(&dev->dev, "Could not store PCI conf saved state!\n"); | 361 | dev_err(&dev->dev, "Could not store PCI conf saved state!\n"); |
365 | 362 | else { | |
363 | dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n"); | ||
364 | __pci_reset_function_locked(dev); | ||
365 | } | ||
366 | /* Now disable the device (this also ensures some private device | 366 | /* Now disable the device (this also ensures some private device |
367 | * data is setup before we export) | 367 | * data is setup before we export) |
368 | */ | 368 | */ |