diff options
Diffstat (limited to 'drivers')
65 files changed, 463 insertions, 324 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 78db97687f26..c4b06cc075f9 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
| @@ -800,6 +800,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) | |||
| 800 | match.hrv = hrv; | 800 | match.hrv = hrv; |
| 801 | 801 | ||
| 802 | dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); | 802 | dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); |
| 803 | put_device(dev); | ||
| 803 | return !!dev; | 804 | return !!dev; |
| 804 | } | 805 | } |
| 805 | EXPORT_SYMBOL(acpi_dev_present); | 806 | EXPORT_SYMBOL(acpi_dev_present); |
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index 57410f9c5d44..c52c738e554a 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
| @@ -164,9 +164,7 @@ config ARM_CHARLCD | |||
| 164 | line and the Linux version on the second line, but that's | 164 | line and the Linux version on the second line, but that's |
| 165 | still useful. | 165 | still useful. |
| 166 | 166 | ||
| 167 | endif # AUXDISPLAY | 167 | menuconfig PARPORT_PANEL |
| 168 | |||
| 169 | menuconfig PANEL | ||
| 170 | tristate "Parallel port LCD/Keypad Panel support" | 168 | tristate "Parallel port LCD/Keypad Panel support" |
| 171 | depends on PARPORT | 169 | depends on PARPORT |
| 172 | select CHARLCD | 170 | select CHARLCD |
| @@ -178,7 +176,7 @@ menuconfig PANEL | |||
| 178 | compiled as a module, or linked into the kernel and started at boot. | 176 | compiled as a module, or linked into the kernel and started at boot. |
| 179 | If you don't understand what all this is about, say N. | 177 | If you don't understand what all this is about, say N. |
| 180 | 178 | ||
| 181 | if PANEL | 179 | if PARPORT_PANEL |
| 182 | 180 | ||
| 183 | config PANEL_PARPORT | 181 | config PANEL_PARPORT |
| 184 | int "Default parallel port number (0=LPT1)" | 182 | int "Default parallel port number (0=LPT1)" |
| @@ -419,8 +417,11 @@ config PANEL_LCD_PIN_BL | |||
| 419 | 417 | ||
| 420 | Default for the 'BL' pin in custom profile is '0' (uncontrolled). | 418 | Default for the 'BL' pin in custom profile is '0' (uncontrolled). |
| 421 | 419 | ||
| 420 | endif # PARPORT_PANEL | ||
| 421 | |||
| 422 | config PANEL_CHANGE_MESSAGE | 422 | config PANEL_CHANGE_MESSAGE |
| 423 | bool "Change LCD initialization message ?" | 423 | bool "Change LCD initialization message ?" |
| 424 | depends on CHARLCD | ||
| 424 | default "n" | 425 | default "n" |
| 425 | ---help--- | 426 | ---help--- |
| 426 | This allows you to replace the boot message indicating the kernel version | 427 | This allows you to replace the boot message indicating the kernel version |
| @@ -444,7 +445,34 @@ config PANEL_BOOT_MESSAGE | |||
| 444 | An empty message will only clear the display at driver init time. Any other | 445 | An empty message will only clear the display at driver init time. Any other |
| 445 | printf()-formatted message is valid with newline and escape codes. | 446 | printf()-formatted message is valid with newline and escape codes. |
| 446 | 447 | ||
| 447 | endif # PANEL | 448 | choice |
| 449 | prompt "Backlight initial state" | ||
| 450 | default CHARLCD_BL_FLASH | ||
| 451 | |||
| 452 | config CHARLCD_BL_OFF | ||
| 453 | bool "Off" | ||
| 454 | help | ||
| 455 | Backlight is initially turned off | ||
| 456 | |||
| 457 | config CHARLCD_BL_ON | ||
| 458 | bool "On" | ||
| 459 | help | ||
| 460 | Backlight is initially turned on | ||
| 461 | |||
| 462 | config CHARLCD_BL_FLASH | ||
| 463 | bool "Flash" | ||
| 464 | help | ||
| 465 | Backlight is flashed briefly on init | ||
| 466 | |||
| 467 | endchoice | ||
| 468 | |||
| 469 | endif # AUXDISPLAY | ||
| 470 | |||
| 471 | config PANEL | ||
| 472 | tristate "Parallel port LCD/Keypad Panel support (OLD OPTION)" | ||
| 473 | depends on PARPORT | ||
| 474 | select AUXDISPLAY | ||
| 475 | select PARPORT_PANEL | ||
| 448 | 476 | ||
| 449 | config CHARLCD | 477 | config CHARLCD |
| 450 | tristate "Character LCD core support" if COMPILE_TEST | 478 | tristate "Character LCD core support" if COMPILE_TEST |
diff --git a/drivers/auxdisplay/Makefile b/drivers/auxdisplay/Makefile index 7ac6776ca3f6..cf54b5efb07e 100644 --- a/drivers/auxdisplay/Makefile +++ b/drivers/auxdisplay/Makefile | |||
| @@ -10,4 +10,4 @@ obj-$(CONFIG_CFAG12864B) += cfag12864b.o cfag12864bfb.o | |||
| 10 | obj-$(CONFIG_IMG_ASCII_LCD) += img-ascii-lcd.o | 10 | obj-$(CONFIG_IMG_ASCII_LCD) += img-ascii-lcd.o |
| 11 | obj-$(CONFIG_HD44780) += hd44780.o | 11 | obj-$(CONFIG_HD44780) += hd44780.o |
| 12 | obj-$(CONFIG_HT16K33) += ht16k33.o | 12 | obj-$(CONFIG_HT16K33) += ht16k33.o |
| 13 | obj-$(CONFIG_PANEL) += panel.o | 13 | obj-$(CONFIG_PARPORT_PANEL) += panel.o |
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 60e0b772673f..92745efefb54 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c | |||
| @@ -91,7 +91,7 @@ struct charlcd_priv { | |||
| 91 | unsigned long long drvdata[0]; | 91 | unsigned long long drvdata[0]; |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | #define to_priv(p) container_of(p, struct charlcd_priv, lcd) | 94 | #define charlcd_to_priv(p) container_of(p, struct charlcd_priv, lcd) |
| 95 | 95 | ||
| 96 | /* Device single-open policy control */ | 96 | /* Device single-open policy control */ |
| 97 | static atomic_t charlcd_available = ATOMIC_INIT(1); | 97 | static atomic_t charlcd_available = ATOMIC_INIT(1); |
| @@ -105,7 +105,7 @@ static void long_sleep(int ms) | |||
| 105 | /* turn the backlight on or off */ | 105 | /* turn the backlight on or off */ |
| 106 | static void charlcd_backlight(struct charlcd *lcd, int on) | 106 | static void charlcd_backlight(struct charlcd *lcd, int on) |
| 107 | { | 107 | { |
| 108 | struct charlcd_priv *priv = to_priv(lcd); | 108 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 109 | 109 | ||
| 110 | if (!lcd->ops->backlight) | 110 | if (!lcd->ops->backlight) |
| 111 | return; | 111 | return; |
| @@ -134,7 +134,7 @@ static void charlcd_bl_off(struct work_struct *work) | |||
| 134 | /* turn the backlight on for a little while */ | 134 | /* turn the backlight on for a little while */ |
| 135 | void charlcd_poke(struct charlcd *lcd) | 135 | void charlcd_poke(struct charlcd *lcd) |
| 136 | { | 136 | { |
| 137 | struct charlcd_priv *priv = to_priv(lcd); | 137 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 138 | 138 | ||
| 139 | if (!lcd->ops->backlight) | 139 | if (!lcd->ops->backlight) |
| 140 | return; | 140 | return; |
| @@ -152,7 +152,7 @@ EXPORT_SYMBOL_GPL(charlcd_poke); | |||
| 152 | 152 | ||
| 153 | static void charlcd_gotoxy(struct charlcd *lcd) | 153 | static void charlcd_gotoxy(struct charlcd *lcd) |
| 154 | { | 154 | { |
| 155 | struct charlcd_priv *priv = to_priv(lcd); | 155 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 156 | unsigned int addr; | 156 | unsigned int addr; |
| 157 | 157 | ||
| 158 | /* | 158 | /* |
| @@ -170,7 +170,7 @@ static void charlcd_gotoxy(struct charlcd *lcd) | |||
| 170 | 170 | ||
| 171 | static void charlcd_home(struct charlcd *lcd) | 171 | static void charlcd_home(struct charlcd *lcd) |
| 172 | { | 172 | { |
| 173 | struct charlcd_priv *priv = to_priv(lcd); | 173 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 174 | 174 | ||
| 175 | priv->addr.x = 0; | 175 | priv->addr.x = 0; |
| 176 | priv->addr.y = 0; | 176 | priv->addr.y = 0; |
| @@ -179,7 +179,7 @@ static void charlcd_home(struct charlcd *lcd) | |||
| 179 | 179 | ||
| 180 | static void charlcd_print(struct charlcd *lcd, char c) | 180 | static void charlcd_print(struct charlcd *lcd, char c) |
| 181 | { | 181 | { |
| 182 | struct charlcd_priv *priv = to_priv(lcd); | 182 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 183 | 183 | ||
| 184 | if (priv->addr.x < lcd->bwidth) { | 184 | if (priv->addr.x < lcd->bwidth) { |
| 185 | if (lcd->char_conv) | 185 | if (lcd->char_conv) |
| @@ -211,7 +211,7 @@ static void charlcd_clear_fast(struct charlcd *lcd) | |||
| 211 | /* clears the display and resets X/Y */ | 211 | /* clears the display and resets X/Y */ |
| 212 | static void charlcd_clear_display(struct charlcd *lcd) | 212 | static void charlcd_clear_display(struct charlcd *lcd) |
| 213 | { | 213 | { |
| 214 | struct charlcd_priv *priv = to_priv(lcd); | 214 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 215 | 215 | ||
| 216 | lcd->ops->write_cmd(lcd, LCD_CMD_DISPLAY_CLEAR); | 216 | lcd->ops->write_cmd(lcd, LCD_CMD_DISPLAY_CLEAR); |
| 217 | priv->addr.x = 0; | 217 | priv->addr.x = 0; |
| @@ -223,7 +223,7 @@ static void charlcd_clear_display(struct charlcd *lcd) | |||
| 223 | static int charlcd_init_display(struct charlcd *lcd) | 223 | static int charlcd_init_display(struct charlcd *lcd) |
| 224 | { | 224 | { |
| 225 | void (*write_cmd_raw)(struct charlcd *lcd, int cmd); | 225 | void (*write_cmd_raw)(struct charlcd *lcd, int cmd); |
| 226 | struct charlcd_priv *priv = to_priv(lcd); | 226 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 227 | u8 init; | 227 | u8 init; |
| 228 | 228 | ||
| 229 | if (lcd->ifwidth != 4 && lcd->ifwidth != 8) | 229 | if (lcd->ifwidth != 4 && lcd->ifwidth != 8) |
| @@ -369,7 +369,7 @@ static bool parse_xy(const char *s, unsigned long *x, unsigned long *y) | |||
| 369 | 369 | ||
| 370 | static inline int handle_lcd_special_code(struct charlcd *lcd) | 370 | static inline int handle_lcd_special_code(struct charlcd *lcd) |
| 371 | { | 371 | { |
| 372 | struct charlcd_priv *priv = to_priv(lcd); | 372 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 373 | 373 | ||
| 374 | /* LCD special codes */ | 374 | /* LCD special codes */ |
| 375 | 375 | ||
| @@ -580,7 +580,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) | |||
| 580 | 580 | ||
| 581 | static void charlcd_write_char(struct charlcd *lcd, char c) | 581 | static void charlcd_write_char(struct charlcd *lcd, char c) |
| 582 | { | 582 | { |
| 583 | struct charlcd_priv *priv = to_priv(lcd); | 583 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 584 | 584 | ||
| 585 | /* first, we'll test if we're in escape mode */ | 585 | /* first, we'll test if we're in escape mode */ |
| 586 | if ((c != '\n') && priv->esc_seq.len >= 0) { | 586 | if ((c != '\n') && priv->esc_seq.len >= 0) { |
| @@ -705,7 +705,7 @@ static ssize_t charlcd_write(struct file *file, const char __user *buf, | |||
| 705 | 705 | ||
| 706 | static int charlcd_open(struct inode *inode, struct file *file) | 706 | static int charlcd_open(struct inode *inode, struct file *file) |
| 707 | { | 707 | { |
| 708 | struct charlcd_priv *priv = to_priv(the_charlcd); | 708 | struct charlcd_priv *priv = charlcd_to_priv(the_charlcd); |
| 709 | int ret; | 709 | int ret; |
| 710 | 710 | ||
| 711 | ret = -EBUSY; | 711 | ret = -EBUSY; |
| @@ -763,10 +763,24 @@ static void charlcd_puts(struct charlcd *lcd, const char *s) | |||
| 763 | } | 763 | } |
| 764 | } | 764 | } |
| 765 | 765 | ||
| 766 | #ifdef CONFIG_PANEL_BOOT_MESSAGE | ||
| 767 | #define LCD_INIT_TEXT CONFIG_PANEL_BOOT_MESSAGE | ||
| 768 | #else | ||
| 769 | #define LCD_INIT_TEXT "Linux-" UTS_RELEASE "\n" | ||
| 770 | #endif | ||
| 771 | |||
| 772 | #ifdef CONFIG_CHARLCD_BL_ON | ||
| 773 | #define LCD_INIT_BL "\x1b[L+" | ||
| 774 | #elif defined(CONFIG_CHARLCD_BL_FLASH) | ||
| 775 | #define LCD_INIT_BL "\x1b[L*" | ||
| 776 | #else | ||
| 777 | #define LCD_INIT_BL "\x1b[L-" | ||
| 778 | #endif | ||
| 779 | |||
| 766 | /* initialize the LCD driver */ | 780 | /* initialize the LCD driver */ |
| 767 | static int charlcd_init(struct charlcd *lcd) | 781 | static int charlcd_init(struct charlcd *lcd) |
| 768 | { | 782 | { |
| 769 | struct charlcd_priv *priv = to_priv(lcd); | 783 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 770 | int ret; | 784 | int ret; |
| 771 | 785 | ||
| 772 | if (lcd->ops->backlight) { | 786 | if (lcd->ops->backlight) { |
| @@ -784,13 +798,8 @@ static int charlcd_init(struct charlcd *lcd) | |||
| 784 | return ret; | 798 | return ret; |
| 785 | 799 | ||
| 786 | /* display a short message */ | 800 | /* display a short message */ |
| 787 | #ifdef CONFIG_PANEL_CHANGE_MESSAGE | 801 | charlcd_puts(lcd, "\x1b[Lc\x1b[Lb" LCD_INIT_BL LCD_INIT_TEXT); |
| 788 | #ifdef CONFIG_PANEL_BOOT_MESSAGE | 802 | |
| 789 | charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" CONFIG_PANEL_BOOT_MESSAGE); | ||
| 790 | #endif | ||
| 791 | #else | ||
| 792 | charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*Linux-" UTS_RELEASE "\n"); | ||
| 793 | #endif | ||
| 794 | /* clear the display on the next device opening */ | 803 | /* clear the display on the next device opening */ |
| 795 | priv->must_clear = true; | 804 | priv->must_clear = true; |
| 796 | charlcd_home(lcd); | 805 | charlcd_home(lcd); |
| @@ -818,6 +827,12 @@ struct charlcd *charlcd_alloc(unsigned int drvdata_size) | |||
| 818 | } | 827 | } |
| 819 | EXPORT_SYMBOL_GPL(charlcd_alloc); | 828 | EXPORT_SYMBOL_GPL(charlcd_alloc); |
| 820 | 829 | ||
| 830 | void charlcd_free(struct charlcd *lcd) | ||
| 831 | { | ||
| 832 | kfree(charlcd_to_priv(lcd)); | ||
| 833 | } | ||
| 834 | EXPORT_SYMBOL_GPL(charlcd_free); | ||
| 835 | |||
| 821 | static int panel_notify_sys(struct notifier_block *this, unsigned long code, | 836 | static int panel_notify_sys(struct notifier_block *this, unsigned long code, |
| 822 | void *unused) | 837 | void *unused) |
| 823 | { | 838 | { |
| @@ -866,7 +881,7 @@ EXPORT_SYMBOL_GPL(charlcd_register); | |||
| 866 | 881 | ||
| 867 | int charlcd_unregister(struct charlcd *lcd) | 882 | int charlcd_unregister(struct charlcd *lcd) |
| 868 | { | 883 | { |
| 869 | struct charlcd_priv *priv = to_priv(lcd); | 884 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 870 | 885 | ||
| 871 | unregister_reboot_notifier(&panel_notifier); | 886 | unregister_reboot_notifier(&panel_notifier); |
| 872 | charlcd_puts(lcd, "\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-"); | 887 | charlcd_puts(lcd, "\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-"); |
diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index 9ad93ea42fdc..ab15b64707ad 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c | |||
| @@ -271,7 +271,7 @@ static int hd44780_probe(struct platform_device *pdev) | |||
| 271 | return 0; | 271 | return 0; |
| 272 | 272 | ||
| 273 | fail: | 273 | fail: |
| 274 | kfree(lcd); | 274 | charlcd_free(lcd); |
| 275 | return ret; | 275 | return ret; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| @@ -280,6 +280,8 @@ static int hd44780_remove(struct platform_device *pdev) | |||
| 280 | struct charlcd *lcd = platform_get_drvdata(pdev); | 280 | struct charlcd *lcd = platform_get_drvdata(pdev); |
| 281 | 281 | ||
| 282 | charlcd_unregister(lcd); | 282 | charlcd_unregister(lcd); |
| 283 | |||
| 284 | charlcd_free(lcd); | ||
| 283 | return 0; | 285 | return 0; |
| 284 | } | 286 | } |
| 285 | 287 | ||
diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c index 21b9b2f2470a..e06de63497cf 100644 --- a/drivers/auxdisplay/panel.c +++ b/drivers/auxdisplay/panel.c | |||
| @@ -1620,7 +1620,7 @@ err_lcd_unreg: | |||
| 1620 | if (lcd.enabled) | 1620 | if (lcd.enabled) |
| 1621 | charlcd_unregister(lcd.charlcd); | 1621 | charlcd_unregister(lcd.charlcd); |
| 1622 | err_unreg_device: | 1622 | err_unreg_device: |
| 1623 | kfree(lcd.charlcd); | 1623 | charlcd_free(lcd.charlcd); |
| 1624 | lcd.charlcd = NULL; | 1624 | lcd.charlcd = NULL; |
| 1625 | parport_unregister_device(pprt); | 1625 | parport_unregister_device(pprt); |
| 1626 | pprt = NULL; | 1626 | pprt = NULL; |
| @@ -1647,7 +1647,7 @@ static void panel_detach(struct parport *port) | |||
| 1647 | if (lcd.enabled) { | 1647 | if (lcd.enabled) { |
| 1648 | charlcd_unregister(lcd.charlcd); | 1648 | charlcd_unregister(lcd.charlcd); |
| 1649 | lcd.initialized = false; | 1649 | lcd.initialized = false; |
| 1650 | kfree(lcd.charlcd); | 1650 | charlcd_free(lcd.charlcd); |
| 1651 | lcd.charlcd = NULL; | 1651 | lcd.charlcd = NULL; |
| 1652 | } | 1652 | } |
| 1653 | 1653 | ||
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 76c9969b7124..96a6dc9d305c 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
| @@ -1469,12 +1469,12 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, | |||
| 1469 | if (IS_ERR(gpd_data)) | 1469 | if (IS_ERR(gpd_data)) |
| 1470 | return PTR_ERR(gpd_data); | 1470 | return PTR_ERR(gpd_data); |
| 1471 | 1471 | ||
| 1472 | genpd_lock(genpd); | ||
| 1473 | |||
| 1474 | ret = genpd->attach_dev ? genpd->attach_dev(genpd, dev) : 0; | 1472 | ret = genpd->attach_dev ? genpd->attach_dev(genpd, dev) : 0; |
| 1475 | if (ret) | 1473 | if (ret) |
| 1476 | goto out; | 1474 | goto out; |
| 1477 | 1475 | ||
| 1476 | genpd_lock(genpd); | ||
| 1477 | |||
| 1478 | dev_pm_domain_set(dev, &genpd->domain); | 1478 | dev_pm_domain_set(dev, &genpd->domain); |
| 1479 | 1479 | ||
| 1480 | genpd->device_count++; | 1480 | genpd->device_count++; |
| @@ -1482,9 +1482,8 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, | |||
| 1482 | 1482 | ||
| 1483 | list_add_tail(&gpd_data->base.list_node, &genpd->dev_list); | 1483 | list_add_tail(&gpd_data->base.list_node, &genpd->dev_list); |
| 1484 | 1484 | ||
| 1485 | out: | ||
| 1486 | genpd_unlock(genpd); | 1485 | genpd_unlock(genpd); |
| 1487 | 1486 | out: | |
| 1488 | if (ret) | 1487 | if (ret) |
| 1489 | genpd_free_dev_data(dev, gpd_data); | 1488 | genpd_free_dev_data(dev, gpd_data); |
| 1490 | else | 1489 | else |
| @@ -1533,15 +1532,15 @@ static int genpd_remove_device(struct generic_pm_domain *genpd, | |||
| 1533 | genpd->device_count--; | 1532 | genpd->device_count--; |
| 1534 | genpd->max_off_time_changed = true; | 1533 | genpd->max_off_time_changed = true; |
| 1535 | 1534 | ||
| 1536 | if (genpd->detach_dev) | ||
| 1537 | genpd->detach_dev(genpd, dev); | ||
| 1538 | |||
| 1539 | dev_pm_domain_set(dev, NULL); | 1535 | dev_pm_domain_set(dev, NULL); |
| 1540 | 1536 | ||
| 1541 | list_del_init(&pdd->list_node); | 1537 | list_del_init(&pdd->list_node); |
| 1542 | 1538 | ||
| 1543 | genpd_unlock(genpd); | 1539 | genpd_unlock(genpd); |
| 1544 | 1540 | ||
| 1541 | if (genpd->detach_dev) | ||
| 1542 | genpd->detach_dev(genpd, dev); | ||
| 1543 | |||
| 1545 | genpd_free_dev_data(dev, gpd_data); | 1544 | genpd_free_dev_data(dev, gpd_data); |
| 1546 | 1545 | ||
| 1547 | return 0; | 1546 | return 0; |
diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 1fad9291f6aa..7fc5a18e02ad 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c | |||
| @@ -472,7 +472,7 @@ static int software_node_read_string_array(const struct fwnode_handle *fwnode, | |||
| 472 | val, nval); | 472 | val, nval); |
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | struct fwnode_handle * | 475 | static struct fwnode_handle * |
| 476 | software_node_get_parent(const struct fwnode_handle *fwnode) | 476 | software_node_get_parent(const struct fwnode_handle *fwnode) |
| 477 | { | 477 | { |
| 478 | struct software_node *swnode = to_software_node(fwnode); | 478 | struct software_node *swnode = to_software_node(fwnode); |
| @@ -481,7 +481,7 @@ software_node_get_parent(const struct fwnode_handle *fwnode) | |||
| 481 | NULL; | 481 | NULL; |
| 482 | } | 482 | } |
| 483 | 483 | ||
| 484 | struct fwnode_handle * | 484 | static struct fwnode_handle * |
| 485 | software_node_get_next_child(const struct fwnode_handle *fwnode, | 485 | software_node_get_next_child(const struct fwnode_handle *fwnode, |
| 486 | struct fwnode_handle *child) | 486 | struct fwnode_handle *child) |
| 487 | { | 487 | { |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 1e6edd568214..bf1c61cab8eb 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
| @@ -656,7 +656,7 @@ static int loop_validate_file(struct file *file, struct block_device *bdev) | |||
| 656 | return -EBADF; | 656 | return -EBADF; |
| 657 | 657 | ||
| 658 | l = f->f_mapping->host->i_bdev->bd_disk->private_data; | 658 | l = f->f_mapping->host->i_bdev->bd_disk->private_data; |
| 659 | if (l->lo_state == Lo_unbound) { | 659 | if (l->lo_state != Lo_bound) { |
| 660 | return -EINVAL; | 660 | return -EINVAL; |
| 661 | } | 661 | } |
| 662 | f = l->lo_backing_file; | 662 | f = l->lo_backing_file; |
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index 96670eefaeb2..377a694dc228 100644 --- a/drivers/block/paride/pcd.c +++ b/drivers/block/paride/pcd.c | |||
| @@ -749,8 +749,12 @@ static int pcd_detect(void) | |||
| 749 | return 0; | 749 | return 0; |
| 750 | 750 | ||
| 751 | printk("%s: No CD-ROM drive found\n", name); | 751 | printk("%s: No CD-ROM drive found\n", name); |
| 752 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) | 752 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { |
| 753 | blk_cleanup_queue(cd->disk->queue); | ||
| 754 | cd->disk->queue = NULL; | ||
| 755 | blk_mq_free_tag_set(&cd->tag_set); | ||
| 753 | put_disk(cd->disk); | 756 | put_disk(cd->disk); |
| 757 | } | ||
| 754 | pi_unregister_driver(par_drv); | 758 | pi_unregister_driver(par_drv); |
| 755 | return -1; | 759 | return -1; |
| 756 | } | 760 | } |
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index e92e7a8eeeb2..103b617cdc31 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c | |||
| @@ -761,8 +761,12 @@ static int pf_detect(void) | |||
| 761 | return 0; | 761 | return 0; |
| 762 | 762 | ||
| 763 | printk("%s: No ATAPI disk detected\n", name); | 763 | printk("%s: No ATAPI disk detected\n", name); |
| 764 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) | 764 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { |
| 765 | blk_cleanup_queue(pf->disk->queue); | ||
| 766 | pf->disk->queue = NULL; | ||
| 767 | blk_mq_free_tag_set(&pf->tag_set); | ||
| 765 | put_disk(pf->disk); | 768 | put_disk(pf->disk); |
| 769 | } | ||
| 766 | pi_unregister_driver(par_drv); | 770 | pi_unregister_driver(par_drv); |
| 767 | return -1; | 771 | return -1; |
| 768 | } | 772 | } |
| @@ -1047,13 +1051,15 @@ static void __exit pf_exit(void) | |||
| 1047 | int unit; | 1051 | int unit; |
| 1048 | unregister_blkdev(major, name); | 1052 | unregister_blkdev(major, name); |
| 1049 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { | 1053 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { |
| 1050 | if (!pf->present) | 1054 | if (pf->present) |
| 1051 | continue; | 1055 | del_gendisk(pf->disk); |
| 1052 | del_gendisk(pf->disk); | 1056 | |
| 1053 | blk_cleanup_queue(pf->disk->queue); | 1057 | blk_cleanup_queue(pf->disk->queue); |
| 1054 | blk_mq_free_tag_set(&pf->tag_set); | 1058 | blk_mq_free_tag_set(&pf->tag_set); |
| 1055 | put_disk(pf->disk); | 1059 | put_disk(pf->disk); |
| 1056 | pi_release(pf->pi); | 1060 | |
| 1061 | if (pf->present) | ||
| 1062 | pi_release(pf->pi); | ||
| 1057 | } | 1063 | } |
| 1058 | } | 1064 | } |
| 1059 | 1065 | ||
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 4ba967d65cf9..2210c1b9491b 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -833,7 +833,7 @@ static int parse_rbd_opts_token(char *c, void *private) | |||
| 833 | pctx->opts->queue_depth = intval; | 833 | pctx->opts->queue_depth = intval; |
| 834 | break; | 834 | break; |
| 835 | case Opt_alloc_size: | 835 | case Opt_alloc_size: |
| 836 | if (intval < 1) { | 836 | if (intval < SECTOR_SIZE) { |
| 837 | pr_err("alloc_size out of range\n"); | 837 | pr_err("alloc_size out of range\n"); |
| 838 | return -EINVAL; | 838 | return -EINVAL; |
| 839 | } | 839 | } |
| @@ -924,23 +924,6 @@ static void rbd_put_client(struct rbd_client *rbdc) | |||
| 924 | kref_put(&rbdc->kref, rbd_client_release); | 924 | kref_put(&rbdc->kref, rbd_client_release); |
| 925 | } | 925 | } |
| 926 | 926 | ||
| 927 | static int wait_for_latest_osdmap(struct ceph_client *client) | ||
| 928 | { | ||
| 929 | u64 newest_epoch; | ||
| 930 | int ret; | ||
| 931 | |||
| 932 | ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch); | ||
| 933 | if (ret) | ||
| 934 | return ret; | ||
| 935 | |||
| 936 | if (client->osdc.osdmap->epoch >= newest_epoch) | ||
| 937 | return 0; | ||
| 938 | |||
| 939 | ceph_osdc_maybe_request_map(&client->osdc); | ||
| 940 | return ceph_monc_wait_osdmap(&client->monc, newest_epoch, | ||
| 941 | client->options->mount_timeout); | ||
| 942 | } | ||
| 943 | |||
| 944 | /* | 927 | /* |
| 945 | * Get a ceph client with specific addr and configuration, if one does | 928 | * Get a ceph client with specific addr and configuration, if one does |
| 946 | * not exist create it. Either way, ceph_opts is consumed by this | 929 | * not exist create it. Either way, ceph_opts is consumed by this |
| @@ -960,7 +943,8 @@ static struct rbd_client *rbd_get_client(struct ceph_options *ceph_opts) | |||
| 960 | * Using an existing client. Make sure ->pg_pools is up to | 943 | * Using an existing client. Make sure ->pg_pools is up to |
| 961 | * date before we look up the pool id in do_rbd_add(). | 944 | * date before we look up the pool id in do_rbd_add(). |
| 962 | */ | 945 | */ |
| 963 | ret = wait_for_latest_osdmap(rbdc->client); | 946 | ret = ceph_wait_for_latest_osdmap(rbdc->client, |
| 947 | rbdc->client->options->mount_timeout); | ||
| 964 | if (ret) { | 948 | if (ret) { |
| 965 | rbd_warn(NULL, "failed to get latest osdmap: %d", ret); | 949 | rbd_warn(NULL, "failed to get latest osdmap: %d", ret); |
| 966 | rbd_put_client(rbdc); | 950 | rbd_put_client(rbdc); |
| @@ -4203,12 +4187,12 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) | |||
| 4203 | q->limits.max_sectors = queue_max_hw_sectors(q); | 4187 | q->limits.max_sectors = queue_max_hw_sectors(q); |
| 4204 | blk_queue_max_segments(q, USHRT_MAX); | 4188 | blk_queue_max_segments(q, USHRT_MAX); |
| 4205 | blk_queue_max_segment_size(q, UINT_MAX); | 4189 | blk_queue_max_segment_size(q, UINT_MAX); |
| 4206 | blk_queue_io_min(q, objset_bytes); | 4190 | blk_queue_io_min(q, rbd_dev->opts->alloc_size); |
| 4207 | blk_queue_io_opt(q, objset_bytes); | 4191 | blk_queue_io_opt(q, rbd_dev->opts->alloc_size); |
| 4208 | 4192 | ||
| 4209 | if (rbd_dev->opts->trim) { | 4193 | if (rbd_dev->opts->trim) { |
| 4210 | blk_queue_flag_set(QUEUE_FLAG_DISCARD, q); | 4194 | blk_queue_flag_set(QUEUE_FLAG_DISCARD, q); |
| 4211 | q->limits.discard_granularity = objset_bytes; | 4195 | q->limits.discard_granularity = rbd_dev->opts->alloc_size; |
| 4212 | blk_queue_max_discard_sectors(q, objset_bytes >> SECTOR_SHIFT); | 4196 | blk_queue_max_discard_sectors(q, objset_bytes >> SECTOR_SHIFT); |
| 4213 | blk_queue_max_write_zeroes_sectors(q, objset_bytes >> SECTOR_SHIFT); | 4197 | blk_queue_max_write_zeroes_sectors(q, objset_bytes >> SECTOR_SHIFT); |
| 4214 | } | 4198 | } |
diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c index a8dd80576c95..857f8c086274 100644 --- a/drivers/clocksource/clps711x-timer.c +++ b/drivers/clocksource/clps711x-timer.c | |||
| @@ -31,16 +31,9 @@ static u64 notrace clps711x_sched_clock_read(void) | |||
| 31 | return ~readw(tcd); | 31 | return ~readw(tcd); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | static int __init _clps711x_clksrc_init(struct clk *clock, void __iomem *base) | 34 | static void __init clps711x_clksrc_init(struct clk *clock, void __iomem *base) |
| 35 | { | 35 | { |
| 36 | unsigned long rate; | 36 | unsigned long rate = clk_get_rate(clock); |
| 37 | |||
| 38 | if (!base) | ||
| 39 | return -ENOMEM; | ||
| 40 | if (IS_ERR(clock)) | ||
| 41 | return PTR_ERR(clock); | ||
| 42 | |||
| 43 | rate = clk_get_rate(clock); | ||
| 44 | 37 | ||
| 45 | tcd = base; | 38 | tcd = base; |
| 46 | 39 | ||
| @@ -48,8 +41,6 @@ static int __init _clps711x_clksrc_init(struct clk *clock, void __iomem *base) | |||
| 48 | clocksource_mmio_readw_down); | 41 | clocksource_mmio_readw_down); |
| 49 | 42 | ||
| 50 | sched_clock_register(clps711x_sched_clock_read, 16, rate); | 43 | sched_clock_register(clps711x_sched_clock_read, 16, rate); |
| 51 | |||
| 52 | return 0; | ||
| 53 | } | 44 | } |
| 54 | 45 | ||
| 55 | static irqreturn_t clps711x_timer_interrupt(int irq, void *dev_id) | 46 | static irqreturn_t clps711x_timer_interrupt(int irq, void *dev_id) |
| @@ -67,13 +58,6 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base, | |||
| 67 | struct clock_event_device *clkevt; | 58 | struct clock_event_device *clkevt; |
| 68 | unsigned long rate; | 59 | unsigned long rate; |
| 69 | 60 | ||
| 70 | if (!irq) | ||
| 71 | return -EINVAL; | ||
| 72 | if (!base) | ||
| 73 | return -ENOMEM; | ||
| 74 | if (IS_ERR(clock)) | ||
| 75 | return PTR_ERR(clock); | ||
| 76 | |||
| 77 | clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL); | 61 | clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL); |
| 78 | if (!clkevt) | 62 | if (!clkevt) |
| 79 | return -ENOMEM; | 63 | return -ENOMEM; |
| @@ -93,31 +77,29 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base, | |||
| 93 | "clps711x-timer", clkevt); | 77 | "clps711x-timer", clkevt); |
| 94 | } | 78 | } |
| 95 | 79 | ||
| 96 | void __init clps711x_clksrc_init(void __iomem *tc1_base, void __iomem *tc2_base, | ||
| 97 | unsigned int irq) | ||
| 98 | { | ||
| 99 | struct clk *tc1 = clk_get_sys("clps711x-timer.0", NULL); | ||
| 100 | struct clk *tc2 = clk_get_sys("clps711x-timer.1", NULL); | ||
| 101 | |||
| 102 | BUG_ON(_clps711x_clksrc_init(tc1, tc1_base)); | ||
| 103 | BUG_ON(_clps711x_clkevt_init(tc2, tc2_base, irq)); | ||
| 104 | } | ||
| 105 | |||
| 106 | #ifdef CONFIG_TIMER_OF | ||
| 107 | static int __init clps711x_timer_init(struct device_node *np) | 80 | static int __init clps711x_timer_init(struct device_node *np) |
| 108 | { | 81 | { |
| 109 | unsigned int irq = irq_of_parse_and_map(np, 0); | 82 | unsigned int irq = irq_of_parse_and_map(np, 0); |
| 110 | struct clk *clock = of_clk_get(np, 0); | 83 | struct clk *clock = of_clk_get(np, 0); |
| 111 | void __iomem *base = of_iomap(np, 0); | 84 | void __iomem *base = of_iomap(np, 0); |
| 112 | 85 | ||
| 86 | if (!base) | ||
| 87 | return -ENOMEM; | ||
| 88 | if (!irq) | ||
| 89 | return -EINVAL; | ||
| 90 | if (IS_ERR(clock)) | ||
| 91 | return PTR_ERR(clock); | ||
| 92 | |||
| 113 | switch (of_alias_get_id(np, "timer")) { | 93 | switch (of_alias_get_id(np, "timer")) { |
| 114 | case CLPS711X_CLKSRC_CLOCKSOURCE: | 94 | case CLPS711X_CLKSRC_CLOCKSOURCE: |
| 115 | return _clps711x_clksrc_init(clock, base); | 95 | clps711x_clksrc_init(clock, base); |
| 96 | break; | ||
| 116 | case CLPS711X_CLKSRC_CLOCKEVENT: | 97 | case CLPS711X_CLKSRC_CLOCKEVENT: |
| 117 | return _clps711x_clkevt_init(clock, base, irq); | 98 | return _clps711x_clkevt_init(clock, base, irq); |
| 118 | default: | 99 | default: |
| 119 | return -EINVAL; | 100 | return -EINVAL; |
| 120 | } | 101 | } |
| 102 | |||
| 103 | return 0; | ||
| 121 | } | 104 | } |
| 122 | TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init); | 105 | TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init); |
| 123 | #endif | ||
diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c index 54f8a331b53a..37671a5d4ed9 100644 --- a/drivers/clocksource/mips-gic-timer.c +++ b/drivers/clocksource/mips-gic-timer.c | |||
| @@ -67,7 +67,7 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id) | |||
| 67 | return IRQ_HANDLED; | 67 | return IRQ_HANDLED; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | struct irqaction gic_compare_irqaction = { | 70 | static struct irqaction gic_compare_irqaction = { |
| 71 | .handler = gic_compare_interrupt, | 71 | .handler = gic_compare_interrupt, |
| 72 | .percpu_dev_id = &gic_clockevent_device, | 72 | .percpu_dev_id = &gic_clockevent_device, |
| 73 | .flags = IRQF_PERCPU | IRQF_TIMER, | 73 | .flags = IRQF_PERCPU | IRQF_TIMER, |
diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index 43f4d5c4d6fa..f987027ca566 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c | |||
| @@ -71,7 +71,7 @@ static u64 tc_get_cycles32(struct clocksource *cs) | |||
| 71 | return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); | 71 | return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | void tc_clksrc_suspend(struct clocksource *cs) | 74 | static void tc_clksrc_suspend(struct clocksource *cs) |
| 75 | { | 75 | { |
| 76 | int i; | 76 | int i; |
| 77 | 77 | ||
| @@ -86,7 +86,7 @@ void tc_clksrc_suspend(struct clocksource *cs) | |||
| 86 | bmr_cache = readl(tcaddr + ATMEL_TC_BMR); | 86 | bmr_cache = readl(tcaddr + ATMEL_TC_BMR); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | void tc_clksrc_resume(struct clocksource *cs) | 89 | static void tc_clksrc_resume(struct clocksource *cs) |
| 90 | { | 90 | { |
| 91 | int i; | 91 | int i; |
| 92 | 92 | ||
diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index e8163693e936..5e6038fbf115 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c | |||
| @@ -58,7 +58,7 @@ static u64 riscv_sched_clock(void) | |||
| 58 | static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = { | 58 | static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = { |
| 59 | .name = "riscv_clocksource", | 59 | .name = "riscv_clocksource", |
| 60 | .rating = 300, | 60 | .rating = 300, |
| 61 | .mask = CLOCKSOURCE_MASK(BITS_PER_LONG), | 61 | .mask = CLOCKSOURCE_MASK(64), |
| 62 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 62 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
| 63 | .read = riscv_clocksource_rdtime, | 63 | .read = riscv_clocksource_rdtime, |
| 64 | }; | 64 | }; |
| @@ -120,8 +120,7 @@ static int __init riscv_timer_init_dt(struct device_node *n) | |||
| 120 | return error; | 120 | return error; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | sched_clock_register(riscv_sched_clock, | 123 | sched_clock_register(riscv_sched_clock, 64, riscv_timebase); |
| 124 | BITS_PER_LONG, riscv_timebase); | ||
| 125 | 124 | ||
| 126 | error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING, | 125 | error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING, |
| 127 | "clockevents/riscv/timer:starting", | 126 | "clockevents/riscv/timer:starting", |
diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c index c364027638e1..3352da6ed61f 100644 --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c | |||
| @@ -586,8 +586,8 @@ static int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, | |||
| 586 | } | 586 | } |
| 587 | 587 | ||
| 588 | /* Optimized set_load which removes costly spin wait in timer_start */ | 588 | /* Optimized set_load which removes costly spin wait in timer_start */ |
| 589 | int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, | 589 | static int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, |
| 590 | unsigned int load) | 590 | int autoreload, unsigned int load) |
| 591 | { | 591 | { |
| 592 | u32 l; | 592 | u32 l; |
| 593 | 593 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index bfa9062ce6b9..16fcb56c232b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
| @@ -700,6 +700,8 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
| 700 | struct amdgpu_vm_bo_base *bo_base, *tmp; | 700 | struct amdgpu_vm_bo_base *bo_base, *tmp; |
| 701 | int r = 0; | 701 | int r = 0; |
| 702 | 702 | ||
| 703 | vm->bulk_moveable &= list_empty(&vm->evicted); | ||
| 704 | |||
| 703 | list_for_each_entry_safe(bo_base, tmp, &vm->evicted, vm_status) { | 705 | list_for_each_entry_safe(bo_base, tmp, &vm->evicted, vm_status) { |
| 704 | struct amdgpu_bo *bo = bo_base->bo; | 706 | struct amdgpu_bo *bo = bo_base->bo; |
| 705 | 707 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 600259b4e291..2fe8397241ea 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | |||
| @@ -742,7 +742,7 @@ static int gmc_v9_0_allocate_vm_inv_eng(struct amdgpu_device *adev) | |||
| 742 | } | 742 | } |
| 743 | 743 | ||
| 744 | ring->vm_inv_eng = inv_eng - 1; | 744 | ring->vm_inv_eng = inv_eng - 1; |
| 745 | change_bit(inv_eng - 1, (unsigned long *)(&vm_inv_engs[vmhub])); | 745 | vm_inv_engs[vmhub] &= ~(1 << ring->vm_inv_eng); |
| 746 | 746 | ||
| 747 | dev_info(adev->dev, "ring %s uses VM inv eng %u on hub %u\n", | 747 | dev_info(adev->dev, "ring %s uses VM inv eng %u on hub %u\n", |
| 748 | ring->name, ring->vm_inv_eng, ring->funcs->vmhub); | 748 | ring->name, ring->vm_inv_eng, ring->funcs->vmhub); |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 0573eab0e190..f35e4ab55b27 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include "regs-vp.h" | 20 | #include "regs-vp.h" |
| 21 | 21 | ||
| 22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 23 | #include <linux/ktime.h> | ||
| 23 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
| 24 | #include <linux/wait.h> | 25 | #include <linux/wait.h> |
| 25 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
| @@ -352,15 +353,62 @@ static void mixer_cfg_vp_blend(struct mixer_context *ctx, unsigned int alpha) | |||
| 352 | mixer_reg_write(ctx, MXR_VIDEO_CFG, val); | 353 | mixer_reg_write(ctx, MXR_VIDEO_CFG, val); |
| 353 | } | 354 | } |
| 354 | 355 | ||
| 355 | static void mixer_vsync_set_update(struct mixer_context *ctx, bool enable) | 356 | static bool mixer_is_synced(struct mixer_context *ctx) |
| 356 | { | 357 | { |
| 357 | /* block update on vsync */ | 358 | u32 base, shadow; |
| 358 | mixer_reg_writemask(ctx, MXR_STATUS, enable ? | ||
| 359 | MXR_STATUS_SYNC_ENABLE : 0, MXR_STATUS_SYNC_ENABLE); | ||
| 360 | 359 | ||
| 360 | if (ctx->mxr_ver == MXR_VER_16_0_33_0 || | ||
| 361 | ctx->mxr_ver == MXR_VER_128_0_0_184) | ||
| 362 | return !(mixer_reg_read(ctx, MXR_CFG) & | ||
| 363 | MXR_CFG_LAYER_UPDATE_COUNT_MASK); | ||
| 364 | |||
| 365 | if (test_bit(MXR_BIT_VP_ENABLED, &ctx->flags) && | ||
| 366 | vp_reg_read(ctx, VP_SHADOW_UPDATE)) | ||
| 367 | return false; | ||
| 368 | |||
| 369 | base = mixer_reg_read(ctx, MXR_CFG); | ||
| 370 | shadow = mixer_reg_read(ctx, MXR_CFG_S); | ||
| 371 | if (base != shadow) | ||
| 372 | return false; | ||
| 373 | |||
| 374 | base = mixer_reg_read(ctx, MXR_GRAPHIC_BASE(0)); | ||
| 375 | shadow = mixer_reg_read(ctx, MXR_GRAPHIC_BASE_S(0)); | ||
| 376 | if (base != shadow) | ||
| 377 | return false; | ||
| 378 | |||
| 379 | base = mixer_reg_read(ctx, MXR_GRAPHIC_BASE(1)); | ||
| 380 | shadow = mixer_reg_read(ctx, MXR_GRAPHIC_BASE_S(1)); | ||
| 381 | if (base != shadow) | ||
| 382 | return false; | ||
| 383 | |||
| 384 | return true; | ||
| 385 | } | ||
| 386 | |||
| 387 | static int mixer_wait_for_sync(struct mixer_context *ctx) | ||
| 388 | { | ||
| 389 | ktime_t timeout = ktime_add_us(ktime_get(), 100000); | ||
| 390 | |||
| 391 | while (!mixer_is_synced(ctx)) { | ||
| 392 | usleep_range(1000, 2000); | ||
| 393 | if (ktime_compare(ktime_get(), timeout) > 0) | ||
| 394 | return -ETIMEDOUT; | ||
| 395 | } | ||
| 396 | return 0; | ||
| 397 | } | ||
| 398 | |||
| 399 | static void mixer_disable_sync(struct mixer_context *ctx) | ||
| 400 | { | ||
| 401 | mixer_reg_writemask(ctx, MXR_STATUS, 0, MXR_STATUS_SYNC_ENABLE); | ||
| 402 | } | ||
| 403 | |||
| 404 | static void mixer_enable_sync(struct mixer_context *ctx) | ||
| 405 | { | ||
| 406 | if (ctx->mxr_ver == MXR_VER_16_0_33_0 || | ||
| 407 | ctx->mxr_ver == MXR_VER_128_0_0_184) | ||
| 408 | mixer_reg_writemask(ctx, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE); | ||
| 409 | mixer_reg_writemask(ctx, MXR_STATUS, ~0, MXR_STATUS_SYNC_ENABLE); | ||
| 361 | if (test_bit(MXR_BIT_VP_ENABLED, &ctx->flags)) | 410 | if (test_bit(MXR_BIT_VP_ENABLED, &ctx->flags)) |
| 362 | vp_reg_write(ctx, VP_SHADOW_UPDATE, enable ? | 411 | vp_reg_write(ctx, VP_SHADOW_UPDATE, VP_SHADOW_UPDATE_ENABLE); |
| 363 | VP_SHADOW_UPDATE_ENABLE : 0); | ||
| 364 | } | 412 | } |
| 365 | 413 | ||
| 366 | static void mixer_cfg_scan(struct mixer_context *ctx, int width, int height) | 414 | static void mixer_cfg_scan(struct mixer_context *ctx, int width, int height) |
| @@ -498,7 +546,6 @@ static void vp_video_buffer(struct mixer_context *ctx, | |||
| 498 | 546 | ||
| 499 | spin_lock_irqsave(&ctx->reg_slock, flags); | 547 | spin_lock_irqsave(&ctx->reg_slock, flags); |
| 500 | 548 | ||
| 501 | vp_reg_write(ctx, VP_SHADOW_UPDATE, 1); | ||
| 502 | /* interlace or progressive scan mode */ | 549 | /* interlace or progressive scan mode */ |
| 503 | val = (test_bit(MXR_BIT_INTERLACE, &ctx->flags) ? ~0 : 0); | 550 | val = (test_bit(MXR_BIT_INTERLACE, &ctx->flags) ? ~0 : 0); |
| 504 | vp_reg_writemask(ctx, VP_MODE, val, VP_MODE_LINE_SKIP); | 551 | vp_reg_writemask(ctx, VP_MODE, val, VP_MODE_LINE_SKIP); |
| @@ -553,11 +600,6 @@ static void vp_video_buffer(struct mixer_context *ctx, | |||
| 553 | vp_regs_dump(ctx); | 600 | vp_regs_dump(ctx); |
| 554 | } | 601 | } |
| 555 | 602 | ||
| 556 | static void mixer_layer_update(struct mixer_context *ctx) | ||
| 557 | { | ||
| 558 | mixer_reg_writemask(ctx, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE); | ||
| 559 | } | ||
| 560 | |||
| 561 | static void mixer_graph_buffer(struct mixer_context *ctx, | 603 | static void mixer_graph_buffer(struct mixer_context *ctx, |
| 562 | struct exynos_drm_plane *plane) | 604 | struct exynos_drm_plane *plane) |
| 563 | { | 605 | { |
| @@ -640,11 +682,6 @@ static void mixer_graph_buffer(struct mixer_context *ctx, | |||
| 640 | mixer_cfg_layer(ctx, win, priority, true); | 682 | mixer_cfg_layer(ctx, win, priority, true); |
| 641 | mixer_cfg_gfx_blend(ctx, win, pixel_alpha, state->base.alpha); | 683 | mixer_cfg_gfx_blend(ctx, win, pixel_alpha, state->base.alpha); |
| 642 | 684 | ||
| 643 | /* layer update mandatory for mixer 16.0.33.0 */ | ||
| 644 | if (ctx->mxr_ver == MXR_VER_16_0_33_0 || | ||
| 645 | ctx->mxr_ver == MXR_VER_128_0_0_184) | ||
| 646 | mixer_layer_update(ctx); | ||
| 647 | |||
| 648 | spin_unlock_irqrestore(&ctx->reg_slock, flags); | 685 | spin_unlock_irqrestore(&ctx->reg_slock, flags); |
| 649 | 686 | ||
| 650 | mixer_regs_dump(ctx); | 687 | mixer_regs_dump(ctx); |
| @@ -709,7 +746,7 @@ static void mixer_win_reset(struct mixer_context *ctx) | |||
| 709 | static irqreturn_t mixer_irq_handler(int irq, void *arg) | 746 | static irqreturn_t mixer_irq_handler(int irq, void *arg) |
| 710 | { | 747 | { |
| 711 | struct mixer_context *ctx = arg; | 748 | struct mixer_context *ctx = arg; |
| 712 | u32 val, base, shadow; | 749 | u32 val; |
| 713 | 750 | ||
| 714 | spin_lock(&ctx->reg_slock); | 751 | spin_lock(&ctx->reg_slock); |
| 715 | 752 | ||
| @@ -723,26 +760,9 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg) | |||
| 723 | val &= ~MXR_INT_STATUS_VSYNC; | 760 | val &= ~MXR_INT_STATUS_VSYNC; |
| 724 | 761 | ||
| 725 | /* interlace scan need to check shadow register */ | 762 | /* interlace scan need to check shadow register */ |
| 726 | if (test_bit(MXR_BIT_INTERLACE, &ctx->flags)) { | 763 | if (test_bit(MXR_BIT_INTERLACE, &ctx->flags) |
| 727 | if (test_bit(MXR_BIT_VP_ENABLED, &ctx->flags) && | 764 | && !mixer_is_synced(ctx)) |
| 728 | vp_reg_read(ctx, VP_SHADOW_UPDATE)) | 765 | goto out; |
| 729 | goto out; | ||
| 730 | |||
| 731 | base = mixer_reg_read(ctx, MXR_CFG); | ||
| 732 | shadow = mixer_reg_read(ctx, MXR_CFG_S); | ||
| 733 | if (base != shadow) | ||
| 734 | goto out; | ||
| 735 | |||
| 736 | base = mixer_reg_read(ctx, MXR_GRAPHIC_BASE(0)); | ||
| 737 | shadow = mixer_reg_read(ctx, MXR_GRAPHIC_BASE_S(0)); | ||
| 738 | if (base != shadow) | ||
| 739 | goto out; | ||
| 740 | |||
| 741 | base = mixer_reg_read(ctx, MXR_GRAPHIC_BASE(1)); | ||
| 742 | shadow = mixer_reg_read(ctx, MXR_GRAPHIC_BASE_S(1)); | ||
| 743 | if (base != shadow) | ||
| 744 | goto out; | ||
| 745 | } | ||
| 746 | 766 | ||
| 747 | drm_crtc_handle_vblank(&ctx->crtc->base); | 767 | drm_crtc_handle_vblank(&ctx->crtc->base); |
| 748 | } | 768 | } |
| @@ -917,12 +937,14 @@ static void mixer_disable_vblank(struct exynos_drm_crtc *crtc) | |||
| 917 | 937 | ||
| 918 | static void mixer_atomic_begin(struct exynos_drm_crtc *crtc) | 938 | static void mixer_atomic_begin(struct exynos_drm_crtc *crtc) |
| 919 | { | 939 | { |
| 920 | struct mixer_context *mixer_ctx = crtc->ctx; | 940 | struct mixer_context *ctx = crtc->ctx; |
| 921 | 941 | ||
| 922 | if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) | 942 | if (!test_bit(MXR_BIT_POWERED, &ctx->flags)) |
| 923 | return; | 943 | return; |
| 924 | 944 | ||
| 925 | mixer_vsync_set_update(mixer_ctx, false); | 945 | if (mixer_wait_for_sync(ctx)) |
| 946 | dev_err(ctx->dev, "timeout waiting for VSYNC\n"); | ||
| 947 | mixer_disable_sync(ctx); | ||
| 926 | } | 948 | } |
| 927 | 949 | ||
| 928 | static void mixer_update_plane(struct exynos_drm_crtc *crtc, | 950 | static void mixer_update_plane(struct exynos_drm_crtc *crtc, |
| @@ -964,7 +986,7 @@ static void mixer_atomic_flush(struct exynos_drm_crtc *crtc) | |||
| 964 | if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) | 986 | if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) |
| 965 | return; | 987 | return; |
| 966 | 988 | ||
| 967 | mixer_vsync_set_update(mixer_ctx, true); | 989 | mixer_enable_sync(mixer_ctx); |
| 968 | exynos_crtc_handle_event(crtc); | 990 | exynos_crtc_handle_event(crtc); |
| 969 | } | 991 | } |
| 970 | 992 | ||
| @@ -979,7 +1001,7 @@ static void mixer_enable(struct exynos_drm_crtc *crtc) | |||
| 979 | 1001 | ||
| 980 | exynos_drm_pipe_clk_enable(crtc, true); | 1002 | exynos_drm_pipe_clk_enable(crtc, true); |
| 981 | 1003 | ||
| 982 | mixer_vsync_set_update(ctx, false); | 1004 | mixer_disable_sync(ctx); |
| 983 | 1005 | ||
| 984 | mixer_reg_writemask(ctx, MXR_STATUS, ~0, MXR_STATUS_SOFT_RESET); | 1006 | mixer_reg_writemask(ctx, MXR_STATUS, ~0, MXR_STATUS_SOFT_RESET); |
| 985 | 1007 | ||
| @@ -992,7 +1014,7 @@ static void mixer_enable(struct exynos_drm_crtc *crtc) | |||
| 992 | 1014 | ||
| 993 | mixer_commit(ctx); | 1015 | mixer_commit(ctx); |
| 994 | 1016 | ||
| 995 | mixer_vsync_set_update(ctx, true); | 1017 | mixer_enable_sync(ctx); |
| 996 | 1018 | ||
| 997 | set_bit(MXR_BIT_POWERED, &ctx->flags); | 1019 | set_bit(MXR_BIT_POWERED, &ctx->flags); |
| 998 | } | 1020 | } |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 30d516e975c6..8558e81fdc2a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -1734,8 +1734,13 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, | |||
| 1734 | * pages from. | 1734 | * pages from. |
| 1735 | */ | 1735 | */ |
| 1736 | if (!obj->base.filp) { | 1736 | if (!obj->base.filp) { |
| 1737 | i915_gem_object_put(obj); | 1737 | addr = -ENXIO; |
| 1738 | return -ENXIO; | 1738 | goto err; |
| 1739 | } | ||
| 1740 | |||
| 1741 | if (range_overflows(args->offset, args->size, (u64)obj->base.size)) { | ||
| 1742 | addr = -EINVAL; | ||
| 1743 | goto err; | ||
| 1739 | } | 1744 | } |
| 1740 | 1745 | ||
| 1741 | addr = vm_mmap(obj->base.filp, 0, args->size, | 1746 | addr = vm_mmap(obj->base.filp, 0, args->size, |
| @@ -1749,8 +1754,8 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, | |||
| 1749 | struct vm_area_struct *vma; | 1754 | struct vm_area_struct *vma; |
| 1750 | 1755 | ||
| 1751 | if (down_write_killable(&mm->mmap_sem)) { | 1756 | if (down_write_killable(&mm->mmap_sem)) { |
| 1752 | i915_gem_object_put(obj); | 1757 | addr = -EINTR; |
| 1753 | return -EINTR; | 1758 | goto err; |
| 1754 | } | 1759 | } |
| 1755 | vma = find_vma(mm, addr); | 1760 | vma = find_vma(mm, addr); |
| 1756 | if (vma && __vma_matches(vma, obj->base.filp, addr, args->size)) | 1761 | if (vma && __vma_matches(vma, obj->base.filp, addr, args->size)) |
| @@ -1768,12 +1773,10 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, | |||
| 1768 | i915_gem_object_put(obj); | 1773 | i915_gem_object_put(obj); |
| 1769 | 1774 | ||
| 1770 | args->addr_ptr = (u64)addr; | 1775 | args->addr_ptr = (u64)addr; |
| 1771 | |||
| 1772 | return 0; | 1776 | return 0; |
| 1773 | 1777 | ||
| 1774 | err: | 1778 | err: |
| 1775 | i915_gem_object_put(obj); | 1779 | i915_gem_object_put(obj); |
| 1776 | |||
| 1777 | return addr; | 1780 | return addr; |
| 1778 | } | 1781 | } |
| 1779 | 1782 | ||
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 9a65341fec09..aa6791255252 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c | |||
| @@ -1721,7 +1721,7 @@ error_msg(struct i915_gpu_state *error, unsigned long engines, const char *msg) | |||
| 1721 | i915_error_generate_code(error, engines)); | 1721 | i915_error_generate_code(error, engines)); |
| 1722 | if (engines) { | 1722 | if (engines) { |
| 1723 | /* Just show the first executing process, more is confusing */ | 1723 | /* Just show the first executing process, more is confusing */ |
| 1724 | i = ffs(engines); | 1724 | i = __ffs(engines); |
| 1725 | len += scnprintf(error->error_msg + len, | 1725 | len += scnprintf(error->error_msg + len, |
| 1726 | sizeof(error->error_msg) - len, | 1726 | sizeof(error->error_msg) - len, |
| 1727 | ", in %s [%d]", | 1727 | ", in %s [%d]", |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index b508d8a735e0..4364f42cac6b 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
| @@ -1673,6 +1673,7 @@ init_vbt_missing_defaults(struct drm_i915_private *dev_priv) | |||
| 1673 | info->supports_dvi = (port != PORT_A && port != PORT_E); | 1673 | info->supports_dvi = (port != PORT_A && port != PORT_E); |
| 1674 | info->supports_hdmi = info->supports_dvi; | 1674 | info->supports_hdmi = info->supports_dvi; |
| 1675 | info->supports_dp = (port != PORT_E); | 1675 | info->supports_dp = (port != PORT_E); |
| 1676 | info->supports_edp = (port == PORT_A); | ||
| 1676 | } | 1677 | } |
| 1677 | } | 1678 | } |
| 1678 | 1679 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index 88a52f6b39fe..7dfbbbc1beea 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c | |||
| @@ -181,7 +181,7 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf, | |||
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | ret = pm_runtime_get_sync(drm->dev); | 183 | ret = pm_runtime_get_sync(drm->dev); |
| 184 | if (IS_ERR_VALUE(ret) && ret != -EACCES) | 184 | if (ret < 0 && ret != -EACCES) |
| 185 | return ret; | 185 | return ret; |
| 186 | ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args)); | 186 | ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args)); |
| 187 | pm_runtime_put_autosuspend(drm->dev); | 187 | pm_runtime_put_autosuspend(drm->dev); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c index aa9fec80492d..40c47d6a7d78 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c | |||
| @@ -100,12 +100,10 @@ static void | |||
| 100 | nouveau_dmem_free(struct hmm_devmem *devmem, struct page *page) | 100 | nouveau_dmem_free(struct hmm_devmem *devmem, struct page *page) |
| 101 | { | 101 | { |
| 102 | struct nouveau_dmem_chunk *chunk; | 102 | struct nouveau_dmem_chunk *chunk; |
| 103 | struct nouveau_drm *drm; | ||
| 104 | unsigned long idx; | 103 | unsigned long idx; |
| 105 | 104 | ||
| 106 | chunk = (void *)hmm_devmem_page_get_drvdata(page); | 105 | chunk = (void *)hmm_devmem_page_get_drvdata(page); |
| 107 | idx = page_to_pfn(page) - chunk->pfn_first; | 106 | idx = page_to_pfn(page) - chunk->pfn_first; |
| 108 | drm = chunk->drm; | ||
| 109 | 107 | ||
| 110 | /* | 108 | /* |
| 111 | * FIXME: | 109 | * FIXME: |
| @@ -456,11 +454,6 @@ nouveau_dmem_resume(struct nouveau_drm *drm) | |||
| 456 | /* FIXME handle pin failure */ | 454 | /* FIXME handle pin failure */ |
| 457 | WARN_ON(ret); | 455 | WARN_ON(ret); |
| 458 | } | 456 | } |
| 459 | list_for_each_entry (chunk, &drm->dmem->chunk_empty, list) { | ||
| 460 | ret = nouveau_bo_pin(chunk->bo, TTM_PL_FLAG_VRAM, false); | ||
| 461 | /* FIXME handle pin failure */ | ||
| 462 | WARN_ON(ret); | ||
| 463 | } | ||
| 464 | mutex_unlock(&drm->dmem->mutex); | 457 | mutex_unlock(&drm->dmem->mutex); |
| 465 | } | 458 | } |
| 466 | 459 | ||
| @@ -479,9 +472,6 @@ nouveau_dmem_suspend(struct nouveau_drm *drm) | |||
| 479 | list_for_each_entry (chunk, &drm->dmem->chunk_full, list) { | 472 | list_for_each_entry (chunk, &drm->dmem->chunk_full, list) { |
| 480 | nouveau_bo_unpin(chunk->bo); | 473 | nouveau_bo_unpin(chunk->bo); |
| 481 | } | 474 | } |
| 482 | list_for_each_entry (chunk, &drm->dmem->chunk_empty, list) { | ||
| 483 | nouveau_bo_unpin(chunk->bo); | ||
| 484 | } | ||
| 485 | mutex_unlock(&drm->dmem->mutex); | 475 | mutex_unlock(&drm->dmem->mutex); |
| 486 | } | 476 | } |
| 487 | 477 | ||
| @@ -623,7 +613,7 @@ nouveau_dmem_init(struct nouveau_drm *drm) | |||
| 623 | */ | 613 | */ |
| 624 | drm->dmem->devmem = hmm_devmem_add(&nouveau_dmem_devmem_ops, | 614 | drm->dmem->devmem = hmm_devmem_add(&nouveau_dmem_devmem_ops, |
| 625 | device, size); | 615 | device, size); |
| 626 | if (drm->dmem->devmem == NULL) { | 616 | if (IS_ERR(drm->dmem->devmem)) { |
| 627 | kfree(drm->dmem); | 617 | kfree(drm->dmem); |
| 628 | drm->dmem = NULL; | 618 | drm->dmem = NULL; |
| 629 | return; | 619 | return; |
diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c index d5a23295dd80..bb7b58407039 100644 --- a/drivers/gpu/drm/udl/udl_gem.c +++ b/drivers/gpu/drm/udl/udl_gem.c | |||
| @@ -224,7 +224,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev, | |||
| 224 | *offset = drm_vma_node_offset_addr(&gobj->base.vma_node); | 224 | *offset = drm_vma_node_offset_addr(&gobj->base.vma_node); |
| 225 | 225 | ||
| 226 | out: | 226 | out: |
| 227 | drm_gem_object_put(&gobj->base); | 227 | drm_gem_object_put_unlocked(&gobj->base); |
| 228 | unlock: | 228 | unlock: |
| 229 | mutex_unlock(&udl->gem_lock); | 229 | mutex_unlock(&udl->gem_lock); |
| 230 | return ret; | 230 | return ret; |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index b913a56f3426..2a9112515f46 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | |||
| @@ -564,11 +564,9 @@ static int vmw_fb_set_par(struct fb_info *info) | |||
| 564 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 564 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 565 | DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) | 565 | DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) |
| 566 | }; | 566 | }; |
| 567 | struct drm_display_mode *old_mode; | ||
| 568 | struct drm_display_mode *mode; | 567 | struct drm_display_mode *mode; |
| 569 | int ret; | 568 | int ret; |
| 570 | 569 | ||
| 571 | old_mode = par->set_mode; | ||
| 572 | mode = drm_mode_duplicate(vmw_priv->dev, &new_mode); | 570 | mode = drm_mode_duplicate(vmw_priv->dev, &new_mode); |
| 573 | if (!mode) { | 571 | if (!mode) { |
| 574 | DRM_ERROR("Could not create new fb mode.\n"); | 572 | DRM_ERROR("Could not create new fb mode.\n"); |
| @@ -579,11 +577,7 @@ static int vmw_fb_set_par(struct fb_info *info) | |||
| 579 | mode->vdisplay = var->yres; | 577 | mode->vdisplay = var->yres; |
| 580 | vmw_guess_mode_timing(mode); | 578 | vmw_guess_mode_timing(mode); |
| 581 | 579 | ||
| 582 | if (old_mode && drm_mode_equal(old_mode, mode)) { | 580 | if (!vmw_kms_validate_mode_vram(vmw_priv, |
| 583 | drm_mode_destroy(vmw_priv->dev, mode); | ||
| 584 | mode = old_mode; | ||
| 585 | old_mode = NULL; | ||
| 586 | } else if (!vmw_kms_validate_mode_vram(vmw_priv, | ||
| 587 | mode->hdisplay * | 581 | mode->hdisplay * |
| 588 | DIV_ROUND_UP(var->bits_per_pixel, 8), | 582 | DIV_ROUND_UP(var->bits_per_pixel, 8), |
| 589 | mode->vdisplay)) { | 583 | mode->vdisplay)) { |
| @@ -620,8 +614,8 @@ static int vmw_fb_set_par(struct fb_info *info) | |||
| 620 | schedule_delayed_work(&par->local_work, 0); | 614 | schedule_delayed_work(&par->local_work, 0); |
| 621 | 615 | ||
| 622 | out_unlock: | 616 | out_unlock: |
| 623 | if (old_mode) | 617 | if (par->set_mode) |
| 624 | drm_mode_destroy(vmw_priv->dev, old_mode); | 618 | drm_mode_destroy(vmw_priv->dev, par->set_mode); |
| 625 | par->set_mode = mode; | 619 | par->set_mode = mode; |
| 626 | 620 | ||
| 627 | mutex_unlock(&par->bo_mutex); | 621 | mutex_unlock(&par->bo_mutex); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index b93c558dd86e..7da752ca1c34 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | |||
| @@ -57,7 +57,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man, | |||
| 57 | 57 | ||
| 58 | id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL); | 58 | id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL); |
| 59 | if (id < 0) | 59 | if (id < 0) |
| 60 | return id; | 60 | return (id != -ENOMEM ? 0 : id); |
| 61 | 61 | ||
| 62 | spin_lock(&gman->lock); | 62 | spin_lock(&gman->lock); |
| 63 | 63 | ||
diff --git a/drivers/infiniband/hw/i40iw/i40iw_utils.c b/drivers/infiniband/hw/i40iw/i40iw_utils.c index c5a881172524..337410f40860 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_utils.c +++ b/drivers/infiniband/hw/i40iw/i40iw_utils.c | |||
| @@ -173,7 +173,12 @@ int i40iw_inetaddr_event(struct notifier_block *notifier, | |||
| 173 | 173 | ||
| 174 | rcu_read_lock(); | 174 | rcu_read_lock(); |
| 175 | in = __in_dev_get_rcu(upper_dev); | 175 | in = __in_dev_get_rcu(upper_dev); |
| 176 | local_ipaddr = ntohl(in->ifa_list->ifa_address); | 176 | |
| 177 | if (!in->ifa_list) | ||
| 178 | local_ipaddr = 0; | ||
| 179 | else | ||
| 180 | local_ipaddr = ntohl(in->ifa_list->ifa_address); | ||
| 181 | |||
| 177 | rcu_read_unlock(); | 182 | rcu_read_unlock(); |
| 178 | } else { | 183 | } else { |
| 179 | local_ipaddr = ntohl(ifa->ifa_address); | 184 | local_ipaddr = ntohl(ifa->ifa_address); |
| @@ -185,6 +190,11 @@ int i40iw_inetaddr_event(struct notifier_block *notifier, | |||
| 185 | case NETDEV_UP: | 190 | case NETDEV_UP: |
| 186 | /* Fall through */ | 191 | /* Fall through */ |
| 187 | case NETDEV_CHANGEADDR: | 192 | case NETDEV_CHANGEADDR: |
| 193 | |||
| 194 | /* Just skip if no need to handle ARP cache */ | ||
| 195 | if (!local_ipaddr) | ||
| 196 | break; | ||
| 197 | |||
| 188 | i40iw_manage_arp_cache(iwdev, | 198 | i40iw_manage_arp_cache(iwdev, |
| 189 | netdev->dev_addr, | 199 | netdev->dev_addr, |
| 190 | &local_ipaddr, | 200 | &local_ipaddr, |
diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c index 782499abcd98..2a0b59a4b6eb 100644 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c | |||
| @@ -804,8 +804,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev) | |||
| 804 | unsigned long flags; | 804 | unsigned long flags; |
| 805 | 805 | ||
| 806 | for (i = 0 ; i < dev->num_ports; i++) { | 806 | for (i = 0 ; i < dev->num_ports; i++) { |
| 807 | cancel_delayed_work(&dev->sriov.alias_guid.ports_guid[i].alias_guid_work); | ||
| 808 | det = &sriov->alias_guid.ports_guid[i]; | 807 | det = &sriov->alias_guid.ports_guid[i]; |
| 808 | cancel_delayed_work_sync(&det->alias_guid_work); | ||
| 809 | spin_lock_irqsave(&sriov->alias_guid.ag_work_lock, flags); | 809 | spin_lock_irqsave(&sriov->alias_guid.ag_work_lock, flags); |
| 810 | while (!list_empty(&det->cb_list)) { | 810 | while (!list_empty(&det->cb_list)) { |
| 811 | cb_ctx = list_entry(det->cb_list.next, | 811 | cb_ctx = list_entry(det->cb_list.next, |
diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index eaa055007f28..9e08df7914aa 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | enum devx_obj_flags { | 21 | enum devx_obj_flags { |
| 22 | DEVX_OBJ_FLAGS_INDIRECT_MKEY = 1 << 0, | 22 | DEVX_OBJ_FLAGS_INDIRECT_MKEY = 1 << 0, |
| 23 | DEVX_OBJ_FLAGS_DCT = 1 << 1, | ||
| 23 | }; | 24 | }; |
| 24 | 25 | ||
| 25 | struct devx_async_data { | 26 | struct devx_async_data { |
| @@ -39,7 +40,10 @@ struct devx_obj { | |||
| 39 | u32 dinlen; /* destroy inbox length */ | 40 | u32 dinlen; /* destroy inbox length */ |
| 40 | u32 dinbox[MLX5_MAX_DESTROY_INBOX_SIZE_DW]; | 41 | u32 dinbox[MLX5_MAX_DESTROY_INBOX_SIZE_DW]; |
| 41 | u32 flags; | 42 | u32 flags; |
| 42 | struct mlx5_ib_devx_mr devx_mr; | 43 | union { |
| 44 | struct mlx5_ib_devx_mr devx_mr; | ||
| 45 | struct mlx5_core_dct core_dct; | ||
| 46 | }; | ||
| 43 | }; | 47 | }; |
| 44 | 48 | ||
| 45 | struct devx_umem { | 49 | struct devx_umem { |
| @@ -347,7 +351,6 @@ static u64 devx_get_obj_id(const void *in) | |||
| 347 | obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_RQ, | 351 | obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_RQ, |
| 348 | MLX5_GET(arm_rq_in, in, srq_number)); | 352 | MLX5_GET(arm_rq_in, in, srq_number)); |
| 349 | break; | 353 | break; |
| 350 | case MLX5_CMD_OP_DRAIN_DCT: | ||
| 351 | case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: | 354 | case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: |
| 352 | obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_DCT, | 355 | obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_DCT, |
| 353 | MLX5_GET(drain_dct_in, in, dctn)); | 356 | MLX5_GET(drain_dct_in, in, dctn)); |
| @@ -618,7 +621,6 @@ static bool devx_is_obj_modify_cmd(const void *in) | |||
| 618 | case MLX5_CMD_OP_2RST_QP: | 621 | case MLX5_CMD_OP_2RST_QP: |
| 619 | case MLX5_CMD_OP_ARM_XRC_SRQ: | 622 | case MLX5_CMD_OP_ARM_XRC_SRQ: |
| 620 | case MLX5_CMD_OP_ARM_RQ: | 623 | case MLX5_CMD_OP_ARM_RQ: |
| 621 | case MLX5_CMD_OP_DRAIN_DCT: | ||
| 622 | case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: | 624 | case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: |
| 623 | case MLX5_CMD_OP_ARM_XRQ: | 625 | case MLX5_CMD_OP_ARM_XRQ: |
| 624 | case MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY: | 626 | case MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY: |
| @@ -1124,7 +1126,11 @@ static int devx_obj_cleanup(struct ib_uobject *uobject, | |||
| 1124 | if (obj->flags & DEVX_OBJ_FLAGS_INDIRECT_MKEY) | 1126 | if (obj->flags & DEVX_OBJ_FLAGS_INDIRECT_MKEY) |
| 1125 | devx_cleanup_mkey(obj); | 1127 | devx_cleanup_mkey(obj); |
| 1126 | 1128 | ||
| 1127 | ret = mlx5_cmd_exec(obj->mdev, obj->dinbox, obj->dinlen, out, sizeof(out)); | 1129 | if (obj->flags & DEVX_OBJ_FLAGS_DCT) |
| 1130 | ret = mlx5_core_destroy_dct(obj->mdev, &obj->core_dct); | ||
| 1131 | else | ||
| 1132 | ret = mlx5_cmd_exec(obj->mdev, obj->dinbox, obj->dinlen, out, | ||
| 1133 | sizeof(out)); | ||
| 1128 | if (ib_is_destroy_retryable(ret, why, uobject)) | 1134 | if (ib_is_destroy_retryable(ret, why, uobject)) |
| 1129 | return ret; | 1135 | return ret; |
| 1130 | 1136 | ||
| @@ -1185,9 +1191,17 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)( | |||
| 1185 | devx_set_umem_valid(cmd_in); | 1191 | devx_set_umem_valid(cmd_in); |
| 1186 | } | 1192 | } |
| 1187 | 1193 | ||
| 1188 | err = mlx5_cmd_exec(dev->mdev, cmd_in, | 1194 | if (opcode == MLX5_CMD_OP_CREATE_DCT) { |
| 1189 | cmd_in_len, | 1195 | obj->flags |= DEVX_OBJ_FLAGS_DCT; |
| 1190 | cmd_out, cmd_out_len); | 1196 | err = mlx5_core_create_dct(dev->mdev, &obj->core_dct, |
| 1197 | cmd_in, cmd_in_len, | ||
| 1198 | cmd_out, cmd_out_len); | ||
| 1199 | } else { | ||
| 1200 | err = mlx5_cmd_exec(dev->mdev, cmd_in, | ||
| 1201 | cmd_in_len, | ||
| 1202 | cmd_out, cmd_out_len); | ||
| 1203 | } | ||
| 1204 | |||
| 1191 | if (err) | 1205 | if (err) |
| 1192 | goto obj_free; | 1206 | goto obj_free; |
| 1193 | 1207 | ||
| @@ -1214,7 +1228,11 @@ err_copy: | |||
| 1214 | if (obj->flags & DEVX_OBJ_FLAGS_INDIRECT_MKEY) | 1228 | if (obj->flags & DEVX_OBJ_FLAGS_INDIRECT_MKEY) |
| 1215 | devx_cleanup_mkey(obj); | 1229 | devx_cleanup_mkey(obj); |
| 1216 | obj_destroy: | 1230 | obj_destroy: |
| 1217 | mlx5_cmd_exec(obj->mdev, obj->dinbox, obj->dinlen, out, sizeof(out)); | 1231 | if (obj->flags & DEVX_OBJ_FLAGS_DCT) |
| 1232 | mlx5_core_destroy_dct(obj->mdev, &obj->core_dct); | ||
| 1233 | else | ||
| 1234 | mlx5_cmd_exec(obj->mdev, obj->dinbox, obj->dinlen, out, | ||
| 1235 | sizeof(out)); | ||
| 1218 | obj_free: | 1236 | obj_free: |
| 1219 | kfree(obj); | 1237 | kfree(obj); |
| 1220 | return err; | 1238 | return err; |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 994c19d01211..531ff20b32ad 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -415,10 +415,17 @@ static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u8 *active_speed, | |||
| 415 | *active_speed = IB_SPEED_EDR; | 415 | *active_speed = IB_SPEED_EDR; |
| 416 | break; | 416 | break; |
| 417 | case MLX5E_PROT_MASK(MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2): | 417 | case MLX5E_PROT_MASK(MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2): |
| 418 | *active_width = IB_WIDTH_2X; | ||
| 419 | *active_speed = IB_SPEED_EDR; | ||
| 420 | break; | ||
| 418 | case MLX5E_PROT_MASK(MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR): | 421 | case MLX5E_PROT_MASK(MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR): |
| 419 | *active_width = IB_WIDTH_1X; | 422 | *active_width = IB_WIDTH_1X; |
| 420 | *active_speed = IB_SPEED_HDR; | 423 | *active_speed = IB_SPEED_HDR; |
| 421 | break; | 424 | break; |
| 425 | case MLX5E_PROT_MASK(MLX5E_CAUI_4_100GBASE_CR4_KR4): | ||
| 426 | *active_width = IB_WIDTH_4X; | ||
| 427 | *active_speed = IB_SPEED_EDR; | ||
| 428 | break; | ||
| 422 | case MLX5E_PROT_MASK(MLX5E_100GAUI_2_100GBASE_CR2_KR2): | 429 | case MLX5E_PROT_MASK(MLX5E_100GAUI_2_100GBASE_CR2_KR2): |
| 423 | *active_width = IB_WIDTH_2X; | 430 | *active_width = IB_WIDTH_2X; |
| 424 | *active_speed = IB_SPEED_HDR; | 431 | *active_speed = IB_SPEED_HDR; |
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 6b1f0e76900b..7cd006da1dae 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
| @@ -3729,6 +3729,7 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
| 3729 | 3729 | ||
| 3730 | } else if (cur_state == IB_QPS_INIT && new_state == IB_QPS_RTR) { | 3730 | } else if (cur_state == IB_QPS_INIT && new_state == IB_QPS_RTR) { |
| 3731 | struct mlx5_ib_modify_qp_resp resp = {}; | 3731 | struct mlx5_ib_modify_qp_resp resp = {}; |
| 3732 | u32 out[MLX5_ST_SZ_DW(create_dct_out)] = {0}; | ||
| 3732 | u32 min_resp_len = offsetof(typeof(resp), dctn) + | 3733 | u32 min_resp_len = offsetof(typeof(resp), dctn) + |
| 3733 | sizeof(resp.dctn); | 3734 | sizeof(resp.dctn); |
| 3734 | 3735 | ||
| @@ -3747,7 +3748,8 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
| 3747 | MLX5_SET(dctc, dctc, hop_limit, attr->ah_attr.grh.hop_limit); | 3748 | MLX5_SET(dctc, dctc, hop_limit, attr->ah_attr.grh.hop_limit); |
| 3748 | 3749 | ||
| 3749 | err = mlx5_core_create_dct(dev->mdev, &qp->dct.mdct, qp->dct.in, | 3750 | err = mlx5_core_create_dct(dev->mdev, &qp->dct.mdct, qp->dct.in, |
| 3750 | MLX5_ST_SZ_BYTES(create_dct_in)); | 3751 | MLX5_ST_SZ_BYTES(create_dct_in), out, |
| 3752 | sizeof(out)); | ||
| 3751 | if (err) | 3753 | if (err) |
| 3752 | return err; | 3754 | return err; |
| 3753 | resp.dctn = qp->dct.mdct.mqp.qpn; | 3755 | resp.dctn = qp->dct.mdct.mqp.qpn; |
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index b319e51c379b..21cb088d6687 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
| @@ -2608,7 +2608,12 @@ static int map_sg(struct device *dev, struct scatterlist *sglist, | |||
| 2608 | 2608 | ||
| 2609 | /* Everything is mapped - write the right values into s->dma_address */ | 2609 | /* Everything is mapped - write the right values into s->dma_address */ |
| 2610 | for_each_sg(sglist, s, nelems, i) { | 2610 | for_each_sg(sglist, s, nelems, i) { |
| 2611 | s->dma_address += address + s->offset; | 2611 | /* |
| 2612 | * Add in the remaining piece of the scatter-gather offset that | ||
| 2613 | * was masked out when we were determining the physical address | ||
| 2614 | * via (sg_phys(s) & PAGE_MASK) earlier. | ||
| 2615 | */ | ||
| 2616 | s->dma_address += address + (s->offset & ~PAGE_MASK); | ||
| 2612 | s->dma_length = s->length; | 2617 | s->dma_length = s->length; |
| 2613 | } | 2618 | } |
| 2614 | 2619 | ||
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 87274b54febd..28cb713d728c 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
| @@ -1538,6 +1538,9 @@ static void iommu_disable_protect_mem_regions(struct intel_iommu *iommu) | |||
| 1538 | u32 pmen; | 1538 | u32 pmen; |
| 1539 | unsigned long flags; | 1539 | unsigned long flags; |
| 1540 | 1540 | ||
| 1541 | if (!cap_plmr(iommu->cap) && !cap_phmr(iommu->cap)) | ||
| 1542 | return; | ||
| 1543 | |||
| 1541 | raw_spin_lock_irqsave(&iommu->register_lock, flags); | 1544 | raw_spin_lock_irqsave(&iommu->register_lock, flags); |
| 1542 | pmen = readl(iommu->reg + DMAR_PMEN_REG); | 1545 | pmen = readl(iommu->reg + DMAR_PMEN_REG); |
| 1543 | pmen &= ~DMA_PMEN_EPM; | 1546 | pmen &= ~DMA_PMEN_EPM; |
| @@ -5332,7 +5335,7 @@ int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sd | |||
| 5332 | 5335 | ||
| 5333 | ctx_lo = context[0].lo; | 5336 | ctx_lo = context[0].lo; |
| 5334 | 5337 | ||
| 5335 | sdev->did = domain->iommu_did[iommu->seq_id]; | 5338 | sdev->did = FLPT_DEFAULT_DID; |
| 5336 | sdev->sid = PCI_DEVID(info->bus, info->devfn); | 5339 | sdev->sid = PCI_DEVID(info->bus, info->devfn); |
| 5337 | 5340 | ||
| 5338 | if (!(ctx_lo & CONTEXT_PASIDE)) { | 5341 | if (!(ctx_lo & CONTEXT_PASIDE)) { |
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index f8d3ba247523..2de8122e218f 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c | |||
| @@ -207,8 +207,10 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad, | |||
| 207 | curr_iova = rb_entry(curr, struct iova, node); | 207 | curr_iova = rb_entry(curr, struct iova, node); |
| 208 | } while (curr && new_pfn <= curr_iova->pfn_hi); | 208 | } while (curr && new_pfn <= curr_iova->pfn_hi); |
| 209 | 209 | ||
| 210 | if (limit_pfn < size || new_pfn < iovad->start_pfn) | 210 | if (limit_pfn < size || new_pfn < iovad->start_pfn) { |
| 211 | iovad->max32_alloc_size = size; | ||
| 211 | goto iova32_full; | 212 | goto iova32_full; |
| 213 | } | ||
| 212 | 214 | ||
| 213 | /* pfn_lo will point to size aligned address if size_aligned is set */ | 215 | /* pfn_lo will point to size aligned address if size_aligned is set */ |
| 214 | new->pfn_lo = new_pfn; | 216 | new->pfn_lo = new_pfn; |
| @@ -222,7 +224,6 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad, | |||
| 222 | return 0; | 224 | return 0; |
| 223 | 225 | ||
| 224 | iova32_full: | 226 | iova32_full: |
| 225 | iovad->max32_alloc_size = size; | ||
| 226 | spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags); | 227 | spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags); |
| 227 | return -ENOMEM; | 228 | return -ENOMEM; |
| 228 | } | 229 | } |
diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c index 83364fedbf0a..5e4ca139e4ea 100644 --- a/drivers/irqchip/irq-brcmstb-l2.c +++ b/drivers/irqchip/irq-brcmstb-l2.c | |||
| @@ -275,14 +275,14 @@ out_free: | |||
| 275 | return ret; | 275 | return ret; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | int __init brcmstb_l2_edge_intc_of_init(struct device_node *np, | 278 | static int __init brcmstb_l2_edge_intc_of_init(struct device_node *np, |
| 279 | struct device_node *parent) | 279 | struct device_node *parent) |
| 280 | { | 280 | { |
| 281 | return brcmstb_l2_intc_of_init(np, parent, &l2_edge_intc_init); | 281 | return brcmstb_l2_intc_of_init(np, parent, &l2_edge_intc_init); |
| 282 | } | 282 | } |
| 283 | IRQCHIP_DECLARE(brcmstb_l2_intc, "brcm,l2-intc", brcmstb_l2_edge_intc_of_init); | 283 | IRQCHIP_DECLARE(brcmstb_l2_intc, "brcm,l2-intc", brcmstb_l2_edge_intc_of_init); |
| 284 | 284 | ||
| 285 | int __init brcmstb_l2_lvl_intc_of_init(struct device_node *np, | 285 | static int __init brcmstb_l2_lvl_intc_of_init(struct device_node *np, |
| 286 | struct device_node *parent) | 286 | struct device_node *parent) |
| 287 | { | 287 | { |
| 288 | return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init); | 288 | return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init); |
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 2dd1ff0cf558..7577755bdcf4 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c | |||
| @@ -1482,7 +1482,7 @@ static int lpi_range_cmp(void *priv, struct list_head *a, struct list_head *b) | |||
| 1482 | ra = container_of(a, struct lpi_range, entry); | 1482 | ra = container_of(a, struct lpi_range, entry); |
| 1483 | rb = container_of(b, struct lpi_range, entry); | 1483 | rb = container_of(b, struct lpi_range, entry); |
| 1484 | 1484 | ||
| 1485 | return rb->base_id - ra->base_id; | 1485 | return ra->base_id - rb->base_id; |
| 1486 | } | 1486 | } |
| 1487 | 1487 | ||
| 1488 | static void merge_lpi_ranges(void) | 1488 | static void merge_lpi_ranges(void) |
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index ba2a37a27a54..fd3110c171ba 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
| @@ -1089,11 +1089,10 @@ static void gic_init_chip(struct gic_chip_data *gic, struct device *dev, | |||
| 1089 | #endif | 1089 | #endif |
| 1090 | } | 1090 | } |
| 1091 | 1091 | ||
| 1092 | static int gic_init_bases(struct gic_chip_data *gic, int irq_start, | 1092 | static int gic_init_bases(struct gic_chip_data *gic, |
| 1093 | struct fwnode_handle *handle) | 1093 | struct fwnode_handle *handle) |
| 1094 | { | 1094 | { |
| 1095 | irq_hw_number_t hwirq_base; | 1095 | int gic_irqs, ret; |
| 1096 | int gic_irqs, irq_base, ret; | ||
| 1097 | 1096 | ||
| 1098 | if (IS_ENABLED(CONFIG_GIC_NON_BANKED) && gic->percpu_offset) { | 1097 | if (IS_ENABLED(CONFIG_GIC_NON_BANKED) && gic->percpu_offset) { |
| 1099 | /* Frankein-GIC without banked registers... */ | 1098 | /* Frankein-GIC without banked registers... */ |
| @@ -1145,28 +1144,21 @@ static int gic_init_bases(struct gic_chip_data *gic, int irq_start, | |||
| 1145 | } else { /* Legacy support */ | 1144 | } else { /* Legacy support */ |
| 1146 | /* | 1145 | /* |
| 1147 | * For primary GICs, skip over SGIs. | 1146 | * For primary GICs, skip over SGIs. |
| 1148 | * For secondary GICs, skip over PPIs, too. | 1147 | * No secondary GIC support whatsoever. |
| 1149 | */ | 1148 | */ |
| 1150 | if (gic == &gic_data[0] && (irq_start & 31) > 0) { | 1149 | int irq_base; |
| 1151 | hwirq_base = 16; | ||
| 1152 | if (irq_start != -1) | ||
| 1153 | irq_start = (irq_start & ~31) + 16; | ||
| 1154 | } else { | ||
| 1155 | hwirq_base = 32; | ||
| 1156 | } | ||
| 1157 | 1150 | ||
| 1158 | gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */ | 1151 | gic_irqs -= 16; /* calculate # of irqs to allocate */ |
| 1159 | 1152 | ||
| 1160 | irq_base = irq_alloc_descs(irq_start, 16, gic_irqs, | 1153 | irq_base = irq_alloc_descs(16, 16, gic_irqs, |
| 1161 | numa_node_id()); | 1154 | numa_node_id()); |
| 1162 | if (irq_base < 0) { | 1155 | if (irq_base < 0) { |
| 1163 | WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n", | 1156 | WARN(1, "Cannot allocate irq_descs @ IRQ16, assuming pre-allocated\n"); |
| 1164 | irq_start); | 1157 | irq_base = 16; |
| 1165 | irq_base = irq_start; | ||
| 1166 | } | 1158 | } |
| 1167 | 1159 | ||
| 1168 | gic->domain = irq_domain_add_legacy(NULL, gic_irqs, irq_base, | 1160 | gic->domain = irq_domain_add_legacy(NULL, gic_irqs, irq_base, |
| 1169 | hwirq_base, &gic_irq_domain_ops, gic); | 1161 | 16, &gic_irq_domain_ops, gic); |
| 1170 | } | 1162 | } |
| 1171 | 1163 | ||
| 1172 | if (WARN_ON(!gic->domain)) { | 1164 | if (WARN_ON(!gic->domain)) { |
| @@ -1195,7 +1187,6 @@ error: | |||
| 1195 | } | 1187 | } |
| 1196 | 1188 | ||
| 1197 | static int __init __gic_init_bases(struct gic_chip_data *gic, | 1189 | static int __init __gic_init_bases(struct gic_chip_data *gic, |
| 1198 | int irq_start, | ||
| 1199 | struct fwnode_handle *handle) | 1190 | struct fwnode_handle *handle) |
| 1200 | { | 1191 | { |
| 1201 | char *name; | 1192 | char *name; |
| @@ -1231,32 +1222,28 @@ static int __init __gic_init_bases(struct gic_chip_data *gic, | |||
| 1231 | gic_init_chip(gic, NULL, name, false); | 1222 | gic_init_chip(gic, NULL, name, false); |
| 1232 | } | 1223 | } |
| 1233 | 1224 | ||
| 1234 | ret = gic_init_bases(gic, irq_start, handle); | 1225 | ret = gic_init_bases(gic, handle); |
| 1235 | if (ret) | 1226 | if (ret) |
| 1236 | kfree(name); | 1227 | kfree(name); |
| 1237 | 1228 | ||
| 1238 | return ret; | 1229 | return ret; |
| 1239 | } | 1230 | } |
| 1240 | 1231 | ||
| 1241 | void __init gic_init(unsigned int gic_nr, int irq_start, | 1232 | void __init gic_init(void __iomem *dist_base, void __iomem *cpu_base) |
| 1242 | void __iomem *dist_base, void __iomem *cpu_base) | ||
| 1243 | { | 1233 | { |
| 1244 | struct gic_chip_data *gic; | 1234 | struct gic_chip_data *gic; |
| 1245 | 1235 | ||
| 1246 | if (WARN_ON(gic_nr >= CONFIG_ARM_GIC_MAX_NR)) | ||
| 1247 | return; | ||
| 1248 | |||
| 1249 | /* | 1236 | /* |
| 1250 | * Non-DT/ACPI systems won't run a hypervisor, so let's not | 1237 | * Non-DT/ACPI systems won't run a hypervisor, so let's not |
| 1251 | * bother with these... | 1238 | * bother with these... |
| 1252 | */ | 1239 | */ |
| 1253 | static_branch_disable(&supports_deactivate_key); | 1240 | static_branch_disable(&supports_deactivate_key); |
| 1254 | 1241 | ||
| 1255 | gic = &gic_data[gic_nr]; | 1242 | gic = &gic_data[0]; |
| 1256 | gic->raw_dist_base = dist_base; | 1243 | gic->raw_dist_base = dist_base; |
| 1257 | gic->raw_cpu_base = cpu_base; | 1244 | gic->raw_cpu_base = cpu_base; |
| 1258 | 1245 | ||
| 1259 | __gic_init_bases(gic, irq_start, NULL); | 1246 | __gic_init_bases(gic, NULL); |
| 1260 | } | 1247 | } |
| 1261 | 1248 | ||
| 1262 | static void gic_teardown(struct gic_chip_data *gic) | 1249 | static void gic_teardown(struct gic_chip_data *gic) |
| @@ -1399,7 +1386,7 @@ int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq) | |||
| 1399 | if (ret) | 1386 | if (ret) |
| 1400 | return ret; | 1387 | return ret; |
| 1401 | 1388 | ||
| 1402 | ret = gic_init_bases(*gic, -1, &dev->of_node->fwnode); | 1389 | ret = gic_init_bases(*gic, &dev->of_node->fwnode); |
| 1403 | if (ret) { | 1390 | if (ret) { |
| 1404 | gic_teardown(*gic); | 1391 | gic_teardown(*gic); |
| 1405 | return ret; | 1392 | return ret; |
| @@ -1459,7 +1446,7 @@ gic_of_init(struct device_node *node, struct device_node *parent) | |||
| 1459 | if (gic_cnt == 0 && !gic_check_eoimode(node, &gic->raw_cpu_base)) | 1446 | if (gic_cnt == 0 && !gic_check_eoimode(node, &gic->raw_cpu_base)) |
| 1460 | static_branch_disable(&supports_deactivate_key); | 1447 | static_branch_disable(&supports_deactivate_key); |
| 1461 | 1448 | ||
| 1462 | ret = __gic_init_bases(gic, -1, &node->fwnode); | 1449 | ret = __gic_init_bases(gic, &node->fwnode); |
| 1463 | if (ret) { | 1450 | if (ret) { |
| 1464 | gic_teardown(gic); | 1451 | gic_teardown(gic); |
| 1465 | return ret; | 1452 | return ret; |
| @@ -1650,7 +1637,7 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header, | |||
| 1650 | return -ENOMEM; | 1637 | return -ENOMEM; |
| 1651 | } | 1638 | } |
| 1652 | 1639 | ||
| 1653 | ret = __gic_init_bases(gic, -1, domain_handle); | 1640 | ret = __gic_init_bases(gic, domain_handle); |
| 1654 | if (ret) { | 1641 | if (ret) { |
| 1655 | pr_err("Failed to initialise GIC\n"); | 1642 | pr_err("Failed to initialise GIC\n"); |
| 1656 | irq_domain_free_fwnode(domain_handle); | 1643 | irq_domain_free_fwnode(domain_handle); |
diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c index d1098f4da6a4..88df3d00052c 100644 --- a/drivers/irqchip/irq-imx-irqsteer.c +++ b/drivers/irqchip/irq-imx-irqsteer.c | |||
| @@ -169,8 +169,12 @@ static int imx_irqsteer_probe(struct platform_device *pdev) | |||
| 169 | 169 | ||
| 170 | raw_spin_lock_init(&data->lock); | 170 | raw_spin_lock_init(&data->lock); |
| 171 | 171 | ||
| 172 | of_property_read_u32(np, "fsl,num-irqs", &irqs_num); | 172 | ret = of_property_read_u32(np, "fsl,num-irqs", &irqs_num); |
| 173 | of_property_read_u32(np, "fsl,channel", &data->channel); | 173 | if (ret) |
| 174 | return ret; | ||
| 175 | ret = of_property_read_u32(np, "fsl,channel", &data->channel); | ||
| 176 | if (ret) | ||
| 177 | return ret; | ||
| 174 | 178 | ||
| 175 | /* | 179 | /* |
| 176 | * There is one output irq for each group of 64 inputs. | 180 | * There is one output irq for each group of 64 inputs. |
diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index 567b29c47608..98b6e1d4b1a6 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c | |||
| @@ -161,6 +161,9 @@ static void mbigen_write_msg(struct msi_desc *desc, struct msi_msg *msg) | |||
| 161 | void __iomem *base = d->chip_data; | 161 | void __iomem *base = d->chip_data; |
| 162 | u32 val; | 162 | u32 val; |
| 163 | 163 | ||
| 164 | if (!msg->address_lo && !msg->address_hi) | ||
| 165 | return; | ||
| 166 | |||
| 164 | base += get_mbigen_vec_reg(d->hwirq); | 167 | base += get_mbigen_vec_reg(d->hwirq); |
| 165 | val = readl_relaxed(base); | 168 | val = readl_relaxed(base); |
| 166 | 169 | ||
diff --git a/drivers/irqchip/irq-mmp.c b/drivers/irqchip/irq-mmp.c index 3496b61a312a..8eed478f3b7e 100644 --- a/drivers/irqchip/irq-mmp.c +++ b/drivers/irqchip/irq-mmp.c | |||
| @@ -179,7 +179,7 @@ static int mmp_irq_domain_xlate(struct irq_domain *d, struct device_node *node, | |||
| 179 | return 0; | 179 | return 0; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | const struct irq_domain_ops mmp_irq_domain_ops = { | 182 | static const struct irq_domain_ops mmp_irq_domain_ops = { |
| 183 | .map = mmp_irq_domain_map, | 183 | .map = mmp_irq_domain_map, |
| 184 | .xlate = mmp_irq_domain_xlate, | 184 | .xlate = mmp_irq_domain_xlate, |
| 185 | }; | 185 | }; |
diff --git a/drivers/irqchip/irq-mvebu-sei.c b/drivers/irqchip/irq-mvebu-sei.c index add4c9c934c8..18832ccc8ff8 100644 --- a/drivers/irqchip/irq-mvebu-sei.c +++ b/drivers/irqchip/irq-mvebu-sei.c | |||
| @@ -478,7 +478,7 @@ dispose_irq: | |||
| 478 | return ret; | 478 | return ret; |
| 479 | } | 479 | } |
| 480 | 480 | ||
| 481 | struct mvebu_sei_caps mvebu_sei_ap806_caps = { | 481 | static struct mvebu_sei_caps mvebu_sei_ap806_caps = { |
| 482 | .ap_range = { | 482 | .ap_range = { |
| 483 | .first = 0, | 483 | .first = 0, |
| 484 | .size = 21, | 484 | .size = 21, |
diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c index a93296b9b45d..7bd1d4cb2e19 100644 --- a/drivers/irqchip/irq-stm32-exti.c +++ b/drivers/irqchip/irq-stm32-exti.c | |||
| @@ -716,7 +716,6 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data, | |||
| 716 | const struct stm32_exti_bank *stm32_bank; | 716 | const struct stm32_exti_bank *stm32_bank; |
| 717 | struct stm32_exti_chip_data *chip_data; | 717 | struct stm32_exti_chip_data *chip_data; |
| 718 | void __iomem *base = h_data->base; | 718 | void __iomem *base = h_data->base; |
| 719 | u32 irqs_mask; | ||
| 720 | 719 | ||
| 721 | stm32_bank = h_data->drv_data->exti_banks[bank_idx]; | 720 | stm32_bank = h_data->drv_data->exti_banks[bank_idx]; |
| 722 | chip_data = &h_data->chips_data[bank_idx]; | 721 | chip_data = &h_data->chips_data[bank_idx]; |
| @@ -725,21 +724,12 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data, | |||
| 725 | 724 | ||
| 726 | raw_spin_lock_init(&chip_data->rlock); | 725 | raw_spin_lock_init(&chip_data->rlock); |
| 727 | 726 | ||
| 728 | /* Determine number of irqs supported */ | ||
| 729 | writel_relaxed(~0UL, base + stm32_bank->rtsr_ofst); | ||
| 730 | irqs_mask = readl_relaxed(base + stm32_bank->rtsr_ofst); | ||
| 731 | |||
| 732 | /* | 727 | /* |
| 733 | * This IP has no reset, so after hot reboot we should | 728 | * This IP has no reset, so after hot reboot we should |
| 734 | * clear registers to avoid residue | 729 | * clear registers to avoid residue |
| 735 | */ | 730 | */ |
| 736 | writel_relaxed(0, base + stm32_bank->imr_ofst); | 731 | writel_relaxed(0, base + stm32_bank->imr_ofst); |
| 737 | writel_relaxed(0, base + stm32_bank->emr_ofst); | 732 | writel_relaxed(0, base + stm32_bank->emr_ofst); |
| 738 | writel_relaxed(0, base + stm32_bank->rtsr_ofst); | ||
| 739 | writel_relaxed(0, base + stm32_bank->ftsr_ofst); | ||
| 740 | writel_relaxed(~0UL, base + stm32_bank->rpr_ofst); | ||
| 741 | if (stm32_bank->fpr_ofst != UNDEF_REG) | ||
| 742 | writel_relaxed(~0UL, base + stm32_bank->fpr_ofst); | ||
| 743 | 733 | ||
| 744 | pr_info("%pOF: bank%d\n", h_data->node, bank_idx); | 734 | pr_info("%pOF: bank%d\n", h_data->node, bank_idx); |
| 745 | 735 | ||
diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c index c712b7deb3a9..82a97866e0cf 100644 --- a/drivers/mmc/host/alcor.c +++ b/drivers/mmc/host/alcor.c | |||
| @@ -1044,14 +1044,27 @@ static void alcor_init_mmc(struct alcor_sdmmc_host *host) | |||
| 1044 | mmc->caps2 = MMC_CAP2_NO_SDIO; | 1044 | mmc->caps2 = MMC_CAP2_NO_SDIO; |
| 1045 | mmc->ops = &alcor_sdc_ops; | 1045 | mmc->ops = &alcor_sdc_ops; |
| 1046 | 1046 | ||
| 1047 | /* Hardware cannot do scatter lists */ | 1047 | /* The hardware does DMA data transfer of 4096 bytes to/from a single |
| 1048 | * buffer address. Scatterlists are not supported, but upon DMA | ||
| 1049 | * completion (signalled via IRQ), the original vendor driver does | ||
| 1050 | * then immediately set up another DMA transfer of the next 4096 | ||
| 1051 | * bytes. | ||
| 1052 | * | ||
| 1053 | * This means that we need to handle the I/O in 4096 byte chunks. | ||
| 1054 | * Lacking a way to limit the sglist entries to 4096 bytes, we instead | ||
| 1055 | * impose that only one segment is provided, with maximum size 4096, | ||
| 1056 | * which also happens to be the minimum size. This means that the | ||
| 1057 | * single-entry sglist handled by this driver can be handed directly | ||
| 1058 | * to the hardware, nice and simple. | ||
| 1059 | * | ||
| 1060 | * Unfortunately though, that means we only do 4096 bytes I/O per | ||
| 1061 | * MMC command. A future improvement would be to make the driver | ||
| 1062 | * accept sg lists and entries of any size, and simply iterate | ||
| 1063 | * through them 4096 bytes at a time. | ||
| 1064 | */ | ||
| 1048 | mmc->max_segs = AU6601_MAX_DMA_SEGMENTS; | 1065 | mmc->max_segs = AU6601_MAX_DMA_SEGMENTS; |
| 1049 | mmc->max_seg_size = AU6601_MAX_DMA_BLOCK_SIZE; | 1066 | mmc->max_seg_size = AU6601_MAX_DMA_BLOCK_SIZE; |
| 1050 | 1067 | mmc->max_req_size = mmc->max_seg_size; | |
| 1051 | mmc->max_blk_size = mmc->max_seg_size; | ||
| 1052 | mmc->max_blk_count = mmc->max_segs; | ||
| 1053 | |||
| 1054 | mmc->max_req_size = mmc->max_seg_size * mmc->max_segs; | ||
| 1055 | } | 1068 | } |
| 1056 | 1069 | ||
| 1057 | static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev) | 1070 | static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev) |
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 49e0daf2ef5e..f37003df1e01 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c | |||
| @@ -1117,7 +1117,7 @@ static inline void mmc_davinci_cpufreq_deregister(struct mmc_davinci_host *host) | |||
| 1117 | { | 1117 | { |
| 1118 | } | 1118 | } |
| 1119 | #endif | 1119 | #endif |
| 1120 | static void __init init_mmcsd_host(struct mmc_davinci_host *host) | 1120 | static void init_mmcsd_host(struct mmc_davinci_host *host) |
| 1121 | { | 1121 | { |
| 1122 | 1122 | ||
| 1123 | mmc_davinci_reset_ctrl(host, 1); | 1123 | mmc_davinci_reset_ctrl(host, 1); |
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index d54612257b06..45f7b9b53d48 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c | |||
| @@ -290,11 +290,8 @@ static void mxcmci_swap_buffers(struct mmc_data *data) | |||
| 290 | struct scatterlist *sg; | 290 | struct scatterlist *sg; |
| 291 | int i; | 291 | int i; |
| 292 | 292 | ||
| 293 | for_each_sg(data->sg, sg, data->sg_len, i) { | 293 | for_each_sg(data->sg, sg, data->sg_len, i) |
| 294 | void *buf = kmap_atomic(sg_page(sg) + sg->offset); | 294 | buffer_swap32(sg_virt(sg), sg->length); |
| 295 | buffer_swap32(buf, sg->length); | ||
| 296 | kunmap_atomic(buf); | ||
| 297 | } | ||
| 298 | } | 295 | } |
| 299 | #else | 296 | #else |
| 300 | static inline void mxcmci_swap_buffers(struct mmc_data *data) {} | 297 | static inline void mxcmci_swap_buffers(struct mmc_data *data) {} |
| @@ -611,7 +608,6 @@ static int mxcmci_transfer_data(struct mxcmci_host *host) | |||
| 611 | { | 608 | { |
| 612 | struct mmc_data *data = host->req->data; | 609 | struct mmc_data *data = host->req->data; |
| 613 | struct scatterlist *sg; | 610 | struct scatterlist *sg; |
| 614 | void *buf; | ||
| 615 | int stat, i; | 611 | int stat, i; |
| 616 | 612 | ||
| 617 | host->data = data; | 613 | host->data = data; |
| @@ -619,18 +615,14 @@ static int mxcmci_transfer_data(struct mxcmci_host *host) | |||
| 619 | 615 | ||
| 620 | if (data->flags & MMC_DATA_READ) { | 616 | if (data->flags & MMC_DATA_READ) { |
| 621 | for_each_sg(data->sg, sg, data->sg_len, i) { | 617 | for_each_sg(data->sg, sg, data->sg_len, i) { |
| 622 | buf = kmap_atomic(sg_page(sg) + sg->offset); | 618 | stat = mxcmci_pull(host, sg_virt(sg), sg->length); |
| 623 | stat = mxcmci_pull(host, buf, sg->length); | ||
| 624 | kunmap(buf); | ||
| 625 | if (stat) | 619 | if (stat) |
| 626 | return stat; | 620 | return stat; |
| 627 | host->datasize += sg->length; | 621 | host->datasize += sg->length; |
| 628 | } | 622 | } |
| 629 | } else { | 623 | } else { |
| 630 | for_each_sg(data->sg, sg, data->sg_len, i) { | 624 | for_each_sg(data->sg, sg, data->sg_len, i) { |
| 631 | buf = kmap_atomic(sg_page(sg) + sg->offset); | 625 | stat = mxcmci_push(host, sg_virt(sg), sg->length); |
| 632 | stat = mxcmci_push(host, buf, sg->length); | ||
| 633 | kunmap(buf); | ||
| 634 | if (stat) | 626 | if (stat) |
| 635 | return stat; | 627 | return stat; |
| 636 | host->datasize += sg->length; | 628 | host->datasize += sg->length; |
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index c907bf502a12..c1d3f0e38921 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c | |||
| @@ -162,7 +162,7 @@ static void pxamci_dma_irq(void *param); | |||
| 162 | static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) | 162 | static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) |
| 163 | { | 163 | { |
| 164 | struct dma_async_tx_descriptor *tx; | 164 | struct dma_async_tx_descriptor *tx; |
| 165 | enum dma_data_direction direction; | 165 | enum dma_transfer_direction direction; |
| 166 | struct dma_slave_config config; | 166 | struct dma_slave_config config; |
| 167 | struct dma_chan *chan; | 167 | struct dma_chan *chan; |
| 168 | unsigned int nob = data->blocks; | 168 | unsigned int nob = data->blocks; |
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 71e13844df6c..8742e27e4e8b 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c | |||
| @@ -641,6 +641,7 @@ int renesas_sdhi_probe(struct platform_device *pdev, | |||
| 641 | struct renesas_sdhi *priv; | 641 | struct renesas_sdhi *priv; |
| 642 | struct resource *res; | 642 | struct resource *res; |
| 643 | int irq, ret, i; | 643 | int irq, ret, i; |
| 644 | u16 ver; | ||
| 644 | 645 | ||
| 645 | of_data = of_device_get_match_data(&pdev->dev); | 646 | of_data = of_device_get_match_data(&pdev->dev); |
| 646 | 647 | ||
| @@ -773,12 +774,17 @@ int renesas_sdhi_probe(struct platform_device *pdev, | |||
| 773 | if (ret) | 774 | if (ret) |
| 774 | goto efree; | 775 | goto efree; |
| 775 | 776 | ||
| 777 | ver = sd_ctrl_read16(host, CTL_VERSION); | ||
| 778 | /* GEN2_SDR104 is first known SDHI to use 32bit block count */ | ||
| 779 | if (ver < SDHI_VER_GEN2_SDR104 && mmc_data->max_blk_count > U16_MAX) | ||
| 780 | mmc_data->max_blk_count = U16_MAX; | ||
| 781 | |||
| 776 | ret = tmio_mmc_host_probe(host); | 782 | ret = tmio_mmc_host_probe(host); |
| 777 | if (ret < 0) | 783 | if (ret < 0) |
| 778 | goto edisclk; | 784 | goto edisclk; |
| 779 | 785 | ||
| 780 | /* One Gen2 SDHI incarnation does NOT have a CBSY bit */ | 786 | /* One Gen2 SDHI incarnation does NOT have a CBSY bit */ |
| 781 | if (sd_ctrl_read16(host, CTL_VERSION) == SDHI_VER_GEN2_SDR50) | 787 | if (ver == SDHI_VER_GEN2_SDR50) |
| 782 | mmc_data->flags &= ~TMIO_MMC_HAVE_CBSY; | 788 | mmc_data->flags &= ~TMIO_MMC_HAVE_CBSY; |
| 783 | 789 | ||
| 784 | /* Enable tuning iff we have an SCC and a supported mode */ | 790 | /* Enable tuning iff we have an SCC and a supported mode */ |
diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index b1a66ca3821a..5bbed477c9b1 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c | |||
| @@ -1056,6 +1056,9 @@ static int sdhci_omap_probe(struct platform_device *pdev) | |||
| 1056 | mmc->f_max = 48000000; | 1056 | mmc->f_max = 48000000; |
| 1057 | } | 1057 | } |
| 1058 | 1058 | ||
| 1059 | if (!mmc_can_gpio_ro(mmc)) | ||
| 1060 | mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT; | ||
| 1061 | |||
| 1059 | pltfm_host->clk = devm_clk_get(dev, "fck"); | 1062 | pltfm_host->clk = devm_clk_get(dev, "fck"); |
| 1060 | if (IS_ERR(pltfm_host->clk)) { | 1063 | if (IS_ERR(pltfm_host->clk)) { |
| 1061 | ret = PTR_ERR(pltfm_host->clk); | 1064 | ret = PTR_ERR(pltfm_host->clk); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/qp.c b/drivers/net/ethernet/mellanox/mlx5/core/qp.c index 370ca94b6775..b8ba74de9555 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/qp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/qp.c | |||
| @@ -40,6 +40,9 @@ | |||
| 40 | #include "mlx5_core.h" | 40 | #include "mlx5_core.h" |
| 41 | #include "lib/eq.h" | 41 | #include "lib/eq.h" |
| 42 | 42 | ||
| 43 | static int mlx5_core_drain_dct(struct mlx5_core_dev *dev, | ||
| 44 | struct mlx5_core_dct *dct); | ||
| 45 | |||
| 43 | static struct mlx5_core_rsc_common * | 46 | static struct mlx5_core_rsc_common * |
| 44 | mlx5_get_rsc(struct mlx5_qp_table *table, u32 rsn) | 47 | mlx5_get_rsc(struct mlx5_qp_table *table, u32 rsn) |
| 45 | { | 48 | { |
| @@ -227,20 +230,49 @@ static void destroy_resource_common(struct mlx5_core_dev *dev, | |||
| 227 | wait_for_completion(&qp->common.free); | 230 | wait_for_completion(&qp->common.free); |
| 228 | } | 231 | } |
| 229 | 232 | ||
| 233 | static int _mlx5_core_destroy_dct(struct mlx5_core_dev *dev, | ||
| 234 | struct mlx5_core_dct *dct, bool need_cleanup) | ||
| 235 | { | ||
| 236 | u32 out[MLX5_ST_SZ_DW(destroy_dct_out)] = {0}; | ||
| 237 | u32 in[MLX5_ST_SZ_DW(destroy_dct_in)] = {0}; | ||
| 238 | struct mlx5_core_qp *qp = &dct->mqp; | ||
| 239 | int err; | ||
| 240 | |||
| 241 | err = mlx5_core_drain_dct(dev, dct); | ||
| 242 | if (err) { | ||
| 243 | if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { | ||
| 244 | goto destroy; | ||
| 245 | } else { | ||
| 246 | mlx5_core_warn( | ||
| 247 | dev, "failed drain DCT 0x%x with error 0x%x\n", | ||
| 248 | qp->qpn, err); | ||
| 249 | return err; | ||
| 250 | } | ||
| 251 | } | ||
| 252 | wait_for_completion(&dct->drained); | ||
| 253 | destroy: | ||
| 254 | if (need_cleanup) | ||
| 255 | destroy_resource_common(dev, &dct->mqp); | ||
| 256 | MLX5_SET(destroy_dct_in, in, opcode, MLX5_CMD_OP_DESTROY_DCT); | ||
| 257 | MLX5_SET(destroy_dct_in, in, dctn, qp->qpn); | ||
| 258 | MLX5_SET(destroy_dct_in, in, uid, qp->uid); | ||
| 259 | err = mlx5_cmd_exec(dev, (void *)&in, sizeof(in), | ||
| 260 | (void *)&out, sizeof(out)); | ||
| 261 | return err; | ||
| 262 | } | ||
| 263 | |||
| 230 | int mlx5_core_create_dct(struct mlx5_core_dev *dev, | 264 | int mlx5_core_create_dct(struct mlx5_core_dev *dev, |
| 231 | struct mlx5_core_dct *dct, | 265 | struct mlx5_core_dct *dct, |
| 232 | u32 *in, int inlen) | 266 | u32 *in, int inlen, |
| 267 | u32 *out, int outlen) | ||
| 233 | { | 268 | { |
| 234 | u32 out[MLX5_ST_SZ_DW(create_dct_out)] = {0}; | ||
| 235 | u32 din[MLX5_ST_SZ_DW(destroy_dct_in)] = {0}; | ||
| 236 | u32 dout[MLX5_ST_SZ_DW(destroy_dct_out)] = {0}; | ||
| 237 | struct mlx5_core_qp *qp = &dct->mqp; | 269 | struct mlx5_core_qp *qp = &dct->mqp; |
| 238 | int err; | 270 | int err; |
| 239 | 271 | ||
| 240 | init_completion(&dct->drained); | 272 | init_completion(&dct->drained); |
| 241 | MLX5_SET(create_dct_in, in, opcode, MLX5_CMD_OP_CREATE_DCT); | 273 | MLX5_SET(create_dct_in, in, opcode, MLX5_CMD_OP_CREATE_DCT); |
| 242 | 274 | ||
| 243 | err = mlx5_cmd_exec(dev, in, inlen, &out, sizeof(out)); | 275 | err = mlx5_cmd_exec(dev, in, inlen, out, outlen); |
| 244 | if (err) { | 276 | if (err) { |
| 245 | mlx5_core_warn(dev, "create DCT failed, ret %d\n", err); | 277 | mlx5_core_warn(dev, "create DCT failed, ret %d\n", err); |
| 246 | return err; | 278 | return err; |
| @@ -254,11 +286,7 @@ int mlx5_core_create_dct(struct mlx5_core_dev *dev, | |||
| 254 | 286 | ||
| 255 | return 0; | 287 | return 0; |
| 256 | err_cmd: | 288 | err_cmd: |
| 257 | MLX5_SET(destroy_dct_in, din, opcode, MLX5_CMD_OP_DESTROY_DCT); | 289 | _mlx5_core_destroy_dct(dev, dct, false); |
| 258 | MLX5_SET(destroy_dct_in, din, dctn, qp->qpn); | ||
| 259 | MLX5_SET(destroy_dct_in, din, uid, qp->uid); | ||
| 260 | mlx5_cmd_exec(dev, (void *)&in, sizeof(din), | ||
| 261 | (void *)&out, sizeof(dout)); | ||
| 262 | return err; | 290 | return err; |
| 263 | } | 291 | } |
| 264 | EXPORT_SYMBOL_GPL(mlx5_core_create_dct); | 292 | EXPORT_SYMBOL_GPL(mlx5_core_create_dct); |
| @@ -323,29 +351,7 @@ static int mlx5_core_drain_dct(struct mlx5_core_dev *dev, | |||
| 323 | int mlx5_core_destroy_dct(struct mlx5_core_dev *dev, | 351 | int mlx5_core_destroy_dct(struct mlx5_core_dev *dev, |
| 324 | struct mlx5_core_dct *dct) | 352 | struct mlx5_core_dct *dct) |
| 325 | { | 353 | { |
| 326 | u32 out[MLX5_ST_SZ_DW(destroy_dct_out)] = {0}; | 354 | return _mlx5_core_destroy_dct(dev, dct, true); |
| 327 | u32 in[MLX5_ST_SZ_DW(destroy_dct_in)] = {0}; | ||
| 328 | struct mlx5_core_qp *qp = &dct->mqp; | ||
| 329 | int err; | ||
| 330 | |||
| 331 | err = mlx5_core_drain_dct(dev, dct); | ||
| 332 | if (err) { | ||
| 333 | if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { | ||
| 334 | goto destroy; | ||
| 335 | } else { | ||
| 336 | mlx5_core_warn(dev, "failed drain DCT 0x%x with error 0x%x\n", qp->qpn, err); | ||
| 337 | return err; | ||
| 338 | } | ||
| 339 | } | ||
| 340 | wait_for_completion(&dct->drained); | ||
| 341 | destroy: | ||
| 342 | destroy_resource_common(dev, &dct->mqp); | ||
| 343 | MLX5_SET(destroy_dct_in, in, opcode, MLX5_CMD_OP_DESTROY_DCT); | ||
| 344 | MLX5_SET(destroy_dct_in, in, dctn, qp->qpn); | ||
| 345 | MLX5_SET(destroy_dct_in, in, uid, qp->uid); | ||
| 346 | err = mlx5_cmd_exec(dev, (void *)&in, sizeof(in), | ||
| 347 | (void *)&out, sizeof(out)); | ||
| 348 | return err; | ||
| 349 | } | 355 | } |
| 350 | EXPORT_SYMBOL_GPL(mlx5_core_destroy_dct); | 356 | EXPORT_SYMBOL_GPL(mlx5_core_destroy_dct); |
| 351 | 357 | ||
diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c index 900c7073c46f..71308766e891 100644 --- a/drivers/platform/chrome/cros_ec_debugfs.c +++ b/drivers/platform/chrome/cros_ec_debugfs.c | |||
| @@ -440,7 +440,7 @@ static int cros_ec_debugfs_probe(struct platform_device *pd) | |||
| 440 | 440 | ||
| 441 | ret = cros_ec_create_pdinfo(debug_info); | 441 | ret = cros_ec_create_pdinfo(debug_info); |
| 442 | if (ret) | 442 | if (ret) |
| 443 | goto remove_debugfs; | 443 | goto remove_log; |
| 444 | 444 | ||
| 445 | ec->debug_info = debug_info; | 445 | ec->debug_info = debug_info; |
| 446 | 446 | ||
| @@ -448,6 +448,8 @@ static int cros_ec_debugfs_probe(struct platform_device *pd) | |||
| 448 | 448 | ||
| 449 | return 0; | 449 | return 0; |
| 450 | 450 | ||
| 451 | remove_log: | ||
| 452 | cros_ec_cleanup_console_log(debug_info); | ||
| 451 | remove_debugfs: | 453 | remove_debugfs: |
| 452 | debugfs_remove_recursive(debug_info->dir); | 454 | debugfs_remove_recursive(debug_info->dir); |
| 453 | return ret; | 455 | return ret; |
| @@ -467,7 +469,8 @@ static int __maybe_unused cros_ec_debugfs_suspend(struct device *dev) | |||
| 467 | { | 469 | { |
| 468 | struct cros_ec_dev *ec = dev_get_drvdata(dev); | 470 | struct cros_ec_dev *ec = dev_get_drvdata(dev); |
| 469 | 471 | ||
| 470 | cancel_delayed_work_sync(&ec->debug_info->log_poll_work); | 472 | if (ec->debug_info->log_buffer.buf) |
| 473 | cancel_delayed_work_sync(&ec->debug_info->log_poll_work); | ||
| 471 | 474 | ||
| 472 | return 0; | 475 | return 0; |
| 473 | } | 476 | } |
| @@ -476,7 +479,8 @@ static int __maybe_unused cros_ec_debugfs_resume(struct device *dev) | |||
| 476 | { | 479 | { |
| 477 | struct cros_ec_dev *ec = dev_get_drvdata(dev); | 480 | struct cros_ec_dev *ec = dev_get_drvdata(dev); |
| 478 | 481 | ||
| 479 | schedule_delayed_work(&ec->debug_info->log_poll_work, 0); | 482 | if (ec->debug_info->log_buffer.buf) |
| 483 | schedule_delayed_work(&ec->debug_info->log_poll_work, 0); | ||
| 480 | 484 | ||
| 481 | return 0; | 485 | return 0; |
| 482 | } | 486 | } |
diff --git a/drivers/platform/chrome/wilco_ec/mailbox.c b/drivers/platform/chrome/wilco_ec/mailbox.c index f6ff29a11f1a..14355668ddfa 100644 --- a/drivers/platform/chrome/wilco_ec/mailbox.c +++ b/drivers/platform/chrome/wilco_ec/mailbox.c | |||
| @@ -223,11 +223,11 @@ int wilco_ec_mailbox(struct wilco_ec_device *ec, struct wilco_ec_message *msg) | |||
| 223 | msg->command, msg->type, msg->flags, msg->response_size, | 223 | msg->command, msg->type, msg->flags, msg->response_size, |
| 224 | msg->request_size); | 224 | msg->request_size); |
| 225 | 225 | ||
| 226 | mutex_lock(&ec->mailbox_lock); | ||
| 226 | /* Prepare request packet */ | 227 | /* Prepare request packet */ |
| 227 | rq = ec->data_buffer; | 228 | rq = ec->data_buffer; |
| 228 | wilco_ec_prepare(msg, rq); | 229 | wilco_ec_prepare(msg, rq); |
| 229 | 230 | ||
| 230 | mutex_lock(&ec->mailbox_lock); | ||
| 231 | ret = wilco_ec_transfer(ec, msg, rq); | 231 | ret = wilco_ec_transfer(ec, msg, rq); |
| 232 | mutex_unlock(&ec->mailbox_lock); | 232 | mutex_unlock(&ec->mailbox_lock); |
| 233 | 233 | ||
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 3c3cf89f713f..14bac4966c87 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c | |||
| @@ -1801,6 +1801,12 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device) | |||
| 1801 | } | 1801 | } |
| 1802 | hisi_sas_dereg_device(hisi_hba, device); | 1802 | hisi_sas_dereg_device(hisi_hba, device); |
| 1803 | 1803 | ||
| 1804 | if (dev_is_sata(device)) { | ||
| 1805 | rc = hisi_sas_softreset_ata_disk(device); | ||
| 1806 | if (rc) | ||
| 1807 | return TMF_RESP_FUNC_FAILED; | ||
| 1808 | } | ||
| 1809 | |||
| 1804 | rc = hisi_sas_debug_I_T_nexus_reset(device); | 1810 | rc = hisi_sas_debug_I_T_nexus_reset(device); |
| 1805 | 1811 | ||
| 1806 | if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV)) | 1812 | if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV)) |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 1135e74646e2..8cec5230fe31 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
| @@ -96,6 +96,7 @@ static int client_reserve = 1; | |||
| 96 | static char partition_name[96] = "UNKNOWN"; | 96 | static char partition_name[96] = "UNKNOWN"; |
| 97 | static unsigned int partition_number = -1; | 97 | static unsigned int partition_number = -1; |
| 98 | static LIST_HEAD(ibmvscsi_head); | 98 | static LIST_HEAD(ibmvscsi_head); |
| 99 | static DEFINE_SPINLOCK(ibmvscsi_driver_lock); | ||
| 99 | 100 | ||
| 100 | static struct scsi_transport_template *ibmvscsi_transport_template; | 101 | static struct scsi_transport_template *ibmvscsi_transport_template; |
| 101 | 102 | ||
| @@ -2270,7 +2271,9 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
| 2270 | } | 2271 | } |
| 2271 | 2272 | ||
| 2272 | dev_set_drvdata(&vdev->dev, hostdata); | 2273 | dev_set_drvdata(&vdev->dev, hostdata); |
| 2274 | spin_lock(&ibmvscsi_driver_lock); | ||
| 2273 | list_add_tail(&hostdata->host_list, &ibmvscsi_head); | 2275 | list_add_tail(&hostdata->host_list, &ibmvscsi_head); |
| 2276 | spin_unlock(&ibmvscsi_driver_lock); | ||
| 2274 | return 0; | 2277 | return 0; |
| 2275 | 2278 | ||
| 2276 | add_srp_port_failed: | 2279 | add_srp_port_failed: |
| @@ -2292,15 +2295,27 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
| 2292 | static int ibmvscsi_remove(struct vio_dev *vdev) | 2295 | static int ibmvscsi_remove(struct vio_dev *vdev) |
| 2293 | { | 2296 | { |
| 2294 | struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev); | 2297 | struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev); |
| 2295 | list_del(&hostdata->host_list); | 2298 | unsigned long flags; |
| 2296 | unmap_persist_bufs(hostdata); | 2299 | |
| 2300 | srp_remove_host(hostdata->host); | ||
| 2301 | scsi_remove_host(hostdata->host); | ||
| 2302 | |||
| 2303 | purge_requests(hostdata, DID_ERROR); | ||
| 2304 | |||
| 2305 | spin_lock_irqsave(hostdata->host->host_lock, flags); | ||
| 2297 | release_event_pool(&hostdata->pool, hostdata); | 2306 | release_event_pool(&hostdata->pool, hostdata); |
| 2307 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); | ||
| 2308 | |||
| 2298 | ibmvscsi_release_crq_queue(&hostdata->queue, hostdata, | 2309 | ibmvscsi_release_crq_queue(&hostdata->queue, hostdata, |
| 2299 | max_events); | 2310 | max_events); |
| 2300 | 2311 | ||
| 2301 | kthread_stop(hostdata->work_thread); | 2312 | kthread_stop(hostdata->work_thread); |
| 2302 | srp_remove_host(hostdata->host); | 2313 | unmap_persist_bufs(hostdata); |
| 2303 | scsi_remove_host(hostdata->host); | 2314 | |
| 2315 | spin_lock(&ibmvscsi_driver_lock); | ||
| 2316 | list_del(&hostdata->host_list); | ||
| 2317 | spin_unlock(&ibmvscsi_driver_lock); | ||
| 2318 | |||
| 2304 | scsi_host_put(hostdata->host); | 2319 | scsi_host_put(hostdata->host); |
| 2305 | 2320 | ||
| 2306 | return 0; | 2321 | return 0; |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 420045155ba0..0c700b140ce7 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
| @@ -4991,6 +4991,13 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) | |||
| 4991 | if ((domain & 0xf0) == 0xf0) | 4991 | if ((domain & 0xf0) == 0xf0) |
| 4992 | continue; | 4992 | continue; |
| 4993 | 4993 | ||
| 4994 | /* Bypass if not same domain and area of adapter. */ | ||
| 4995 | if (area && domain && ((area != vha->d_id.b.area) || | ||
| 4996 | (domain != vha->d_id.b.domain)) && | ||
| 4997 | (ha->current_topology == ISP_CFG_NL)) | ||
| 4998 | continue; | ||
| 4999 | |||
| 5000 | |||
| 4994 | /* Bypass invalid local loop ID. */ | 5001 | /* Bypass invalid local loop ID. */ |
| 4995 | if (loop_id > LAST_LOCAL_LOOP_ID) | 5002 | if (loop_id > LAST_LOCAL_LOOP_ID) |
| 4996 | continue; | 5003 | continue; |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 677f82fdf56f..91f576d743fe 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
| @@ -1517,7 +1517,7 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type, | |||
| 1517 | goto eh_reset_failed; | 1517 | goto eh_reset_failed; |
| 1518 | } | 1518 | } |
| 1519 | err = 2; | 1519 | err = 2; |
| 1520 | if (do_reset(fcport, cmd->device->lun, blk_mq_rq_cpu(cmd->request) + 1) | 1520 | if (do_reset(fcport, cmd->device->lun, 1) |
| 1521 | != QLA_SUCCESS) { | 1521 | != QLA_SUCCESS) { |
| 1522 | ql_log(ql_log_warn, vha, 0x800c, | 1522 | ql_log(ql_log_warn, vha, 0x800c, |
| 1523 | "do_reset failed for cmd=%p.\n", cmd); | 1523 | "do_reset failed for cmd=%p.\n", cmd); |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 20189675677a..601b9f1de267 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
| @@ -585,10 +585,17 @@ static bool scsi_end_request(struct request *req, blk_status_t error, | |||
| 585 | if (!blk_rq_is_scsi(req)) { | 585 | if (!blk_rq_is_scsi(req)) { |
| 586 | WARN_ON_ONCE(!(cmd->flags & SCMD_INITIALIZED)); | 586 | WARN_ON_ONCE(!(cmd->flags & SCMD_INITIALIZED)); |
| 587 | cmd->flags &= ~SCMD_INITIALIZED; | 587 | cmd->flags &= ~SCMD_INITIALIZED; |
| 588 | destroy_rcu_head(&cmd->rcu); | ||
| 589 | } | 588 | } |
| 590 | 589 | ||
| 591 | /* | 590 | /* |
| 591 | * Calling rcu_barrier() is not necessary here because the | ||
| 592 | * SCSI error handler guarantees that the function called by | ||
| 593 | * call_rcu() has been called before scsi_end_request() is | ||
| 594 | * called. | ||
| 595 | */ | ||
| 596 | destroy_rcu_head(&cmd->rcu); | ||
| 597 | |||
| 598 | /* | ||
| 592 | * In the MQ case the command gets freed by __blk_mq_end_request, | 599 | * In the MQ case the command gets freed by __blk_mq_end_request, |
| 593 | * so we have to do all cleanup that depends on it earlier. | 600 | * so we have to do all cleanup that depends on it earlier. |
| 594 | * | 601 | * |
| @@ -2541,8 +2548,10 @@ void scsi_device_resume(struct scsi_device *sdev) | |||
| 2541 | * device deleted during suspend) | 2548 | * device deleted during suspend) |
| 2542 | */ | 2549 | */ |
| 2543 | mutex_lock(&sdev->state_mutex); | 2550 | mutex_lock(&sdev->state_mutex); |
| 2544 | sdev->quiesced_by = NULL; | 2551 | if (sdev->quiesced_by) { |
| 2545 | blk_clear_pm_only(sdev->request_queue); | 2552 | sdev->quiesced_by = NULL; |
| 2553 | blk_clear_pm_only(sdev->request_queue); | ||
| 2554 | } | ||
| 2546 | if (sdev->sdev_state == SDEV_QUIESCE) | 2555 | if (sdev->sdev_state == SDEV_QUIESCE) |
| 2547 | scsi_device_set_state(sdev, SDEV_RUNNING); | 2556 | scsi_device_set_state(sdev, SDEV_RUNNING); |
| 2548 | mutex_unlock(&sdev->state_mutex); | 2557 | mutex_unlock(&sdev->state_mutex); |
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 0508831d6fb9..0a82e93566dc 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
| @@ -2200,6 +2200,8 @@ void iscsi_remove_session(struct iscsi_cls_session *session) | |||
| 2200 | scsi_target_unblock(&session->dev, SDEV_TRANSPORT_OFFLINE); | 2200 | scsi_target_unblock(&session->dev, SDEV_TRANSPORT_OFFLINE); |
| 2201 | /* flush running scans then delete devices */ | 2201 | /* flush running scans then delete devices */ |
| 2202 | flush_work(&session->scan_work); | 2202 | flush_work(&session->scan_work); |
| 2203 | /* flush running unbind operations */ | ||
| 2204 | flush_work(&session->unbind_work); | ||
| 2203 | __iscsi_unbind_session(&session->unbind_work); | 2205 | __iscsi_unbind_session(&session->unbind_work); |
| 2204 | 2206 | ||
| 2205 | /* hw iscsi may not have removed all connections from session */ | 2207 | /* hw iscsi may not have removed all connections from session */ |
diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c index 720760cd493f..ba39647a690c 100644 --- a/drivers/thermal/broadcom/bcm2835_thermal.c +++ b/drivers/thermal/broadcom/bcm2835_thermal.c | |||
| @@ -119,8 +119,7 @@ static const struct debugfs_reg32 bcm2835_thermal_regs[] = { | |||
| 119 | 119 | ||
| 120 | static void bcm2835_thermal_debugfs(struct platform_device *pdev) | 120 | static void bcm2835_thermal_debugfs(struct platform_device *pdev) |
| 121 | { | 121 | { |
| 122 | struct thermal_zone_device *tz = platform_get_drvdata(pdev); | 122 | struct bcm2835_thermal_data *data = platform_get_drvdata(pdev); |
| 123 | struct bcm2835_thermal_data *data = tz->devdata; | ||
| 124 | struct debugfs_regset32 *regset; | 123 | struct debugfs_regset32 *regset; |
| 125 | 124 | ||
| 126 | data->debugfsdir = debugfs_create_dir("bcm2835_thermal", NULL); | 125 | data->debugfsdir = debugfs_create_dir("bcm2835_thermal", NULL); |
| @@ -266,7 +265,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) | |||
| 266 | 265 | ||
| 267 | data->tz = tz; | 266 | data->tz = tz; |
| 268 | 267 | ||
| 269 | platform_set_drvdata(pdev, tz); | 268 | platform_set_drvdata(pdev, data); |
| 270 | 269 | ||
| 271 | /* | 270 | /* |
| 272 | * Thermal_zone doesn't enable hwmon as default, | 271 | * Thermal_zone doesn't enable hwmon as default, |
| @@ -290,8 +289,8 @@ err_clk: | |||
| 290 | 289 | ||
| 291 | static int bcm2835_thermal_remove(struct platform_device *pdev) | 290 | static int bcm2835_thermal_remove(struct platform_device *pdev) |
| 292 | { | 291 | { |
| 293 | struct thermal_zone_device *tz = platform_get_drvdata(pdev); | 292 | struct bcm2835_thermal_data *data = platform_get_drvdata(pdev); |
| 294 | struct bcm2835_thermal_data *data = tz->devdata; | 293 | struct thermal_zone_device *tz = data->tz; |
| 295 | 294 | ||
| 296 | debugfs_remove_recursive(data->debugfsdir); | 295 | debugfs_remove_recursive(data->debugfsdir); |
| 297 | thermal_zone_of_sensor_unregister(&pdev->dev, tz); | 296 | thermal_zone_of_sensor_unregister(&pdev->dev, tz); |
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 6fff16113628..f7c1f49ec87f 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c | |||
| @@ -536,12 +536,11 @@ static int cpufreq_power2state(struct thermal_cooling_device *cdev, | |||
| 536 | struct thermal_zone_device *tz, u32 power, | 536 | struct thermal_zone_device *tz, u32 power, |
| 537 | unsigned long *state) | 537 | unsigned long *state) |
| 538 | { | 538 | { |
| 539 | unsigned int cur_freq, target_freq; | 539 | unsigned int target_freq; |
| 540 | u32 last_load, normalised_power; | 540 | u32 last_load, normalised_power; |
| 541 | struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; | 541 | struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; |
| 542 | struct cpufreq_policy *policy = cpufreq_cdev->policy; | 542 | struct cpufreq_policy *policy = cpufreq_cdev->policy; |
| 543 | 543 | ||
| 544 | cur_freq = cpufreq_quick_get(policy->cpu); | ||
| 545 | power = power > 0 ? power : 0; | 544 | power = power > 0 ? power : 0; |
| 546 | last_load = cpufreq_cdev->last_load ?: 1; | 545 | last_load = cpufreq_cdev->last_load ?: 1; |
| 547 | normalised_power = (power * 100) / last_load; | 546 | normalised_power = (power * 100) / last_load; |
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 61ca7ce3624e..5f3ed24e26ec 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c | |||
| @@ -22,6 +22,13 @@ enum int3400_thermal_uuid { | |||
| 22 | INT3400_THERMAL_PASSIVE_1, | 22 | INT3400_THERMAL_PASSIVE_1, |
| 23 | INT3400_THERMAL_ACTIVE, | 23 | INT3400_THERMAL_ACTIVE, |
| 24 | INT3400_THERMAL_CRITICAL, | 24 | INT3400_THERMAL_CRITICAL, |
| 25 | INT3400_THERMAL_ADAPTIVE_PERFORMANCE, | ||
| 26 | INT3400_THERMAL_EMERGENCY_CALL_MODE, | ||
| 27 | INT3400_THERMAL_PASSIVE_2, | ||
| 28 | INT3400_THERMAL_POWER_BOSS, | ||
| 29 | INT3400_THERMAL_VIRTUAL_SENSOR, | ||
| 30 | INT3400_THERMAL_COOLING_MODE, | ||
| 31 | INT3400_THERMAL_HARDWARE_DUTY_CYCLING, | ||
| 25 | INT3400_THERMAL_MAXIMUM_UUID, | 32 | INT3400_THERMAL_MAXIMUM_UUID, |
| 26 | }; | 33 | }; |
| 27 | 34 | ||
| @@ -29,6 +36,13 @@ static char *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = { | |||
| 29 | "42A441D6-AE6A-462b-A84B-4A8CE79027D3", | 36 | "42A441D6-AE6A-462b-A84B-4A8CE79027D3", |
| 30 | "3A95C389-E4B8-4629-A526-C52C88626BAE", | 37 | "3A95C389-E4B8-4629-A526-C52C88626BAE", |
| 31 | "97C68AE7-15FA-499c-B8C9-5DA81D606E0A", | 38 | "97C68AE7-15FA-499c-B8C9-5DA81D606E0A", |
| 39 | "63BE270F-1C11-48FD-A6F7-3AF253FF3E2D", | ||
| 40 | "5349962F-71E6-431D-9AE8-0A635B710AEE", | ||
| 41 | "9E04115A-AE87-4D1C-9500-0F3E340BFE75", | ||
| 42 | "F5A35014-C209-46A4-993A-EB56DE7530A1", | ||
| 43 | "6ED722A7-9240-48A5-B479-31EEF723D7CF", | ||
| 44 | "16CAF1B7-DD38-40ED-B1C1-1B8A1913D531", | ||
| 45 | "BE84BABF-C4D4-403D-B495-3128FD44dAC1", | ||
| 32 | }; | 46 | }; |
| 33 | 47 | ||
| 34 | struct int3400_thermal_priv { | 48 | struct int3400_thermal_priv { |
| @@ -299,10 +313,9 @@ static int int3400_thermal_probe(struct platform_device *pdev) | |||
| 299 | 313 | ||
| 300 | platform_set_drvdata(pdev, priv); | 314 | platform_set_drvdata(pdev, priv); |
| 301 | 315 | ||
| 302 | if (priv->uuid_bitmap & 1 << INT3400_THERMAL_PASSIVE_1) { | 316 | int3400_thermal_ops.get_mode = int3400_thermal_get_mode; |
| 303 | int3400_thermal_ops.get_mode = int3400_thermal_get_mode; | 317 | int3400_thermal_ops.set_mode = int3400_thermal_set_mode; |
| 304 | int3400_thermal_ops.set_mode = int3400_thermal_set_mode; | 318 | |
| 305 | } | ||
| 306 | priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0, | 319 | priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0, |
| 307 | priv, &int3400_thermal_ops, | 320 | priv, &int3400_thermal_ops, |
| 308 | &int3400_thermal_params, 0, 0); | 321 | &int3400_thermal_params, 0, 0); |
diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c index 7571f7c2e7c9..ac7256b5f020 100644 --- a/drivers/thermal/intel/intel_powerclamp.c +++ b/drivers/thermal/intel/intel_powerclamp.c | |||
| @@ -101,7 +101,7 @@ struct powerclamp_worker_data { | |||
| 101 | bool clamping; | 101 | bool clamping; |
| 102 | }; | 102 | }; |
| 103 | 103 | ||
| 104 | static struct powerclamp_worker_data * __percpu worker_data; | 104 | static struct powerclamp_worker_data __percpu *worker_data; |
| 105 | static struct thermal_cooling_device *cooling_dev; | 105 | static struct thermal_cooling_device *cooling_dev; |
| 106 | static unsigned long *cpu_clamping_mask; /* bit map for tracking per cpu | 106 | static unsigned long *cpu_clamping_mask; /* bit map for tracking per cpu |
| 107 | * clamping kthread worker | 107 | * clamping kthread worker |
| @@ -494,7 +494,7 @@ static void start_power_clamp_worker(unsigned long cpu) | |||
| 494 | struct powerclamp_worker_data *w_data = per_cpu_ptr(worker_data, cpu); | 494 | struct powerclamp_worker_data *w_data = per_cpu_ptr(worker_data, cpu); |
| 495 | struct kthread_worker *worker; | 495 | struct kthread_worker *worker; |
| 496 | 496 | ||
| 497 | worker = kthread_create_worker_on_cpu(cpu, 0, "kidle_inject/%ld", cpu); | 497 | worker = kthread_create_worker_on_cpu(cpu, 0, "kidle_inj/%ld", cpu); |
| 498 | if (IS_ERR(worker)) | 498 | if (IS_ERR(worker)) |
| 499 | return; | 499 | return; |
| 500 | 500 | ||
diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index 5c07a61447d3..e4ea7f6aef20 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c | |||
| @@ -199,6 +199,9 @@ enum { | |||
| 199 | #define MT7622_TS1 0 | 199 | #define MT7622_TS1 0 |
| 200 | #define MT7622_NUM_CONTROLLER 1 | 200 | #define MT7622_NUM_CONTROLLER 1 |
| 201 | 201 | ||
| 202 | /* The maximum number of banks */ | ||
| 203 | #define MAX_NUM_ZONES 8 | ||
| 204 | |||
| 202 | /* The calibration coefficient of sensor */ | 205 | /* The calibration coefficient of sensor */ |
| 203 | #define MT7622_CALIBRATION 165 | 206 | #define MT7622_CALIBRATION 165 |
| 204 | 207 | ||
| @@ -249,7 +252,7 @@ struct mtk_thermal_data { | |||
| 249 | const int num_controller; | 252 | const int num_controller; |
| 250 | const int *controller_offset; | 253 | const int *controller_offset; |
| 251 | bool need_switch_bank; | 254 | bool need_switch_bank; |
| 252 | struct thermal_bank_cfg bank_data[]; | 255 | struct thermal_bank_cfg bank_data[MAX_NUM_ZONES]; |
| 253 | }; | 256 | }; |
| 254 | 257 | ||
| 255 | struct mtk_thermal { | 258 | struct mtk_thermal { |
| @@ -268,7 +271,7 @@ struct mtk_thermal { | |||
| 268 | s32 vts[MAX_NUM_VTS]; | 271 | s32 vts[MAX_NUM_VTS]; |
| 269 | 272 | ||
| 270 | const struct mtk_thermal_data *conf; | 273 | const struct mtk_thermal_data *conf; |
| 271 | struct mtk_thermal_bank banks[]; | 274 | struct mtk_thermal_bank banks[MAX_NUM_ZONES]; |
| 272 | }; | 275 | }; |
| 273 | 276 | ||
| 274 | /* MT8183 thermal sensor data */ | 277 | /* MT8183 thermal sensor data */ |
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 48eef552cba4..fc9399d9c082 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
| @@ -666,7 +666,7 @@ static int exynos_get_temp(void *p, int *temp) | |||
| 666 | struct exynos_tmu_data *data = p; | 666 | struct exynos_tmu_data *data = p; |
| 667 | int value, ret = 0; | 667 | int value, ret = 0; |
| 668 | 668 | ||
| 669 | if (!data || !data->tmu_read || !data->enabled) | 669 | if (!data || !data->tmu_read) |
| 670 | return -EINVAL; | 670 | return -EINVAL; |
| 671 | else if (!data->enabled) | 671 | else if (!data->enabled) |
| 672 | /* | 672 | /* |
