diff options
Diffstat (limited to 'drivers')
295 files changed, 1989 insertions, 1031 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 1ff17799769d..6389c88b3500 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -698,7 +698,7 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, | |||
| 698 | 698 | ||
| 699 | DPRINTK("ENTER\n"); | 699 | DPRINTK("ENTER\n"); |
| 700 | 700 | ||
| 701 | ahci_stop_engine(ap); | 701 | hpriv->stop_engine(ap); |
| 702 | 702 | ||
| 703 | rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), | 703 | rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), |
| 704 | deadline, &online, NULL); | 704 | deadline, &online, NULL); |
| @@ -724,7 +724,7 @@ static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, | |||
| 724 | bool online; | 724 | bool online; |
| 725 | int rc; | 725 | int rc; |
| 726 | 726 | ||
| 727 | ahci_stop_engine(ap); | 727 | hpriv->stop_engine(ap); |
| 728 | 728 | ||
| 729 | /* clear D2H reception area to properly wait for D2H FIS */ | 729 | /* clear D2H reception area to properly wait for D2H FIS */ |
| 730 | ata_tf_init(link->device, &tf); | 730 | ata_tf_init(link->device, &tf); |
| @@ -788,7 +788,7 @@ static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class, | |||
| 788 | 788 | ||
| 789 | DPRINTK("ENTER\n"); | 789 | DPRINTK("ENTER\n"); |
| 790 | 790 | ||
| 791 | ahci_stop_engine(ap); | 791 | hpriv->stop_engine(ap); |
| 792 | 792 | ||
| 793 | for (i = 0; i < 2; i++) { | 793 | for (i = 0; i < 2; i++) { |
| 794 | u16 val; | 794 | u16 val; |
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 4356ef1d28a8..824bd399f02e 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h | |||
| @@ -350,7 +350,6 @@ struct ahci_host_priv { | |||
| 350 | u32 em_msg_type; /* EM message type */ | 350 | u32 em_msg_type; /* EM message type */ |
| 351 | bool got_runtime_pm; /* Did we do pm_runtime_get? */ | 351 | bool got_runtime_pm; /* Did we do pm_runtime_get? */ |
| 352 | struct clk *clks[AHCI_MAX_CLKS]; /* Optional */ | 352 | struct clk *clks[AHCI_MAX_CLKS]; /* Optional */ |
| 353 | struct reset_control *rsts; /* Optional */ | ||
| 354 | struct regulator **target_pwrs; /* Optional */ | 353 | struct regulator **target_pwrs; /* Optional */ |
| 355 | /* | 354 | /* |
| 356 | * If platform uses PHYs. There is a 1:1 relation between the port number and | 355 | * If platform uses PHYs. There is a 1:1 relation between the port number and |
| @@ -366,6 +365,13 @@ struct ahci_host_priv { | |||
| 366 | * be overridden anytime before the host is activated. | 365 | * be overridden anytime before the host is activated. |
| 367 | */ | 366 | */ |
| 368 | void (*start_engine)(struct ata_port *ap); | 367 | void (*start_engine)(struct ata_port *ap); |
| 368 | /* | ||
| 369 | * Optional ahci_stop_engine override, if not set this gets set to the | ||
| 370 | * default ahci_stop_engine during ahci_save_initial_config, this can | ||
| 371 | * be overridden anytime before the host is activated. | ||
| 372 | */ | ||
| 373 | int (*stop_engine)(struct ata_port *ap); | ||
| 374 | |||
| 369 | irqreturn_t (*irq_handler)(int irq, void *dev_instance); | 375 | irqreturn_t (*irq_handler)(int irq, void *dev_instance); |
| 370 | 376 | ||
| 371 | /* only required for per-port MSI(-X) support */ | 377 | /* only required for per-port MSI(-X) support */ |
diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index de7128d81e9c..0045dacd814b 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c | |||
| @@ -62,6 +62,60 @@ static void ahci_mvebu_regret_option(struct ahci_host_priv *hpriv) | |||
| 62 | writel(0x80, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA); | 62 | writel(0x80, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | /** | ||
| 66 | * ahci_mvebu_stop_engine | ||
| 67 | * | ||
| 68 | * @ap: Target ata port | ||
| 69 | * | ||
| 70 | * Errata Ref#226 - SATA Disk HOT swap issue when connected through | ||
| 71 | * Port Multiplier in FIS-based Switching mode. | ||
| 72 | * | ||
| 73 | * To avoid the issue, according to design, the bits[11:8, 0] of | ||
| 74 | * register PxFBS are cleared when Port Command and Status (0x18) bit[0] | ||
| 75 | * changes its value from 1 to 0, i.e. falling edge of Port | ||
| 76 | * Command and Status bit[0] sends PULSE that resets PxFBS | ||
| 77 | * bits[11:8; 0]. | ||
| 78 | * | ||
| 79 | * This function is used to override function of "ahci_stop_engine" | ||
| 80 | * from libahci.c by adding the mvebu work around(WA) to save PxFBS | ||
| 81 | * value before the PxCMD ST write of 0, then restore PxFBS value. | ||
| 82 | * | ||
| 83 | * Return: 0 on success; Error code otherwise. | ||
| 84 | */ | ||
| 85 | int ahci_mvebu_stop_engine(struct ata_port *ap) | ||
| 86 | { | ||
| 87 | void __iomem *port_mmio = ahci_port_base(ap); | ||
| 88 | u32 tmp, port_fbs; | ||
| 89 | |||
| 90 | tmp = readl(port_mmio + PORT_CMD); | ||
| 91 | |||
| 92 | /* check if the HBA is idle */ | ||
| 93 | if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0) | ||
| 94 | return 0; | ||
| 95 | |||
| 96 | /* save the port PxFBS register for later restore */ | ||
| 97 | port_fbs = readl(port_mmio + PORT_FBS); | ||
| 98 | |||
| 99 | /* setting HBA to idle */ | ||
| 100 | tmp &= ~PORT_CMD_START; | ||
| 101 | writel(tmp, port_mmio + PORT_CMD); | ||
| 102 | |||
| 103 | /* | ||
| 104 | * bit #15 PxCMD signal doesn't clear PxFBS, | ||
| 105 | * restore the PxFBS register right after clearing the PxCMD ST, | ||
| 106 | * no need to wait for the PxCMD bit #15. | ||
| 107 | */ | ||
| 108 | writel(port_fbs, port_mmio + PORT_FBS); | ||
| 109 | |||
| 110 | /* wait for engine to stop. This could be as long as 500 msec */ | ||
| 111 | tmp = ata_wait_register(ap, port_mmio + PORT_CMD, | ||
| 112 | PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500); | ||
| 113 | if (tmp & PORT_CMD_LIST_ON) | ||
| 114 | return -EIO; | ||
| 115 | |||
| 116 | return 0; | ||
| 117 | } | ||
| 118 | |||
| 65 | #ifdef CONFIG_PM_SLEEP | 119 | #ifdef CONFIG_PM_SLEEP |
| 66 | static int ahci_mvebu_suspend(struct platform_device *pdev, pm_message_t state) | 120 | static int ahci_mvebu_suspend(struct platform_device *pdev, pm_message_t state) |
| 67 | { | 121 | { |
| @@ -112,6 +166,8 @@ static int ahci_mvebu_probe(struct platform_device *pdev) | |||
| 112 | if (rc) | 166 | if (rc) |
| 113 | return rc; | 167 | return rc; |
| 114 | 168 | ||
| 169 | hpriv->stop_engine = ahci_mvebu_stop_engine; | ||
| 170 | |||
| 115 | if (of_device_is_compatible(pdev->dev.of_node, | 171 | if (of_device_is_compatible(pdev->dev.of_node, |
| 116 | "marvell,armada-380-ahci")) { | 172 | "marvell,armada-380-ahci")) { |
| 117 | dram = mv_mbus_dram_info(); | 173 | dram = mv_mbus_dram_info(); |
diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c index 2685f28160f7..cfdef4d44ae9 100644 --- a/drivers/ata/ahci_qoriq.c +++ b/drivers/ata/ahci_qoriq.c | |||
| @@ -96,7 +96,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class, | |||
| 96 | 96 | ||
| 97 | DPRINTK("ENTER\n"); | 97 | DPRINTK("ENTER\n"); |
| 98 | 98 | ||
| 99 | ahci_stop_engine(ap); | 99 | hpriv->stop_engine(ap); |
| 100 | 100 | ||
| 101 | /* | 101 | /* |
| 102 | * There is a errata on ls1021a Rev1.0 and Rev2.0 which is: | 102 | * There is a errata on ls1021a Rev1.0 and Rev2.0 which is: |
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index c2b5941d9184..ad58da7c9aff 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c | |||
| @@ -165,7 +165,7 @@ static int xgene_ahci_restart_engine(struct ata_port *ap) | |||
| 165 | PORT_CMD_ISSUE, 0x0, 1, 100)) | 165 | PORT_CMD_ISSUE, 0x0, 1, 100)) |
| 166 | return -EBUSY; | 166 | return -EBUSY; |
| 167 | 167 | ||
| 168 | ahci_stop_engine(ap); | 168 | hpriv->stop_engine(ap); |
| 169 | ahci_start_fis_rx(ap); | 169 | ahci_start_fis_rx(ap); |
| 170 | 170 | ||
| 171 | /* | 171 | /* |
| @@ -421,7 +421,7 @@ static int xgene_ahci_hardreset(struct ata_link *link, unsigned int *class, | |||
| 421 | portrxfis_saved = readl(port_mmio + PORT_FIS_ADDR); | 421 | portrxfis_saved = readl(port_mmio + PORT_FIS_ADDR); |
| 422 | portrxfishi_saved = readl(port_mmio + PORT_FIS_ADDR_HI); | 422 | portrxfishi_saved = readl(port_mmio + PORT_FIS_ADDR_HI); |
| 423 | 423 | ||
| 424 | ahci_stop_engine(ap); | 424 | hpriv->stop_engine(ap); |
| 425 | 425 | ||
| 426 | rc = xgene_ahci_do_hardreset(link, deadline, &online); | 426 | rc = xgene_ahci_do_hardreset(link, deadline, &online); |
| 427 | 427 | ||
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 7adcf3caabd0..e5d90977caec 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
| @@ -560,6 +560,9 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv) | |||
| 560 | if (!hpriv->start_engine) | 560 | if (!hpriv->start_engine) |
| 561 | hpriv->start_engine = ahci_start_engine; | 561 | hpriv->start_engine = ahci_start_engine; |
| 562 | 562 | ||
| 563 | if (!hpriv->stop_engine) | ||
| 564 | hpriv->stop_engine = ahci_stop_engine; | ||
| 565 | |||
| 563 | if (!hpriv->irq_handler) | 566 | if (!hpriv->irq_handler) |
| 564 | hpriv->irq_handler = ahci_single_level_irq_intr; | 567 | hpriv->irq_handler = ahci_single_level_irq_intr; |
| 565 | } | 568 | } |
| @@ -897,9 +900,10 @@ static void ahci_start_port(struct ata_port *ap) | |||
| 897 | static int ahci_deinit_port(struct ata_port *ap, const char **emsg) | 900 | static int ahci_deinit_port(struct ata_port *ap, const char **emsg) |
| 898 | { | 901 | { |
| 899 | int rc; | 902 | int rc; |
| 903 | struct ahci_host_priv *hpriv = ap->host->private_data; | ||
| 900 | 904 | ||
| 901 | /* disable DMA */ | 905 | /* disable DMA */ |
| 902 | rc = ahci_stop_engine(ap); | 906 | rc = hpriv->stop_engine(ap); |
| 903 | if (rc) { | 907 | if (rc) { |
| 904 | *emsg = "failed to stop engine"; | 908 | *emsg = "failed to stop engine"; |
| 905 | return rc; | 909 | return rc; |
| @@ -1310,7 +1314,7 @@ int ahci_kick_engine(struct ata_port *ap) | |||
| 1310 | int busy, rc; | 1314 | int busy, rc; |
| 1311 | 1315 | ||
| 1312 | /* stop engine */ | 1316 | /* stop engine */ |
| 1313 | rc = ahci_stop_engine(ap); | 1317 | rc = hpriv->stop_engine(ap); |
| 1314 | if (rc) | 1318 | if (rc) |
| 1315 | goto out_restart; | 1319 | goto out_restart; |
| 1316 | 1320 | ||
| @@ -1549,7 +1553,7 @@ int ahci_do_hardreset(struct ata_link *link, unsigned int *class, | |||
| 1549 | 1553 | ||
| 1550 | DPRINTK("ENTER\n"); | 1554 | DPRINTK("ENTER\n"); |
| 1551 | 1555 | ||
| 1552 | ahci_stop_engine(ap); | 1556 | hpriv->stop_engine(ap); |
| 1553 | 1557 | ||
| 1554 | /* clear D2H reception area to properly wait for D2H FIS */ | 1558 | /* clear D2H reception area to properly wait for D2H FIS */ |
| 1555 | ata_tf_init(link->device, &tf); | 1559 | ata_tf_init(link->device, &tf); |
| @@ -2075,14 +2079,14 @@ void ahci_error_handler(struct ata_port *ap) | |||
| 2075 | 2079 | ||
| 2076 | if (!(ap->pflags & ATA_PFLAG_FROZEN)) { | 2080 | if (!(ap->pflags & ATA_PFLAG_FROZEN)) { |
| 2077 | /* restart engine */ | 2081 | /* restart engine */ |
| 2078 | ahci_stop_engine(ap); | 2082 | hpriv->stop_engine(ap); |
| 2079 | hpriv->start_engine(ap); | 2083 | hpriv->start_engine(ap); |
| 2080 | } | 2084 | } |
| 2081 | 2085 | ||
| 2082 | sata_pmp_error_handler(ap); | 2086 | sata_pmp_error_handler(ap); |
| 2083 | 2087 | ||
| 2084 | if (!ata_dev_enabled(ap->link.device)) | 2088 | if (!ata_dev_enabled(ap->link.device)) |
| 2085 | ahci_stop_engine(ap); | 2089 | hpriv->stop_engine(ap); |
| 2086 | } | 2090 | } |
| 2087 | EXPORT_SYMBOL_GPL(ahci_error_handler); | 2091 | EXPORT_SYMBOL_GPL(ahci_error_handler); |
| 2088 | 2092 | ||
| @@ -2129,7 +2133,7 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep) | |||
| 2129 | return; | 2133 | return; |
| 2130 | 2134 | ||
| 2131 | /* set DITO, MDAT, DETO and enable DevSlp, need to stop engine first */ | 2135 | /* set DITO, MDAT, DETO and enable DevSlp, need to stop engine first */ |
| 2132 | rc = ahci_stop_engine(ap); | 2136 | rc = hpriv->stop_engine(ap); |
| 2133 | if (rc) | 2137 | if (rc) |
| 2134 | return; | 2138 | return; |
| 2135 | 2139 | ||
| @@ -2189,7 +2193,7 @@ static void ahci_enable_fbs(struct ata_port *ap) | |||
| 2189 | return; | 2193 | return; |
| 2190 | } | 2194 | } |
| 2191 | 2195 | ||
| 2192 | rc = ahci_stop_engine(ap); | 2196 | rc = hpriv->stop_engine(ap); |
| 2193 | if (rc) | 2197 | if (rc) |
| 2194 | return; | 2198 | return; |
| 2195 | 2199 | ||
| @@ -2222,7 +2226,7 @@ static void ahci_disable_fbs(struct ata_port *ap) | |||
| 2222 | return; | 2226 | return; |
| 2223 | } | 2227 | } |
| 2224 | 2228 | ||
| 2225 | rc = ahci_stop_engine(ap); | 2229 | rc = hpriv->stop_engine(ap); |
| 2226 | if (rc) | 2230 | if (rc) |
| 2227 | return; | 2231 | return; |
| 2228 | 2232 | ||
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 46a762442dc5..30cc8f1a31e1 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <linux/phy/phy.h> | 25 | #include <linux/phy/phy.h> |
| 26 | #include <linux/pm_runtime.h> | 26 | #include <linux/pm_runtime.h> |
| 27 | #include <linux/of_platform.h> | 27 | #include <linux/of_platform.h> |
| 28 | #include <linux/reset.h> | ||
| 29 | #include "ahci.h" | 28 | #include "ahci.h" |
| 30 | 29 | ||
| 31 | static void ahci_host_stop(struct ata_host *host); | 30 | static void ahci_host_stop(struct ata_host *host); |
| @@ -196,8 +195,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_disable_regulators); | |||
| 196 | * following order: | 195 | * following order: |
| 197 | * 1) Regulator | 196 | * 1) Regulator |
| 198 | * 2) Clocks (through ahci_platform_enable_clks) | 197 | * 2) Clocks (through ahci_platform_enable_clks) |
| 199 | * 3) Resets | 198 | * 3) Phys |
| 200 | * 4) Phys | ||
| 201 | * | 199 | * |
| 202 | * If resource enabling fails at any point the previous enabled resources | 200 | * If resource enabling fails at any point the previous enabled resources |
| 203 | * are disabled in reverse order. | 201 | * are disabled in reverse order. |
| @@ -217,19 +215,12 @@ int ahci_platform_enable_resources(struct ahci_host_priv *hpriv) | |||
| 217 | if (rc) | 215 | if (rc) |
| 218 | goto disable_regulator; | 216 | goto disable_regulator; |
| 219 | 217 | ||
| 220 | rc = reset_control_deassert(hpriv->rsts); | ||
| 221 | if (rc) | ||
| 222 | goto disable_clks; | ||
| 223 | |||
| 224 | rc = ahci_platform_enable_phys(hpriv); | 218 | rc = ahci_platform_enable_phys(hpriv); |
| 225 | if (rc) | 219 | if (rc) |
| 226 | goto disable_resets; | 220 | goto disable_clks; |
| 227 | 221 | ||
| 228 | return 0; | 222 | return 0; |
| 229 | 223 | ||
| 230 | disable_resets: | ||
| 231 | reset_control_assert(hpriv->rsts); | ||
| 232 | |||
| 233 | disable_clks: | 224 | disable_clks: |
| 234 | ahci_platform_disable_clks(hpriv); | 225 | ahci_platform_disable_clks(hpriv); |
| 235 | 226 | ||
| @@ -248,15 +239,12 @@ EXPORT_SYMBOL_GPL(ahci_platform_enable_resources); | |||
| 248 | * following order: | 239 | * following order: |
| 249 | * 1) Phys | 240 | * 1) Phys |
| 250 | * 2) Clocks (through ahci_platform_disable_clks) | 241 | * 2) Clocks (through ahci_platform_disable_clks) |
| 251 | * 3) Resets | 242 | * 3) Regulator |
| 252 | * 4) Regulator | ||
| 253 | */ | 243 | */ |
| 254 | void ahci_platform_disable_resources(struct ahci_host_priv *hpriv) | 244 | void ahci_platform_disable_resources(struct ahci_host_priv *hpriv) |
| 255 | { | 245 | { |
| 256 | ahci_platform_disable_phys(hpriv); | 246 | ahci_platform_disable_phys(hpriv); |
| 257 | 247 | ||
| 258 | reset_control_assert(hpriv->rsts); | ||
| 259 | |||
| 260 | ahci_platform_disable_clks(hpriv); | 248 | ahci_platform_disable_clks(hpriv); |
| 261 | 249 | ||
| 262 | ahci_platform_disable_regulators(hpriv); | 250 | ahci_platform_disable_regulators(hpriv); |
| @@ -405,12 +393,6 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev) | |||
| 405 | hpriv->clks[i] = clk; | 393 | hpriv->clks[i] = clk; |
| 406 | } | 394 | } |
| 407 | 395 | ||
| 408 | hpriv->rsts = devm_reset_control_array_get_optional_shared(dev); | ||
| 409 | if (IS_ERR(hpriv->rsts)) { | ||
| 410 | rc = PTR_ERR(hpriv->rsts); | ||
| 411 | goto err_out; | ||
| 412 | } | ||
| 413 | |||
| 414 | hpriv->nports = child_nodes = of_get_child_count(dev->of_node); | 396 | hpriv->nports = child_nodes = of_get_child_count(dev->of_node); |
| 415 | 397 | ||
| 416 | /* | 398 | /* |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 8bc71ca61e7f..68596bd4cf06 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -4549,6 +4549,12 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
| 4549 | ATA_HORKAGE_ZERO_AFTER_TRIM | | 4549 | ATA_HORKAGE_ZERO_AFTER_TRIM | |
| 4550 | ATA_HORKAGE_NOLPM, }, | 4550 | ATA_HORKAGE_NOLPM, }, |
| 4551 | 4551 | ||
| 4552 | /* This specific Samsung model/firmware-rev does not handle LPM well */ | ||
| 4553 | { "SAMSUNG MZMPC128HBFU-000MV", "CXM14M1Q", ATA_HORKAGE_NOLPM, }, | ||
| 4554 | |||
| 4555 | /* Sandisk devices which are known to not handle LPM well */ | ||
| 4556 | { "SanDisk SD7UB3Q*G1001", NULL, ATA_HORKAGE_NOLPM, }, | ||
| 4557 | |||
| 4552 | /* devices that don't properly handle queued TRIM commands */ | 4558 | /* devices that don't properly handle queued TRIM commands */ |
| 4553 | { "Micron_M500_*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | | 4559 | { "Micron_M500_*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | |
| 4554 | ATA_HORKAGE_ZERO_AFTER_TRIM, }, | 4560 | ATA_HORKAGE_ZERO_AFTER_TRIM, }, |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c016829a38fd..513b260bcff1 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
| @@ -175,8 +175,8 @@ static void ata_eh_handle_port_resume(struct ata_port *ap) | |||
| 175 | { } | 175 | { } |
| 176 | #endif /* CONFIG_PM */ | 176 | #endif /* CONFIG_PM */ |
| 177 | 177 | ||
| 178 | static void __ata_ehi_pushv_desc(struct ata_eh_info *ehi, const char *fmt, | 178 | static __printf(2, 0) void __ata_ehi_pushv_desc(struct ata_eh_info *ehi, |
| 179 | va_list args) | 179 | const char *fmt, va_list args) |
| 180 | { | 180 | { |
| 181 | ehi->desc_len += vscnprintf(ehi->desc + ehi->desc_len, | 181 | ehi->desc_len += vscnprintf(ehi->desc + ehi->desc_len, |
| 182 | ATA_EH_DESC_LEN - ehi->desc_len, | 182 | ATA_EH_DESC_LEN - ehi->desc_len, |
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index aafb8cc03523..e67815b896fc 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c | |||
| @@ -410,7 +410,7 @@ static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class, | |||
| 410 | int rc; | 410 | int rc; |
| 411 | int retry = 100; | 411 | int retry = 100; |
| 412 | 412 | ||
| 413 | ahci_stop_engine(ap); | 413 | hpriv->stop_engine(ap); |
| 414 | 414 | ||
| 415 | /* clear D2H reception area to properly wait for D2H FIS */ | 415 | /* clear D2H reception area to properly wait for D2H FIS */ |
| 416 | ata_tf_init(link->device, &tf); | 416 | ata_tf_init(link->device, &tf); |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 4b1995e2d044..010ca101d412 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
| @@ -285,13 +285,13 @@ static const struct sil24_cerr_info { | |||
| 285 | [PORT_CERR_INCONSISTENT] = { AC_ERR_HSM, ATA_EH_RESET, | 285 | [PORT_CERR_INCONSISTENT] = { AC_ERR_HSM, ATA_EH_RESET, |
| 286 | "protocol mismatch" }, | 286 | "protocol mismatch" }, |
| 287 | [PORT_CERR_DIRECTION] = { AC_ERR_HSM, ATA_EH_RESET, | 287 | [PORT_CERR_DIRECTION] = { AC_ERR_HSM, ATA_EH_RESET, |
| 288 | "data directon mismatch" }, | 288 | "data direction mismatch" }, |
| 289 | [PORT_CERR_UNDERRUN] = { AC_ERR_HSM, ATA_EH_RESET, | 289 | [PORT_CERR_UNDERRUN] = { AC_ERR_HSM, ATA_EH_RESET, |
| 290 | "ran out of SGEs while writing" }, | 290 | "ran out of SGEs while writing" }, |
| 291 | [PORT_CERR_OVERRUN] = { AC_ERR_HSM, ATA_EH_RESET, | 291 | [PORT_CERR_OVERRUN] = { AC_ERR_HSM, ATA_EH_RESET, |
| 292 | "ran out of SGEs while reading" }, | 292 | "ran out of SGEs while reading" }, |
| 293 | [PORT_CERR_PKT_PROT] = { AC_ERR_HSM, ATA_EH_RESET, | 293 | [PORT_CERR_PKT_PROT] = { AC_ERR_HSM, ATA_EH_RESET, |
| 294 | "invalid data directon for ATAPI CDB" }, | 294 | "invalid data direction for ATAPI CDB" }, |
| 295 | [PORT_CERR_SGT_BOUNDARY] = { AC_ERR_SYSTEM, ATA_EH_RESET, | 295 | [PORT_CERR_SGT_BOUNDARY] = { AC_ERR_SYSTEM, ATA_EH_RESET, |
| 296 | "SGT not on qword boundary" }, | 296 | "SGT not on qword boundary" }, |
| 297 | [PORT_CERR_SGT_TGTABRT] = { AC_ERR_HOST_BUS, ATA_EH_RESET, | 297 | [PORT_CERR_SGT_TGTABRT] = { AC_ERR_HOST_BUS, ATA_EH_RESET, |
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index d97c05690faa..4e46dc9e41ad 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c | |||
| @@ -191,7 +191,7 @@ static char *res_strings[] = { | |||
| 191 | "reserved 37", | 191 | "reserved 37", |
| 192 | "reserved 38", | 192 | "reserved 38", |
| 193 | "reserved 39", | 193 | "reserved 39", |
| 194 | "reseverd 40", | 194 | "reserved 40", |
| 195 | "reserved 41", | 195 | "reserved 41", |
| 196 | "reserved 42", | 196 | "reserved 42", |
| 197 | "reserved 43", | 197 | "reserved 43", |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 1ef67db03c8e..9c9a22958717 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <asm/io.h> | 28 | #include <asm/io.h> |
| 29 | #include <linux/atomic.h> | 29 | #include <linux/atomic.h> |
| 30 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
| 31 | #include <linux/nospec.h> | ||
| 31 | 32 | ||
| 32 | #include "uPD98401.h" | 33 | #include "uPD98401.h" |
| 33 | #include "uPD98402.h" | 34 | #include "uPD98402.h" |
| @@ -1458,6 +1459,8 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg) | |||
| 1458 | return -EFAULT; | 1459 | return -EFAULT; |
| 1459 | if (pool < 0 || pool > ZATM_LAST_POOL) | 1460 | if (pool < 0 || pool > ZATM_LAST_POOL) |
| 1460 | return -EINVAL; | 1461 | return -EINVAL; |
| 1462 | pool = array_index_nospec(pool, | ||
| 1463 | ZATM_LAST_POOL + 1); | ||
| 1461 | spin_lock_irqsave(&zatm_dev->lock, flags); | 1464 | spin_lock_irqsave(&zatm_dev->lock, flags); |
| 1462 | info = zatm_dev->pool_info[pool]; | 1465 | info = zatm_dev->pool_info[pool]; |
| 1463 | if (cmd == ZATM_GETPOOLZ) { | 1466 | if (cmd == ZATM_GETPOOLZ) { |
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8e8b04cc569a..33b36fea1d73 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -2366,7 +2366,9 @@ static int rbd_obj_issue_copyup(struct rbd_obj_request *obj_req, u32 bytes) | |||
| 2366 | osd_req_op_cls_init(obj_req->osd_req, 0, CEPH_OSD_OP_CALL, "rbd", | 2366 | osd_req_op_cls_init(obj_req->osd_req, 0, CEPH_OSD_OP_CALL, "rbd", |
| 2367 | "copyup"); | 2367 | "copyup"); |
| 2368 | osd_req_op_cls_request_data_bvecs(obj_req->osd_req, 0, | 2368 | osd_req_op_cls_request_data_bvecs(obj_req->osd_req, 0, |
| 2369 | obj_req->copyup_bvecs, bytes); | 2369 | obj_req->copyup_bvecs, |
| 2370 | obj_req->copyup_bvec_count, | ||
| 2371 | bytes); | ||
| 2370 | 2372 | ||
| 2371 | switch (obj_req->img_request->op_type) { | 2373 | switch (obj_req->img_request->op_type) { |
| 2372 | case OBJ_OP_WRITE: | 2374 | case OBJ_OP_WRITE: |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index c8c8b0b8d333..b937cc1e2c07 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
| @@ -231,6 +231,7 @@ static const struct usb_device_id blacklist_table[] = { | |||
| 231 | { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 }, | 231 | { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 }, |
| 232 | { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, | 232 | { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, |
| 233 | { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, | 233 | { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, |
| 234 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, | ||
| 234 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, | 235 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, |
| 235 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, | 236 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, |
| 236 | { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 }, | 237 | { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 }, |
| @@ -263,7 +264,6 @@ static const struct usb_device_id blacklist_table[] = { | |||
| 263 | { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, | 264 | { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, |
| 264 | 265 | ||
| 265 | /* QCA ROME chipset */ | 266 | /* QCA ROME chipset */ |
| 266 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_QCA_ROME }, | ||
| 267 | { USB_DEVICE(0x0cf3, 0xe007), .driver_info = BTUSB_QCA_ROME }, | 267 | { USB_DEVICE(0x0cf3, 0xe007), .driver_info = BTUSB_QCA_ROME }, |
| 268 | { USB_DEVICE(0x0cf3, 0xe009), .driver_info = BTUSB_QCA_ROME }, | 268 | { USB_DEVICE(0x0cf3, 0xe009), .driver_info = BTUSB_QCA_ROME }, |
| 269 | { USB_DEVICE(0x0cf3, 0xe010), .driver_info = BTUSB_QCA_ROME }, | 269 | { USB_DEVICE(0x0cf3, 0xe010), .driver_info = BTUSB_QCA_ROME }, |
| @@ -399,6 +399,13 @@ static const struct dmi_system_id btusb_needs_reset_resume_table[] = { | |||
| 399 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 3060"), | 399 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 3060"), |
| 400 | }, | 400 | }, |
| 401 | }, | 401 | }, |
| 402 | { | ||
| 403 | /* Dell XPS 9360 (QCA ROME device 0cf3:e300) */ | ||
| 404 | .matches = { | ||
| 405 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 406 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"), | ||
| 407 | }, | ||
| 408 | }, | ||
| 402 | {} | 409 | {} |
| 403 | }; | 410 | }; |
| 404 | 411 | ||
| @@ -2852,6 +2859,12 @@ static int btusb_config_oob_wake(struct hci_dev *hdev) | |||
| 2852 | } | 2859 | } |
| 2853 | #endif | 2860 | #endif |
| 2854 | 2861 | ||
| 2862 | static void btusb_check_needs_reset_resume(struct usb_interface *intf) | ||
| 2863 | { | ||
| 2864 | if (dmi_check_system(btusb_needs_reset_resume_table)) | ||
| 2865 | interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; | ||
| 2866 | } | ||
| 2867 | |||
| 2855 | static int btusb_probe(struct usb_interface *intf, | 2868 | static int btusb_probe(struct usb_interface *intf, |
| 2856 | const struct usb_device_id *id) | 2869 | const struct usb_device_id *id) |
| 2857 | { | 2870 | { |
| @@ -2974,9 +2987,6 @@ static int btusb_probe(struct usb_interface *intf, | |||
| 2974 | hdev->send = btusb_send_frame; | 2987 | hdev->send = btusb_send_frame; |
| 2975 | hdev->notify = btusb_notify; | 2988 | hdev->notify = btusb_notify; |
| 2976 | 2989 | ||
| 2977 | if (dmi_check_system(btusb_needs_reset_resume_table)) | ||
| 2978 | interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; | ||
| 2979 | |||
| 2980 | #ifdef CONFIG_PM | 2990 | #ifdef CONFIG_PM |
| 2981 | err = btusb_config_oob_wake(hdev); | 2991 | err = btusb_config_oob_wake(hdev); |
| 2982 | if (err) | 2992 | if (err) |
| @@ -3064,6 +3074,7 @@ static int btusb_probe(struct usb_interface *intf, | |||
| 3064 | data->setup_on_usb = btusb_setup_qca; | 3074 | data->setup_on_usb = btusb_setup_qca; |
| 3065 | hdev->set_bdaddr = btusb_set_bdaddr_ath3012; | 3075 | hdev->set_bdaddr = btusb_set_bdaddr_ath3012; |
| 3066 | set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); | 3076 | set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); |
| 3077 | btusb_check_needs_reset_resume(intf); | ||
| 3067 | } | 3078 | } |
| 3068 | 3079 | ||
| 3069 | #ifdef CONFIG_BT_HCIBTUSB_RTL | 3080 | #ifdef CONFIG_BT_HCIBTUSB_RTL |
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index c381c8e396fc..79d8c84693a1 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c | |||
| @@ -195,7 +195,7 @@ static int uninorth_insert_memory(struct agp_memory *mem, off_t pg_start, int ty | |||
| 195 | return 0; | 195 | return 0; |
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | int uninorth_remove_memory(struct agp_memory *mem, off_t pg_start, int type) | 198 | static int uninorth_remove_memory(struct agp_memory *mem, off_t pg_start, int type) |
| 199 | { | 199 | { |
| 200 | size_t i; | 200 | size_t i; |
| 201 | u32 *gp; | 201 | u32 *gp; |
| @@ -470,7 +470,7 @@ static int uninorth_free_gatt_table(struct agp_bridge_data *bridge) | |||
| 470 | return 0; | 470 | return 0; |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | void null_cache_flush(void) | 473 | static void null_cache_flush(void) |
| 474 | { | 474 | { |
| 475 | mb(); | 475 | mb(); |
| 476 | } | 476 | } |
diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c index c58019750b7e..a2f8c42e527a 100644 --- a/drivers/clk/clk-cs2000-cp.c +++ b/drivers/clk/clk-cs2000-cp.c | |||
| @@ -541,7 +541,7 @@ probe_err: | |||
| 541 | return ret; | 541 | return ret; |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | static int cs2000_resume(struct device *dev) | 544 | static int __maybe_unused cs2000_resume(struct device *dev) |
| 545 | { | 545 | { |
| 546 | struct cs2000_priv *priv = dev_get_drvdata(dev); | 546 | struct cs2000_priv *priv = dev_get_drvdata(dev); |
| 547 | 547 | ||
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index ac4a042f8658..1628b93655ed 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c | |||
| @@ -112,10 +112,18 @@ static int clk_mux_set_parent(struct clk_hw *hw, u8 index) | |||
| 112 | return 0; | 112 | return 0; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | static int clk_mux_determine_rate(struct clk_hw *hw, | ||
| 116 | struct clk_rate_request *req) | ||
| 117 | { | ||
| 118 | struct clk_mux *mux = to_clk_mux(hw); | ||
| 119 | |||
| 120 | return clk_mux_determine_rate_flags(hw, req, mux->flags); | ||
| 121 | } | ||
| 122 | |||
| 115 | const struct clk_ops clk_mux_ops = { | 123 | const struct clk_ops clk_mux_ops = { |
| 116 | .get_parent = clk_mux_get_parent, | 124 | .get_parent = clk_mux_get_parent, |
| 117 | .set_parent = clk_mux_set_parent, | 125 | .set_parent = clk_mux_set_parent, |
| 118 | .determine_rate = __clk_mux_determine_rate, | 126 | .determine_rate = clk_mux_determine_rate, |
| 119 | }; | 127 | }; |
| 120 | EXPORT_SYMBOL_GPL(clk_mux_ops); | 128 | EXPORT_SYMBOL_GPL(clk_mux_ops); |
| 121 | 129 | ||
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index f1d5967b4b39..edd3cf451401 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c | |||
| @@ -216,7 +216,7 @@ static const char * const usart1_src[] = { | |||
| 216 | "pclk5", "pll3_q", "ck_hsi", "ck_csi", "pll4_q", "ck_hse" | 216 | "pclk5", "pll3_q", "ck_hsi", "ck_csi", "pll4_q", "ck_hse" |
| 217 | }; | 217 | }; |
| 218 | 218 | ||
| 219 | const char * const usart234578_src[] = { | 219 | static const char * const usart234578_src[] = { |
| 220 | "pclk1", "pll4_q", "ck_hsi", "ck_csi", "ck_hse" | 220 | "pclk1", "pll4_q", "ck_hsi", "ck_csi", "ck_hse" |
| 221 | }; | 221 | }; |
| 222 | 222 | ||
| @@ -224,10 +224,6 @@ static const char * const usart6_src[] = { | |||
| 224 | "pclk2", "pll4_q", "ck_hsi", "ck_csi", "ck_hse" | 224 | "pclk2", "pll4_q", "ck_hsi", "ck_csi", "ck_hse" |
| 225 | }; | 225 | }; |
| 226 | 226 | ||
| 227 | static const char * const dfsdm_src[] = { | ||
| 228 | "pclk2", "ck_mcu" | ||
| 229 | }; | ||
| 230 | |||
| 231 | static const char * const fdcan_src[] = { | 227 | static const char * const fdcan_src[] = { |
| 232 | "ck_hse", "pll3_q", "pll4_q" | 228 | "ck_hse", "pll3_q", "pll4_q" |
| 233 | }; | 229 | }; |
| @@ -316,10 +312,8 @@ struct stm32_clk_mgate { | |||
| 316 | struct clock_config { | 312 | struct clock_config { |
| 317 | u32 id; | 313 | u32 id; |
| 318 | const char *name; | 314 | const char *name; |
| 319 | union { | 315 | const char *parent_name; |
| 320 | const char *parent_name; | 316 | const char * const *parent_names; |
| 321 | const char * const *parent_names; | ||
| 322 | }; | ||
| 323 | int num_parents; | 317 | int num_parents; |
| 324 | unsigned long flags; | 318 | unsigned long flags; |
| 325 | void *cfg; | 319 | void *cfg; |
| @@ -469,7 +463,7 @@ static void mp1_gate_clk_disable(struct clk_hw *hw) | |||
| 469 | } | 463 | } |
| 470 | } | 464 | } |
| 471 | 465 | ||
| 472 | const struct clk_ops mp1_gate_clk_ops = { | 466 | static const struct clk_ops mp1_gate_clk_ops = { |
| 473 | .enable = mp1_gate_clk_enable, | 467 | .enable = mp1_gate_clk_enable, |
| 474 | .disable = mp1_gate_clk_disable, | 468 | .disable = mp1_gate_clk_disable, |
| 475 | .is_enabled = clk_gate_is_enabled, | 469 | .is_enabled = clk_gate_is_enabled, |
| @@ -698,7 +692,7 @@ static void mp1_mgate_clk_disable(struct clk_hw *hw) | |||
| 698 | mp1_gate_clk_disable(hw); | 692 | mp1_gate_clk_disable(hw); |
| 699 | } | 693 | } |
| 700 | 694 | ||
| 701 | const struct clk_ops mp1_mgate_clk_ops = { | 695 | static const struct clk_ops mp1_mgate_clk_ops = { |
| 702 | .enable = mp1_mgate_clk_enable, | 696 | .enable = mp1_mgate_clk_enable, |
| 703 | .disable = mp1_mgate_clk_disable, | 697 | .disable = mp1_mgate_clk_disable, |
| 704 | .is_enabled = clk_gate_is_enabled, | 698 | .is_enabled = clk_gate_is_enabled, |
| @@ -732,7 +726,7 @@ static int clk_mmux_set_parent(struct clk_hw *hw, u8 index) | |||
| 732 | return 0; | 726 | return 0; |
| 733 | } | 727 | } |
| 734 | 728 | ||
| 735 | const struct clk_ops clk_mmux_ops = { | 729 | static const struct clk_ops clk_mmux_ops = { |
| 736 | .get_parent = clk_mmux_get_parent, | 730 | .get_parent = clk_mmux_get_parent, |
| 737 | .set_parent = clk_mmux_set_parent, | 731 | .set_parent = clk_mmux_set_parent, |
| 738 | .determine_rate = __clk_mux_determine_rate, | 732 | .determine_rate = __clk_mux_determine_rate, |
| @@ -1048,10 +1042,10 @@ struct stm32_pll_cfg { | |||
| 1048 | u32 offset; | 1042 | u32 offset; |
| 1049 | }; | 1043 | }; |
| 1050 | 1044 | ||
| 1051 | struct clk_hw *_clk_register_pll(struct device *dev, | 1045 | static struct clk_hw *_clk_register_pll(struct device *dev, |
| 1052 | struct clk_hw_onecell_data *clk_data, | 1046 | struct clk_hw_onecell_data *clk_data, |
| 1053 | void __iomem *base, spinlock_t *lock, | 1047 | void __iomem *base, spinlock_t *lock, |
| 1054 | const struct clock_config *cfg) | 1048 | const struct clock_config *cfg) |
| 1055 | { | 1049 | { |
| 1056 | struct stm32_pll_cfg *stm_pll_cfg = cfg->cfg; | 1050 | struct stm32_pll_cfg *stm_pll_cfg = cfg->cfg; |
| 1057 | 1051 | ||
| @@ -1405,7 +1399,8 @@ enum { | |||
| 1405 | G_USBH, | 1399 | G_USBH, |
| 1406 | G_ETHSTP, | 1400 | G_ETHSTP, |
| 1407 | G_RTCAPB, | 1401 | G_RTCAPB, |
| 1408 | G_TZC, | 1402 | G_TZC1, |
| 1403 | G_TZC2, | ||
| 1409 | G_TZPC, | 1404 | G_TZPC, |
| 1410 | G_IWDG1, | 1405 | G_IWDG1, |
| 1411 | G_BSEC, | 1406 | G_BSEC, |
| @@ -1417,7 +1412,7 @@ enum { | |||
| 1417 | G_LAST | 1412 | G_LAST |
| 1418 | }; | 1413 | }; |
| 1419 | 1414 | ||
| 1420 | struct stm32_mgate mp1_mgate[G_LAST]; | 1415 | static struct stm32_mgate mp1_mgate[G_LAST]; |
| 1421 | 1416 | ||
| 1422 | #define _K_GATE(_id, _gate_offset, _gate_bit_idx, _gate_flags,\ | 1417 | #define _K_GATE(_id, _gate_offset, _gate_bit_idx, _gate_flags,\ |
| 1423 | _mgate, _ops)\ | 1418 | _mgate, _ops)\ |
| @@ -1440,7 +1435,7 @@ struct stm32_mgate mp1_mgate[G_LAST]; | |||
| 1440 | &mp1_mgate[_id], &mp1_mgate_clk_ops) | 1435 | &mp1_mgate[_id], &mp1_mgate_clk_ops) |
| 1441 | 1436 | ||
| 1442 | /* Peripheral gates */ | 1437 | /* Peripheral gates */ |
| 1443 | struct stm32_gate_cfg per_gate_cfg[G_LAST] = { | 1438 | static struct stm32_gate_cfg per_gate_cfg[G_LAST] = { |
| 1444 | /* Multi gates */ | 1439 | /* Multi gates */ |
| 1445 | K_GATE(G_MDIO, RCC_APB1ENSETR, 31, 0), | 1440 | K_GATE(G_MDIO, RCC_APB1ENSETR, 31, 0), |
| 1446 | K_MGATE(G_DAC12, RCC_APB1ENSETR, 29, 0), | 1441 | K_MGATE(G_DAC12, RCC_APB1ENSETR, 29, 0), |
| @@ -1506,7 +1501,8 @@ struct stm32_gate_cfg per_gate_cfg[G_LAST] = { | |||
| 1506 | K_GATE(G_BSEC, RCC_APB5ENSETR, 16, 0), | 1501 | K_GATE(G_BSEC, RCC_APB5ENSETR, 16, 0), |
| 1507 | K_GATE(G_IWDG1, RCC_APB5ENSETR, 15, 0), | 1502 | K_GATE(G_IWDG1, RCC_APB5ENSETR, 15, 0), |
| 1508 | K_GATE(G_TZPC, RCC_APB5ENSETR, 13, 0), | 1503 | K_GATE(G_TZPC, RCC_APB5ENSETR, 13, 0), |
| 1509 | K_GATE(G_TZC, RCC_APB5ENSETR, 12, 0), | 1504 | K_GATE(G_TZC2, RCC_APB5ENSETR, 12, 0), |
| 1505 | K_GATE(G_TZC1, RCC_APB5ENSETR, 11, 0), | ||
| 1510 | K_GATE(G_RTCAPB, RCC_APB5ENSETR, 8, 0), | 1506 | K_GATE(G_RTCAPB, RCC_APB5ENSETR, 8, 0), |
| 1511 | K_MGATE(G_USART1, RCC_APB5ENSETR, 4, 0), | 1507 | K_MGATE(G_USART1, RCC_APB5ENSETR, 4, 0), |
| 1512 | K_MGATE(G_I2C6, RCC_APB5ENSETR, 3, 0), | 1508 | K_MGATE(G_I2C6, RCC_APB5ENSETR, 3, 0), |
| @@ -1600,7 +1596,7 @@ enum { | |||
| 1600 | M_LAST | 1596 | M_LAST |
| 1601 | }; | 1597 | }; |
| 1602 | 1598 | ||
| 1603 | struct stm32_mmux ker_mux[M_LAST]; | 1599 | static struct stm32_mmux ker_mux[M_LAST]; |
| 1604 | 1600 | ||
| 1605 | #define _K_MUX(_id, _offset, _shift, _width, _mux_flags, _mmux, _ops)\ | 1601 | #define _K_MUX(_id, _offset, _shift, _width, _mux_flags, _mmux, _ops)\ |
| 1606 | [_id] = {\ | 1602 | [_id] = {\ |
| @@ -1623,7 +1619,7 @@ struct stm32_mmux ker_mux[M_LAST]; | |||
| 1623 | _K_MUX(_id, _offset, _shift, _width, _mux_flags,\ | 1619 | _K_MUX(_id, _offset, _shift, _width, _mux_flags,\ |
| 1624 | &ker_mux[_id], &clk_mmux_ops) | 1620 | &ker_mux[_id], &clk_mmux_ops) |
| 1625 | 1621 | ||
| 1626 | const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = { | 1622 | static const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = { |
| 1627 | /* Kernel multi mux */ | 1623 | /* Kernel multi mux */ |
| 1628 | K_MMUX(M_SDMMC12, RCC_SDMMC12CKSELR, 0, 3, 0), | 1624 | K_MMUX(M_SDMMC12, RCC_SDMMC12CKSELR, 0, 3, 0), |
| 1629 | K_MMUX(M_SPI23, RCC_SPI2S23CKSELR, 0, 3, 0), | 1625 | K_MMUX(M_SPI23, RCC_SPI2S23CKSELR, 0, 3, 0), |
| @@ -1860,7 +1856,8 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1860 | PCLK(USART1, "usart1", "pclk5", 0, G_USART1), | 1856 | PCLK(USART1, "usart1", "pclk5", 0, G_USART1), |
| 1861 | PCLK(RTCAPB, "rtcapb", "pclk5", CLK_IGNORE_UNUSED | | 1857 | PCLK(RTCAPB, "rtcapb", "pclk5", CLK_IGNORE_UNUSED | |
| 1862 | CLK_IS_CRITICAL, G_RTCAPB), | 1858 | CLK_IS_CRITICAL, G_RTCAPB), |
| 1863 | PCLK(TZC, "tzc", "pclk5", CLK_IGNORE_UNUSED, G_TZC), | 1859 | PCLK(TZC1, "tzc1", "ck_axi", CLK_IGNORE_UNUSED, G_TZC1), |
| 1860 | PCLK(TZC2, "tzc2", "ck_axi", CLK_IGNORE_UNUSED, G_TZC2), | ||
| 1864 | PCLK(TZPC, "tzpc", "pclk5", CLK_IGNORE_UNUSED, G_TZPC), | 1861 | PCLK(TZPC, "tzpc", "pclk5", CLK_IGNORE_UNUSED, G_TZPC), |
| 1865 | PCLK(IWDG1, "iwdg1", "pclk5", 0, G_IWDG1), | 1862 | PCLK(IWDG1, "iwdg1", "pclk5", 0, G_IWDG1), |
| 1866 | PCLK(BSEC, "bsec", "pclk5", CLK_IGNORE_UNUSED, G_BSEC), | 1863 | PCLK(BSEC, "bsec", "pclk5", CLK_IGNORE_UNUSED, G_BSEC), |
| @@ -1916,8 +1913,7 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1916 | KCLK(RNG1_K, "rng1_k", rng_src, 0, G_RNG1, M_RNG1), | 1913 | KCLK(RNG1_K, "rng1_k", rng_src, 0, G_RNG1, M_RNG1), |
| 1917 | KCLK(RNG2_K, "rng2_k", rng_src, 0, G_RNG2, M_RNG2), | 1914 | KCLK(RNG2_K, "rng2_k", rng_src, 0, G_RNG2, M_RNG2), |
| 1918 | KCLK(USBPHY_K, "usbphy_k", usbphy_src, 0, G_USBPHY, M_USBPHY), | 1915 | KCLK(USBPHY_K, "usbphy_k", usbphy_src, 0, G_USBPHY, M_USBPHY), |
| 1919 | KCLK(STGEN_K, "stgen_k", stgen_src, CLK_IGNORE_UNUSED, | 1916 | KCLK(STGEN_K, "stgen_k", stgen_src, CLK_IS_CRITICAL, G_STGEN, M_STGEN), |
| 1920 | G_STGEN, M_STGEN), | ||
| 1921 | KCLK(SPDIF_K, "spdif_k", spdif_src, 0, G_SPDIF, M_SPDIF), | 1917 | KCLK(SPDIF_K, "spdif_k", spdif_src, 0, G_SPDIF, M_SPDIF), |
| 1922 | KCLK(SPI1_K, "spi1_k", spi123_src, 0, G_SPI1, M_SPI1), | 1918 | KCLK(SPI1_K, "spi1_k", spi123_src, 0, G_SPI1, M_SPI1), |
| 1923 | KCLK(SPI2_K, "spi2_k", spi123_src, 0, G_SPI2, M_SPI23), | 1919 | KCLK(SPI2_K, "spi2_k", spi123_src, 0, G_SPI2, M_SPI23), |
| @@ -1948,8 +1944,8 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1948 | KCLK(FDCAN_K, "fdcan_k", fdcan_src, 0, G_FDCAN, M_FDCAN), | 1944 | KCLK(FDCAN_K, "fdcan_k", fdcan_src, 0, G_FDCAN, M_FDCAN), |
| 1949 | KCLK(SAI1_K, "sai1_k", sai_src, 0, G_SAI1, M_SAI1), | 1945 | KCLK(SAI1_K, "sai1_k", sai_src, 0, G_SAI1, M_SAI1), |
| 1950 | KCLK(SAI2_K, "sai2_k", sai2_src, 0, G_SAI2, M_SAI2), | 1946 | KCLK(SAI2_K, "sai2_k", sai2_src, 0, G_SAI2, M_SAI2), |
| 1951 | KCLK(SAI3_K, "sai3_k", sai_src, 0, G_SAI2, M_SAI3), | 1947 | KCLK(SAI3_K, "sai3_k", sai_src, 0, G_SAI3, M_SAI3), |
| 1952 | KCLK(SAI4_K, "sai4_k", sai_src, 0, G_SAI2, M_SAI4), | 1948 | KCLK(SAI4_K, "sai4_k", sai_src, 0, G_SAI4, M_SAI4), |
| 1953 | KCLK(ADC12_K, "adc12_k", adc12_src, 0, G_ADC12, M_ADC12), | 1949 | KCLK(ADC12_K, "adc12_k", adc12_src, 0, G_ADC12, M_ADC12), |
| 1954 | KCLK(DSI_K, "dsi_k", dsi_src, 0, G_DSI, M_DSI), | 1950 | KCLK(DSI_K, "dsi_k", dsi_src, 0, G_DSI, M_DSI), |
| 1955 | KCLK(ADFSDM_K, "adfsdm_k", sai_src, 0, G_ADFSDM, M_SAI1), | 1951 | KCLK(ADFSDM_K, "adfsdm_k", sai_src, 0, G_ADFSDM, M_SAI1), |
| @@ -1992,10 +1988,6 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1992 | _DIV(RCC_MCO2CFGR, 4, 4, 0, NULL)), | 1988 | _DIV(RCC_MCO2CFGR, 4, 4, 0, NULL)), |
| 1993 | 1989 | ||
| 1994 | /* Debug clocks */ | 1990 | /* Debug clocks */ |
| 1995 | FIXED_FACTOR(NO_ID, "ck_axi_div2", "ck_axi", 0, 1, 2), | ||
| 1996 | |||
| 1997 | GATE(DBG, "ck_apb_dbg", "ck_axi_div2", 0, RCC_DBGCFGR, 8, 0), | ||
| 1998 | |||
| 1999 | GATE(CK_DBG, "ck_sys_dbg", "ck_axi", 0, RCC_DBGCFGR, 8, 0), | 1991 | GATE(CK_DBG, "ck_sys_dbg", "ck_axi", 0, RCC_DBGCFGR, 8, 0), |
| 2000 | 1992 | ||
| 2001 | COMPOSITE(CK_TRACE, "ck_trace", ck_trace_src, CLK_OPS_PARENT_ENABLE, | 1993 | COMPOSITE(CK_TRACE, "ck_trace", ck_trace_src, CLK_OPS_PARENT_ENABLE, |
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index ea67ac81c6f9..7af555f0e60c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
| @@ -426,9 +426,9 @@ static bool mux_is_better_rate(unsigned long rate, unsigned long now, | |||
| 426 | return now <= rate && now > best; | 426 | return now <= rate && now > best; |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | static int | 429 | int clk_mux_determine_rate_flags(struct clk_hw *hw, |
| 430 | clk_mux_determine_rate_flags(struct clk_hw *hw, struct clk_rate_request *req, | 430 | struct clk_rate_request *req, |
| 431 | unsigned long flags) | 431 | unsigned long flags) |
| 432 | { | 432 | { |
| 433 | struct clk_core *core = hw->core, *parent, *best_parent = NULL; | 433 | struct clk_core *core = hw->core, *parent, *best_parent = NULL; |
| 434 | int i, num_parents, ret; | 434 | int i, num_parents, ret; |
| @@ -488,6 +488,7 @@ out: | |||
| 488 | 488 | ||
| 489 | return 0; | 489 | return 0; |
| 490 | } | 490 | } |
| 491 | EXPORT_SYMBOL_GPL(clk_mux_determine_rate_flags); | ||
| 491 | 492 | ||
| 492 | struct clk *__clk_lookup(const char *name) | 493 | struct clk *__clk_lookup(const char *name) |
| 493 | { | 494 | { |
diff --git a/drivers/clk/meson/clk-regmap.c b/drivers/clk/meson/clk-regmap.c index 3645fdb62343..ab7a3556f5b2 100644 --- a/drivers/clk/meson/clk-regmap.c +++ b/drivers/clk/meson/clk-regmap.c | |||
| @@ -153,10 +153,19 @@ static int clk_regmap_mux_set_parent(struct clk_hw *hw, u8 index) | |||
| 153 | val << mux->shift); | 153 | val << mux->shift); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | static int clk_regmap_mux_determine_rate(struct clk_hw *hw, | ||
| 157 | struct clk_rate_request *req) | ||
| 158 | { | ||
| 159 | struct clk_regmap *clk = to_clk_regmap(hw); | ||
| 160 | struct clk_regmap_mux_data *mux = clk_get_regmap_mux_data(clk); | ||
| 161 | |||
| 162 | return clk_mux_determine_rate_flags(hw, req, mux->flags); | ||
| 163 | } | ||
| 164 | |||
| 156 | const struct clk_ops clk_regmap_mux_ops = { | 165 | const struct clk_ops clk_regmap_mux_ops = { |
| 157 | .get_parent = clk_regmap_mux_get_parent, | 166 | .get_parent = clk_regmap_mux_get_parent, |
| 158 | .set_parent = clk_regmap_mux_set_parent, | 167 | .set_parent = clk_regmap_mux_set_parent, |
| 159 | .determine_rate = __clk_mux_determine_rate, | 168 | .determine_rate = clk_regmap_mux_determine_rate, |
| 160 | }; | 169 | }; |
| 161 | EXPORT_SYMBOL_GPL(clk_regmap_mux_ops); | 170 | EXPORT_SYMBOL_GPL(clk_regmap_mux_ops); |
| 162 | 171 | ||
diff --git a/drivers/clk/meson/gxbb-aoclk.h b/drivers/clk/meson/gxbb-aoclk.h index 0be78383f257..badc4c22b4ee 100644 --- a/drivers/clk/meson/gxbb-aoclk.h +++ b/drivers/clk/meson/gxbb-aoclk.h | |||
| @@ -17,8 +17,6 @@ | |||
| 17 | #define AO_RTC_ALT_CLK_CNTL0 0x94 | 17 | #define AO_RTC_ALT_CLK_CNTL0 0x94 |
| 18 | #define AO_RTC_ALT_CLK_CNTL1 0x98 | 18 | #define AO_RTC_ALT_CLK_CNTL1 0x98 |
| 19 | 19 | ||
| 20 | extern const struct clk_ops meson_aoclk_gate_regmap_ops; | ||
| 21 | |||
| 22 | struct aoclk_cec_32k { | 20 | struct aoclk_cec_32k { |
| 23 | struct clk_hw hw; | 21 | struct clk_hw hw; |
| 24 | struct regmap *regmap; | 22 | struct regmap *regmap; |
diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index cc2992493e0b..d0524ec71aad 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c | |||
| @@ -253,7 +253,7 @@ static struct clk_fixed_factor meson8b_fclk_div3_div = { | |||
| 253 | .mult = 1, | 253 | .mult = 1, |
| 254 | .div = 3, | 254 | .div = 3, |
| 255 | .hw.init = &(struct clk_init_data){ | 255 | .hw.init = &(struct clk_init_data){ |
| 256 | .name = "fclk_div_div3", | 256 | .name = "fclk_div3_div", |
| 257 | .ops = &clk_fixed_factor_ops, | 257 | .ops = &clk_fixed_factor_ops, |
| 258 | .parent_names = (const char *[]){ "fixed_pll" }, | 258 | .parent_names = (const char *[]){ "fixed_pll" }, |
| 259 | .num_parents = 1, | 259 | .num_parents = 1, |
| @@ -632,7 +632,8 @@ static struct clk_regmap meson8b_cpu_clk = { | |||
| 632 | .hw.init = &(struct clk_init_data){ | 632 | .hw.init = &(struct clk_init_data){ |
| 633 | .name = "cpu_clk", | 633 | .name = "cpu_clk", |
| 634 | .ops = &clk_regmap_mux_ro_ops, | 634 | .ops = &clk_regmap_mux_ro_ops, |
| 635 | .parent_names = (const char *[]){ "xtal", "cpu_out_sel" }, | 635 | .parent_names = (const char *[]){ "xtal", |
| 636 | "cpu_scale_out_sel" }, | ||
| 636 | .num_parents = 2, | 637 | .num_parents = 2, |
| 637 | .flags = (CLK_SET_RATE_PARENT | | 638 | .flags = (CLK_SET_RATE_PARENT | |
| 638 | CLK_SET_RATE_NO_REPARENT), | 639 | CLK_SET_RATE_NO_REPARENT), |
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index bc5fc1630876..b15115a48775 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c | |||
| @@ -126,6 +126,49 @@ static void cppc_cpufreq_stop_cpu(struct cpufreq_policy *policy) | |||
| 126 | cpu->perf_caps.lowest_perf, cpu_num, ret); | 126 | cpu->perf_caps.lowest_perf, cpu_num, ret); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | /* | ||
| 130 | * The PCC subspace describes the rate at which platform can accept commands | ||
| 131 | * on the shared PCC channel (including READs which do not count towards freq | ||
| 132 | * trasition requests), so ideally we need to use the PCC values as a fallback | ||
| 133 | * if we don't have a platform specific transition_delay_us | ||
| 134 | */ | ||
| 135 | #ifdef CONFIG_ARM64 | ||
| 136 | #include <asm/cputype.h> | ||
| 137 | |||
| 138 | static unsigned int cppc_cpufreq_get_transition_delay_us(int cpu) | ||
| 139 | { | ||
| 140 | unsigned long implementor = read_cpuid_implementor(); | ||
| 141 | unsigned long part_num = read_cpuid_part_number(); | ||
| 142 | unsigned int delay_us = 0; | ||
| 143 | |||
| 144 | switch (implementor) { | ||
| 145 | case ARM_CPU_IMP_QCOM: | ||
| 146 | switch (part_num) { | ||
| 147 | case QCOM_CPU_PART_FALKOR_V1: | ||
| 148 | case QCOM_CPU_PART_FALKOR: | ||
| 149 | delay_us = 10000; | ||
| 150 | break; | ||
| 151 | default: | ||
| 152 | delay_us = cppc_get_transition_latency(cpu) / NSEC_PER_USEC; | ||
| 153 | break; | ||
| 154 | } | ||
| 155 | break; | ||
| 156 | default: | ||
| 157 | delay_us = cppc_get_transition_latency(cpu) / NSEC_PER_USEC; | ||
| 158 | break; | ||
| 159 | } | ||
| 160 | |||
| 161 | return delay_us; | ||
| 162 | } | ||
| 163 | |||
| 164 | #else | ||
| 165 | |||
| 166 | static unsigned int cppc_cpufreq_get_transition_delay_us(int cpu) | ||
| 167 | { | ||
| 168 | return cppc_get_transition_latency(cpu) / NSEC_PER_USEC; | ||
| 169 | } | ||
| 170 | #endif | ||
| 171 | |||
| 129 | static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) | 172 | static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) |
| 130 | { | 173 | { |
| 131 | struct cppc_cpudata *cpu; | 174 | struct cppc_cpudata *cpu; |
| @@ -162,8 +205,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
| 162 | cpu->perf_caps.highest_perf; | 205 | cpu->perf_caps.highest_perf; |
| 163 | policy->cpuinfo.max_freq = cppc_dmi_max_khz; | 206 | policy->cpuinfo.max_freq = cppc_dmi_max_khz; |
| 164 | 207 | ||
| 165 | policy->transition_delay_us = cppc_get_transition_latency(cpu_num) / | 208 | policy->transition_delay_us = cppc_cpufreq_get_transition_delay_us(cpu_num); |
| 166 | NSEC_PER_USEC; | ||
| 167 | policy->shared_type = cpu->shared_type; | 209 | policy->shared_type = cpu->shared_type; |
| 168 | 210 | ||
| 169 | if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { | 211 | if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { |
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index 77e485557498..6f693b7d5220 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c | |||
| @@ -384,7 +384,7 @@ static void aspeed_gpio_irq_set_mask(struct irq_data *d, bool set) | |||
| 384 | if (set) | 384 | if (set) |
| 385 | reg |= bit; | 385 | reg |= bit; |
| 386 | else | 386 | else |
| 387 | reg &= bit; | 387 | reg &= ~bit; |
| 388 | iowrite32(reg, addr); | 388 | iowrite32(reg, addr); |
| 389 | 389 | ||
| 390 | spin_unlock_irqrestore(&gpio->lock, flags); | 390 | spin_unlock_irqrestore(&gpio->lock, flags); |
diff --git a/drivers/gpio/gpio-pci-idio-16.c b/drivers/gpio/gpio-pci-idio-16.c index 1948724d8c36..25d16b2af1c3 100644 --- a/drivers/gpio/gpio-pci-idio-16.c +++ b/drivers/gpio/gpio-pci-idio-16.c | |||
| @@ -116,9 +116,9 @@ static int idio_16_gpio_get_multiple(struct gpio_chip *chip, | |||
| 116 | unsigned long word_mask; | 116 | unsigned long word_mask; |
| 117 | const unsigned long port_mask = GENMASK(gpio_reg_size - 1, 0); | 117 | const unsigned long port_mask = GENMASK(gpio_reg_size - 1, 0); |
| 118 | unsigned long port_state; | 118 | unsigned long port_state; |
| 119 | u8 __iomem ports[] = { | 119 | void __iomem *ports[] = { |
| 120 | idio16gpio->reg->out0_7, idio16gpio->reg->out8_15, | 120 | &idio16gpio->reg->out0_7, &idio16gpio->reg->out8_15, |
| 121 | idio16gpio->reg->in0_7, idio16gpio->reg->in8_15, | 121 | &idio16gpio->reg->in0_7, &idio16gpio->reg->in8_15, |
| 122 | }; | 122 | }; |
| 123 | 123 | ||
| 124 | /* clear bits array to a clean slate */ | 124 | /* clear bits array to a clean slate */ |
| @@ -143,7 +143,7 @@ static int idio_16_gpio_get_multiple(struct gpio_chip *chip, | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | /* read bits from current gpio port */ | 145 | /* read bits from current gpio port */ |
| 146 | port_state = ioread8(ports + i); | 146 | port_state = ioread8(ports[i]); |
| 147 | 147 | ||
| 148 | /* store acquired bits at respective bits array offset */ | 148 | /* store acquired bits at respective bits array offset */ |
| 149 | bits[word_index] |= port_state << word_offset; | 149 | bits[word_index] |= port_state << word_offset; |
diff --git a/drivers/gpio/gpio-pcie-idio-24.c b/drivers/gpio/gpio-pcie-idio-24.c index 835607ecf658..f953541e7890 100644 --- a/drivers/gpio/gpio-pcie-idio-24.c +++ b/drivers/gpio/gpio-pcie-idio-24.c | |||
| @@ -206,10 +206,10 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip, | |||
| 206 | unsigned long word_mask; | 206 | unsigned long word_mask; |
| 207 | const unsigned long port_mask = GENMASK(gpio_reg_size - 1, 0); | 207 | const unsigned long port_mask = GENMASK(gpio_reg_size - 1, 0); |
| 208 | unsigned long port_state; | 208 | unsigned long port_state; |
| 209 | u8 __iomem ports[] = { | 209 | void __iomem *ports[] = { |
| 210 | idio24gpio->reg->out0_7, idio24gpio->reg->out8_15, | 210 | &idio24gpio->reg->out0_7, &idio24gpio->reg->out8_15, |
| 211 | idio24gpio->reg->out16_23, idio24gpio->reg->in0_7, | 211 | &idio24gpio->reg->out16_23, &idio24gpio->reg->in0_7, |
| 212 | idio24gpio->reg->in8_15, idio24gpio->reg->in16_23, | 212 | &idio24gpio->reg->in8_15, &idio24gpio->reg->in16_23, |
| 213 | }; | 213 | }; |
| 214 | const unsigned long out_mode_mask = BIT(1); | 214 | const unsigned long out_mode_mask = BIT(1); |
| 215 | 215 | ||
| @@ -217,7 +217,7 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip, | |||
| 217 | bitmap_zero(bits, chip->ngpio); | 217 | bitmap_zero(bits, chip->ngpio); |
| 218 | 218 | ||
| 219 | /* get bits are evaluated a gpio port register at a time */ | 219 | /* get bits are evaluated a gpio port register at a time */ |
| 220 | for (i = 0; i < ARRAY_SIZE(ports); i++) { | 220 | for (i = 0; i < ARRAY_SIZE(ports) + 1; i++) { |
| 221 | /* gpio offset in bits array */ | 221 | /* gpio offset in bits array */ |
| 222 | bits_offset = i * gpio_reg_size; | 222 | bits_offset = i * gpio_reg_size; |
| 223 | 223 | ||
| @@ -236,7 +236,7 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip, | |||
| 236 | 236 | ||
| 237 | /* read bits from current gpio port (port 6 is TTL GPIO) */ | 237 | /* read bits from current gpio port (port 6 is TTL GPIO) */ |
| 238 | if (i < 6) | 238 | if (i < 6) |
| 239 | port_state = ioread8(ports + i); | 239 | port_state = ioread8(ports[i]); |
| 240 | else if (ioread8(&idio24gpio->reg->ctl) & out_mode_mask) | 240 | else if (ioread8(&idio24gpio->reg->ctl) & out_mode_mask) |
| 241 | port_state = ioread8(&idio24gpio->reg->ttl_out0_7); | 241 | port_state = ioread8(&idio24gpio->reg->ttl_out0_7); |
| 242 | else | 242 | else |
| @@ -301,9 +301,9 @@ static void idio_24_gpio_set_multiple(struct gpio_chip *chip, | |||
| 301 | const unsigned long port_mask = GENMASK(gpio_reg_size, 0); | 301 | const unsigned long port_mask = GENMASK(gpio_reg_size, 0); |
| 302 | unsigned long flags; | 302 | unsigned long flags; |
| 303 | unsigned int out_state; | 303 | unsigned int out_state; |
| 304 | u8 __iomem ports[] = { | 304 | void __iomem *ports[] = { |
| 305 | idio24gpio->reg->out0_7, idio24gpio->reg->out8_15, | 305 | &idio24gpio->reg->out0_7, &idio24gpio->reg->out8_15, |
| 306 | idio24gpio->reg->out16_23 | 306 | &idio24gpio->reg->out16_23 |
| 307 | }; | 307 | }; |
| 308 | const unsigned long out_mode_mask = BIT(1); | 308 | const unsigned long out_mode_mask = BIT(1); |
| 309 | const unsigned int ttl_offset = 48; | 309 | const unsigned int ttl_offset = 48; |
| @@ -327,9 +327,9 @@ static void idio_24_gpio_set_multiple(struct gpio_chip *chip, | |||
| 327 | raw_spin_lock_irqsave(&idio24gpio->lock, flags); | 327 | raw_spin_lock_irqsave(&idio24gpio->lock, flags); |
| 328 | 328 | ||
| 329 | /* process output lines */ | 329 | /* process output lines */ |
| 330 | out_state = ioread8(ports + i) & ~gpio_mask; | 330 | out_state = ioread8(ports[i]) & ~gpio_mask; |
| 331 | out_state |= (*bits >> bits_offset) & gpio_mask; | 331 | out_state |= (*bits >> bits_offset) & gpio_mask; |
| 332 | iowrite8(out_state, ports + i); | 332 | iowrite8(out_state, ports[i]); |
| 333 | 333 | ||
| 334 | raw_spin_unlock_irqrestore(&idio24gpio->lock, flags); | 334 | raw_spin_unlock_irqrestore(&idio24gpio->lock, flags); |
| 335 | } | 335 | } |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 43aeb07343ec..d8ccb500872f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
| @@ -497,7 +497,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip) | |||
| 497 | struct gpiohandle_request handlereq; | 497 | struct gpiohandle_request handlereq; |
| 498 | struct linehandle_state *lh; | 498 | struct linehandle_state *lh; |
| 499 | struct file *file; | 499 | struct file *file; |
| 500 | int fd, i, ret; | 500 | int fd, i, count = 0, ret; |
| 501 | u32 lflags; | 501 | u32 lflags; |
| 502 | 502 | ||
| 503 | if (copy_from_user(&handlereq, ip, sizeof(handlereq))) | 503 | if (copy_from_user(&handlereq, ip, sizeof(handlereq))) |
| @@ -558,6 +558,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip) | |||
| 558 | if (ret) | 558 | if (ret) |
| 559 | goto out_free_descs; | 559 | goto out_free_descs; |
| 560 | lh->descs[i] = desc; | 560 | lh->descs[i] = desc; |
| 561 | count = i; | ||
| 561 | 562 | ||
| 562 | if (lflags & GPIOHANDLE_REQUEST_ACTIVE_LOW) | 563 | if (lflags & GPIOHANDLE_REQUEST_ACTIVE_LOW) |
| 563 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); | 564 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); |
| @@ -628,7 +629,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip) | |||
| 628 | out_put_unused_fd: | 629 | out_put_unused_fd: |
| 629 | put_unused_fd(fd); | 630 | put_unused_fd(fd); |
| 630 | out_free_descs: | 631 | out_free_descs: |
| 631 | for (; i >= 0; i--) | 632 | for (i = 0; i < count; i++) |
| 632 | gpiod_free(lh->descs[i]); | 633 | gpiod_free(lh->descs[i]); |
| 633 | kfree(lh->label); | 634 | kfree(lh->label); |
| 634 | out_free_lh: | 635 | out_free_lh: |
| @@ -902,7 +903,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) | |||
| 902 | desc = &gdev->descs[offset]; | 903 | desc = &gdev->descs[offset]; |
| 903 | ret = gpiod_request(desc, le->label); | 904 | ret = gpiod_request(desc, le->label); |
| 904 | if (ret) | 905 | if (ret) |
| 905 | goto out_free_desc; | 906 | goto out_free_label; |
| 906 | le->desc = desc; | 907 | le->desc = desc; |
| 907 | le->eflags = eflags; | 908 | le->eflags = eflags; |
| 908 | 909 | ||
diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c index 15e5b72e6e00..8446e0876ac8 100644 --- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c +++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c | |||
| @@ -1451,7 +1451,7 @@ bool calculate_user_regamma_ramp(struct dc_transfer_func *output_tf, | |||
| 1451 | 1451 | ||
| 1452 | kfree(rgb_regamma); | 1452 | kfree(rgb_regamma); |
| 1453 | rgb_regamma_alloc_fail: | 1453 | rgb_regamma_alloc_fail: |
| 1454 | kfree(rgb_user); | 1454 | kvfree(rgb_user); |
| 1455 | rgb_user_alloc_fail: | 1455 | rgb_user_alloc_fail: |
| 1456 | return ret; | 1456 | return ret; |
| 1457 | } | 1457 | } |
diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 1d75d3a1f951..fa2c7997e2fd 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig | |||
| @@ -84,6 +84,7 @@ config DRM_SIL_SII8620 | |||
| 84 | tristate "Silicon Image SII8620 HDMI/MHL bridge" | 84 | tristate "Silicon Image SII8620 HDMI/MHL bridge" |
| 85 | depends on OF && RC_CORE | 85 | depends on OF && RC_CORE |
| 86 | select DRM_KMS_HELPER | 86 | select DRM_KMS_HELPER |
| 87 | imply EXTCON | ||
| 87 | help | 88 | help |
| 88 | Silicon Image SII8620 HDMI/MHL bridge chip driver. | 89 | Silicon Image SII8620 HDMI/MHL bridge chip driver. |
| 89 | 90 | ||
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 26a22f529e9b..895741e9cd7d 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c | |||
| @@ -155,6 +155,8 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state) | |||
| 155 | state->connectors[i].state); | 155 | state->connectors[i].state); |
| 156 | state->connectors[i].ptr = NULL; | 156 | state->connectors[i].ptr = NULL; |
| 157 | state->connectors[i].state = NULL; | 157 | state->connectors[i].state = NULL; |
| 158 | state->connectors[i].old_state = NULL; | ||
| 159 | state->connectors[i].new_state = NULL; | ||
| 158 | drm_connector_put(connector); | 160 | drm_connector_put(connector); |
| 159 | } | 161 | } |
| 160 | 162 | ||
| @@ -169,6 +171,8 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state) | |||
| 169 | 171 | ||
| 170 | state->crtcs[i].ptr = NULL; | 172 | state->crtcs[i].ptr = NULL; |
| 171 | state->crtcs[i].state = NULL; | 173 | state->crtcs[i].state = NULL; |
| 174 | state->crtcs[i].old_state = NULL; | ||
| 175 | state->crtcs[i].new_state = NULL; | ||
| 172 | } | 176 | } |
| 173 | 177 | ||
| 174 | for (i = 0; i < config->num_total_plane; i++) { | 178 | for (i = 0; i < config->num_total_plane; i++) { |
| @@ -181,6 +185,8 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state) | |||
| 181 | state->planes[i].state); | 185 | state->planes[i].state); |
| 182 | state->planes[i].ptr = NULL; | 186 | state->planes[i].ptr = NULL; |
| 183 | state->planes[i].state = NULL; | 187 | state->planes[i].state = NULL; |
| 188 | state->planes[i].old_state = NULL; | ||
| 189 | state->planes[i].new_state = NULL; | ||
| 184 | } | 190 | } |
| 185 | 191 | ||
| 186 | for (i = 0; i < state->num_private_objs; i++) { | 192 | for (i = 0; i < state->num_private_objs; i++) { |
| @@ -190,6 +196,8 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state) | |||
| 190 | state->private_objs[i].state); | 196 | state->private_objs[i].state); |
| 191 | state->private_objs[i].ptr = NULL; | 197 | state->private_objs[i].ptr = NULL; |
| 192 | state->private_objs[i].state = NULL; | 198 | state->private_objs[i].state = NULL; |
| 199 | state->private_objs[i].old_state = NULL; | ||
| 200 | state->private_objs[i].new_state = NULL; | ||
| 193 | } | 201 | } |
| 194 | state->num_private_objs = 0; | 202 | state->num_private_objs = 0; |
| 195 | 203 | ||
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index e394799979a6..6d9b9453707c 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c | |||
| @@ -212,6 +212,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) | |||
| 212 | return -ENOMEM; | 212 | return -ENOMEM; |
| 213 | 213 | ||
| 214 | filp->private_data = priv; | 214 | filp->private_data = priv; |
| 215 | filp->f_mode |= FMODE_UNSIGNED_OFFSET; | ||
| 215 | priv->filp = filp; | 216 | priv->filp = filp; |
| 216 | priv->pid = get_pid(task_pid(current)); | 217 | priv->pid = get_pid(task_pid(current)); |
| 217 | priv->minor = minor; | 218 | priv->minor = minor; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 6f402c4f2bdd..ab61c038f42c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
| @@ -214,7 +214,6 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align, | |||
| 214 | INIT_LIST_HEAD(&nvbo->entry); | 214 | INIT_LIST_HEAD(&nvbo->entry); |
| 215 | INIT_LIST_HEAD(&nvbo->vma_list); | 215 | INIT_LIST_HEAD(&nvbo->vma_list); |
| 216 | nvbo->bo.bdev = &drm->ttm.bdev; | 216 | nvbo->bo.bdev = &drm->ttm.bdev; |
| 217 | nvbo->cli = cli; | ||
| 218 | 217 | ||
| 219 | /* This is confusing, and doesn't actually mean we want an uncached | 218 | /* This is confusing, and doesn't actually mean we want an uncached |
| 220 | * mapping, but is what NOUVEAU_GEM_DOMAIN_COHERENT gets translated | 219 | * mapping, but is what NOUVEAU_GEM_DOMAIN_COHERENT gets translated |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.h b/drivers/gpu/drm/nouveau/nouveau_bo.h index be8e00b49cde..73c48440d4d7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.h +++ b/drivers/gpu/drm/nouveau/nouveau_bo.h | |||
| @@ -26,8 +26,6 @@ struct nouveau_bo { | |||
| 26 | 26 | ||
| 27 | struct list_head vma_list; | 27 | struct list_head vma_list; |
| 28 | 28 | ||
| 29 | struct nouveau_cli *cli; | ||
| 30 | |||
| 31 | unsigned contig:1; | 29 | unsigned contig:1; |
| 32 | unsigned page:5; | 30 | unsigned page:5; |
| 33 | unsigned kind:8; | 31 | unsigned kind:8; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index dff51a0ee028..8c093ca4222e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c | |||
| @@ -63,7 +63,7 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, | |||
| 63 | struct ttm_mem_reg *reg) | 63 | struct ttm_mem_reg *reg) |
| 64 | { | 64 | { |
| 65 | struct nouveau_bo *nvbo = nouveau_bo(bo); | 65 | struct nouveau_bo *nvbo = nouveau_bo(bo); |
| 66 | struct nouveau_drm *drm = nvbo->cli->drm; | 66 | struct nouveau_drm *drm = nouveau_bdev(bo->bdev); |
| 67 | struct nouveau_mem *mem; | 67 | struct nouveau_mem *mem; |
| 68 | int ret; | 68 | int ret; |
| 69 | 69 | ||
| @@ -103,7 +103,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, | |||
| 103 | struct ttm_mem_reg *reg) | 103 | struct ttm_mem_reg *reg) |
| 104 | { | 104 | { |
| 105 | struct nouveau_bo *nvbo = nouveau_bo(bo); | 105 | struct nouveau_bo *nvbo = nouveau_bo(bo); |
| 106 | struct nouveau_drm *drm = nvbo->cli->drm; | 106 | struct nouveau_drm *drm = nouveau_bdev(bo->bdev); |
| 107 | struct nouveau_mem *mem; | 107 | struct nouveau_mem *mem; |
| 108 | int ret; | 108 | int ret; |
| 109 | 109 | ||
| @@ -131,7 +131,7 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man, | |||
| 131 | struct ttm_mem_reg *reg) | 131 | struct ttm_mem_reg *reg) |
| 132 | { | 132 | { |
| 133 | struct nouveau_bo *nvbo = nouveau_bo(bo); | 133 | struct nouveau_bo *nvbo = nouveau_bo(bo); |
| 134 | struct nouveau_drm *drm = nvbo->cli->drm; | 134 | struct nouveau_drm *drm = nouveau_bdev(bo->bdev); |
| 135 | struct nouveau_mem *mem; | 135 | struct nouveau_mem *mem; |
| 136 | int ret; | 136 | int ret; |
| 137 | 137 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 8bd739cfd00d..2b3ccd850750 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
| @@ -3264,10 +3264,11 @@ nv50_mstm_destroy_connector(struct drm_dp_mst_topology_mgr *mgr, | |||
| 3264 | 3264 | ||
| 3265 | drm_connector_unregister(&mstc->connector); | 3265 | drm_connector_unregister(&mstc->connector); |
| 3266 | 3266 | ||
| 3267 | drm_modeset_lock_all(drm->dev); | ||
| 3268 | drm_fb_helper_remove_one_connector(&drm->fbcon->helper, &mstc->connector); | 3267 | drm_fb_helper_remove_one_connector(&drm->fbcon->helper, &mstc->connector); |
| 3268 | |||
| 3269 | drm_modeset_lock(&drm->dev->mode_config.connection_mutex, NULL); | ||
| 3269 | mstc->port = NULL; | 3270 | mstc->port = NULL; |
| 3270 | drm_modeset_unlock_all(drm->dev); | 3271 | drm_modeset_unlock(&drm->dev->mode_config.connection_mutex); |
| 3271 | 3272 | ||
| 3272 | drm_connector_unreference(&mstc->connector); | 3273 | drm_connector_unreference(&mstc->connector); |
| 3273 | } | 3274 | } |
| @@ -3277,9 +3278,7 @@ nv50_mstm_register_connector(struct drm_connector *connector) | |||
| 3277 | { | 3278 | { |
| 3278 | struct nouveau_drm *drm = nouveau_drm(connector->dev); | 3279 | struct nouveau_drm *drm = nouveau_drm(connector->dev); |
| 3279 | 3280 | ||
| 3280 | drm_modeset_lock_all(drm->dev); | ||
| 3281 | drm_fb_helper_add_one_connector(&drm->fbcon->helper, connector); | 3281 | drm_fb_helper_add_one_connector(&drm->fbcon->helper, connector); |
| 3282 | drm_modeset_unlock_all(drm->dev); | ||
| 3283 | 3282 | ||
| 3284 | drm_connector_register(connector); | 3283 | drm_connector_register(connector); |
| 3285 | } | 3284 | } |
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 5e2e65e88847..7f3ac6b13b56 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c | |||
| @@ -828,6 +828,12 @@ static void dispc_ovl_set_scale_coef(struct dispc_device *dispc, | |||
| 828 | h_coef = dispc_ovl_get_scale_coef(fir_hinc, true); | 828 | h_coef = dispc_ovl_get_scale_coef(fir_hinc, true); |
| 829 | v_coef = dispc_ovl_get_scale_coef(fir_vinc, five_taps); | 829 | v_coef = dispc_ovl_get_scale_coef(fir_vinc, five_taps); |
| 830 | 830 | ||
| 831 | if (!h_coef || !v_coef) { | ||
| 832 | dev_err(&dispc->pdev->dev, "%s: failed to find scale coefs\n", | ||
| 833 | __func__); | ||
| 834 | return; | ||
| 835 | } | ||
| 836 | |||
| 831 | for (i = 0; i < 8; i++) { | 837 | for (i = 0; i < 8; i++) { |
| 832 | u32 h, hv; | 838 | u32 h, hv; |
| 833 | 839 | ||
| @@ -2342,7 +2348,7 @@ static int dispc_ovl_calc_scaling_24xx(struct dispc_device *dispc, | |||
| 2342 | } | 2348 | } |
| 2343 | 2349 | ||
| 2344 | if (in_width > maxsinglelinewidth) { | 2350 | if (in_width > maxsinglelinewidth) { |
| 2345 | DSSERR("Cannot scale max input width exceeded"); | 2351 | DSSERR("Cannot scale max input width exceeded\n"); |
| 2346 | return -EINVAL; | 2352 | return -EINVAL; |
| 2347 | } | 2353 | } |
| 2348 | return 0; | 2354 | return 0; |
| @@ -2424,13 +2430,13 @@ again: | |||
| 2424 | } | 2430 | } |
| 2425 | 2431 | ||
| 2426 | if (in_width > (maxsinglelinewidth * 2)) { | 2432 | if (in_width > (maxsinglelinewidth * 2)) { |
| 2427 | DSSERR("Cannot setup scaling"); | 2433 | DSSERR("Cannot setup scaling\n"); |
| 2428 | DSSERR("width exceeds maximum width possible"); | 2434 | DSSERR("width exceeds maximum width possible\n"); |
| 2429 | return -EINVAL; | 2435 | return -EINVAL; |
| 2430 | } | 2436 | } |
| 2431 | 2437 | ||
| 2432 | if (in_width > maxsinglelinewidth && *five_taps) { | 2438 | if (in_width > maxsinglelinewidth && *five_taps) { |
| 2433 | DSSERR("cannot setup scaling with five taps"); | 2439 | DSSERR("cannot setup scaling with five taps\n"); |
| 2434 | return -EINVAL; | 2440 | return -EINVAL; |
| 2435 | } | 2441 | } |
| 2436 | return 0; | 2442 | return 0; |
| @@ -2472,7 +2478,7 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc, | |||
| 2472 | in_width > maxsinglelinewidth && ++*decim_x); | 2478 | in_width > maxsinglelinewidth && ++*decim_x); |
| 2473 | 2479 | ||
| 2474 | if (in_width > maxsinglelinewidth) { | 2480 | if (in_width > maxsinglelinewidth) { |
| 2475 | DSSERR("Cannot scale width exceeds max line width"); | 2481 | DSSERR("Cannot scale width exceeds max line width\n"); |
| 2476 | return -EINVAL; | 2482 | return -EINVAL; |
| 2477 | } | 2483 | } |
| 2478 | 2484 | ||
| @@ -2490,7 +2496,7 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc, | |||
| 2490 | * bandwidth. Despite what theory says this appears to | 2496 | * bandwidth. Despite what theory says this appears to |
| 2491 | * be true also for 16-bit color formats. | 2497 | * be true also for 16-bit color formats. |
| 2492 | */ | 2498 | */ |
| 2493 | DSSERR("Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)", *decim_x); | 2499 | DSSERR("Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)\n", *decim_x); |
| 2494 | 2500 | ||
| 2495 | return -EINVAL; | 2501 | return -EINVAL; |
| 2496 | } | 2502 | } |
| @@ -4633,7 +4639,7 @@ static int dispc_errata_i734_wa_init(struct dispc_device *dispc) | |||
| 4633 | i734_buf.size, &i734_buf.paddr, | 4639 | i734_buf.size, &i734_buf.paddr, |
| 4634 | GFP_KERNEL); | 4640 | GFP_KERNEL); |
| 4635 | if (!i734_buf.vaddr) { | 4641 | if (!i734_buf.vaddr) { |
| 4636 | dev_err(&dispc->pdev->dev, "%s: dma_alloc_writecombine failed", | 4642 | dev_err(&dispc->pdev->dev, "%s: dma_alloc_writecombine failed\n", |
| 4637 | __func__); | 4643 | __func__); |
| 4638 | return -ENOMEM; | 4644 | return -ENOMEM; |
| 4639 | } | 4645 | } |
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c index 97c88861d67a..5879f45f6fc9 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c | |||
| @@ -679,7 +679,7 @@ static int hdmi_audio_config(struct device *dev, | |||
| 679 | struct omap_dss_audio *dss_audio) | 679 | struct omap_dss_audio *dss_audio) |
| 680 | { | 680 | { |
| 681 | struct omap_hdmi *hd = dev_get_drvdata(dev); | 681 | struct omap_hdmi *hd = dev_get_drvdata(dev); |
| 682 | int ret; | 682 | int ret = 0; |
| 683 | 683 | ||
| 684 | mutex_lock(&hd->lock); | 684 | mutex_lock(&hd->lock); |
| 685 | 685 | ||
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c index 35ed2add6189..813ba42f2753 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | |||
| @@ -922,8 +922,13 @@ int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core) | |||
| 922 | { | 922 | { |
| 923 | const struct hdmi4_features *features; | 923 | const struct hdmi4_features *features; |
| 924 | struct resource *res; | 924 | struct resource *res; |
| 925 | const struct soc_device_attribute *soc; | ||
| 925 | 926 | ||
| 926 | features = soc_device_match(hdmi4_soc_devices)->data; | 927 | soc = soc_device_match(hdmi4_soc_devices); |
| 928 | if (!soc) | ||
| 929 | return -ENODEV; | ||
| 930 | |||
| 931 | features = soc->data; | ||
| 927 | core->cts_swmode = features->cts_swmode; | 932 | core->cts_swmode = features->cts_swmode; |
| 928 | core->audio_use_mclk = features->audio_use_mclk; | 933 | core->audio_use_mclk = features->audio_use_mclk; |
| 929 | 934 | ||
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c index d28da9ac3e90..ae1a001d1b83 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c | |||
| @@ -671,7 +671,7 @@ static int hdmi_audio_config(struct device *dev, | |||
| 671 | struct omap_dss_audio *dss_audio) | 671 | struct omap_dss_audio *dss_audio) |
| 672 | { | 672 | { |
| 673 | struct omap_hdmi *hd = dev_get_drvdata(dev); | 673 | struct omap_hdmi *hd = dev_get_drvdata(dev); |
| 674 | int ret; | 674 | int ret = 0; |
| 675 | 675 | ||
| 676 | mutex_lock(&hd->lock); | 676 | mutex_lock(&hd->lock); |
| 677 | 677 | ||
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index a0d7b1d905e8..5cde26ac937b 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c | |||
| @@ -121,6 +121,9 @@ static int omap_connector_get_modes(struct drm_connector *connector) | |||
| 121 | if (dssdrv->read_edid) { | 121 | if (dssdrv->read_edid) { |
| 122 | void *edid = kzalloc(MAX_EDID, GFP_KERNEL); | 122 | void *edid = kzalloc(MAX_EDID, GFP_KERNEL); |
| 123 | 123 | ||
| 124 | if (!edid) | ||
| 125 | return 0; | ||
| 126 | |||
| 124 | if ((dssdrv->read_edid(dssdev, edid, MAX_EDID) > 0) && | 127 | if ((dssdrv->read_edid(dssdev, edid, MAX_EDID) > 0) && |
| 125 | drm_edid_is_valid(edid)) { | 128 | drm_edid_is_valid(edid)) { |
| 126 | drm_mode_connector_update_edid_property( | 129 | drm_mode_connector_update_edid_property( |
| @@ -139,6 +142,9 @@ static int omap_connector_get_modes(struct drm_connector *connector) | |||
| 139 | struct drm_display_mode *mode = drm_mode_create(dev); | 142 | struct drm_display_mode *mode = drm_mode_create(dev); |
| 140 | struct videomode vm = {0}; | 143 | struct videomode vm = {0}; |
| 141 | 144 | ||
| 145 | if (!mode) | ||
| 146 | return 0; | ||
| 147 | |||
| 142 | dssdrv->get_timings(dssdev, &vm); | 148 | dssdrv->get_timings(dssdev, &vm); |
| 143 | 149 | ||
| 144 | drm_display_mode_from_videomode(&vm, mode); | 150 | drm_display_mode_from_videomode(&vm, mode); |
| @@ -200,6 +206,10 @@ static int omap_connector_mode_valid(struct drm_connector *connector, | |||
| 200 | if (!r) { | 206 | if (!r) { |
| 201 | /* check if vrefresh is still valid */ | 207 | /* check if vrefresh is still valid */ |
| 202 | new_mode = drm_mode_duplicate(dev, mode); | 208 | new_mode = drm_mode_duplicate(dev, mode); |
| 209 | |||
| 210 | if (!new_mode) | ||
| 211 | return MODE_BAD; | ||
| 212 | |||
| 203 | new_mode->clock = vm.pixelclock / 1000; | 213 | new_mode->clock = vm.pixelclock / 1000; |
| 204 | new_mode->vrefresh = 0; | 214 | new_mode->vrefresh = 0; |
| 205 | if (mode->vrefresh == drm_mode_vrefresh(new_mode)) | 215 | if (mode->vrefresh == drm_mode_vrefresh(new_mode)) |
diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index f9fa1c90b35c..401c02e9e6b2 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | |||
| @@ -401,12 +401,16 @@ int tiler_unpin(struct tiler_block *block) | |||
| 401 | struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w, | 401 | struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w, |
| 402 | u16 h, u16 align) | 402 | u16 h, u16 align) |
| 403 | { | 403 | { |
| 404 | struct tiler_block *block = kzalloc(sizeof(*block), GFP_KERNEL); | 404 | struct tiler_block *block; |
| 405 | u32 min_align = 128; | 405 | u32 min_align = 128; |
| 406 | int ret; | 406 | int ret; |
| 407 | unsigned long flags; | 407 | unsigned long flags; |
| 408 | u32 slot_bytes; | 408 | u32 slot_bytes; |
| 409 | 409 | ||
| 410 | block = kzalloc(sizeof(*block), GFP_KERNEL); | ||
| 411 | if (!block) | ||
| 412 | return ERR_PTR(-ENOMEM); | ||
| 413 | |||
| 410 | BUG_ON(!validfmt(fmt)); | 414 | BUG_ON(!validfmt(fmt)); |
| 411 | 415 | ||
| 412 | /* convert width/height to slots */ | 416 | /* convert width/height to slots */ |
diff --git a/drivers/gpu/drm/omapdrm/tcm-sita.c b/drivers/gpu/drm/omapdrm/tcm-sita.c index d7f7bc9f061a..817be3c41863 100644 --- a/drivers/gpu/drm/omapdrm/tcm-sita.c +++ b/drivers/gpu/drm/omapdrm/tcm-sita.c | |||
| @@ -90,7 +90,7 @@ static int l2r_t2b(u16 w, u16 h, u16 a, s16 offset, | |||
| 90 | { | 90 | { |
| 91 | int i; | 91 | int i; |
| 92 | unsigned long index; | 92 | unsigned long index; |
| 93 | bool area_free; | 93 | bool area_free = false; |
| 94 | unsigned long slots_per_band = PAGE_SIZE / slot_bytes; | 94 | unsigned long slots_per_band = PAGE_SIZE / slot_bytes; |
| 95 | unsigned long bit_offset = (offset > 0) ? offset / slot_bytes : 0; | 95 | unsigned long bit_offset = (offset > 0) ? offset / slot_bytes : 0; |
| 96 | unsigned long curr_bit = bit_offset; | 96 | unsigned long curr_bit = bit_offset; |
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c index 72c9dbd81d7f..f185812970da 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c | |||
| @@ -96,7 +96,6 @@ struct vc4_dpi { | |||
| 96 | struct platform_device *pdev; | 96 | struct platform_device *pdev; |
| 97 | 97 | ||
| 98 | struct drm_encoder *encoder; | 98 | struct drm_encoder *encoder; |
| 99 | struct drm_connector *connector; | ||
| 100 | 99 | ||
| 101 | void __iomem *regs; | 100 | void __iomem *regs; |
| 102 | 101 | ||
| @@ -164,14 +163,31 @@ static void vc4_dpi_encoder_disable(struct drm_encoder *encoder) | |||
| 164 | 163 | ||
| 165 | static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) | 164 | static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) |
| 166 | { | 165 | { |
| 166 | struct drm_device *dev = encoder->dev; | ||
| 167 | struct drm_display_mode *mode = &encoder->crtc->mode; | 167 | struct drm_display_mode *mode = &encoder->crtc->mode; |
| 168 | struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); | 168 | struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); |
| 169 | struct vc4_dpi *dpi = vc4_encoder->dpi; | 169 | struct vc4_dpi *dpi = vc4_encoder->dpi; |
| 170 | struct drm_connector_list_iter conn_iter; | ||
| 171 | struct drm_connector *connector = NULL, *connector_scan; | ||
| 170 | u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE; | 172 | u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE; |
| 171 | int ret; | 173 | int ret; |
| 172 | 174 | ||
| 173 | if (dpi->connector->display_info.num_bus_formats) { | 175 | /* Look up the connector attached to DPI so we can get the |
| 174 | u32 bus_format = dpi->connector->display_info.bus_formats[0]; | 176 | * bus_format. Ideally the bridge would tell us the |
| 177 | * bus_format we want, but it doesn't yet, so assume that it's | ||
| 178 | * uniform throughout the bridge chain. | ||
| 179 | */ | ||
| 180 | drm_connector_list_iter_begin(dev, &conn_iter); | ||
| 181 | drm_for_each_connector_iter(connector_scan, &conn_iter) { | ||
| 182 | if (connector_scan->encoder == encoder) { | ||
| 183 | connector = connector_scan; | ||
| 184 | break; | ||
| 185 | } | ||
| 186 | } | ||
| 187 | drm_connector_list_iter_end(&conn_iter); | ||
| 188 | |||
| 189 | if (connector && connector->display_info.num_bus_formats) { | ||
| 190 | u32 bus_format = connector->display_info.bus_formats[0]; | ||
| 175 | 191 | ||
| 176 | switch (bus_format) { | 192 | switch (bus_format) { |
| 177 | case MEDIA_BUS_FMT_RGB888_1X24: | 193 | case MEDIA_BUS_FMT_RGB888_1X24: |
| @@ -199,6 +215,9 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) | |||
| 199 | DRM_ERROR("Unknown media bus format %d\n", bus_format); | 215 | DRM_ERROR("Unknown media bus format %d\n", bus_format); |
| 200 | break; | 216 | break; |
| 201 | } | 217 | } |
| 218 | } else { | ||
| 219 | /* Default to 24bit if no connector found. */ | ||
| 220 | dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT); | ||
| 202 | } | 221 | } |
| 203 | 222 | ||
| 204 | if (mode->flags & DRM_MODE_FLAG_NHSYNC) | 223 | if (mode->flags & DRM_MODE_FLAG_NHSYNC) |
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 3483c05cc3d6..71d44c357d35 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c | |||
| @@ -505,7 +505,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, | |||
| 505 | * the scl fields here. | 505 | * the scl fields here. |
| 506 | */ | 506 | */ |
| 507 | if (num_planes == 1) { | 507 | if (num_planes == 1) { |
| 508 | scl0 = vc4_get_scl_field(state, 1); | 508 | scl0 = vc4_get_scl_field(state, 0); |
| 509 | scl1 = scl0; | 509 | scl1 = scl0; |
| 510 | } else { | 510 | } else { |
| 511 | scl0 = vc4_get_scl_field(state, 1); | 511 | scl0 = vc4_get_scl_field(state, 1); |
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 60252fd796f6..0000434a1fbd 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
| @@ -462,10 +462,11 @@ config HID_LENOVO | |||
| 462 | select NEW_LEDS | 462 | select NEW_LEDS |
| 463 | select LEDS_CLASS | 463 | select LEDS_CLASS |
| 464 | ---help--- | 464 | ---help--- |
| 465 | Support for Lenovo devices that are not fully compliant with HID standard. | 465 | Support for IBM/Lenovo devices that are not fully compliant with HID standard. |
| 466 | 466 | ||
| 467 | Say Y if you want support for the non-compliant features of the Lenovo | 467 | Say Y if you want support for horizontal scrolling of the IBM/Lenovo |
| 468 | Thinkpad standalone keyboards, e.g: | 468 | Scrollpoint mice or the non-compliant features of the Lenovo Thinkpad |
| 469 | standalone keyboards, e.g: | ||
| 469 | - ThinkPad USB Keyboard with TrackPoint (supports extra LEDs and trackpoint | 470 | - ThinkPad USB Keyboard with TrackPoint (supports extra LEDs and trackpoint |
| 470 | configuration) | 471 | configuration) |
| 471 | - ThinkPad Compact Bluetooth Keyboard with TrackPoint (supports Fn keys) | 472 | - ThinkPad Compact Bluetooth Keyboard with TrackPoint (supports Fn keys) |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 0b5cc910f62e..46f5ecd11bf7 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -552,6 +552,13 @@ | |||
| 552 | #define USB_VENDOR_ID_HUION 0x256c | 552 | #define USB_VENDOR_ID_HUION 0x256c |
| 553 | #define USB_DEVICE_ID_HUION_TABLET 0x006e | 553 | #define USB_DEVICE_ID_HUION_TABLET 0x006e |
| 554 | 554 | ||
| 555 | #define USB_VENDOR_ID_IBM 0x04b3 | ||
| 556 | #define USB_DEVICE_ID_IBM_SCROLLPOINT_III 0x3100 | ||
| 557 | #define USB_DEVICE_ID_IBM_SCROLLPOINT_PRO 0x3103 | ||
| 558 | #define USB_DEVICE_ID_IBM_SCROLLPOINT_OPTICAL 0x3105 | ||
| 559 | #define USB_DEVICE_ID_IBM_SCROLLPOINT_800DPI_OPTICAL 0x3108 | ||
| 560 | #define USB_DEVICE_ID_IBM_SCROLLPOINT_800DPI_OPTICAL_PRO 0x3109 | ||
| 561 | |||
| 555 | #define USB_VENDOR_ID_IDEACOM 0x1cb6 | 562 | #define USB_VENDOR_ID_IDEACOM 0x1cb6 |
| 556 | #define USB_DEVICE_ID_IDEACOM_IDC6650 0x6650 | 563 | #define USB_DEVICE_ID_IDEACOM_IDC6650 0x6650 |
| 557 | #define USB_DEVICE_ID_IDEACOM_IDC6651 0x6651 | 564 | #define USB_DEVICE_ID_IDEACOM_IDC6651 0x6651 |
| @@ -684,6 +691,7 @@ | |||
| 684 | #define USB_DEVICE_ID_LENOVO_TPKBD 0x6009 | 691 | #define USB_DEVICE_ID_LENOVO_TPKBD 0x6009 |
| 685 | #define USB_DEVICE_ID_LENOVO_CUSBKBD 0x6047 | 692 | #define USB_DEVICE_ID_LENOVO_CUSBKBD 0x6047 |
| 686 | #define USB_DEVICE_ID_LENOVO_CBTKBD 0x6048 | 693 | #define USB_DEVICE_ID_LENOVO_CBTKBD 0x6048 |
| 694 | #define USB_DEVICE_ID_LENOVO_SCROLLPOINT_OPTICAL 0x6049 | ||
| 687 | #define USB_DEVICE_ID_LENOVO_TPPRODOCK 0x6067 | 695 | #define USB_DEVICE_ID_LENOVO_TPPRODOCK 0x6067 |
| 688 | #define USB_DEVICE_ID_LENOVO_X1_COVER 0x6085 | 696 | #define USB_DEVICE_ID_LENOVO_X1_COVER 0x6085 |
| 689 | #define USB_DEVICE_ID_LENOVO_X1_TAB 0x60a3 | 697 | #define USB_DEVICE_ID_LENOVO_X1_TAB 0x60a3 |
| @@ -964,6 +972,7 @@ | |||
| 964 | #define USB_DEVICE_ID_SIS817_TOUCH 0x0817 | 972 | #define USB_DEVICE_ID_SIS817_TOUCH 0x0817 |
| 965 | #define USB_DEVICE_ID_SIS_TS 0x1013 | 973 | #define USB_DEVICE_ID_SIS_TS 0x1013 |
| 966 | #define USB_DEVICE_ID_SIS1030_TOUCH 0x1030 | 974 | #define USB_DEVICE_ID_SIS1030_TOUCH 0x1030 |
| 975 | #define USB_DEVICE_ID_SIS10FB_TOUCH 0x10fb | ||
| 967 | 976 | ||
| 968 | #define USB_VENDOR_ID_SKYCABLE 0x1223 | 977 | #define USB_VENDOR_ID_SKYCABLE 0x1223 |
| 969 | #define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07 | 978 | #define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07 |
diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c index 1ac4ff4d57a6..643b6eb54442 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c | |||
| @@ -6,6 +6,17 @@ | |||
| 6 | * | 6 | * |
| 7 | * Copyright (c) 2012 Bernhard Seibold | 7 | * Copyright (c) 2012 Bernhard Seibold |
| 8 | * Copyright (c) 2014 Jamie Lentin <jm@lentin.co.uk> | 8 | * Copyright (c) 2014 Jamie Lentin <jm@lentin.co.uk> |
| 9 | * | ||
| 10 | * Linux IBM/Lenovo Scrollpoint mouse driver: | ||
| 11 | * - IBM Scrollpoint III | ||
| 12 | * - IBM Scrollpoint Pro | ||
| 13 | * - IBM Scrollpoint Optical | ||
| 14 | * - IBM Scrollpoint Optical 800dpi | ||
| 15 | * - IBM Scrollpoint Optical 800dpi Pro | ||
| 16 | * - Lenovo Scrollpoint Optical | ||
| 17 | * | ||
| 18 | * Copyright (c) 2012 Peter De Wachter <pdewacht@gmail.com> | ||
| 19 | * Copyright (c) 2018 Peter Ganzhorn <peter.ganzhorn@gmail.com> | ||
| 9 | */ | 20 | */ |
| 10 | 21 | ||
| 11 | /* | 22 | /* |
| @@ -160,6 +171,17 @@ static int lenovo_input_mapping_cptkbd(struct hid_device *hdev, | |||
| 160 | return 0; | 171 | return 0; |
| 161 | } | 172 | } |
| 162 | 173 | ||
| 174 | static int lenovo_input_mapping_scrollpoint(struct hid_device *hdev, | ||
| 175 | struct hid_input *hi, struct hid_field *field, | ||
| 176 | struct hid_usage *usage, unsigned long **bit, int *max) | ||
| 177 | { | ||
| 178 | if (usage->hid == HID_GD_Z) { | ||
| 179 | hid_map_usage(hi, usage, bit, max, EV_REL, REL_HWHEEL); | ||
| 180 | return 1; | ||
| 181 | } | ||
| 182 | return 0; | ||
| 183 | } | ||
| 184 | |||
| 163 | static int lenovo_input_mapping(struct hid_device *hdev, | 185 | static int lenovo_input_mapping(struct hid_device *hdev, |
| 164 | struct hid_input *hi, struct hid_field *field, | 186 | struct hid_input *hi, struct hid_field *field, |
| 165 | struct hid_usage *usage, unsigned long **bit, int *max) | 187 | struct hid_usage *usage, unsigned long **bit, int *max) |
| @@ -172,6 +194,14 @@ static int lenovo_input_mapping(struct hid_device *hdev, | |||
| 172 | case USB_DEVICE_ID_LENOVO_CBTKBD: | 194 | case USB_DEVICE_ID_LENOVO_CBTKBD: |
| 173 | return lenovo_input_mapping_cptkbd(hdev, hi, field, | 195 | return lenovo_input_mapping_cptkbd(hdev, hi, field, |
| 174 | usage, bit, max); | 196 | usage, bit, max); |
| 197 | case USB_DEVICE_ID_IBM_SCROLLPOINT_III: | ||
| 198 | case USB_DEVICE_ID_IBM_SCROLLPOINT_PRO: | ||
| 199 | case USB_DEVICE_ID_IBM_SCROLLPOINT_OPTICAL: | ||
| 200 | case USB_DEVICE_ID_IBM_SCROLLPOINT_800DPI_OPTICAL: | ||
| 201 | case USB_DEVICE_ID_IBM_SCROLLPOINT_800DPI_OPTICAL_PRO: | ||
| 202 | case USB_DEVICE_ID_LENOVO_SCROLLPOINT_OPTICAL: | ||
| 203 | return lenovo_input_mapping_scrollpoint(hdev, hi, field, | ||
| 204 | usage, bit, max); | ||
| 175 | default: | 205 | default: |
| 176 | return 0; | 206 | return 0; |
| 177 | } | 207 | } |
| @@ -883,6 +913,12 @@ static const struct hid_device_id lenovo_devices[] = { | |||
| 883 | { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD) }, | 913 | { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD) }, |
| 884 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CBTKBD) }, | 914 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CBTKBD) }, |
| 885 | { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPPRODOCK) }, | 915 | { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPPRODOCK) }, |
| 916 | { HID_USB_DEVICE(USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_SCROLLPOINT_III) }, | ||
| 917 | { HID_USB_DEVICE(USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_SCROLLPOINT_PRO) }, | ||
| 918 | { HID_USB_DEVICE(USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_SCROLLPOINT_OPTICAL) }, | ||
| 919 | { HID_USB_DEVICE(USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_SCROLLPOINT_800DPI_OPTICAL) }, | ||
| 920 | { HID_USB_DEVICE(USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_SCROLLPOINT_800DPI_OPTICAL_PRO) }, | ||
| 921 | { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_SCROLLPOINT_OPTICAL) }, | ||
| 886 | { } | 922 | { } |
| 887 | }; | 923 | }; |
| 888 | 924 | ||
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 963328674e93..cc33622253aa 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
| @@ -174,6 +174,8 @@ static const struct i2c_hid_quirks { | |||
| 174 | I2C_HID_QUIRK_NO_IRQ_AFTER_RESET }, | 174 | I2C_HID_QUIRK_NO_IRQ_AFTER_RESET }, |
| 175 | { I2C_VENDOR_ID_RAYD, I2C_PRODUCT_ID_RAYD_3118, | 175 | { I2C_VENDOR_ID_RAYD, I2C_PRODUCT_ID_RAYD_3118, |
| 176 | I2C_HID_QUIRK_RESEND_REPORT_DESCR }, | 176 | I2C_HID_QUIRK_RESEND_REPORT_DESCR }, |
| 177 | { USB_VENDOR_ID_SIS_TOUCH, USB_DEVICE_ID_SIS10FB_TOUCH, | ||
| 178 | I2C_HID_QUIRK_RESEND_REPORT_DESCR }, | ||
| 177 | { 0, 0 } | 179 | { 0, 0 } |
| 178 | }; | 180 | }; |
| 179 | 181 | ||
diff --git a/drivers/hid/intel-ish-hid/ishtp-hid-client.c b/drivers/hid/intel-ish-hid/ishtp-hid-client.c index 157b44aacdff..acc2536c8094 100644 --- a/drivers/hid/intel-ish-hid/ishtp-hid-client.c +++ b/drivers/hid/intel-ish-hid/ishtp-hid-client.c | |||
| @@ -77,21 +77,21 @@ static void process_recv(struct ishtp_cl *hid_ishtp_cl, void *recv_buf, | |||
| 77 | struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; | 77 | struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; |
| 78 | int curr_hid_dev = client_data->cur_hid_dev; | 78 | int curr_hid_dev = client_data->cur_hid_dev; |
| 79 | 79 | ||
| 80 | if (data_len < sizeof(struct hostif_msg_hdr)) { | ||
| 81 | dev_err(&client_data->cl_device->dev, | ||
| 82 | "[hid-ish]: error, received %u which is less than data header %u\n", | ||
| 83 | (unsigned int)data_len, | ||
| 84 | (unsigned int)sizeof(struct hostif_msg_hdr)); | ||
| 85 | ++client_data->bad_recv_cnt; | ||
| 86 | ish_hw_reset(hid_ishtp_cl->dev); | ||
| 87 | return; | ||
| 88 | } | ||
| 89 | |||
| 90 | payload = recv_buf + sizeof(struct hostif_msg_hdr); | 80 | payload = recv_buf + sizeof(struct hostif_msg_hdr); |
| 91 | total_len = data_len; | 81 | total_len = data_len; |
| 92 | cur_pos = 0; | 82 | cur_pos = 0; |
| 93 | 83 | ||
| 94 | do { | 84 | do { |
| 85 | if (cur_pos + sizeof(struct hostif_msg) > total_len) { | ||
| 86 | dev_err(&client_data->cl_device->dev, | ||
| 87 | "[hid-ish]: error, received %u which is less than data header %u\n", | ||
| 88 | (unsigned int)data_len, | ||
| 89 | (unsigned int)sizeof(struct hostif_msg_hdr)); | ||
| 90 | ++client_data->bad_recv_cnt; | ||
| 91 | ish_hw_reset(hid_ishtp_cl->dev); | ||
| 92 | break; | ||
| 93 | } | ||
| 94 | |||
| 95 | recv_msg = (struct hostif_msg *)(recv_buf + cur_pos); | 95 | recv_msg = (struct hostif_msg *)(recv_buf + cur_pos); |
| 96 | payload_len = recv_msg->hdr.size; | 96 | payload_len = recv_msg->hdr.size; |
| 97 | 97 | ||
| @@ -412,9 +412,7 @@ void hid_ishtp_get_report(struct hid_device *hid, int report_id, | |||
| 412 | { | 412 | { |
| 413 | struct ishtp_hid_data *hid_data = hid->driver_data; | 413 | struct ishtp_hid_data *hid_data = hid->driver_data; |
| 414 | struct ishtp_cl_data *client_data = hid_data->client_data; | 414 | struct ishtp_cl_data *client_data = hid_data->client_data; |
| 415 | static unsigned char buf[10]; | 415 | struct hostif_msg_to_sensor msg = {}; |
| 416 | unsigned int len; | ||
| 417 | struct hostif_msg_to_sensor *msg = (struct hostif_msg_to_sensor *)buf; | ||
| 418 | int rv; | 416 | int rv; |
| 419 | int i; | 417 | int i; |
| 420 | 418 | ||
| @@ -426,14 +424,11 @@ void hid_ishtp_get_report(struct hid_device *hid, int report_id, | |||
| 426 | return; | 424 | return; |
| 427 | } | 425 | } |
| 428 | 426 | ||
| 429 | len = sizeof(struct hostif_msg_to_sensor); | 427 | msg.hdr.command = (report_type == HID_FEATURE_REPORT) ? |
| 430 | |||
| 431 | memset(msg, 0, sizeof(struct hostif_msg_to_sensor)); | ||
| 432 | msg->hdr.command = (report_type == HID_FEATURE_REPORT) ? | ||
| 433 | HOSTIF_GET_FEATURE_REPORT : HOSTIF_GET_INPUT_REPORT; | 428 | HOSTIF_GET_FEATURE_REPORT : HOSTIF_GET_INPUT_REPORT; |
| 434 | for (i = 0; i < client_data->num_hid_devices; ++i) { | 429 | for (i = 0; i < client_data->num_hid_devices; ++i) { |
| 435 | if (hid == client_data->hid_sensor_hubs[i]) { | 430 | if (hid == client_data->hid_sensor_hubs[i]) { |
| 436 | msg->hdr.device_id = | 431 | msg.hdr.device_id = |
| 437 | client_data->hid_devices[i].dev_id; | 432 | client_data->hid_devices[i].dev_id; |
| 438 | break; | 433 | break; |
| 439 | } | 434 | } |
| @@ -442,8 +437,9 @@ void hid_ishtp_get_report(struct hid_device *hid, int report_id, | |||
| 442 | if (i == client_data->num_hid_devices) | 437 | if (i == client_data->num_hid_devices) |
| 443 | return; | 438 | return; |
| 444 | 439 | ||
| 445 | msg->report_id = report_id; | 440 | msg.report_id = report_id; |
| 446 | rv = ishtp_cl_send(client_data->hid_ishtp_cl, buf, len); | 441 | rv = ishtp_cl_send(client_data->hid_ishtp_cl, (uint8_t *)&msg, |
| 442 | sizeof(msg)); | ||
| 447 | if (rv) | 443 | if (rv) |
| 448 | hid_ishtp_trace(client_data, "%s hid %p send failed\n", | 444 | hid_ishtp_trace(client_data, "%s hid %p send failed\n", |
| 449 | __func__, hid); | 445 | __func__, hid); |
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c index f272cdd9bd55..2623a567ffba 100644 --- a/drivers/hid/intel-ish-hid/ishtp/bus.c +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c | |||
| @@ -418,7 +418,7 @@ static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev, | |||
| 418 | list_del(&device->device_link); | 418 | list_del(&device->device_link); |
| 419 | spin_unlock_irqrestore(&dev->device_list_lock, flags); | 419 | spin_unlock_irqrestore(&dev->device_list_lock, flags); |
| 420 | dev_err(dev->devc, "Failed to register ISHTP client device\n"); | 420 | dev_err(dev->devc, "Failed to register ISHTP client device\n"); |
| 421 | kfree(device); | 421 | put_device(&device->dev); |
| 422 | return NULL; | 422 | return NULL; |
| 423 | } | 423 | } |
| 424 | 424 | ||
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index b54ef1ffcbec..ee7a37eb159a 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c | |||
| @@ -1213,8 +1213,10 @@ static int __wacom_devm_sysfs_create_group(struct wacom *wacom, | |||
| 1213 | devres->root = root; | 1213 | devres->root = root; |
| 1214 | 1214 | ||
| 1215 | error = sysfs_create_group(devres->root, group); | 1215 | error = sysfs_create_group(devres->root, group); |
| 1216 | if (error) | 1216 | if (error) { |
| 1217 | devres_free(devres); | ||
| 1217 | return error; | 1218 | return error; |
| 1219 | } | ||
| 1218 | 1220 | ||
| 1219 | devres_add(&wacom->hdev->dev, devres); | 1221 | devres_add(&wacom->hdev->dev, devres); |
| 1220 | 1222 | ||
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index ee270e065ba9..2a972ed6851b 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig | |||
| @@ -61,9 +61,12 @@ config INFINIBAND_ON_DEMAND_PAGING | |||
| 61 | pages on demand instead. | 61 | pages on demand instead. |
| 62 | 62 | ||
| 63 | config INFINIBAND_ADDR_TRANS | 63 | config INFINIBAND_ADDR_TRANS |
| 64 | bool | 64 | bool "RDMA/CM" |
| 65 | depends on INFINIBAND | 65 | depends on INFINIBAND |
| 66 | default y | 66 | default y |
| 67 | ---help--- | ||
| 68 | Support for RDMA communication manager (CM). | ||
| 69 | This allows for a generic connection abstraction over RDMA. | ||
| 67 | 70 | ||
| 68 | config INFINIBAND_ADDR_TRANS_CONFIGFS | 71 | config INFINIBAND_ADDR_TRANS_CONFIGFS |
| 69 | bool | 72 | bool |
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index e337b08de2ff..fb2d347f760f 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c | |||
| @@ -291,14 +291,18 @@ static int find_gid(struct ib_gid_table *table, const union ib_gid *gid, | |||
| 291 | * so lookup free slot only if requested. | 291 | * so lookup free slot only if requested. |
| 292 | */ | 292 | */ |
| 293 | if (pempty && empty < 0) { | 293 | if (pempty && empty < 0) { |
| 294 | if (data->props & GID_TABLE_ENTRY_INVALID) { | 294 | if (data->props & GID_TABLE_ENTRY_INVALID && |
| 295 | /* Found an invalid (free) entry; allocate it */ | 295 | (default_gid == |
| 296 | if (data->props & GID_TABLE_ENTRY_DEFAULT) { | 296 | !!(data->props & GID_TABLE_ENTRY_DEFAULT))) { |
| 297 | if (default_gid) | 297 | /* |
| 298 | empty = curr_index; | 298 | * Found an invalid (free) entry; allocate it. |
| 299 | } else { | 299 | * If default GID is requested, then our |
| 300 | empty = curr_index; | 300 | * found slot must be one of the DEFAULT |
| 301 | } | 301 | * reserved slots or we fail. |
| 302 | * This ensures that only DEFAULT reserved | ||
| 303 | * slots are used for default property GIDs. | ||
| 304 | */ | ||
| 305 | empty = curr_index; | ||
| 302 | } | 306 | } |
| 303 | } | 307 | } |
| 304 | 308 | ||
| @@ -420,8 +424,10 @@ int ib_cache_gid_add(struct ib_device *ib_dev, u8 port, | |||
| 420 | return ret; | 424 | return ret; |
| 421 | } | 425 | } |
| 422 | 426 | ||
| 423 | int ib_cache_gid_del(struct ib_device *ib_dev, u8 port, | 427 | static int |
| 424 | union ib_gid *gid, struct ib_gid_attr *attr) | 428 | _ib_cache_gid_del(struct ib_device *ib_dev, u8 port, |
| 429 | union ib_gid *gid, struct ib_gid_attr *attr, | ||
| 430 | unsigned long mask, bool default_gid) | ||
| 425 | { | 431 | { |
| 426 | struct ib_gid_table *table; | 432 | struct ib_gid_table *table; |
| 427 | int ret = 0; | 433 | int ret = 0; |
| @@ -431,11 +437,7 @@ int ib_cache_gid_del(struct ib_device *ib_dev, u8 port, | |||
| 431 | 437 | ||
| 432 | mutex_lock(&table->lock); | 438 | mutex_lock(&table->lock); |
| 433 | 439 | ||
| 434 | ix = find_gid(table, gid, attr, false, | 440 | ix = find_gid(table, gid, attr, default_gid, mask, NULL); |
| 435 | GID_ATTR_FIND_MASK_GID | | ||
| 436 | GID_ATTR_FIND_MASK_GID_TYPE | | ||
| 437 | GID_ATTR_FIND_MASK_NETDEV, | ||
| 438 | NULL); | ||
| 439 | if (ix < 0) { | 441 | if (ix < 0) { |
| 440 | ret = -EINVAL; | 442 | ret = -EINVAL; |
| 441 | goto out_unlock; | 443 | goto out_unlock; |
| @@ -452,6 +454,17 @@ out_unlock: | |||
| 452 | return ret; | 454 | return ret; |
| 453 | } | 455 | } |
| 454 | 456 | ||
| 457 | int ib_cache_gid_del(struct ib_device *ib_dev, u8 port, | ||
| 458 | union ib_gid *gid, struct ib_gid_attr *attr) | ||
| 459 | { | ||
| 460 | unsigned long mask = GID_ATTR_FIND_MASK_GID | | ||
| 461 | GID_ATTR_FIND_MASK_GID_TYPE | | ||
| 462 | GID_ATTR_FIND_MASK_DEFAULT | | ||
| 463 | GID_ATTR_FIND_MASK_NETDEV; | ||
| 464 | |||
| 465 | return _ib_cache_gid_del(ib_dev, port, gid, attr, mask, false); | ||
| 466 | } | ||
| 467 | |||
| 455 | int ib_cache_gid_del_all_netdev_gids(struct ib_device *ib_dev, u8 port, | 468 | int ib_cache_gid_del_all_netdev_gids(struct ib_device *ib_dev, u8 port, |
| 456 | struct net_device *ndev) | 469 | struct net_device *ndev) |
| 457 | { | 470 | { |
| @@ -728,7 +741,7 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, | |||
| 728 | unsigned long gid_type_mask, | 741 | unsigned long gid_type_mask, |
| 729 | enum ib_cache_gid_default_mode mode) | 742 | enum ib_cache_gid_default_mode mode) |
| 730 | { | 743 | { |
| 731 | union ib_gid gid; | 744 | union ib_gid gid = { }; |
| 732 | struct ib_gid_attr gid_attr; | 745 | struct ib_gid_attr gid_attr; |
| 733 | struct ib_gid_table *table; | 746 | struct ib_gid_table *table; |
| 734 | unsigned int gid_type; | 747 | unsigned int gid_type; |
| @@ -736,7 +749,9 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, | |||
| 736 | 749 | ||
| 737 | table = ib_dev->cache.ports[port - rdma_start_port(ib_dev)].gid; | 750 | table = ib_dev->cache.ports[port - rdma_start_port(ib_dev)].gid; |
| 738 | 751 | ||
| 739 | make_default_gid(ndev, &gid); | 752 | mask = GID_ATTR_FIND_MASK_GID_TYPE | |
| 753 | GID_ATTR_FIND_MASK_DEFAULT | | ||
| 754 | GID_ATTR_FIND_MASK_NETDEV; | ||
| 740 | memset(&gid_attr, 0, sizeof(gid_attr)); | 755 | memset(&gid_attr, 0, sizeof(gid_attr)); |
| 741 | gid_attr.ndev = ndev; | 756 | gid_attr.ndev = ndev; |
| 742 | 757 | ||
| @@ -747,12 +762,12 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, | |||
| 747 | gid_attr.gid_type = gid_type; | 762 | gid_attr.gid_type = gid_type; |
| 748 | 763 | ||
| 749 | if (mode == IB_CACHE_GID_DEFAULT_MODE_SET) { | 764 | if (mode == IB_CACHE_GID_DEFAULT_MODE_SET) { |
| 750 | mask = GID_ATTR_FIND_MASK_GID_TYPE | | 765 | make_default_gid(ndev, &gid); |
| 751 | GID_ATTR_FIND_MASK_DEFAULT; | ||
| 752 | __ib_cache_gid_add(ib_dev, port, &gid, | 766 | __ib_cache_gid_add(ib_dev, port, &gid, |
| 753 | &gid_attr, mask, true); | 767 | &gid_attr, mask, true); |
| 754 | } else if (mode == IB_CACHE_GID_DEFAULT_MODE_DELETE) { | 768 | } else if (mode == IB_CACHE_GID_DEFAULT_MODE_DELETE) { |
| 755 | ib_cache_gid_del(ib_dev, port, &gid, &gid_attr); | 769 | _ib_cache_gid_del(ib_dev, port, &gid, |
| 770 | &gid_attr, mask, true); | ||
| 756 | } | 771 | } |
| 757 | } | 772 | } |
| 758 | } | 773 | } |
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 51a641002e10..a693fcd4c513 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
| @@ -382,6 +382,8 @@ struct cma_hdr { | |||
| 382 | #define CMA_VERSION 0x00 | 382 | #define CMA_VERSION 0x00 |
| 383 | 383 | ||
| 384 | struct cma_req_info { | 384 | struct cma_req_info { |
| 385 | struct sockaddr_storage listen_addr_storage; | ||
| 386 | struct sockaddr_storage src_addr_storage; | ||
| 385 | struct ib_device *device; | 387 | struct ib_device *device; |
| 386 | int port; | 388 | int port; |
| 387 | union ib_gid local_gid; | 389 | union ib_gid local_gid; |
| @@ -866,7 +868,6 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv, | |||
| 866 | { | 868 | { |
| 867 | struct ib_qp_attr qp_attr; | 869 | struct ib_qp_attr qp_attr; |
| 868 | int qp_attr_mask, ret; | 870 | int qp_attr_mask, ret; |
| 869 | union ib_gid sgid; | ||
| 870 | 871 | ||
| 871 | mutex_lock(&id_priv->qp_mutex); | 872 | mutex_lock(&id_priv->qp_mutex); |
| 872 | if (!id_priv->id.qp) { | 873 | if (!id_priv->id.qp) { |
| @@ -889,12 +890,6 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv, | |||
| 889 | if (ret) | 890 | if (ret) |
| 890 | goto out; | 891 | goto out; |
| 891 | 892 | ||
| 892 | ret = ib_query_gid(id_priv->id.device, id_priv->id.port_num, | ||
| 893 | rdma_ah_read_grh(&qp_attr.ah_attr)->sgid_index, | ||
| 894 | &sgid, NULL); | ||
| 895 | if (ret) | ||
| 896 | goto out; | ||
| 897 | |||
| 898 | BUG_ON(id_priv->cma_dev->device != id_priv->id.device); | 893 | BUG_ON(id_priv->cma_dev->device != id_priv->id.device); |
| 899 | 894 | ||
| 900 | if (conn_param) | 895 | if (conn_param) |
| @@ -1340,11 +1335,11 @@ static bool validate_net_dev(struct net_device *net_dev, | |||
| 1340 | } | 1335 | } |
| 1341 | 1336 | ||
| 1342 | static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event, | 1337 | static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event, |
| 1343 | const struct cma_req_info *req) | 1338 | struct cma_req_info *req) |
| 1344 | { | 1339 | { |
| 1345 | struct sockaddr_storage listen_addr_storage, src_addr_storage; | 1340 | struct sockaddr *listen_addr = |
| 1346 | struct sockaddr *listen_addr = (struct sockaddr *)&listen_addr_storage, | 1341 | (struct sockaddr *)&req->listen_addr_storage; |
| 1347 | *src_addr = (struct sockaddr *)&src_addr_storage; | 1342 | struct sockaddr *src_addr = (struct sockaddr *)&req->src_addr_storage; |
| 1348 | struct net_device *net_dev; | 1343 | struct net_device *net_dev; |
| 1349 | const union ib_gid *gid = req->has_gid ? &req->local_gid : NULL; | 1344 | const union ib_gid *gid = req->has_gid ? &req->local_gid : NULL; |
| 1350 | int err; | 1345 | int err; |
| @@ -1359,11 +1354,6 @@ static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event, | |||
| 1359 | if (!net_dev) | 1354 | if (!net_dev) |
| 1360 | return ERR_PTR(-ENODEV); | 1355 | return ERR_PTR(-ENODEV); |
| 1361 | 1356 | ||
| 1362 | if (!validate_net_dev(net_dev, listen_addr, src_addr)) { | ||
| 1363 | dev_put(net_dev); | ||
| 1364 | return ERR_PTR(-EHOSTUNREACH); | ||
| 1365 | } | ||
| 1366 | |||
| 1367 | return net_dev; | 1357 | return net_dev; |
| 1368 | } | 1358 | } |
| 1369 | 1359 | ||
| @@ -1490,15 +1480,51 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id, | |||
| 1490 | } | 1480 | } |
| 1491 | } | 1481 | } |
| 1492 | 1482 | ||
| 1483 | /* | ||
| 1484 | * Net namespace might be getting deleted while route lookup, | ||
| 1485 | * cm_id lookup is in progress. Therefore, perform netdevice | ||
| 1486 | * validation, cm_id lookup under rcu lock. | ||
| 1487 | * RCU lock along with netdevice state check, synchronizes with | ||
| 1488 | * netdevice migrating to different net namespace and also avoids | ||
| 1489 | * case where net namespace doesn't get deleted while lookup is in | ||
| 1490 | * progress. | ||
| 1491 | * If the device state is not IFF_UP, its properties such as ifindex | ||
| 1492 | * and nd_net cannot be trusted to remain valid without rcu lock. | ||
| 1493 | * net/core/dev.c change_net_namespace() ensures to synchronize with | ||
| 1494 | * ongoing operations on net device after device is closed using | ||
| 1495 | * synchronize_net(). | ||
| 1496 | */ | ||
| 1497 | rcu_read_lock(); | ||
| 1498 | if (*net_dev) { | ||
| 1499 | /* | ||
| 1500 | * If netdevice is down, it is likely that it is administratively | ||
| 1501 | * down or it might be migrating to different namespace. | ||
| 1502 | * In that case avoid further processing, as the net namespace | ||
| 1503 | * or ifindex may change. | ||
| 1504 | */ | ||
| 1505 | if (((*net_dev)->flags & IFF_UP) == 0) { | ||
| 1506 | id_priv = ERR_PTR(-EHOSTUNREACH); | ||
| 1507 | goto err; | ||
| 1508 | } | ||
| 1509 | |||
| 1510 | if (!validate_net_dev(*net_dev, | ||
| 1511 | (struct sockaddr *)&req.listen_addr_storage, | ||
| 1512 | (struct sockaddr *)&req.src_addr_storage)) { | ||
| 1513 | id_priv = ERR_PTR(-EHOSTUNREACH); | ||
| 1514 | goto err; | ||
| 1515 | } | ||
| 1516 | } | ||
| 1517 | |||
| 1493 | bind_list = cma_ps_find(*net_dev ? dev_net(*net_dev) : &init_net, | 1518 | bind_list = cma_ps_find(*net_dev ? dev_net(*net_dev) : &init_net, |
| 1494 | rdma_ps_from_service_id(req.service_id), | 1519 | rdma_ps_from_service_id(req.service_id), |
| 1495 | cma_port_from_service_id(req.service_id)); | 1520 | cma_port_from_service_id(req.service_id)); |
| 1496 | id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev); | 1521 | id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev); |
| 1522 | err: | ||
| 1523 | rcu_read_unlock(); | ||
| 1497 | if (IS_ERR(id_priv) && *net_dev) { | 1524 | if (IS_ERR(id_priv) && *net_dev) { |
| 1498 | dev_put(*net_dev); | 1525 | dev_put(*net_dev); |
| 1499 | *net_dev = NULL; | 1526 | *net_dev = NULL; |
| 1500 | } | 1527 | } |
| 1501 | |||
| 1502 | return id_priv; | 1528 | return id_priv; |
| 1503 | } | 1529 | } |
| 1504 | 1530 | ||
diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c index 9821ae900f6d..da12da1c36f6 100644 --- a/drivers/infiniband/core/iwpm_util.c +++ b/drivers/infiniband/core/iwpm_util.c | |||
| @@ -114,7 +114,7 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, | |||
| 114 | struct sockaddr_storage *mapped_sockaddr, | 114 | struct sockaddr_storage *mapped_sockaddr, |
| 115 | u8 nl_client) | 115 | u8 nl_client) |
| 116 | { | 116 | { |
| 117 | struct hlist_head *hash_bucket_head; | 117 | struct hlist_head *hash_bucket_head = NULL; |
| 118 | struct iwpm_mapping_info *map_info; | 118 | struct iwpm_mapping_info *map_info; |
| 119 | unsigned long flags; | 119 | unsigned long flags; |
| 120 | int ret = -EINVAL; | 120 | int ret = -EINVAL; |
| @@ -142,6 +142,9 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, | |||
| 142 | } | 142 | } |
| 143 | } | 143 | } |
| 144 | spin_unlock_irqrestore(&iwpm_mapinfo_lock, flags); | 144 | spin_unlock_irqrestore(&iwpm_mapinfo_lock, flags); |
| 145 | |||
| 146 | if (!hash_bucket_head) | ||
| 147 | kfree(map_info); | ||
| 145 | return ret; | 148 | return ret; |
| 146 | } | 149 | } |
| 147 | 150 | ||
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index c50596f7f98a..b28452a55a08 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
| @@ -59,7 +59,7 @@ module_param_named(recv_queue_size, mad_recvq_size, int, 0444); | |||
| 59 | MODULE_PARM_DESC(recv_queue_size, "Size of receive queue in number of work requests"); | 59 | MODULE_PARM_DESC(recv_queue_size, "Size of receive queue in number of work requests"); |
| 60 | 60 | ||
| 61 | static struct list_head ib_mad_port_list; | 61 | static struct list_head ib_mad_port_list; |
| 62 | static u32 ib_mad_client_id = 0; | 62 | static atomic_t ib_mad_client_id = ATOMIC_INIT(0); |
| 63 | 63 | ||
| 64 | /* Port list lock */ | 64 | /* Port list lock */ |
| 65 | static DEFINE_SPINLOCK(ib_mad_port_list_lock); | 65 | static DEFINE_SPINLOCK(ib_mad_port_list_lock); |
| @@ -377,7 +377,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, | |||
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | spin_lock_irqsave(&port_priv->reg_lock, flags); | 379 | spin_lock_irqsave(&port_priv->reg_lock, flags); |
| 380 | mad_agent_priv->agent.hi_tid = ++ib_mad_client_id; | 380 | mad_agent_priv->agent.hi_tid = atomic_inc_return(&ib_mad_client_id); |
| 381 | 381 | ||
| 382 | /* | 382 | /* |
| 383 | * Make sure MAD registration (if supplied) | 383 | * Make sure MAD registration (if supplied) |
diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c index cc2966380c0c..c0e4fd55e2cc 100644 --- a/drivers/infiniband/core/roce_gid_mgmt.c +++ b/drivers/infiniband/core/roce_gid_mgmt.c | |||
| @@ -255,6 +255,7 @@ static void bond_delete_netdev_default_gids(struct ib_device *ib_dev, | |||
| 255 | struct net_device *rdma_ndev) | 255 | struct net_device *rdma_ndev) |
| 256 | { | 256 | { |
| 257 | struct net_device *real_dev = rdma_vlan_dev_real_dev(event_ndev); | 257 | struct net_device *real_dev = rdma_vlan_dev_real_dev(event_ndev); |
| 258 | unsigned long gid_type_mask; | ||
| 258 | 259 | ||
| 259 | if (!rdma_ndev) | 260 | if (!rdma_ndev) |
| 260 | return; | 261 | return; |
| @@ -264,21 +265,22 @@ static void bond_delete_netdev_default_gids(struct ib_device *ib_dev, | |||
| 264 | 265 | ||
| 265 | rcu_read_lock(); | 266 | rcu_read_lock(); |
| 266 | 267 | ||
| 267 | if (rdma_is_upper_dev_rcu(rdma_ndev, event_ndev) && | 268 | if (((rdma_ndev != event_ndev && |
| 268 | is_eth_active_slave_of_bonding_rcu(rdma_ndev, real_dev) == | 269 | !rdma_is_upper_dev_rcu(rdma_ndev, event_ndev)) || |
| 269 | BONDING_SLAVE_STATE_INACTIVE) { | 270 | is_eth_active_slave_of_bonding_rcu(rdma_ndev, real_dev) |
| 270 | unsigned long gid_type_mask; | 271 | == |
| 271 | 272 | BONDING_SLAVE_STATE_INACTIVE)) { | |
| 272 | rcu_read_unlock(); | 273 | rcu_read_unlock(); |
| 274 | return; | ||
| 275 | } | ||
| 273 | 276 | ||
| 274 | gid_type_mask = roce_gid_type_mask_support(ib_dev, port); | 277 | rcu_read_unlock(); |
| 275 | 278 | ||
| 276 | ib_cache_gid_set_default_gid(ib_dev, port, rdma_ndev, | 279 | gid_type_mask = roce_gid_type_mask_support(ib_dev, port); |
| 277 | gid_type_mask, | 280 | |
| 278 | IB_CACHE_GID_DEFAULT_MODE_DELETE); | 281 | ib_cache_gid_set_default_gid(ib_dev, port, rdma_ndev, |
| 279 | } else { | 282 | gid_type_mask, |
| 280 | rcu_read_unlock(); | 283 | IB_CACHE_GID_DEFAULT_MODE_DELETE); |
| 281 | } | ||
| 282 | } | 284 | } |
| 283 | 285 | ||
| 284 | static void enum_netdev_ipv4_ips(struct ib_device *ib_dev, | 286 | static void enum_netdev_ipv4_ips(struct ib_device *ib_dev, |
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 74329483af6d..eab43b17e9cf 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
| @@ -159,6 +159,23 @@ static void ucma_put_ctx(struct ucma_context *ctx) | |||
| 159 | complete(&ctx->comp); | 159 | complete(&ctx->comp); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | /* | ||
| 163 | * Same as ucm_get_ctx but requires that ->cm_id->device is valid, eg that the | ||
| 164 | * CM_ID is bound. | ||
| 165 | */ | ||
| 166 | static struct ucma_context *ucma_get_ctx_dev(struct ucma_file *file, int id) | ||
| 167 | { | ||
| 168 | struct ucma_context *ctx = ucma_get_ctx(file, id); | ||
| 169 | |||
| 170 | if (IS_ERR(ctx)) | ||
| 171 | return ctx; | ||
| 172 | if (!ctx->cm_id->device) { | ||
| 173 | ucma_put_ctx(ctx); | ||
| 174 | return ERR_PTR(-EINVAL); | ||
| 175 | } | ||
| 176 | return ctx; | ||
| 177 | } | ||
| 178 | |||
| 162 | static void ucma_close_event_id(struct work_struct *work) | 179 | static void ucma_close_event_id(struct work_struct *work) |
| 163 | { | 180 | { |
| 164 | struct ucma_event *uevent_close = container_of(work, struct ucma_event, close_work); | 181 | struct ucma_event *uevent_close = container_of(work, struct ucma_event, close_work); |
| @@ -683,7 +700,7 @@ static ssize_t ucma_resolve_ip(struct ucma_file *file, | |||
| 683 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 700 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 684 | return -EFAULT; | 701 | return -EFAULT; |
| 685 | 702 | ||
| 686 | if (!rdma_addr_size_in6(&cmd.src_addr) || | 703 | if ((cmd.src_addr.sin6_family && !rdma_addr_size_in6(&cmd.src_addr)) || |
| 687 | !rdma_addr_size_in6(&cmd.dst_addr)) | 704 | !rdma_addr_size_in6(&cmd.dst_addr)) |
| 688 | return -EINVAL; | 705 | return -EINVAL; |
| 689 | 706 | ||
| @@ -734,7 +751,7 @@ static ssize_t ucma_resolve_route(struct ucma_file *file, | |||
| 734 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 751 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 735 | return -EFAULT; | 752 | return -EFAULT; |
| 736 | 753 | ||
| 737 | ctx = ucma_get_ctx(file, cmd.id); | 754 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 738 | if (IS_ERR(ctx)) | 755 | if (IS_ERR(ctx)) |
| 739 | return PTR_ERR(ctx); | 756 | return PTR_ERR(ctx); |
| 740 | 757 | ||
| @@ -1050,7 +1067,7 @@ static ssize_t ucma_connect(struct ucma_file *file, const char __user *inbuf, | |||
| 1050 | if (!cmd.conn_param.valid) | 1067 | if (!cmd.conn_param.valid) |
| 1051 | return -EINVAL; | 1068 | return -EINVAL; |
| 1052 | 1069 | ||
| 1053 | ctx = ucma_get_ctx(file, cmd.id); | 1070 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1054 | if (IS_ERR(ctx)) | 1071 | if (IS_ERR(ctx)) |
| 1055 | return PTR_ERR(ctx); | 1072 | return PTR_ERR(ctx); |
| 1056 | 1073 | ||
| @@ -1092,7 +1109,7 @@ static ssize_t ucma_accept(struct ucma_file *file, const char __user *inbuf, | |||
| 1092 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 1109 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 1093 | return -EFAULT; | 1110 | return -EFAULT; |
| 1094 | 1111 | ||
| 1095 | ctx = ucma_get_ctx(file, cmd.id); | 1112 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1096 | if (IS_ERR(ctx)) | 1113 | if (IS_ERR(ctx)) |
| 1097 | return PTR_ERR(ctx); | 1114 | return PTR_ERR(ctx); |
| 1098 | 1115 | ||
| @@ -1120,7 +1137,7 @@ static ssize_t ucma_reject(struct ucma_file *file, const char __user *inbuf, | |||
| 1120 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 1137 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 1121 | return -EFAULT; | 1138 | return -EFAULT; |
| 1122 | 1139 | ||
| 1123 | ctx = ucma_get_ctx(file, cmd.id); | 1140 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1124 | if (IS_ERR(ctx)) | 1141 | if (IS_ERR(ctx)) |
| 1125 | return PTR_ERR(ctx); | 1142 | return PTR_ERR(ctx); |
| 1126 | 1143 | ||
| @@ -1139,7 +1156,7 @@ static ssize_t ucma_disconnect(struct ucma_file *file, const char __user *inbuf, | |||
| 1139 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 1156 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 1140 | return -EFAULT; | 1157 | return -EFAULT; |
| 1141 | 1158 | ||
| 1142 | ctx = ucma_get_ctx(file, cmd.id); | 1159 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1143 | if (IS_ERR(ctx)) | 1160 | if (IS_ERR(ctx)) |
| 1144 | return PTR_ERR(ctx); | 1161 | return PTR_ERR(ctx); |
| 1145 | 1162 | ||
| @@ -1167,15 +1184,10 @@ static ssize_t ucma_init_qp_attr(struct ucma_file *file, | |||
| 1167 | if (cmd.qp_state > IB_QPS_ERR) | 1184 | if (cmd.qp_state > IB_QPS_ERR) |
| 1168 | return -EINVAL; | 1185 | return -EINVAL; |
| 1169 | 1186 | ||
| 1170 | ctx = ucma_get_ctx(file, cmd.id); | 1187 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1171 | if (IS_ERR(ctx)) | 1188 | if (IS_ERR(ctx)) |
| 1172 | return PTR_ERR(ctx); | 1189 | return PTR_ERR(ctx); |
| 1173 | 1190 | ||
| 1174 | if (!ctx->cm_id->device) { | ||
| 1175 | ret = -EINVAL; | ||
| 1176 | goto out; | ||
| 1177 | } | ||
| 1178 | |||
| 1179 | resp.qp_attr_mask = 0; | 1191 | resp.qp_attr_mask = 0; |
| 1180 | memset(&qp_attr, 0, sizeof qp_attr); | 1192 | memset(&qp_attr, 0, sizeof qp_attr); |
| 1181 | qp_attr.qp_state = cmd.qp_state; | 1193 | qp_attr.qp_state = cmd.qp_state; |
| @@ -1316,13 +1328,13 @@ static ssize_t ucma_set_option(struct ucma_file *file, const char __user *inbuf, | |||
| 1316 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 1328 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 1317 | return -EFAULT; | 1329 | return -EFAULT; |
| 1318 | 1330 | ||
| 1331 | if (unlikely(cmd.optlen > KMALLOC_MAX_SIZE)) | ||
| 1332 | return -EINVAL; | ||
| 1333 | |||
| 1319 | ctx = ucma_get_ctx(file, cmd.id); | 1334 | ctx = ucma_get_ctx(file, cmd.id); |
| 1320 | if (IS_ERR(ctx)) | 1335 | if (IS_ERR(ctx)) |
| 1321 | return PTR_ERR(ctx); | 1336 | return PTR_ERR(ctx); |
| 1322 | 1337 | ||
| 1323 | if (unlikely(cmd.optlen > KMALLOC_MAX_SIZE)) | ||
| 1324 | return -EINVAL; | ||
| 1325 | |||
| 1326 | optval = memdup_user(u64_to_user_ptr(cmd.optval), | 1338 | optval = memdup_user(u64_to_user_ptr(cmd.optval), |
| 1327 | cmd.optlen); | 1339 | cmd.optlen); |
| 1328 | if (IS_ERR(optval)) { | 1340 | if (IS_ERR(optval)) { |
| @@ -1384,7 +1396,7 @@ static ssize_t ucma_process_join(struct ucma_file *file, | |||
| 1384 | else | 1396 | else |
| 1385 | return -EINVAL; | 1397 | return -EINVAL; |
| 1386 | 1398 | ||
| 1387 | ctx = ucma_get_ctx(file, cmd->id); | 1399 | ctx = ucma_get_ctx_dev(file, cmd->id); |
| 1388 | if (IS_ERR(ctx)) | 1400 | if (IS_ERR(ctx)) |
| 1389 | return PTR_ERR(ctx); | 1401 | return PTR_ERR(ctx); |
| 1390 | 1402 | ||
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 13cb5e4deb86..21a887c9523b 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
| @@ -691,6 +691,7 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file, | |||
| 691 | 691 | ||
| 692 | mr->device = pd->device; | 692 | mr->device = pd->device; |
| 693 | mr->pd = pd; | 693 | mr->pd = pd; |
| 694 | mr->dm = NULL; | ||
| 694 | mr->uobject = uobj; | 695 | mr->uobject = uobj; |
| 695 | atomic_inc(&pd->usecnt); | 696 | atomic_inc(&pd->usecnt); |
| 696 | mr->res.type = RDMA_RESTRACK_MR; | 697 | mr->res.type = RDMA_RESTRACK_MR; |
| @@ -765,6 +766,11 @@ ssize_t ib_uverbs_rereg_mr(struct ib_uverbs_file *file, | |||
| 765 | 766 | ||
| 766 | mr = uobj->object; | 767 | mr = uobj->object; |
| 767 | 768 | ||
| 769 | if (mr->dm) { | ||
| 770 | ret = -EINVAL; | ||
| 771 | goto put_uobjs; | ||
| 772 | } | ||
| 773 | |||
| 768 | if (cmd.flags & IB_MR_REREG_ACCESS) { | 774 | if (cmd.flags & IB_MR_REREG_ACCESS) { |
| 769 | ret = ib_check_mr_access(cmd.access_flags); | 775 | ret = ib_check_mr_access(cmd.access_flags); |
| 770 | if (ret) | 776 | if (ret) |
diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c index 8c93970dc8f1..8d32c4ae368c 100644 --- a/drivers/infiniband/core/uverbs_ioctl.c +++ b/drivers/infiniband/core/uverbs_ioctl.c | |||
| @@ -234,6 +234,15 @@ static int uverbs_validate_kernel_mandatory(const struct uverbs_method_spec *met | |||
| 234 | return -EINVAL; | 234 | return -EINVAL; |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | for (; i < method_spec->num_buckets; i++) { | ||
| 238 | struct uverbs_attr_spec_hash *attr_spec_bucket = | ||
| 239 | method_spec->attr_buckets[i]; | ||
| 240 | |||
| 241 | if (!bitmap_empty(attr_spec_bucket->mandatory_attrs_bitmask, | ||
| 242 | attr_spec_bucket->num_attrs)) | ||
| 243 | return -EINVAL; | ||
| 244 | } | ||
| 245 | |||
| 237 | return 0; | 246 | return 0; |
| 238 | } | 247 | } |
| 239 | 248 | ||
diff --git a/drivers/infiniband/core/uverbs_std_types_flow_action.c b/drivers/infiniband/core/uverbs_std_types_flow_action.c index cbcec3da12f6..b4f016dfa23d 100644 --- a/drivers/infiniband/core/uverbs_std_types_flow_action.c +++ b/drivers/infiniband/core/uverbs_std_types_flow_action.c | |||
| @@ -363,28 +363,28 @@ static int UVERBS_HANDLER(UVERBS_METHOD_FLOW_ACTION_ESP_MODIFY)(struct ib_device | |||
| 363 | 363 | ||
| 364 | static const struct uverbs_attr_spec uverbs_flow_action_esp_keymat[] = { | 364 | static const struct uverbs_attr_spec uverbs_flow_action_esp_keymat[] = { |
| 365 | [IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM] = { | 365 | [IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM] = { |
| 366 | .ptr = { | 366 | { .ptr = { |
| 367 | .type = UVERBS_ATTR_TYPE_PTR_IN, | 367 | .type = UVERBS_ATTR_TYPE_PTR_IN, |
| 368 | UVERBS_ATTR_TYPE(struct ib_uverbs_flow_action_esp_keymat_aes_gcm), | 368 | UVERBS_ATTR_TYPE(struct ib_uverbs_flow_action_esp_keymat_aes_gcm), |
| 369 | .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO, | 369 | .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO, |
| 370 | }, | 370 | } }, |
| 371 | }, | 371 | }, |
| 372 | }; | 372 | }; |
| 373 | 373 | ||
| 374 | static const struct uverbs_attr_spec uverbs_flow_action_esp_replay[] = { | 374 | static const struct uverbs_attr_spec uverbs_flow_action_esp_replay[] = { |
| 375 | [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE] = { | 375 | [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE] = { |
| 376 | .ptr = { | 376 | { .ptr = { |
| 377 | .type = UVERBS_ATTR_TYPE_PTR_IN, | 377 | .type = UVERBS_ATTR_TYPE_PTR_IN, |
| 378 | /* No need to specify any data */ | 378 | /* No need to specify any data */ |
| 379 | .len = 0, | 379 | .len = 0, |
| 380 | } | 380 | } } |
| 381 | }, | 381 | }, |
| 382 | [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP] = { | 382 | [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP] = { |
| 383 | .ptr = { | 383 | { .ptr = { |
| 384 | .type = UVERBS_ATTR_TYPE_PTR_IN, | 384 | .type = UVERBS_ATTR_TYPE_PTR_IN, |
| 385 | UVERBS_ATTR_STRUCT(struct ib_uverbs_flow_action_esp_replay_bmp, size), | 385 | UVERBS_ATTR_STRUCT(struct ib_uverbs_flow_action_esp_replay_bmp, size), |
| 386 | .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO, | 386 | .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO, |
| 387 | } | 387 | } } |
| 388 | }, | 388 | }, |
| 389 | }; | 389 | }; |
| 390 | 390 | ||
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 7eff3aeffe01..6ddfb1fade79 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c | |||
| @@ -1656,6 +1656,7 @@ struct ib_mr *ib_alloc_mr(struct ib_pd *pd, | |||
| 1656 | if (!IS_ERR(mr)) { | 1656 | if (!IS_ERR(mr)) { |
| 1657 | mr->device = pd->device; | 1657 | mr->device = pd->device; |
| 1658 | mr->pd = pd; | 1658 | mr->pd = pd; |
| 1659 | mr->dm = NULL; | ||
| 1659 | mr->uobject = NULL; | 1660 | mr->uobject = NULL; |
| 1660 | atomic_inc(&pd->usecnt); | 1661 | atomic_inc(&pd->usecnt); |
| 1661 | mr->need_inval = false; | 1662 | mr->need_inval = false; |
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c index 6f2b26126c64..2be2e1ac1b5f 100644 --- a/drivers/infiniband/hw/cxgb4/cq.c +++ b/drivers/infiniband/hw/cxgb4/cq.c | |||
| @@ -315,7 +315,7 @@ static void advance_oldest_read(struct t4_wq *wq) | |||
| 315 | * Deal with out-of-order and/or completions that complete | 315 | * Deal with out-of-order and/or completions that complete |
| 316 | * prior unsignalled WRs. | 316 | * prior unsignalled WRs. |
| 317 | */ | 317 | */ |
| 318 | void c4iw_flush_hw_cq(struct c4iw_cq *chp) | 318 | void c4iw_flush_hw_cq(struct c4iw_cq *chp, struct c4iw_qp *flush_qhp) |
| 319 | { | 319 | { |
| 320 | struct t4_cqe *hw_cqe, *swcqe, read_cqe; | 320 | struct t4_cqe *hw_cqe, *swcqe, read_cqe; |
| 321 | struct c4iw_qp *qhp; | 321 | struct c4iw_qp *qhp; |
| @@ -339,6 +339,13 @@ void c4iw_flush_hw_cq(struct c4iw_cq *chp) | |||
| 339 | if (qhp == NULL) | 339 | if (qhp == NULL) |
| 340 | goto next_cqe; | 340 | goto next_cqe; |
| 341 | 341 | ||
| 342 | if (flush_qhp != qhp) { | ||
| 343 | spin_lock(&qhp->lock); | ||
| 344 | |||
| 345 | if (qhp->wq.flushed == 1) | ||
| 346 | goto next_cqe; | ||
| 347 | } | ||
| 348 | |||
| 342 | if (CQE_OPCODE(hw_cqe) == FW_RI_TERMINATE) | 349 | if (CQE_OPCODE(hw_cqe) == FW_RI_TERMINATE) |
| 343 | goto next_cqe; | 350 | goto next_cqe; |
| 344 | 351 | ||
| @@ -390,6 +397,8 @@ void c4iw_flush_hw_cq(struct c4iw_cq *chp) | |||
| 390 | next_cqe: | 397 | next_cqe: |
| 391 | t4_hwcq_consume(&chp->cq); | 398 | t4_hwcq_consume(&chp->cq); |
| 392 | ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); | 399 | ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); |
| 400 | if (qhp && flush_qhp != qhp) | ||
| 401 | spin_unlock(&qhp->lock); | ||
| 393 | } | 402 | } |
| 394 | } | 403 | } |
| 395 | 404 | ||
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index feeb8ee6f4a2..44161ca4d2a8 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c | |||
| @@ -875,6 +875,11 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) | |||
| 875 | 875 | ||
| 876 | rdev->status_page->db_off = 0; | 876 | rdev->status_page->db_off = 0; |
| 877 | 877 | ||
| 878 | init_completion(&rdev->rqt_compl); | ||
| 879 | init_completion(&rdev->pbl_compl); | ||
| 880 | kref_init(&rdev->rqt_kref); | ||
| 881 | kref_init(&rdev->pbl_kref); | ||
| 882 | |||
| 878 | return 0; | 883 | return 0; |
| 879 | err_free_status_page_and_wr_log: | 884 | err_free_status_page_and_wr_log: |
| 880 | if (c4iw_wr_log && rdev->wr_log) | 885 | if (c4iw_wr_log && rdev->wr_log) |
| @@ -893,13 +898,15 @@ destroy_resource: | |||
| 893 | 898 | ||
| 894 | static void c4iw_rdev_close(struct c4iw_rdev *rdev) | 899 | static void c4iw_rdev_close(struct c4iw_rdev *rdev) |
| 895 | { | 900 | { |
| 896 | destroy_workqueue(rdev->free_workq); | ||
| 897 | kfree(rdev->wr_log); | 901 | kfree(rdev->wr_log); |
| 898 | c4iw_release_dev_ucontext(rdev, &rdev->uctx); | 902 | c4iw_release_dev_ucontext(rdev, &rdev->uctx); |
| 899 | free_page((unsigned long)rdev->status_page); | 903 | free_page((unsigned long)rdev->status_page); |
| 900 | c4iw_pblpool_destroy(rdev); | 904 | c4iw_pblpool_destroy(rdev); |
| 901 | c4iw_rqtpool_destroy(rdev); | 905 | c4iw_rqtpool_destroy(rdev); |
| 906 | wait_for_completion(&rdev->pbl_compl); | ||
| 907 | wait_for_completion(&rdev->rqt_compl); | ||
| 902 | c4iw_ocqp_pool_destroy(rdev); | 908 | c4iw_ocqp_pool_destroy(rdev); |
| 909 | destroy_workqueue(rdev->free_workq); | ||
| 903 | c4iw_destroy_resource(&rdev->resource); | 910 | c4iw_destroy_resource(&rdev->resource); |
| 904 | } | 911 | } |
| 905 | 912 | ||
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h index cc929002c05e..831027717121 100644 --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h | |||
| @@ -185,6 +185,10 @@ struct c4iw_rdev { | |||
| 185 | struct wr_log_entry *wr_log; | 185 | struct wr_log_entry *wr_log; |
| 186 | int wr_log_size; | 186 | int wr_log_size; |
| 187 | struct workqueue_struct *free_workq; | 187 | struct workqueue_struct *free_workq; |
| 188 | struct completion rqt_compl; | ||
| 189 | struct completion pbl_compl; | ||
| 190 | struct kref rqt_kref; | ||
| 191 | struct kref pbl_kref; | ||
| 188 | }; | 192 | }; |
| 189 | 193 | ||
| 190 | static inline int c4iw_fatal_error(struct c4iw_rdev *rdev) | 194 | static inline int c4iw_fatal_error(struct c4iw_rdev *rdev) |
| @@ -1049,7 +1053,7 @@ u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size); | |||
| 1049 | void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size); | 1053 | void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size); |
| 1050 | u32 c4iw_ocqp_pool_alloc(struct c4iw_rdev *rdev, int size); | 1054 | u32 c4iw_ocqp_pool_alloc(struct c4iw_rdev *rdev, int size); |
| 1051 | void c4iw_ocqp_pool_free(struct c4iw_rdev *rdev, u32 addr, int size); | 1055 | void c4iw_ocqp_pool_free(struct c4iw_rdev *rdev, u32 addr, int size); |
| 1052 | void c4iw_flush_hw_cq(struct c4iw_cq *chp); | 1056 | void c4iw_flush_hw_cq(struct c4iw_cq *chp, struct c4iw_qp *flush_qhp); |
| 1053 | void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count); | 1057 | void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count); |
| 1054 | int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); | 1058 | int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); |
| 1055 | int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count); | 1059 | int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count); |
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c index de77b6027d69..ae167b686608 100644 --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c | |||
| @@ -1343,12 +1343,12 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp, | |||
| 1343 | qhp->wq.flushed = 1; | 1343 | qhp->wq.flushed = 1; |
| 1344 | t4_set_wq_in_error(&qhp->wq); | 1344 | t4_set_wq_in_error(&qhp->wq); |
| 1345 | 1345 | ||
| 1346 | c4iw_flush_hw_cq(rchp); | 1346 | c4iw_flush_hw_cq(rchp, qhp); |
| 1347 | c4iw_count_rcqes(&rchp->cq, &qhp->wq, &count); | 1347 | c4iw_count_rcqes(&rchp->cq, &qhp->wq, &count); |
| 1348 | rq_flushed = c4iw_flush_rq(&qhp->wq, &rchp->cq, count); | 1348 | rq_flushed = c4iw_flush_rq(&qhp->wq, &rchp->cq, count); |
| 1349 | 1349 | ||
| 1350 | if (schp != rchp) | 1350 | if (schp != rchp) |
| 1351 | c4iw_flush_hw_cq(schp); | 1351 | c4iw_flush_hw_cq(schp, qhp); |
| 1352 | sq_flushed = c4iw_flush_sq(qhp); | 1352 | sq_flushed = c4iw_flush_sq(qhp); |
| 1353 | 1353 | ||
| 1354 | spin_unlock(&qhp->lock); | 1354 | spin_unlock(&qhp->lock); |
diff --git a/drivers/infiniband/hw/cxgb4/resource.c b/drivers/infiniband/hw/cxgb4/resource.c index 3cf25997ed2b..0ef25ae05e6f 100644 --- a/drivers/infiniband/hw/cxgb4/resource.c +++ b/drivers/infiniband/hw/cxgb4/resource.c | |||
| @@ -260,12 +260,22 @@ u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size) | |||
| 260 | rdev->stats.pbl.cur += roundup(size, 1 << MIN_PBL_SHIFT); | 260 | rdev->stats.pbl.cur += roundup(size, 1 << MIN_PBL_SHIFT); |
| 261 | if (rdev->stats.pbl.cur > rdev->stats.pbl.max) | 261 | if (rdev->stats.pbl.cur > rdev->stats.pbl.max) |
| 262 | rdev->stats.pbl.max = rdev->stats.pbl.cur; | 262 | rdev->stats.pbl.max = rdev->stats.pbl.cur; |
| 263 | kref_get(&rdev->pbl_kref); | ||
| 263 | } else | 264 | } else |
| 264 | rdev->stats.pbl.fail++; | 265 | rdev->stats.pbl.fail++; |
| 265 | mutex_unlock(&rdev->stats.lock); | 266 | mutex_unlock(&rdev->stats.lock); |
| 266 | return (u32)addr; | 267 | return (u32)addr; |
| 267 | } | 268 | } |
| 268 | 269 | ||
| 270 | static void destroy_pblpool(struct kref *kref) | ||
| 271 | { | ||
| 272 | struct c4iw_rdev *rdev; | ||
| 273 | |||
| 274 | rdev = container_of(kref, struct c4iw_rdev, pbl_kref); | ||
| 275 | gen_pool_destroy(rdev->pbl_pool); | ||
| 276 | complete(&rdev->pbl_compl); | ||
| 277 | } | ||
| 278 | |||
| 269 | void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size) | 279 | void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size) |
| 270 | { | 280 | { |
| 271 | pr_debug("addr 0x%x size %d\n", addr, size); | 281 | pr_debug("addr 0x%x size %d\n", addr, size); |
| @@ -273,6 +283,7 @@ void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size) | |||
| 273 | rdev->stats.pbl.cur -= roundup(size, 1 << MIN_PBL_SHIFT); | 283 | rdev->stats.pbl.cur -= roundup(size, 1 << MIN_PBL_SHIFT); |
| 274 | mutex_unlock(&rdev->stats.lock); | 284 | mutex_unlock(&rdev->stats.lock); |
| 275 | gen_pool_free(rdev->pbl_pool, (unsigned long)addr, size); | 285 | gen_pool_free(rdev->pbl_pool, (unsigned long)addr, size); |
| 286 | kref_put(&rdev->pbl_kref, destroy_pblpool); | ||
| 276 | } | 287 | } |
| 277 | 288 | ||
| 278 | int c4iw_pblpool_create(struct c4iw_rdev *rdev) | 289 | int c4iw_pblpool_create(struct c4iw_rdev *rdev) |
| @@ -310,7 +321,7 @@ int c4iw_pblpool_create(struct c4iw_rdev *rdev) | |||
| 310 | 321 | ||
| 311 | void c4iw_pblpool_destroy(struct c4iw_rdev *rdev) | 322 | void c4iw_pblpool_destroy(struct c4iw_rdev *rdev) |
| 312 | { | 323 | { |
| 313 | gen_pool_destroy(rdev->pbl_pool); | 324 | kref_put(&rdev->pbl_kref, destroy_pblpool); |
| 314 | } | 325 | } |
| 315 | 326 | ||
| 316 | /* | 327 | /* |
| @@ -331,12 +342,22 @@ u32 c4iw_rqtpool_alloc(struct c4iw_rdev *rdev, int size) | |||
| 331 | rdev->stats.rqt.cur += roundup(size << 6, 1 << MIN_RQT_SHIFT); | 342 | rdev->stats.rqt.cur += roundup(size << 6, 1 << MIN_RQT_SHIFT); |
| 332 | if (rdev->stats.rqt.cur > rdev->stats.rqt.max) | 343 | if (rdev->stats.rqt.cur > rdev->stats.rqt.max) |
| 333 | rdev->stats.rqt.max = rdev->stats.rqt.cur; | 344 | rdev->stats.rqt.max = rdev->stats.rqt.cur; |
| 345 | kref_get(&rdev->rqt_kref); | ||
| 334 | } else | 346 | } else |
| 335 | rdev->stats.rqt.fail++; | 347 | rdev->stats.rqt.fail++; |
| 336 | mutex_unlock(&rdev->stats.lock); | 348 | mutex_unlock(&rdev->stats.lock); |
| 337 | return (u32)addr; | 349 | return (u32)addr; |
| 338 | } | 350 | } |
| 339 | 351 | ||
| 352 | static void destroy_rqtpool(struct kref *kref) | ||
| 353 | { | ||
| 354 | struct c4iw_rdev *rdev; | ||
| 355 | |||
| 356 | rdev = container_of(kref, struct c4iw_rdev, rqt_kref); | ||
| 357 | gen_pool_destroy(rdev->rqt_pool); | ||
| 358 | complete(&rdev->rqt_compl); | ||
| 359 | } | ||
| 360 | |||
| 340 | void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size) | 361 | void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size) |
| 341 | { | 362 | { |
| 342 | pr_debug("addr 0x%x size %d\n", addr, size << 6); | 363 | pr_debug("addr 0x%x size %d\n", addr, size << 6); |
| @@ -344,6 +365,7 @@ void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size) | |||
| 344 | rdev->stats.rqt.cur -= roundup(size << 6, 1 << MIN_RQT_SHIFT); | 365 | rdev->stats.rqt.cur -= roundup(size << 6, 1 << MIN_RQT_SHIFT); |
| 345 | mutex_unlock(&rdev->stats.lock); | 366 | mutex_unlock(&rdev->stats.lock); |
| 346 | gen_pool_free(rdev->rqt_pool, (unsigned long)addr, size << 6); | 367 | gen_pool_free(rdev->rqt_pool, (unsigned long)addr, size << 6); |
| 368 | kref_put(&rdev->rqt_kref, destroy_rqtpool); | ||
| 347 | } | 369 | } |
| 348 | 370 | ||
| 349 | int c4iw_rqtpool_create(struct c4iw_rdev *rdev) | 371 | int c4iw_rqtpool_create(struct c4iw_rdev *rdev) |
| @@ -380,7 +402,7 @@ int c4iw_rqtpool_create(struct c4iw_rdev *rdev) | |||
| 380 | 402 | ||
| 381 | void c4iw_rqtpool_destroy(struct c4iw_rdev *rdev) | 403 | void c4iw_rqtpool_destroy(struct c4iw_rdev *rdev) |
| 382 | { | 404 | { |
| 383 | gen_pool_destroy(rdev->rqt_pool); | 405 | kref_put(&rdev->rqt_kref, destroy_rqtpool); |
| 384 | } | 406 | } |
| 385 | 407 | ||
| 386 | /* | 408 | /* |
diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c index a97055dd4fbd..b5fab55cc275 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c | |||
| @@ -412,7 +412,6 @@ static void hfi1_cleanup_sdma_notifier(struct hfi1_msix_entry *msix) | |||
| 412 | static int get_irq_affinity(struct hfi1_devdata *dd, | 412 | static int get_irq_affinity(struct hfi1_devdata *dd, |
| 413 | struct hfi1_msix_entry *msix) | 413 | struct hfi1_msix_entry *msix) |
| 414 | { | 414 | { |
| 415 | int ret; | ||
| 416 | cpumask_var_t diff; | 415 | cpumask_var_t diff; |
| 417 | struct hfi1_affinity_node *entry; | 416 | struct hfi1_affinity_node *entry; |
| 418 | struct cpu_mask_set *set = NULL; | 417 | struct cpu_mask_set *set = NULL; |
| @@ -424,10 +423,6 @@ static int get_irq_affinity(struct hfi1_devdata *dd, | |||
| 424 | extra[0] = '\0'; | 423 | extra[0] = '\0'; |
| 425 | cpumask_clear(&msix->mask); | 424 | cpumask_clear(&msix->mask); |
| 426 | 425 | ||
| 427 | ret = zalloc_cpumask_var(&diff, GFP_KERNEL); | ||
| 428 | if (!ret) | ||
| 429 | return -ENOMEM; | ||
| 430 | |||
| 431 | entry = node_affinity_lookup(dd->node); | 426 | entry = node_affinity_lookup(dd->node); |
| 432 | 427 | ||
| 433 | switch (msix->type) { | 428 | switch (msix->type) { |
| @@ -458,6 +453,9 @@ static int get_irq_affinity(struct hfi1_devdata *dd, | |||
| 458 | * finds its CPU here. | 453 | * finds its CPU here. |
| 459 | */ | 454 | */ |
| 460 | if (cpu == -1 && set) { | 455 | if (cpu == -1 && set) { |
| 456 | if (!zalloc_cpumask_var(&diff, GFP_KERNEL)) | ||
| 457 | return -ENOMEM; | ||
| 458 | |||
| 461 | if (cpumask_equal(&set->mask, &set->used)) { | 459 | if (cpumask_equal(&set->mask, &set->used)) { |
| 462 | /* | 460 | /* |
| 463 | * We've used up all the CPUs, bump up the generation | 461 | * We've used up all the CPUs, bump up the generation |
| @@ -469,6 +467,8 @@ static int get_irq_affinity(struct hfi1_devdata *dd, | |||
| 469 | cpumask_andnot(diff, &set->mask, &set->used); | 467 | cpumask_andnot(diff, &set->mask, &set->used); |
| 470 | cpu = cpumask_first(diff); | 468 | cpu = cpumask_first(diff); |
| 471 | cpumask_set_cpu(cpu, &set->used); | 469 | cpumask_set_cpu(cpu, &set->used); |
| 470 | |||
| 471 | free_cpumask_var(diff); | ||
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | cpumask_set_cpu(cpu, &msix->mask); | 474 | cpumask_set_cpu(cpu, &msix->mask); |
| @@ -482,7 +482,6 @@ static int get_irq_affinity(struct hfi1_devdata *dd, | |||
| 482 | hfi1_setup_sdma_notifier(msix); | 482 | hfi1_setup_sdma_notifier(msix); |
| 483 | } | 483 | } |
| 484 | 484 | ||
| 485 | free_cpumask_var(diff); | ||
| 486 | return 0; | 485 | return 0; |
| 487 | } | 486 | } |
| 488 | 487 | ||
diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index 46d1475b2154..bd837a048bf4 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c | |||
| @@ -433,31 +433,43 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, | |||
| 433 | bool do_cnp) | 433 | bool do_cnp) |
| 434 | { | 434 | { |
| 435 | struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); | 435 | struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); |
| 436 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); | ||
| 436 | struct ib_other_headers *ohdr = pkt->ohdr; | 437 | struct ib_other_headers *ohdr = pkt->ohdr; |
| 437 | struct ib_grh *grh = pkt->grh; | 438 | struct ib_grh *grh = pkt->grh; |
| 438 | u32 rqpn = 0, bth1; | 439 | u32 rqpn = 0, bth1; |
| 439 | u16 pkey, rlid, dlid = ib_get_dlid(pkt->hdr); | 440 | u16 pkey; |
| 441 | u32 rlid, slid, dlid = 0; | ||
| 440 | u8 hdr_type, sc, svc_type; | 442 | u8 hdr_type, sc, svc_type; |
| 441 | bool is_mcast = false; | 443 | bool is_mcast = false; |
| 442 | 444 | ||
| 445 | /* can be called from prescan */ | ||
| 443 | if (pkt->etype == RHF_RCV_TYPE_BYPASS) { | 446 | if (pkt->etype == RHF_RCV_TYPE_BYPASS) { |
| 444 | is_mcast = hfi1_is_16B_mcast(dlid); | 447 | is_mcast = hfi1_is_16B_mcast(dlid); |
| 445 | pkey = hfi1_16B_get_pkey(pkt->hdr); | 448 | pkey = hfi1_16B_get_pkey(pkt->hdr); |
| 446 | sc = hfi1_16B_get_sc(pkt->hdr); | 449 | sc = hfi1_16B_get_sc(pkt->hdr); |
| 450 | dlid = hfi1_16B_get_dlid(pkt->hdr); | ||
| 451 | slid = hfi1_16B_get_slid(pkt->hdr); | ||
| 447 | hdr_type = HFI1_PKT_TYPE_16B; | 452 | hdr_type = HFI1_PKT_TYPE_16B; |
| 448 | } else { | 453 | } else { |
| 449 | is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) && | 454 | is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) && |
| 450 | (dlid != be16_to_cpu(IB_LID_PERMISSIVE)); | 455 | (dlid != be16_to_cpu(IB_LID_PERMISSIVE)); |
| 451 | pkey = ib_bth_get_pkey(ohdr); | 456 | pkey = ib_bth_get_pkey(ohdr); |
| 452 | sc = hfi1_9B_get_sc5(pkt->hdr, pkt->rhf); | 457 | sc = hfi1_9B_get_sc5(pkt->hdr, pkt->rhf); |
| 458 | dlid = ib_get_dlid(pkt->hdr); | ||
| 459 | slid = ib_get_slid(pkt->hdr); | ||
| 453 | hdr_type = HFI1_PKT_TYPE_9B; | 460 | hdr_type = HFI1_PKT_TYPE_9B; |
| 454 | } | 461 | } |
| 455 | 462 | ||
| 456 | switch (qp->ibqp.qp_type) { | 463 | switch (qp->ibqp.qp_type) { |
| 464 | case IB_QPT_UD: | ||
| 465 | dlid = ppd->lid; | ||
| 466 | rlid = slid; | ||
| 467 | rqpn = ib_get_sqpn(pkt->ohdr); | ||
| 468 | svc_type = IB_CC_SVCTYPE_UD; | ||
| 469 | break; | ||
| 457 | case IB_QPT_SMI: | 470 | case IB_QPT_SMI: |
| 458 | case IB_QPT_GSI: | 471 | case IB_QPT_GSI: |
| 459 | case IB_QPT_UD: | 472 | rlid = slid; |
| 460 | rlid = ib_get_slid(pkt->hdr); | ||
| 461 | rqpn = ib_get_sqpn(pkt->ohdr); | 473 | rqpn = ib_get_sqpn(pkt->ohdr); |
| 462 | svc_type = IB_CC_SVCTYPE_UD; | 474 | svc_type = IB_CC_SVCTYPE_UD; |
| 463 | break; | 475 | break; |
| @@ -482,7 +494,6 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, | |||
| 482 | dlid, rlid, sc, grh); | 494 | dlid, rlid, sc, grh); |
| 483 | 495 | ||
| 484 | if (!is_mcast && (bth1 & IB_BECN_SMASK)) { | 496 | if (!is_mcast && (bth1 & IB_BECN_SMASK)) { |
| 485 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); | ||
| 486 | u32 lqpn = bth1 & RVT_QPN_MASK; | 497 | u32 lqpn = bth1 & RVT_QPN_MASK; |
| 487 | u8 sl = ibp->sc_to_sl[sc]; | 498 | u8 sl = ibp->sc_to_sl[sc]; |
| 488 | 499 | ||
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h index 32c48265405e..cac2c62bc42d 100644 --- a/drivers/infiniband/hw/hfi1/hfi.h +++ b/drivers/infiniband/hw/hfi1/hfi.h | |||
| @@ -1537,13 +1537,13 @@ void set_link_ipg(struct hfi1_pportdata *ppd); | |||
| 1537 | void process_becn(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, u32 lqpn, | 1537 | void process_becn(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, u32 lqpn, |
| 1538 | u32 rqpn, u8 svc_type); | 1538 | u32 rqpn, u8 svc_type); |
| 1539 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, | 1539 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, |
| 1540 | u32 pkey, u32 slid, u32 dlid, u8 sc5, | 1540 | u16 pkey, u32 slid, u32 dlid, u8 sc5, |
| 1541 | const struct ib_grh *old_grh); | 1541 | const struct ib_grh *old_grh); |
| 1542 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 1542 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
| 1543 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 1543 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
| 1544 | u8 sc5, const struct ib_grh *old_grh); | 1544 | u8 sc5, const struct ib_grh *old_grh); |
| 1545 | typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 1545 | typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
| 1546 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 1546 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
| 1547 | u8 sc5, const struct ib_grh *old_grh); | 1547 | u8 sc5, const struct ib_grh *old_grh); |
| 1548 | 1548 | ||
| 1549 | #define PKEY_CHECK_INVALID -1 | 1549 | #define PKEY_CHECK_INVALID -1 |
| @@ -2437,7 +2437,7 @@ static inline void hfi1_make_16b_hdr(struct hfi1_16b_header *hdr, | |||
| 2437 | ((slid >> OPA_16B_SLID_SHIFT) << OPA_16B_SLID_HIGH_SHIFT); | 2437 | ((slid >> OPA_16B_SLID_SHIFT) << OPA_16B_SLID_HIGH_SHIFT); |
| 2438 | lrh2 = (lrh2 & ~OPA_16B_DLID_MASK) | | 2438 | lrh2 = (lrh2 & ~OPA_16B_DLID_MASK) | |
| 2439 | ((dlid >> OPA_16B_DLID_SHIFT) << OPA_16B_DLID_HIGH_SHIFT); | 2439 | ((dlid >> OPA_16B_DLID_SHIFT) << OPA_16B_DLID_HIGH_SHIFT); |
| 2440 | lrh2 = (lrh2 & ~OPA_16B_PKEY_MASK) | (pkey << OPA_16B_PKEY_SHIFT); | 2440 | lrh2 = (lrh2 & ~OPA_16B_PKEY_MASK) | ((u32)pkey << OPA_16B_PKEY_SHIFT); |
| 2441 | lrh2 = (lrh2 & ~OPA_16B_L4_MASK) | l4; | 2441 | lrh2 = (lrh2 & ~OPA_16B_L4_MASK) | l4; |
| 2442 | 2442 | ||
| 2443 | hdr->lrh[0] = lrh0; | 2443 | hdr->lrh[0] = lrh0; |
diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index 33eba2356742..6309edf811df 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c | |||
| @@ -88,9 +88,9 @@ | |||
| 88 | * pio buffers per ctxt, etc.) Zero means use one user context per CPU. | 88 | * pio buffers per ctxt, etc.) Zero means use one user context per CPU. |
| 89 | */ | 89 | */ |
| 90 | int num_user_contexts = -1; | 90 | int num_user_contexts = -1; |
| 91 | module_param_named(num_user_contexts, num_user_contexts, uint, S_IRUGO); | 91 | module_param_named(num_user_contexts, num_user_contexts, int, 0444); |
| 92 | MODULE_PARM_DESC( | 92 | MODULE_PARM_DESC( |
| 93 | num_user_contexts, "Set max number of user contexts to use"); | 93 | num_user_contexts, "Set max number of user contexts to use (default: -1 will use the real (non-HT) CPU count)"); |
| 94 | 94 | ||
| 95 | uint krcvqs[RXE_NUM_DATA_VL]; | 95 | uint krcvqs[RXE_NUM_DATA_VL]; |
| 96 | int krcvqsset; | 96 | int krcvqsset; |
| @@ -1209,30 +1209,49 @@ static void finalize_asic_data(struct hfi1_devdata *dd, | |||
| 1209 | kfree(ad); | 1209 | kfree(ad); |
| 1210 | } | 1210 | } |
| 1211 | 1211 | ||
| 1212 | static void __hfi1_free_devdata(struct kobject *kobj) | 1212 | /** |
| 1213 | * hfi1_clean_devdata - cleans up per-unit data structure | ||
| 1214 | * @dd: pointer to a valid devdata structure | ||
| 1215 | * | ||
| 1216 | * It cleans up all data structures set up by | ||
| 1217 | * by hfi1_alloc_devdata(). | ||
| 1218 | */ | ||
| 1219 | static void hfi1_clean_devdata(struct hfi1_devdata *dd) | ||
| 1213 | { | 1220 | { |
| 1214 | struct hfi1_devdata *dd = | ||
| 1215 | container_of(kobj, struct hfi1_devdata, kobj); | ||
| 1216 | struct hfi1_asic_data *ad; | 1221 | struct hfi1_asic_data *ad; |
| 1217 | unsigned long flags; | 1222 | unsigned long flags; |
| 1218 | 1223 | ||
| 1219 | spin_lock_irqsave(&hfi1_devs_lock, flags); | 1224 | spin_lock_irqsave(&hfi1_devs_lock, flags); |
| 1220 | idr_remove(&hfi1_unit_table, dd->unit); | 1225 | if (!list_empty(&dd->list)) { |
| 1221 | list_del(&dd->list); | 1226 | idr_remove(&hfi1_unit_table, dd->unit); |
| 1227 | list_del_init(&dd->list); | ||
| 1228 | } | ||
| 1222 | ad = release_asic_data(dd); | 1229 | ad = release_asic_data(dd); |
| 1223 | spin_unlock_irqrestore(&hfi1_devs_lock, flags); | 1230 | spin_unlock_irqrestore(&hfi1_devs_lock, flags); |
| 1224 | if (ad) | 1231 | |
| 1225 | finalize_asic_data(dd, ad); | 1232 | finalize_asic_data(dd, ad); |
| 1226 | free_platform_config(dd); | 1233 | free_platform_config(dd); |
| 1227 | rcu_barrier(); /* wait for rcu callbacks to complete */ | 1234 | rcu_barrier(); /* wait for rcu callbacks to complete */ |
| 1228 | free_percpu(dd->int_counter); | 1235 | free_percpu(dd->int_counter); |
| 1229 | free_percpu(dd->rcv_limit); | 1236 | free_percpu(dd->rcv_limit); |
| 1230 | free_percpu(dd->send_schedule); | 1237 | free_percpu(dd->send_schedule); |
| 1231 | free_percpu(dd->tx_opstats); | 1238 | free_percpu(dd->tx_opstats); |
| 1239 | dd->int_counter = NULL; | ||
| 1240 | dd->rcv_limit = NULL; | ||
| 1241 | dd->send_schedule = NULL; | ||
| 1242 | dd->tx_opstats = NULL; | ||
| 1232 | sdma_clean(dd, dd->num_sdma); | 1243 | sdma_clean(dd, dd->num_sdma); |
| 1233 | rvt_dealloc_device(&dd->verbs_dev.rdi); | 1244 | rvt_dealloc_device(&dd->verbs_dev.rdi); |
| 1234 | } | 1245 | } |
| 1235 | 1246 | ||
| 1247 | static void __hfi1_free_devdata(struct kobject *kobj) | ||
| 1248 | { | ||
| 1249 | struct hfi1_devdata *dd = | ||
| 1250 | container_of(kobj, struct hfi1_devdata, kobj); | ||
| 1251 | |||
| 1252 | hfi1_clean_devdata(dd); | ||
| 1253 | } | ||
| 1254 | |||
| 1236 | static struct kobj_type hfi1_devdata_type = { | 1255 | static struct kobj_type hfi1_devdata_type = { |
| 1237 | .release = __hfi1_free_devdata, | 1256 | .release = __hfi1_free_devdata, |
| 1238 | }; | 1257 | }; |
| @@ -1265,6 +1284,8 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra) | |||
| 1265 | return ERR_PTR(-ENOMEM); | 1284 | return ERR_PTR(-ENOMEM); |
| 1266 | dd->num_pports = nports; | 1285 | dd->num_pports = nports; |
| 1267 | dd->pport = (struct hfi1_pportdata *)(dd + 1); | 1286 | dd->pport = (struct hfi1_pportdata *)(dd + 1); |
| 1287 | dd->pcidev = pdev; | ||
| 1288 | pci_set_drvdata(pdev, dd); | ||
| 1268 | 1289 | ||
| 1269 | INIT_LIST_HEAD(&dd->list); | 1290 | INIT_LIST_HEAD(&dd->list); |
| 1270 | idr_preload(GFP_KERNEL); | 1291 | idr_preload(GFP_KERNEL); |
| @@ -1331,9 +1352,7 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra) | |||
| 1331 | return dd; | 1352 | return dd; |
| 1332 | 1353 | ||
| 1333 | bail: | 1354 | bail: |
| 1334 | if (!list_empty(&dd->list)) | 1355 | hfi1_clean_devdata(dd); |
| 1335 | list_del_init(&dd->list); | ||
| 1336 | rvt_dealloc_device(&dd->verbs_dev.rdi); | ||
| 1337 | return ERR_PTR(ret); | 1356 | return ERR_PTR(ret); |
| 1338 | } | 1357 | } |
| 1339 | 1358 | ||
diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c index 83d66e862207..c1c982908b4b 100644 --- a/drivers/infiniband/hw/hfi1/pcie.c +++ b/drivers/infiniband/hw/hfi1/pcie.c | |||
| @@ -163,9 +163,6 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev) | |||
| 163 | resource_size_t addr; | 163 | resource_size_t addr; |
| 164 | int ret = 0; | 164 | int ret = 0; |
| 165 | 165 | ||
| 166 | dd->pcidev = pdev; | ||
| 167 | pci_set_drvdata(pdev, dd); | ||
| 168 | |||
| 169 | addr = pci_resource_start(pdev, 0); | 166 | addr = pci_resource_start(pdev, 0); |
| 170 | len = pci_resource_len(pdev, 0); | 167 | len = pci_resource_len(pdev, 0); |
| 171 | 168 | ||
diff --git a/drivers/infiniband/hw/hfi1/platform.c b/drivers/infiniband/hw/hfi1/platform.c index d486355880cb..cbf7faa5038c 100644 --- a/drivers/infiniband/hw/hfi1/platform.c +++ b/drivers/infiniband/hw/hfi1/platform.c | |||
| @@ -199,6 +199,7 @@ void free_platform_config(struct hfi1_devdata *dd) | |||
| 199 | { | 199 | { |
| 200 | /* Release memory allocated for eprom or fallback file read. */ | 200 | /* Release memory allocated for eprom or fallback file read. */ |
| 201 | kfree(dd->platform_config.data); | 201 | kfree(dd->platform_config.data); |
| 202 | dd->platform_config.data = NULL; | ||
| 202 | } | 203 | } |
| 203 | 204 | ||
| 204 | void get_port_type(struct hfi1_pportdata *ppd) | 205 | void get_port_type(struct hfi1_pportdata *ppd) |
diff --git a/drivers/infiniband/hw/hfi1/qsfp.c b/drivers/infiniband/hw/hfi1/qsfp.c index 1869f639c3ae..b5966991d647 100644 --- a/drivers/infiniband/hw/hfi1/qsfp.c +++ b/drivers/infiniband/hw/hfi1/qsfp.c | |||
| @@ -204,6 +204,8 @@ static void clean_i2c_bus(struct hfi1_i2c_bus *bus) | |||
| 204 | 204 | ||
| 205 | void clean_up_i2c(struct hfi1_devdata *dd, struct hfi1_asic_data *ad) | 205 | void clean_up_i2c(struct hfi1_devdata *dd, struct hfi1_asic_data *ad) |
| 206 | { | 206 | { |
| 207 | if (!ad) | ||
| 208 | return; | ||
| 207 | clean_i2c_bus(ad->i2c_bus0); | 209 | clean_i2c_bus(ad->i2c_bus0); |
| 208 | ad->i2c_bus0 = NULL; | 210 | ad->i2c_bus0 = NULL; |
| 209 | clean_i2c_bus(ad->i2c_bus1); | 211 | clean_i2c_bus(ad->i2c_bus1); |
diff --git a/drivers/infiniband/hw/hfi1/ruc.c b/drivers/infiniband/hw/hfi1/ruc.c index 3daa94bdae3a..c0071ca4147a 100644 --- a/drivers/infiniband/hw/hfi1/ruc.c +++ b/drivers/infiniband/hw/hfi1/ruc.c | |||
| @@ -733,6 +733,20 @@ static inline void hfi1_make_ruc_bth(struct rvt_qp *qp, | |||
| 733 | ohdr->bth[2] = cpu_to_be32(bth2); | 733 | ohdr->bth[2] = cpu_to_be32(bth2); |
| 734 | } | 734 | } |
| 735 | 735 | ||
| 736 | /** | ||
| 737 | * hfi1_make_ruc_header_16B - build a 16B header | ||
| 738 | * @qp: the queue pair | ||
| 739 | * @ohdr: a pointer to the destination header memory | ||
| 740 | * @bth0: bth0 passed in from the RC/UC builder | ||
| 741 | * @bth2: bth2 passed in from the RC/UC builder | ||
| 742 | * @middle: non zero implies indicates ahg "could" be used | ||
| 743 | * @ps: the current packet state | ||
| 744 | * | ||
| 745 | * This routine may disarm ahg under these situations: | ||
| 746 | * - packet needs a GRH | ||
| 747 | * - BECN needed | ||
| 748 | * - migration state not IB_MIG_MIGRATED | ||
| 749 | */ | ||
| 736 | static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, | 750 | static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, |
| 737 | struct ib_other_headers *ohdr, | 751 | struct ib_other_headers *ohdr, |
| 738 | u32 bth0, u32 bth2, int middle, | 752 | u32 bth0, u32 bth2, int middle, |
| @@ -777,6 +791,12 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, | |||
| 777 | else | 791 | else |
| 778 | middle = 0; | 792 | middle = 0; |
| 779 | 793 | ||
| 794 | if (qp->s_flags & RVT_S_ECN) { | ||
| 795 | qp->s_flags &= ~RVT_S_ECN; | ||
| 796 | /* we recently received a FECN, so return a BECN */ | ||
| 797 | becn = true; | ||
| 798 | middle = 0; | ||
| 799 | } | ||
| 780 | if (middle) | 800 | if (middle) |
| 781 | build_ahg(qp, bth2); | 801 | build_ahg(qp, bth2); |
| 782 | else | 802 | else |
| @@ -784,11 +804,6 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, | |||
| 784 | 804 | ||
| 785 | bth0 |= pkey; | 805 | bth0 |= pkey; |
| 786 | bth0 |= extra_bytes << 20; | 806 | bth0 |= extra_bytes << 20; |
| 787 | if (qp->s_flags & RVT_S_ECN) { | ||
| 788 | qp->s_flags &= ~RVT_S_ECN; | ||
| 789 | /* we recently received a FECN, so return a BECN */ | ||
| 790 | becn = true; | ||
| 791 | } | ||
| 792 | hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2); | 807 | hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2); |
| 793 | 808 | ||
| 794 | if (!ppd->lid) | 809 | if (!ppd->lid) |
| @@ -806,6 +821,20 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, | |||
| 806 | pkey, becn, 0, l4, priv->s_sc); | 821 | pkey, becn, 0, l4, priv->s_sc); |
| 807 | } | 822 | } |
| 808 | 823 | ||
| 824 | /** | ||
| 825 | * hfi1_make_ruc_header_9B - build a 9B header | ||
| 826 | * @qp: the queue pair | ||
| 827 | * @ohdr: a pointer to the destination header memory | ||
| 828 | * @bth0: bth0 passed in from the RC/UC builder | ||
| 829 | * @bth2: bth2 passed in from the RC/UC builder | ||
| 830 | * @middle: non zero implies indicates ahg "could" be used | ||
| 831 | * @ps: the current packet state | ||
| 832 | * | ||
| 833 | * This routine may disarm ahg under these situations: | ||
| 834 | * - packet needs a GRH | ||
| 835 | * - BECN needed | ||
| 836 | * - migration state not IB_MIG_MIGRATED | ||
| 837 | */ | ||
| 809 | static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, | 838 | static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, |
| 810 | struct ib_other_headers *ohdr, | 839 | struct ib_other_headers *ohdr, |
| 811 | u32 bth0, u32 bth2, int middle, | 840 | u32 bth0, u32 bth2, int middle, |
| @@ -839,6 +868,12 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, | |||
| 839 | else | 868 | else |
| 840 | middle = 0; | 869 | middle = 0; |
| 841 | 870 | ||
| 871 | if (qp->s_flags & RVT_S_ECN) { | ||
| 872 | qp->s_flags &= ~RVT_S_ECN; | ||
| 873 | /* we recently received a FECN, so return a BECN */ | ||
| 874 | bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT); | ||
| 875 | middle = 0; | ||
| 876 | } | ||
| 842 | if (middle) | 877 | if (middle) |
| 843 | build_ahg(qp, bth2); | 878 | build_ahg(qp, bth2); |
| 844 | else | 879 | else |
| @@ -846,11 +881,6 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, | |||
| 846 | 881 | ||
| 847 | bth0 |= pkey; | 882 | bth0 |= pkey; |
| 848 | bth0 |= extra_bytes << 20; | 883 | bth0 |= extra_bytes << 20; |
| 849 | if (qp->s_flags & RVT_S_ECN) { | ||
| 850 | qp->s_flags &= ~RVT_S_ECN; | ||
| 851 | /* we recently received a FECN, so return a BECN */ | ||
| 852 | bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT); | ||
| 853 | } | ||
| 854 | hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2); | 884 | hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2); |
| 855 | hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh, | 885 | hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh, |
| 856 | lrh0, | 886 | lrh0, |
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c index bcf3b0bebac8..69c17a5ef038 100644 --- a/drivers/infiniband/hw/hfi1/ud.c +++ b/drivers/infiniband/hw/hfi1/ud.c | |||
| @@ -628,7 +628,7 @@ int hfi1_lookup_pkey_idx(struct hfi1_ibport *ibp, u16 pkey) | |||
| 628 | } | 628 | } |
| 629 | 629 | ||
| 630 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 630 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
| 631 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 631 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
| 632 | u8 sc5, const struct ib_grh *old_grh) | 632 | u8 sc5, const struct ib_grh *old_grh) |
| 633 | { | 633 | { |
| 634 | u64 pbc, pbc_flags = 0; | 634 | u64 pbc, pbc_flags = 0; |
| @@ -687,7 +687,7 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | |||
| 687 | } | 687 | } |
| 688 | 688 | ||
| 689 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, | 689 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, |
| 690 | u32 pkey, u32 slid, u32 dlid, u8 sc5, | 690 | u16 pkey, u32 slid, u32 dlid, u8 sc5, |
| 691 | const struct ib_grh *old_grh) | 691 | const struct ib_grh *old_grh) |
| 692 | { | 692 | { |
| 693 | u64 pbc, pbc_flags = 0; | 693 | u64 pbc, pbc_flags = 0; |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index 0eeabfbee192..63b5b3edabcb 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c | |||
| @@ -912,7 +912,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, | |||
| 912 | obj_per_chunk = buf_chunk_size / obj_size; | 912 | obj_per_chunk = buf_chunk_size / obj_size; |
| 913 | num_hem = (nobj + obj_per_chunk - 1) / obj_per_chunk; | 913 | num_hem = (nobj + obj_per_chunk - 1) / obj_per_chunk; |
| 914 | bt_chunk_num = bt_chunk_size / 8; | 914 | bt_chunk_num = bt_chunk_size / 8; |
| 915 | if (table->type >= HEM_TYPE_MTT) | 915 | if (type >= HEM_TYPE_MTT) |
| 916 | num_bt_l0 = bt_chunk_num; | 916 | num_bt_l0 = bt_chunk_num; |
| 917 | 917 | ||
| 918 | table->hem = kcalloc(num_hem, sizeof(*table->hem), | 918 | table->hem = kcalloc(num_hem, sizeof(*table->hem), |
| @@ -920,7 +920,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, | |||
| 920 | if (!table->hem) | 920 | if (!table->hem) |
| 921 | goto err_kcalloc_hem_buf; | 921 | goto err_kcalloc_hem_buf; |
| 922 | 922 | ||
| 923 | if (check_whether_bt_num_3(table->type, hop_num)) { | 923 | if (check_whether_bt_num_3(type, hop_num)) { |
| 924 | unsigned long num_bt_l1; | 924 | unsigned long num_bt_l1; |
| 925 | 925 | ||
| 926 | num_bt_l1 = (num_hem + bt_chunk_num - 1) / | 926 | num_bt_l1 = (num_hem + bt_chunk_num - 1) / |
| @@ -939,8 +939,8 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, | |||
| 939 | goto err_kcalloc_l1_dma; | 939 | goto err_kcalloc_l1_dma; |
| 940 | } | 940 | } |
| 941 | 941 | ||
| 942 | if (check_whether_bt_num_2(table->type, hop_num) || | 942 | if (check_whether_bt_num_2(type, hop_num) || |
| 943 | check_whether_bt_num_3(table->type, hop_num)) { | 943 | check_whether_bt_num_3(type, hop_num)) { |
| 944 | table->bt_l0 = kcalloc(num_bt_l0, sizeof(*table->bt_l0), | 944 | table->bt_l0 = kcalloc(num_bt_l0, sizeof(*table->bt_l0), |
| 945 | GFP_KERNEL); | 945 | GFP_KERNEL); |
| 946 | if (!table->bt_l0) | 946 | if (!table->bt_l0) |
| @@ -1039,14 +1039,14 @@ void hns_roce_cleanup_hem_table(struct hns_roce_dev *hr_dev, | |||
| 1039 | void hns_roce_cleanup_hem(struct hns_roce_dev *hr_dev) | 1039 | void hns_roce_cleanup_hem(struct hns_roce_dev *hr_dev) |
| 1040 | { | 1040 | { |
| 1041 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->cq_table.table); | 1041 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->cq_table.table); |
| 1042 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.irrl_table); | ||
| 1043 | if (hr_dev->caps.trrl_entry_sz) | 1042 | if (hr_dev->caps.trrl_entry_sz) |
| 1044 | hns_roce_cleanup_hem_table(hr_dev, | 1043 | hns_roce_cleanup_hem_table(hr_dev, |
| 1045 | &hr_dev->qp_table.trrl_table); | 1044 | &hr_dev->qp_table.trrl_table); |
| 1045 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.irrl_table); | ||
| 1046 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.qp_table); | 1046 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.qp_table); |
| 1047 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtpt_table); | 1047 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtpt_table); |
| 1048 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtt_table); | ||
| 1049 | if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) | 1048 | if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) |
| 1050 | hns_roce_cleanup_hem_table(hr_dev, | 1049 | hns_roce_cleanup_hem_table(hr_dev, |
| 1051 | &hr_dev->mr_table.mtt_cqe_table); | 1050 | &hr_dev->mr_table.mtt_cqe_table); |
| 1051 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtt_table); | ||
| 1052 | } | 1052 | } |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 8b84ab7800d8..25916e8522ed 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c | |||
| @@ -71,6 +71,11 @@ static int set_rwqe_data_seg(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 71 | return -EINVAL; | 71 | return -EINVAL; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | if (wr->opcode == IB_WR_RDMA_READ) { | ||
| 75 | dev_err(hr_dev->dev, "Not support inline data!\n"); | ||
| 76 | return -EINVAL; | ||
| 77 | } | ||
| 78 | |||
| 74 | for (i = 0; i < wr->num_sge; i++) { | 79 | for (i = 0; i < wr->num_sge; i++) { |
| 75 | memcpy(wqe, ((void *)wr->sg_list[i].addr), | 80 | memcpy(wqe, ((void *)wr->sg_list[i].addr), |
| 76 | wr->sg_list[i].length); | 81 | wr->sg_list[i].length); |
| @@ -148,7 +153,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 148 | ibqp->qp_type != IB_QPT_GSI && | 153 | ibqp->qp_type != IB_QPT_GSI && |
| 149 | ibqp->qp_type != IB_QPT_UD)) { | 154 | ibqp->qp_type != IB_QPT_UD)) { |
| 150 | dev_err(dev, "Not supported QP(0x%x)type!\n", ibqp->qp_type); | 155 | dev_err(dev, "Not supported QP(0x%x)type!\n", ibqp->qp_type); |
| 151 | *bad_wr = NULL; | 156 | *bad_wr = wr; |
| 152 | return -EOPNOTSUPP; | 157 | return -EOPNOTSUPP; |
| 153 | } | 158 | } |
| 154 | 159 | ||
| @@ -182,7 +187,8 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 182 | qp->sq.wrid[(qp->sq.head + nreq) & (qp->sq.wqe_cnt - 1)] = | 187 | qp->sq.wrid[(qp->sq.head + nreq) & (qp->sq.wqe_cnt - 1)] = |
| 183 | wr->wr_id; | 188 | wr->wr_id; |
| 184 | 189 | ||
| 185 | owner_bit = ~(qp->sq.head >> ilog2(qp->sq.wqe_cnt)) & 0x1; | 190 | owner_bit = |
| 191 | ~(((qp->sq.head + nreq) >> ilog2(qp->sq.wqe_cnt)) & 0x1); | ||
| 186 | 192 | ||
| 187 | /* Corresponding to the QP type, wqe process separately */ | 193 | /* Corresponding to the QP type, wqe process separately */ |
| 188 | if (ibqp->qp_type == IB_QPT_GSI) { | 194 | if (ibqp->qp_type == IB_QPT_GSI) { |
| @@ -456,6 +462,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 456 | } else { | 462 | } else { |
| 457 | dev_err(dev, "Illegal qp_type(0x%x)\n", ibqp->qp_type); | 463 | dev_err(dev, "Illegal qp_type(0x%x)\n", ibqp->qp_type); |
| 458 | spin_unlock_irqrestore(&qp->sq.lock, flags); | 464 | spin_unlock_irqrestore(&qp->sq.lock, flags); |
| 465 | *bad_wr = wr; | ||
| 459 | return -EOPNOTSUPP; | 466 | return -EOPNOTSUPP; |
| 460 | } | 467 | } |
| 461 | } | 468 | } |
| @@ -2592,10 +2599,12 @@ static void modify_qp_init_to_init(struct ib_qp *ibqp, | |||
| 2592 | roce_set_field(qpc_mask->byte_4_sqpn_tst, V2_QPC_BYTE_4_SQPN_M, | 2599 | roce_set_field(qpc_mask->byte_4_sqpn_tst, V2_QPC_BYTE_4_SQPN_M, |
| 2593 | V2_QPC_BYTE_4_SQPN_S, 0); | 2600 | V2_QPC_BYTE_4_SQPN_S, 0); |
| 2594 | 2601 | ||
| 2595 | roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, | 2602 | if (attr_mask & IB_QP_DEST_QPN) { |
| 2596 | V2_QPC_BYTE_56_DQPN_S, hr_qp->qpn); | 2603 | roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, |
| 2597 | roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, | 2604 | V2_QPC_BYTE_56_DQPN_S, hr_qp->qpn); |
| 2598 | V2_QPC_BYTE_56_DQPN_S, 0); | 2605 | roce_set_field(qpc_mask->byte_56_dqpn_err, |
| 2606 | V2_QPC_BYTE_56_DQPN_M, V2_QPC_BYTE_56_DQPN_S, 0); | ||
| 2607 | } | ||
| 2599 | roce_set_field(context->byte_168_irrl_idx, | 2608 | roce_set_field(context->byte_168_irrl_idx, |
| 2600 | V2_QPC_BYTE_168_SQ_SHIFT_BAK_M, | 2609 | V2_QPC_BYTE_168_SQ_SHIFT_BAK_M, |
| 2601 | V2_QPC_BYTE_168_SQ_SHIFT_BAK_S, | 2610 | V2_QPC_BYTE_168_SQ_SHIFT_BAK_S, |
| @@ -2650,8 +2659,7 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, | |||
| 2650 | return -EINVAL; | 2659 | return -EINVAL; |
| 2651 | } | 2660 | } |
| 2652 | 2661 | ||
| 2653 | if ((attr_mask & IB_QP_ALT_PATH) || (attr_mask & IB_QP_ACCESS_FLAGS) || | 2662 | if (attr_mask & IB_QP_ALT_PATH) { |
| 2654 | (attr_mask & IB_QP_PKEY_INDEX) || (attr_mask & IB_QP_QKEY)) { | ||
| 2655 | dev_err(dev, "INIT2RTR attr_mask (0x%x) error\n", attr_mask); | 2663 | dev_err(dev, "INIT2RTR attr_mask (0x%x) error\n", attr_mask); |
| 2656 | return -EINVAL; | 2664 | return -EINVAL; |
| 2657 | } | 2665 | } |
| @@ -2800,10 +2808,12 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, | |||
| 2800 | V2_QPC_BYTE_140_RR_MAX_S, 0); | 2808 | V2_QPC_BYTE_140_RR_MAX_S, 0); |
| 2801 | } | 2809 | } |
| 2802 | 2810 | ||
| 2803 | roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, | 2811 | if (attr_mask & IB_QP_DEST_QPN) { |
| 2804 | V2_QPC_BYTE_56_DQPN_S, attr->dest_qp_num); | 2812 | roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, |
| 2805 | roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, | 2813 | V2_QPC_BYTE_56_DQPN_S, attr->dest_qp_num); |
| 2806 | V2_QPC_BYTE_56_DQPN_S, 0); | 2814 | roce_set_field(qpc_mask->byte_56_dqpn_err, |
| 2815 | V2_QPC_BYTE_56_DQPN_M, V2_QPC_BYTE_56_DQPN_S, 0); | ||
| 2816 | } | ||
| 2807 | 2817 | ||
| 2808 | /* Configure GID index */ | 2818 | /* Configure GID index */ |
| 2809 | port_num = rdma_ah_get_port_num(&attr->ah_attr); | 2819 | port_num = rdma_ah_get_port_num(&attr->ah_attr); |
| @@ -2845,7 +2855,7 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, | |||
| 2845 | if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD) | 2855 | if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD) |
| 2846 | roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M, | 2856 | roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M, |
| 2847 | V2_QPC_BYTE_24_MTU_S, IB_MTU_4096); | 2857 | V2_QPC_BYTE_24_MTU_S, IB_MTU_4096); |
| 2848 | else | 2858 | else if (attr_mask & IB_QP_PATH_MTU) |
| 2849 | roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M, | 2859 | roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M, |
| 2850 | V2_QPC_BYTE_24_MTU_S, attr->path_mtu); | 2860 | V2_QPC_BYTE_24_MTU_S, attr->path_mtu); |
| 2851 | 2861 | ||
| @@ -2922,11 +2932,9 @@ static int modify_qp_rtr_to_rts(struct ib_qp *ibqp, | |||
| 2922 | return -EINVAL; | 2932 | return -EINVAL; |
| 2923 | } | 2933 | } |
| 2924 | 2934 | ||
| 2925 | /* If exist optional param, return error */ | 2935 | /* Not support alternate path and path migration */ |
| 2926 | if ((attr_mask & IB_QP_ALT_PATH) || (attr_mask & IB_QP_ACCESS_FLAGS) || | 2936 | if ((attr_mask & IB_QP_ALT_PATH) || |
| 2927 | (attr_mask & IB_QP_QKEY) || (attr_mask & IB_QP_PATH_MIG_STATE) || | 2937 | (attr_mask & IB_QP_PATH_MIG_STATE)) { |
| 2928 | (attr_mask & IB_QP_CUR_STATE) || | ||
| 2929 | (attr_mask & IB_QP_MIN_RNR_TIMER)) { | ||
| 2930 | dev_err(dev, "RTR2RTS attr_mask (0x%x)error\n", attr_mask); | 2938 | dev_err(dev, "RTR2RTS attr_mask (0x%x)error\n", attr_mask); |
| 2931 | return -EINVAL; | 2939 | return -EINVAL; |
| 2932 | } | 2940 | } |
| @@ -3161,7 +3169,8 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp, | |||
| 3161 | (cur_state == IB_QPS_RTR && new_state == IB_QPS_ERR) || | 3169 | (cur_state == IB_QPS_RTR && new_state == IB_QPS_ERR) || |
| 3162 | (cur_state == IB_QPS_RTS && new_state == IB_QPS_ERR) || | 3170 | (cur_state == IB_QPS_RTS && new_state == IB_QPS_ERR) || |
| 3163 | (cur_state == IB_QPS_SQD && new_state == IB_QPS_ERR) || | 3171 | (cur_state == IB_QPS_SQD && new_state == IB_QPS_ERR) || |
| 3164 | (cur_state == IB_QPS_SQE && new_state == IB_QPS_ERR)) { | 3172 | (cur_state == IB_QPS_SQE && new_state == IB_QPS_ERR) || |
| 3173 | (cur_state == IB_QPS_ERR && new_state == IB_QPS_ERR)) { | ||
| 3165 | /* Nothing */ | 3174 | /* Nothing */ |
| 3166 | ; | 3175 | ; |
| 3167 | } else { | 3176 | } else { |
| @@ -4478,7 +4487,7 @@ static int hns_roce_v2_create_eq(struct hns_roce_dev *hr_dev, | |||
| 4478 | ret = hns_roce_cmd_mbox(hr_dev, mailbox->dma, 0, eq->eqn, 0, | 4487 | ret = hns_roce_cmd_mbox(hr_dev, mailbox->dma, 0, eq->eqn, 0, |
| 4479 | eq_cmd, HNS_ROCE_CMD_TIMEOUT_MSECS); | 4488 | eq_cmd, HNS_ROCE_CMD_TIMEOUT_MSECS); |
| 4480 | if (ret) { | 4489 | if (ret) { |
| 4481 | dev_err(dev, "[mailbox cmd] creat eqc failed.\n"); | 4490 | dev_err(dev, "[mailbox cmd] create eqc failed.\n"); |
| 4482 | goto err_cmd_mbox; | 4491 | goto err_cmd_mbox; |
| 4483 | } | 4492 | } |
| 4484 | 4493 | ||
diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index e289a924e789..d4aad34c21e2 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c | |||
| @@ -620,7 +620,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev, | |||
| 620 | to_hr_ucontext(ib_pd->uobject->context), | 620 | to_hr_ucontext(ib_pd->uobject->context), |
| 621 | ucmd.db_addr, &hr_qp->rdb); | 621 | ucmd.db_addr, &hr_qp->rdb); |
| 622 | if (ret) { | 622 | if (ret) { |
| 623 | dev_err(dev, "rp record doorbell map failed!\n"); | 623 | dev_err(dev, "rq record doorbell map failed!\n"); |
| 624 | goto err_mtt; | 624 | goto err_mtt; |
| 625 | } | 625 | } |
| 626 | } | 626 | } |
diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 17f4f151a97f..61d8b06375bb 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c | |||
| @@ -346,7 +346,7 @@ int mlx4_ib_umem_calc_optimal_mtt_size(struct ib_umem *umem, u64 start_va, | |||
| 346 | /* Add to the first block the misalignment that it suffers from. */ | 346 | /* Add to the first block the misalignment that it suffers from. */ |
| 347 | total_len += (first_block_start & ((1ULL << block_shift) - 1ULL)); | 347 | total_len += (first_block_start & ((1ULL << block_shift) - 1ULL)); |
| 348 | last_block_end = current_block_start + current_block_len; | 348 | last_block_end = current_block_start + current_block_len; |
| 349 | last_block_aligned_end = round_up(last_block_end, 1 << block_shift); | 349 | last_block_aligned_end = round_up(last_block_end, 1ULL << block_shift); |
| 350 | total_len += (last_block_aligned_end - last_block_end); | 350 | total_len += (last_block_aligned_end - last_block_end); |
| 351 | 351 | ||
| 352 | if (total_len & ((1ULL << block_shift) - 1ULL)) | 352 | if (total_len & ((1ULL << block_shift) - 1ULL)) |
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 50af8915e7ec..199648adac74 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
| @@ -673,7 +673,8 @@ static int set_qp_rss(struct mlx4_ib_dev *dev, struct mlx4_ib_rss *rss_ctx, | |||
| 673 | MLX4_IB_RX_HASH_SRC_PORT_TCP | | 673 | MLX4_IB_RX_HASH_SRC_PORT_TCP | |
| 674 | MLX4_IB_RX_HASH_DST_PORT_TCP | | 674 | MLX4_IB_RX_HASH_DST_PORT_TCP | |
| 675 | MLX4_IB_RX_HASH_SRC_PORT_UDP | | 675 | MLX4_IB_RX_HASH_SRC_PORT_UDP | |
| 676 | MLX4_IB_RX_HASH_DST_PORT_UDP)) { | 676 | MLX4_IB_RX_HASH_DST_PORT_UDP | |
| 677 | MLX4_IB_RX_HASH_INNER)) { | ||
| 677 | pr_debug("RX Hash fields_mask has unsupported mask (0x%llx)\n", | 678 | pr_debug("RX Hash fields_mask has unsupported mask (0x%llx)\n", |
| 678 | ucmd->rx_hash_fields_mask); | 679 | ucmd->rx_hash_fields_mask); |
| 679 | return (-EOPNOTSUPP); | 680 | return (-EOPNOTSUPP); |
diff --git a/drivers/infiniband/hw/mlx5/Kconfig b/drivers/infiniband/hw/mlx5/Kconfig index bce263b92821..fb4d77be019b 100644 --- a/drivers/infiniband/hw/mlx5/Kconfig +++ b/drivers/infiniband/hw/mlx5/Kconfig | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | config MLX5_INFINIBAND | 1 | config MLX5_INFINIBAND |
| 2 | tristate "Mellanox Connect-IB HCA support" | 2 | tristate "Mellanox Connect-IB HCA support" |
| 3 | depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE | 3 | depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE |
| 4 | depends on INFINIBAND_USER_ACCESS || INFINIBAND_USER_ACCESS=n | ||
| 4 | ---help--- | 5 | ---help--- |
| 5 | This driver provides low-level InfiniBand support for | 6 | This driver provides low-level InfiniBand support for |
| 6 | Mellanox Connect-IB PCI Express host channel adapters (HCAs). | 7 | Mellanox Connect-IB PCI Express host channel adapters (HCAs). |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index daa919e5a442..b4d8ff8ab807 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -52,7 +52,6 @@ | |||
| 52 | #include <linux/mlx5/port.h> | 52 | #include <linux/mlx5/port.h> |
| 53 | #include <linux/mlx5/vport.h> | 53 | #include <linux/mlx5/vport.h> |
| 54 | #include <linux/mlx5/fs.h> | 54 | #include <linux/mlx5/fs.h> |
| 55 | #include <linux/mlx5/fs_helpers.h> | ||
| 56 | #include <linux/list.h> | 55 | #include <linux/list.h> |
| 57 | #include <rdma/ib_smi.h> | 56 | #include <rdma/ib_smi.h> |
| 58 | #include <rdma/ib_umem.h> | 57 | #include <rdma/ib_umem.h> |
| @@ -180,7 +179,7 @@ static int mlx5_netdev_event(struct notifier_block *this, | |||
| 180 | if (rep_ndev == ndev) | 179 | if (rep_ndev == ndev) |
| 181 | roce->netdev = (event == NETDEV_UNREGISTER) ? | 180 | roce->netdev = (event == NETDEV_UNREGISTER) ? |
| 182 | NULL : ndev; | 181 | NULL : ndev; |
| 183 | } else if (ndev->dev.parent == &ibdev->mdev->pdev->dev) { | 182 | } else if (ndev->dev.parent == &mdev->pdev->dev) { |
| 184 | roce->netdev = (event == NETDEV_UNREGISTER) ? | 183 | roce->netdev = (event == NETDEV_UNREGISTER) ? |
| 185 | NULL : ndev; | 184 | NULL : ndev; |
| 186 | } | 185 | } |
| @@ -4757,7 +4756,7 @@ mlx5_ib_get_vector_affinity(struct ib_device *ibdev, int comp_vector) | |||
| 4757 | { | 4756 | { |
| 4758 | struct mlx5_ib_dev *dev = to_mdev(ibdev); | 4757 | struct mlx5_ib_dev *dev = to_mdev(ibdev); |
| 4759 | 4758 | ||
| 4760 | return mlx5_get_vector_affinity(dev->mdev, comp_vector); | 4759 | return mlx5_get_vector_affinity_hint(dev->mdev, comp_vector); |
| 4761 | } | 4760 | } |
| 4762 | 4761 | ||
| 4763 | /* The mlx5_ib_multiport_mutex should be held when calling this function */ | 4762 | /* The mlx5_ib_multiport_mutex should be held when calling this function */ |
| @@ -5427,9 +5426,7 @@ static void mlx5_ib_stage_cong_debugfs_cleanup(struct mlx5_ib_dev *dev) | |||
| 5427 | static int mlx5_ib_stage_uar_init(struct mlx5_ib_dev *dev) | 5426 | static int mlx5_ib_stage_uar_init(struct mlx5_ib_dev *dev) |
| 5428 | { | 5427 | { |
| 5429 | dev->mdev->priv.uar = mlx5_get_uars_page(dev->mdev); | 5428 | dev->mdev->priv.uar = mlx5_get_uars_page(dev->mdev); |
| 5430 | if (!dev->mdev->priv.uar) | 5429 | return PTR_ERR_OR_ZERO(dev->mdev->priv.uar); |
| 5431 | return -ENOMEM; | ||
| 5432 | return 0; | ||
| 5433 | } | 5430 | } |
| 5434 | 5431 | ||
| 5435 | static void mlx5_ib_stage_uar_cleanup(struct mlx5_ib_dev *dev) | 5432 | static void mlx5_ib_stage_uar_cleanup(struct mlx5_ib_dev *dev) |
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 1520a2f20f98..90a9c461cedc 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c | |||
| @@ -866,25 +866,28 @@ static int mr_umem_get(struct ib_pd *pd, u64 start, u64 length, | |||
| 866 | int *order) | 866 | int *order) |
| 867 | { | 867 | { |
| 868 | struct mlx5_ib_dev *dev = to_mdev(pd->device); | 868 | struct mlx5_ib_dev *dev = to_mdev(pd->device); |
| 869 | struct ib_umem *u; | ||
| 869 | int err; | 870 | int err; |
| 870 | 871 | ||
| 871 | *umem = ib_umem_get(pd->uobject->context, start, length, | 872 | *umem = NULL; |
| 872 | access_flags, 0); | 873 | |
| 873 | err = PTR_ERR_OR_ZERO(*umem); | 874 | u = ib_umem_get(pd->uobject->context, start, length, access_flags, 0); |
| 875 | err = PTR_ERR_OR_ZERO(u); | ||
| 874 | if (err) { | 876 | if (err) { |
| 875 | *umem = NULL; | 877 | mlx5_ib_dbg(dev, "umem get failed (%d)\n", err); |
| 876 | mlx5_ib_err(dev, "umem get failed (%d)\n", err); | ||
| 877 | return err; | 878 | return err; |
| 878 | } | 879 | } |
| 879 | 880 | ||
| 880 | mlx5_ib_cont_pages(*umem, start, MLX5_MKEY_PAGE_SHIFT_MASK, npages, | 881 | mlx5_ib_cont_pages(u, start, MLX5_MKEY_PAGE_SHIFT_MASK, npages, |
| 881 | page_shift, ncont, order); | 882 | page_shift, ncont, order); |
| 882 | if (!*npages) { | 883 | if (!*npages) { |
| 883 | mlx5_ib_warn(dev, "avoid zero region\n"); | 884 | mlx5_ib_warn(dev, "avoid zero region\n"); |
| 884 | ib_umem_release(*umem); | 885 | ib_umem_release(u); |
| 885 | return -EINVAL; | 886 | return -EINVAL; |
| 886 | } | 887 | } |
| 887 | 888 | ||
| 889 | *umem = u; | ||
| 890 | |||
| 888 | mlx5_ib_dbg(dev, "npages %d, ncont %d, order %d, page_shift %d\n", | 891 | mlx5_ib_dbg(dev, "npages %d, ncont %d, order %d, page_shift %d\n", |
| 889 | *npages, *ncont, *order, *page_shift); | 892 | *npages, *ncont, *order, *page_shift); |
| 890 | 893 | ||
| @@ -1458,13 +1461,12 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, | |||
| 1458 | int access_flags = flags & IB_MR_REREG_ACCESS ? | 1461 | int access_flags = flags & IB_MR_REREG_ACCESS ? |
| 1459 | new_access_flags : | 1462 | new_access_flags : |
| 1460 | mr->access_flags; | 1463 | mr->access_flags; |
| 1461 | u64 addr = (flags & IB_MR_REREG_TRANS) ? virt_addr : mr->umem->address; | ||
| 1462 | u64 len = (flags & IB_MR_REREG_TRANS) ? length : mr->umem->length; | ||
| 1463 | int page_shift = 0; | 1464 | int page_shift = 0; |
| 1464 | int upd_flags = 0; | 1465 | int upd_flags = 0; |
| 1465 | int npages = 0; | 1466 | int npages = 0; |
| 1466 | int ncont = 0; | 1467 | int ncont = 0; |
| 1467 | int order = 0; | 1468 | int order = 0; |
| 1469 | u64 addr, len; | ||
| 1468 | int err; | 1470 | int err; |
| 1469 | 1471 | ||
| 1470 | mlx5_ib_dbg(dev, "start 0x%llx, virt_addr 0x%llx, length 0x%llx, access_flags 0x%x\n", | 1472 | mlx5_ib_dbg(dev, "start 0x%llx, virt_addr 0x%llx, length 0x%llx, access_flags 0x%x\n", |
| @@ -1472,6 +1474,17 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, | |||
| 1472 | 1474 | ||
| 1473 | atomic_sub(mr->npages, &dev->mdev->priv.reg_pages); | 1475 | atomic_sub(mr->npages, &dev->mdev->priv.reg_pages); |
| 1474 | 1476 | ||
| 1477 | if (!mr->umem) | ||
| 1478 | return -EINVAL; | ||
| 1479 | |||
| 1480 | if (flags & IB_MR_REREG_TRANS) { | ||
| 1481 | addr = virt_addr; | ||
| 1482 | len = length; | ||
| 1483 | } else { | ||
| 1484 | addr = mr->umem->address; | ||
| 1485 | len = mr->umem->length; | ||
| 1486 | } | ||
| 1487 | |||
| 1475 | if (flags != IB_MR_REREG_PD) { | 1488 | if (flags != IB_MR_REREG_PD) { |
| 1476 | /* | 1489 | /* |
| 1477 | * Replace umem. This needs to be done whether or not UMR is | 1490 | * Replace umem. This needs to be done whether or not UMR is |
| @@ -1479,6 +1492,7 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, | |||
| 1479 | */ | 1492 | */ |
| 1480 | flags |= IB_MR_REREG_TRANS; | 1493 | flags |= IB_MR_REREG_TRANS; |
| 1481 | ib_umem_release(mr->umem); | 1494 | ib_umem_release(mr->umem); |
| 1495 | mr->umem = NULL; | ||
| 1482 | err = mr_umem_get(pd, addr, len, access_flags, &mr->umem, | 1496 | err = mr_umem_get(pd, addr, len, access_flags, &mr->umem, |
| 1483 | &npages, &page_shift, &ncont, &order); | 1497 | &npages, &page_shift, &ncont, &order); |
| 1484 | if (err) | 1498 | if (err) |
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 7ed4b70f6447..87b7c1be2a11 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
| @@ -259,7 +259,11 @@ static int set_rq_size(struct mlx5_ib_dev *dev, struct ib_qp_cap *cap, | |||
| 259 | } else { | 259 | } else { |
| 260 | if (ucmd) { | 260 | if (ucmd) { |
| 261 | qp->rq.wqe_cnt = ucmd->rq_wqe_count; | 261 | qp->rq.wqe_cnt = ucmd->rq_wqe_count; |
| 262 | if (ucmd->rq_wqe_shift > BITS_PER_BYTE * sizeof(ucmd->rq_wqe_shift)) | ||
| 263 | return -EINVAL; | ||
| 262 | qp->rq.wqe_shift = ucmd->rq_wqe_shift; | 264 | qp->rq.wqe_shift = ucmd->rq_wqe_shift; |
| 265 | if ((1 << qp->rq.wqe_shift) / sizeof(struct mlx5_wqe_data_seg) < qp->wq_sig) | ||
| 266 | return -EINVAL; | ||
| 263 | qp->rq.max_gs = (1 << qp->rq.wqe_shift) / sizeof(struct mlx5_wqe_data_seg) - qp->wq_sig; | 267 | qp->rq.max_gs = (1 << qp->rq.wqe_shift) / sizeof(struct mlx5_wqe_data_seg) - qp->wq_sig; |
| 264 | qp->rq.max_post = qp->rq.wqe_cnt; | 268 | qp->rq.max_post = qp->rq.wqe_cnt; |
| 265 | } else { | 269 | } else { |
| @@ -2451,18 +2455,18 @@ enum { | |||
| 2451 | 2455 | ||
| 2452 | static int ib_rate_to_mlx5(struct mlx5_ib_dev *dev, u8 rate) | 2456 | static int ib_rate_to_mlx5(struct mlx5_ib_dev *dev, u8 rate) |
| 2453 | { | 2457 | { |
| 2454 | if (rate == IB_RATE_PORT_CURRENT) { | 2458 | if (rate == IB_RATE_PORT_CURRENT) |
| 2455 | return 0; | 2459 | return 0; |
| 2456 | } else if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_300_GBPS) { | 2460 | |
| 2461 | if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_300_GBPS) | ||
| 2457 | return -EINVAL; | 2462 | return -EINVAL; |
| 2458 | } else { | ||
| 2459 | while (rate != IB_RATE_2_5_GBPS && | ||
| 2460 | !(1 << (rate + MLX5_STAT_RATE_OFFSET) & | ||
| 2461 | MLX5_CAP_GEN(dev->mdev, stat_rate_support))) | ||
| 2462 | --rate; | ||
| 2463 | } | ||
| 2464 | 2463 | ||
| 2465 | return rate + MLX5_STAT_RATE_OFFSET; | 2464 | while (rate != IB_RATE_PORT_CURRENT && |
| 2465 | !(1 << (rate + MLX5_STAT_RATE_OFFSET) & | ||
| 2466 | MLX5_CAP_GEN(dev->mdev, stat_rate_support))) | ||
| 2467 | --rate; | ||
| 2468 | |||
| 2469 | return rate ? rate + MLX5_STAT_RATE_OFFSET : rate; | ||
| 2466 | } | 2470 | } |
| 2467 | 2471 | ||
| 2468 | static int modify_raw_packet_eth_prio(struct mlx5_core_dev *dev, | 2472 | static int modify_raw_packet_eth_prio(struct mlx5_core_dev *dev, |
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 0a75164cedea..007d5e8a0121 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c | |||
| @@ -461,7 +461,7 @@ static bool nes_nic_send(struct sk_buff *skb, struct net_device *netdev) | |||
| 461 | /** | 461 | /** |
| 462 | * nes_netdev_start_xmit | 462 | * nes_netdev_start_xmit |
| 463 | */ | 463 | */ |
| 464 | static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev) | 464 | static netdev_tx_t nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev) |
| 465 | { | 465 | { |
| 466 | struct nes_vnic *nesvnic = netdev_priv(netdev); | 466 | struct nes_vnic *nesvnic = netdev_priv(netdev); |
| 467 | struct nes_device *nesdev = nesvnic->nesdev; | 467 | struct nes_device *nesdev = nesvnic->nesdev; |
diff --git a/drivers/infiniband/sw/rxe/rxe_opcode.c b/drivers/infiniband/sw/rxe/rxe_opcode.c index 61927c165b59..4cf11063e0b5 100644 --- a/drivers/infiniband/sw/rxe/rxe_opcode.c +++ b/drivers/infiniband/sw/rxe/rxe_opcode.c | |||
| @@ -390,7 +390,7 @@ struct rxe_opcode_info rxe_opcode[RXE_NUM_OPCODE] = { | |||
| 390 | .name = "IB_OPCODE_RC_SEND_ONLY_INV", | 390 | .name = "IB_OPCODE_RC_SEND_ONLY_INV", |
| 391 | .mask = RXE_IETH_MASK | RXE_PAYLOAD_MASK | RXE_REQ_MASK | 391 | .mask = RXE_IETH_MASK | RXE_PAYLOAD_MASK | RXE_REQ_MASK |
| 392 | | RXE_COMP_MASK | RXE_RWR_MASK | RXE_SEND_MASK | 392 | | RXE_COMP_MASK | RXE_RWR_MASK | RXE_SEND_MASK |
| 393 | | RXE_END_MASK, | 393 | | RXE_END_MASK | RXE_START_MASK, |
| 394 | .length = RXE_BTH_BYTES + RXE_IETH_BYTES, | 394 | .length = RXE_BTH_BYTES + RXE_IETH_BYTES, |
| 395 | .offset = { | 395 | .offset = { |
| 396 | [RXE_BTH] = 0, | 396 | [RXE_BTH] = 0, |
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 7bdaf71b8221..785199990457 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c | |||
| @@ -728,7 +728,6 @@ next_wqe: | |||
| 728 | rollback_state(wqe, qp, &rollback_wqe, rollback_psn); | 728 | rollback_state(wqe, qp, &rollback_wqe, rollback_psn); |
| 729 | 729 | ||
| 730 | if (ret == -EAGAIN) { | 730 | if (ret == -EAGAIN) { |
| 731 | kfree_skb(skb); | ||
| 732 | rxe_run_task(&qp->req.task, 1); | 731 | rxe_run_task(&qp->req.task, 1); |
| 733 | goto exit; | 732 | goto exit; |
| 734 | } | 733 | } |
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index a65c9969f7fc..955ff3b6da9c 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c | |||
| @@ -742,7 +742,6 @@ static enum resp_states read_reply(struct rxe_qp *qp, | |||
| 742 | err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb); | 742 | err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb); |
| 743 | if (err) { | 743 | if (err) { |
| 744 | pr_err("Failed sending RDMA reply.\n"); | 744 | pr_err("Failed sending RDMA reply.\n"); |
| 745 | kfree_skb(skb); | ||
| 746 | return RESPST_ERR_RNR; | 745 | return RESPST_ERR_RNR; |
| 747 | } | 746 | } |
| 748 | 747 | ||
| @@ -954,10 +953,8 @@ static int send_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt, | |||
| 954 | } | 953 | } |
| 955 | 954 | ||
| 956 | err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb); | 955 | err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb); |
| 957 | if (err) { | 956 | if (err) |
| 958 | pr_err_ratelimited("Failed sending ack\n"); | 957 | pr_err_ratelimited("Failed sending ack\n"); |
| 959 | kfree_skb(skb); | ||
| 960 | } | ||
| 961 | 958 | ||
| 962 | err1: | 959 | err1: |
| 963 | return err; | 960 | return err; |
| @@ -1141,7 +1138,6 @@ static enum resp_states duplicate_request(struct rxe_qp *qp, | |||
| 1141 | if (rc) { | 1138 | if (rc) { |
| 1142 | pr_err("Failed resending result. This flow is not handled - skb ignored\n"); | 1139 | pr_err("Failed resending result. This flow is not handled - skb ignored\n"); |
| 1143 | rxe_drop_ref(qp); | 1140 | rxe_drop_ref(qp); |
| 1144 | kfree_skb(skb_copy); | ||
| 1145 | rc = RESPST_CLEANUP; | 1141 | rc = RESPST_CLEANUP; |
| 1146 | goto out; | 1142 | goto out; |
| 1147 | } | 1143 | } |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 161ba8c76285..cf291f90b58f 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
| @@ -1094,7 +1094,7 @@ drop_and_unlock: | |||
| 1094 | spin_unlock_irqrestore(&priv->lock, flags); | 1094 | spin_unlock_irqrestore(&priv->lock, flags); |
| 1095 | } | 1095 | } |
| 1096 | 1096 | ||
| 1097 | static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1097 | static netdev_tx_t ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) |
| 1098 | { | 1098 | { |
| 1099 | struct ipoib_dev_priv *priv = ipoib_priv(dev); | 1099 | struct ipoib_dev_priv *priv = ipoib_priv(dev); |
| 1100 | struct rdma_netdev *rn = netdev_priv(dev); | 1100 | struct rdma_netdev *rn = netdev_priv(dev); |
diff --git a/drivers/infiniband/ulp/srp/Kconfig b/drivers/infiniband/ulp/srp/Kconfig index c74ee9633041..99db8fe5173a 100644 --- a/drivers/infiniband/ulp/srp/Kconfig +++ b/drivers/infiniband/ulp/srp/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config INFINIBAND_SRP | 1 | config INFINIBAND_SRP |
| 2 | tristate "InfiniBand SCSI RDMA Protocol" | 2 | tristate "InfiniBand SCSI RDMA Protocol" |
| 3 | depends on SCSI | 3 | depends on SCSI && INFINIBAND_ADDR_TRANS |
| 4 | select SCSI_SRP_ATTRS | 4 | select SCSI_SRP_ATTRS |
| 5 | ---help--- | 5 | ---help--- |
| 6 | Support for the SCSI RDMA Protocol over InfiniBand. This | 6 | Support for the SCSI RDMA Protocol over InfiniBand. This |
diff --git a/drivers/infiniband/ulp/srpt/Kconfig b/drivers/infiniband/ulp/srpt/Kconfig index 31ee83d528d9..fb8b7182f05e 100644 --- a/drivers/infiniband/ulp/srpt/Kconfig +++ b/drivers/infiniband/ulp/srpt/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config INFINIBAND_SRPT | 1 | config INFINIBAND_SRPT |
| 2 | tristate "InfiniBand SCSI RDMA Protocol target support" | 2 | tristate "InfiniBand SCSI RDMA Protocol target support" |
| 3 | depends on INFINIBAND && TARGET_CORE | 3 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS && TARGET_CORE |
| 4 | ---help--- | 4 | ---help--- |
| 5 | 5 | ||
| 6 | Support for the SCSI RDMA Protocol (SRP) Target driver. The | 6 | Support for the SCSI RDMA Protocol (SRP) Target driver. The |
diff --git a/drivers/input/input-leds.c b/drivers/input/input-leds.c index 766bf2660116..5f04b2d94635 100644 --- a/drivers/input/input-leds.c +++ b/drivers/input/input-leds.c | |||
| @@ -88,6 +88,7 @@ static int input_leds_connect(struct input_handler *handler, | |||
| 88 | const struct input_device_id *id) | 88 | const struct input_device_id *id) |
| 89 | { | 89 | { |
| 90 | struct input_leds *leds; | 90 | struct input_leds *leds; |
| 91 | struct input_led *led; | ||
| 91 | unsigned int num_leds; | 92 | unsigned int num_leds; |
| 92 | unsigned int led_code; | 93 | unsigned int led_code; |
| 93 | int led_no; | 94 | int led_no; |
| @@ -119,14 +120,13 @@ static int input_leds_connect(struct input_handler *handler, | |||
| 119 | 120 | ||
| 120 | led_no = 0; | 121 | led_no = 0; |
| 121 | for_each_set_bit(led_code, dev->ledbit, LED_CNT) { | 122 | for_each_set_bit(led_code, dev->ledbit, LED_CNT) { |
| 122 | struct input_led *led = &leds->leds[led_no]; | 123 | if (!input_led_info[led_code].name) |
| 124 | continue; | ||
| 123 | 125 | ||
| 126 | led = &leds->leds[led_no]; | ||
| 124 | led->handle = &leds->handle; | 127 | led->handle = &leds->handle; |
| 125 | led->code = led_code; | 128 | led->code = led_code; |
| 126 | 129 | ||
| 127 | if (!input_led_info[led_code].name) | ||
| 128 | continue; | ||
| 129 | |||
| 130 | led->cdev.name = kasprintf(GFP_KERNEL, "%s::%s", | 130 | led->cdev.name = kasprintf(GFP_KERNEL, "%s::%s", |
| 131 | dev_name(&dev->dev), | 131 | dev_name(&dev->dev), |
| 132 | input_led_info[led_code].name); | 132 | input_led_info[led_code].name); |
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 0a67f235ba88..38f9501acdf0 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
| @@ -583,7 +583,7 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse) | |||
| 583 | 583 | ||
| 584 | x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f)); | 584 | x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f)); |
| 585 | y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f)); | 585 | y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f)); |
| 586 | z = packet[4] & 0x7c; | 586 | z = packet[4] & 0x7f; |
| 587 | 587 | ||
| 588 | /* | 588 | /* |
| 589 | * The x and y values tend to be quite large, and when used | 589 | * The x and y values tend to be quite large, and when used |
diff --git a/drivers/input/rmi4/rmi_spi.c b/drivers/input/rmi4/rmi_spi.c index 76edbf2c1bce..082defc329a8 100644 --- a/drivers/input/rmi4/rmi_spi.c +++ b/drivers/input/rmi4/rmi_spi.c | |||
| @@ -147,8 +147,11 @@ static int rmi_spi_xfer(struct rmi_spi_xport *rmi_spi, | |||
| 147 | if (len > RMI_SPI_XFER_SIZE_LIMIT) | 147 | if (len > RMI_SPI_XFER_SIZE_LIMIT) |
| 148 | return -EINVAL; | 148 | return -EINVAL; |
| 149 | 149 | ||
| 150 | if (rmi_spi->xfer_buf_size < len) | 150 | if (rmi_spi->xfer_buf_size < len) { |
| 151 | rmi_spi_manage_pools(rmi_spi, len); | 151 | ret = rmi_spi_manage_pools(rmi_spi, len); |
| 152 | if (ret < 0) | ||
| 153 | return ret; | ||
| 154 | } | ||
| 152 | 155 | ||
| 153 | if (addr == 0) | 156 | if (addr == 0) |
| 154 | /* | 157 | /* |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 4f15496fec8b..3e613afa10b4 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
| @@ -362,7 +362,7 @@ config TOUCHSCREEN_HIDEEP | |||
| 362 | 362 | ||
| 363 | If unsure, say N. | 363 | If unsure, say N. |
| 364 | 364 | ||
| 365 | To compile this driver as a moudle, choose M here : the | 365 | To compile this driver as a module, choose M here : the |
| 366 | module will be called hideep_ts. | 366 | module will be called hideep_ts. |
| 367 | 367 | ||
| 368 | config TOUCHSCREEN_ILI210X | 368 | config TOUCHSCREEN_ILI210X |
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 5d9699fe1b55..09194721aed2 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
| @@ -280,7 +280,8 @@ struct mxt_data { | |||
| 280 | struct input_dev *input_dev; | 280 | struct input_dev *input_dev; |
| 281 | char phys[64]; /* device physical location */ | 281 | char phys[64]; /* device physical location */ |
| 282 | struct mxt_object *object_table; | 282 | struct mxt_object *object_table; |
| 283 | struct mxt_info info; | 283 | struct mxt_info *info; |
| 284 | void *raw_info_block; | ||
| 284 | unsigned int irq; | 285 | unsigned int irq; |
| 285 | unsigned int max_x; | 286 | unsigned int max_x; |
| 286 | unsigned int max_y; | 287 | unsigned int max_y; |
| @@ -460,12 +461,13 @@ static int mxt_lookup_bootloader_address(struct mxt_data *data, bool retry) | |||
| 460 | { | 461 | { |
| 461 | u8 appmode = data->client->addr; | 462 | u8 appmode = data->client->addr; |
| 462 | u8 bootloader; | 463 | u8 bootloader; |
| 464 | u8 family_id = data->info ? data->info->family_id : 0; | ||
| 463 | 465 | ||
| 464 | switch (appmode) { | 466 | switch (appmode) { |
| 465 | case 0x4a: | 467 | case 0x4a: |
| 466 | case 0x4b: | 468 | case 0x4b: |
| 467 | /* Chips after 1664S use different scheme */ | 469 | /* Chips after 1664S use different scheme */ |
| 468 | if (retry || data->info.family_id >= 0xa2) { | 470 | if (retry || family_id >= 0xa2) { |
| 469 | bootloader = appmode - 0x24; | 471 | bootloader = appmode - 0x24; |
| 470 | break; | 472 | break; |
| 471 | } | 473 | } |
| @@ -692,7 +694,7 @@ mxt_get_object(struct mxt_data *data, u8 type) | |||
| 692 | struct mxt_object *object; | 694 | struct mxt_object *object; |
| 693 | int i; | 695 | int i; |
| 694 | 696 | ||
| 695 | for (i = 0; i < data->info.object_num; i++) { | 697 | for (i = 0; i < data->info->object_num; i++) { |
| 696 | object = data->object_table + i; | 698 | object = data->object_table + i; |
| 697 | if (object->type == type) | 699 | if (object->type == type) |
| 698 | return object; | 700 | return object; |
| @@ -1462,12 +1464,12 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg) | |||
| 1462 | data_pos += offset; | 1464 | data_pos += offset; |
| 1463 | } | 1465 | } |
| 1464 | 1466 | ||
| 1465 | if (cfg_info.family_id != data->info.family_id) { | 1467 | if (cfg_info.family_id != data->info->family_id) { |
| 1466 | dev_err(dev, "Family ID mismatch!\n"); | 1468 | dev_err(dev, "Family ID mismatch!\n"); |
| 1467 | return -EINVAL; | 1469 | return -EINVAL; |
| 1468 | } | 1470 | } |
| 1469 | 1471 | ||
| 1470 | if (cfg_info.variant_id != data->info.variant_id) { | 1472 | if (cfg_info.variant_id != data->info->variant_id) { |
| 1471 | dev_err(dev, "Variant ID mismatch!\n"); | 1473 | dev_err(dev, "Variant ID mismatch!\n"); |
| 1472 | return -EINVAL; | 1474 | return -EINVAL; |
| 1473 | } | 1475 | } |
| @@ -1512,7 +1514,7 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg) | |||
| 1512 | 1514 | ||
| 1513 | /* Malloc memory to store configuration */ | 1515 | /* Malloc memory to store configuration */ |
| 1514 | cfg_start_ofs = MXT_OBJECT_START + | 1516 | cfg_start_ofs = MXT_OBJECT_START + |
| 1515 | data->info.object_num * sizeof(struct mxt_object) + | 1517 | data->info->object_num * sizeof(struct mxt_object) + |
| 1516 | MXT_INFO_CHECKSUM_SIZE; | 1518 | MXT_INFO_CHECKSUM_SIZE; |
| 1517 | config_mem_size = data->mem_size - cfg_start_ofs; | 1519 | config_mem_size = data->mem_size - cfg_start_ofs; |
| 1518 | config_mem = kzalloc(config_mem_size, GFP_KERNEL); | 1520 | config_mem = kzalloc(config_mem_size, GFP_KERNEL); |
| @@ -1563,20 +1565,6 @@ release_mem: | |||
| 1563 | return ret; | 1565 | return ret; |
| 1564 | } | 1566 | } |
| 1565 | 1567 | ||
| 1566 | static int mxt_get_info(struct mxt_data *data) | ||
| 1567 | { | ||
| 1568 | struct i2c_client *client = data->client; | ||
| 1569 | struct mxt_info *info = &data->info; | ||
| 1570 | int error; | ||
| 1571 | |||
| 1572 | /* Read 7-byte info block starting at address 0 */ | ||
| 1573 | error = __mxt_read_reg(client, 0, sizeof(*info), info); | ||
| 1574 | if (error) | ||
| 1575 | return error; | ||
| 1576 | |||
| 1577 | return 0; | ||
| 1578 | } | ||
| 1579 | |||
| 1580 | static void mxt_free_input_device(struct mxt_data *data) | 1568 | static void mxt_free_input_device(struct mxt_data *data) |
| 1581 | { | 1569 | { |
| 1582 | if (data->input_dev) { | 1570 | if (data->input_dev) { |
| @@ -1591,9 +1579,10 @@ static void mxt_free_object_table(struct mxt_data *data) | |||
| 1591 | video_unregister_device(&data->dbg.vdev); | 1579 | video_unregister_device(&data->dbg.vdev); |
| 1592 | v4l2_device_unregister(&data->dbg.v4l2); | 1580 | v4l2_device_unregister(&data->dbg.v4l2); |
| 1593 | #endif | 1581 | #endif |
| 1594 | |||
| 1595 | kfree(data->object_table); | ||
| 1596 | data->object_table = NULL; | 1582 | data->object_table = NULL; |
| 1583 | data->info = NULL; | ||
| 1584 | kfree(data->raw_info_block); | ||
| 1585 | data->raw_info_block = NULL; | ||
| 1597 | kfree(data->msg_buf); | 1586 | kfree(data->msg_buf); |
| 1598 | data->msg_buf = NULL; | 1587 | data->msg_buf = NULL; |
| 1599 | data->T5_address = 0; | 1588 | data->T5_address = 0; |
| @@ -1609,34 +1598,18 @@ static void mxt_free_object_table(struct mxt_data *data) | |||
| 1609 | data->max_reportid = 0; | 1598 | data->max_reportid = 0; |
| 1610 | } | 1599 | } |
| 1611 | 1600 | ||
| 1612 | static int mxt_get_object_table(struct mxt_data *data) | 1601 | static int mxt_parse_object_table(struct mxt_data *data, |
| 1602 | struct mxt_object *object_table) | ||
| 1613 | { | 1603 | { |
| 1614 | struct i2c_client *client = data->client; | 1604 | struct i2c_client *client = data->client; |
| 1615 | size_t table_size; | ||
| 1616 | struct mxt_object *object_table; | ||
| 1617 | int error; | ||
| 1618 | int i; | 1605 | int i; |
| 1619 | u8 reportid; | 1606 | u8 reportid; |
| 1620 | u16 end_address; | 1607 | u16 end_address; |
| 1621 | 1608 | ||
| 1622 | table_size = data->info.object_num * sizeof(struct mxt_object); | ||
| 1623 | object_table = kzalloc(table_size, GFP_KERNEL); | ||
| 1624 | if (!object_table) { | ||
| 1625 | dev_err(&data->client->dev, "Failed to allocate memory\n"); | ||
| 1626 | return -ENOMEM; | ||
| 1627 | } | ||
| 1628 | |||
| 1629 | error = __mxt_read_reg(client, MXT_OBJECT_START, table_size, | ||
| 1630 | object_table); | ||
| 1631 | if (error) { | ||
| 1632 | kfree(object_table); | ||
| 1633 | return error; | ||
| 1634 | } | ||
| 1635 | |||
| 1636 | /* Valid Report IDs start counting from 1 */ | 1609 | /* Valid Report IDs start counting from 1 */ |
| 1637 | reportid = 1; | 1610 | reportid = 1; |
| 1638 | data->mem_size = 0; | 1611 | data->mem_size = 0; |
| 1639 | for (i = 0; i < data->info.object_num; i++) { | 1612 | for (i = 0; i < data->info->object_num; i++) { |
| 1640 | struct mxt_object *object = object_table + i; | 1613 | struct mxt_object *object = object_table + i; |
| 1641 | u8 min_id, max_id; | 1614 | u8 min_id, max_id; |
| 1642 | 1615 | ||
| @@ -1660,8 +1633,8 @@ static int mxt_get_object_table(struct mxt_data *data) | |||
| 1660 | 1633 | ||
| 1661 | switch (object->type) { | 1634 | switch (object->type) { |
| 1662 | case MXT_GEN_MESSAGE_T5: | 1635 | case MXT_GEN_MESSAGE_T5: |
| 1663 | if (data->info.family_id == 0x80 && | 1636 | if (data->info->family_id == 0x80 && |
| 1664 | data->info.version < 0x20) { | 1637 | data->info->version < 0x20) { |
| 1665 | /* | 1638 | /* |
| 1666 | * On mXT224 firmware versions prior to V2.0 | 1639 | * On mXT224 firmware versions prior to V2.0 |
| 1667 | * read and discard unused CRC byte otherwise | 1640 | * read and discard unused CRC byte otherwise |
| @@ -1716,24 +1689,102 @@ static int mxt_get_object_table(struct mxt_data *data) | |||
| 1716 | /* If T44 exists, T5 position has to be directly after */ | 1689 | /* If T44 exists, T5 position has to be directly after */ |
| 1717 | if (data->T44_address && (data->T5_address != data->T44_address + 1)) { | 1690 | if (data->T44_address && (data->T5_address != data->T44_address + 1)) { |
| 1718 | dev_err(&client->dev, "Invalid T44 position\n"); | 1691 | dev_err(&client->dev, "Invalid T44 position\n"); |
| 1719 | error = -EINVAL; | 1692 | return -EINVAL; |
| 1720 | goto free_object_table; | ||
| 1721 | } | 1693 | } |
| 1722 | 1694 | ||
| 1723 | data->msg_buf = kcalloc(data->max_reportid, | 1695 | data->msg_buf = kcalloc(data->max_reportid, |
| 1724 | data->T5_msg_size, GFP_KERNEL); | 1696 | data->T5_msg_size, GFP_KERNEL); |
| 1725 | if (!data->msg_buf) { | 1697 | if (!data->msg_buf) |
| 1726 | dev_err(&client->dev, "Failed to allocate message buffer\n"); | 1698 | return -ENOMEM; |
| 1699 | |||
| 1700 | return 0; | ||
| 1701 | } | ||
| 1702 | |||
| 1703 | static int mxt_read_info_block(struct mxt_data *data) | ||
| 1704 | { | ||
| 1705 | struct i2c_client *client = data->client; | ||
| 1706 | int error; | ||
| 1707 | size_t size; | ||
| 1708 | void *id_buf, *buf; | ||
| 1709 | uint8_t num_objects; | ||
| 1710 | u32 calculated_crc; | ||
| 1711 | u8 *crc_ptr; | ||
| 1712 | |||
| 1713 | /* If info block already allocated, free it */ | ||
| 1714 | if (data->raw_info_block) | ||
| 1715 | mxt_free_object_table(data); | ||
| 1716 | |||
| 1717 | /* Read 7-byte ID information block starting at address 0 */ | ||
| 1718 | size = sizeof(struct mxt_info); | ||
| 1719 | id_buf = kzalloc(size, GFP_KERNEL); | ||
| 1720 | if (!id_buf) | ||
| 1721 | return -ENOMEM; | ||
| 1722 | |||
| 1723 | error = __mxt_read_reg(client, 0, size, id_buf); | ||
| 1724 | if (error) | ||
| 1725 | goto err_free_mem; | ||
| 1726 | |||
| 1727 | /* Resize buffer to give space for rest of info block */ | ||
| 1728 | num_objects = ((struct mxt_info *)id_buf)->object_num; | ||
| 1729 | size += (num_objects * sizeof(struct mxt_object)) | ||
| 1730 | + MXT_INFO_CHECKSUM_SIZE; | ||
| 1731 | |||
| 1732 | buf = krealloc(id_buf, size, GFP_KERNEL); | ||
| 1733 | if (!buf) { | ||
| 1727 | error = -ENOMEM; | 1734 | error = -ENOMEM; |
| 1728 | goto free_object_table; | 1735 | goto err_free_mem; |
| 1736 | } | ||
| 1737 | id_buf = buf; | ||
| 1738 | |||
| 1739 | /* Read rest of info block */ | ||
| 1740 | error = __mxt_read_reg(client, MXT_OBJECT_START, | ||
| 1741 | size - MXT_OBJECT_START, | ||
| 1742 | id_buf + MXT_OBJECT_START); | ||
| 1743 | if (error) | ||
| 1744 | goto err_free_mem; | ||
| 1745 | |||
| 1746 | /* Extract & calculate checksum */ | ||
| 1747 | crc_ptr = id_buf + size - MXT_INFO_CHECKSUM_SIZE; | ||
| 1748 | data->info_crc = crc_ptr[0] | (crc_ptr[1] << 8) | (crc_ptr[2] << 16); | ||
| 1749 | |||
| 1750 | calculated_crc = mxt_calculate_crc(id_buf, 0, | ||
| 1751 | size - MXT_INFO_CHECKSUM_SIZE); | ||
| 1752 | |||
| 1753 | /* | ||
| 1754 | * CRC mismatch can be caused by data corruption due to I2C comms | ||
| 1755 | * issue or else device is not using Object Based Protocol (eg i2c-hid) | ||
| 1756 | */ | ||
| 1757 | if ((data->info_crc == 0) || (data->info_crc != calculated_crc)) { | ||
| 1758 | dev_err(&client->dev, | ||
| 1759 | "Info Block CRC error calculated=0x%06X read=0x%06X\n", | ||
| 1760 | calculated_crc, data->info_crc); | ||
| 1761 | error = -EIO; | ||
| 1762 | goto err_free_mem; | ||
| 1763 | } | ||
| 1764 | |||
| 1765 | data->raw_info_block = id_buf; | ||
| 1766 | data->info = (struct mxt_info *)id_buf; | ||
| 1767 | |||
| 1768 | dev_info(&client->dev, | ||
| 1769 | "Family: %u Variant: %u Firmware V%u.%u.%02X Objects: %u\n", | ||
| 1770 | data->info->family_id, data->info->variant_id, | ||
| 1771 | data->info->version >> 4, data->info->version & 0xf, | ||
| 1772 | data->info->build, data->info->object_num); | ||
| 1773 | |||
| 1774 | /* Parse object table information */ | ||
| 1775 | error = mxt_parse_object_table(data, id_buf + MXT_OBJECT_START); | ||
| 1776 | if (error) { | ||
| 1777 | dev_err(&client->dev, "Error %d parsing object table\n", error); | ||
| 1778 | mxt_free_object_table(data); | ||
| 1779 | goto err_free_mem; | ||
| 1729 | } | 1780 | } |
| 1730 | 1781 | ||
| 1731 | data->object_table = object_table; | 1782 | data->object_table = (struct mxt_object *)(id_buf + MXT_OBJECT_START); |
| 1732 | 1783 | ||
| 1733 | return 0; | 1784 | return 0; |
| 1734 | 1785 | ||
| 1735 | free_object_table: | 1786 | err_free_mem: |
| 1736 | mxt_free_object_table(data); | 1787 | kfree(id_buf); |
| 1737 | return error; | 1788 | return error; |
| 1738 | } | 1789 | } |
| 1739 | 1790 | ||
| @@ -2046,7 +2097,7 @@ static int mxt_initialize(struct mxt_data *data) | |||
| 2046 | int error; | 2097 | int error; |
| 2047 | 2098 | ||
| 2048 | while (1) { | 2099 | while (1) { |
| 2049 | error = mxt_get_info(data); | 2100 | error = mxt_read_info_block(data); |
| 2050 | if (!error) | 2101 | if (!error) |
| 2051 | break; | 2102 | break; |
| 2052 | 2103 | ||
| @@ -2077,16 +2128,9 @@ static int mxt_initialize(struct mxt_data *data) | |||
| 2077 | msleep(MXT_FW_RESET_TIME); | 2128 | msleep(MXT_FW_RESET_TIME); |
| 2078 | } | 2129 | } |
| 2079 | 2130 | ||
| 2080 | /* Get object table information */ | ||
| 2081 | error = mxt_get_object_table(data); | ||
| 2082 | if (error) { | ||
| 2083 | dev_err(&client->dev, "Error %d reading object table\n", error); | ||
| 2084 | return error; | ||
| 2085 | } | ||
| 2086 | |||
| 2087 | error = mxt_acquire_irq(data); | 2131 | error = mxt_acquire_irq(data); |
| 2088 | if (error) | 2132 | if (error) |
| 2089 | goto err_free_object_table; | 2133 | return error; |
| 2090 | 2134 | ||
| 2091 | error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME, | 2135 | error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME, |
| 2092 | &client->dev, GFP_KERNEL, data, | 2136 | &client->dev, GFP_KERNEL, data, |
| @@ -2094,14 +2138,10 @@ static int mxt_initialize(struct mxt_data *data) | |||
| 2094 | if (error) { | 2138 | if (error) { |
| 2095 | dev_err(&client->dev, "Failed to invoke firmware loader: %d\n", | 2139 | dev_err(&client->dev, "Failed to invoke firmware loader: %d\n", |
| 2096 | error); | 2140 | error); |
| 2097 | goto err_free_object_table; | 2141 | return error; |
| 2098 | } | 2142 | } |
| 2099 | 2143 | ||
| 2100 | return 0; | 2144 | return 0; |
| 2101 | |||
| 2102 | err_free_object_table: | ||
| 2103 | mxt_free_object_table(data); | ||
| 2104 | return error; | ||
| 2105 | } | 2145 | } |
| 2106 | 2146 | ||
| 2107 | static int mxt_set_t7_power_cfg(struct mxt_data *data, u8 sleep) | 2147 | static int mxt_set_t7_power_cfg(struct mxt_data *data, u8 sleep) |
| @@ -2162,7 +2202,7 @@ recheck: | |||
| 2162 | static u16 mxt_get_debug_value(struct mxt_data *data, unsigned int x, | 2202 | static u16 mxt_get_debug_value(struct mxt_data *data, unsigned int x, |
| 2163 | unsigned int y) | 2203 | unsigned int y) |
| 2164 | { | 2204 | { |
| 2165 | struct mxt_info *info = &data->info; | 2205 | struct mxt_info *info = data->info; |
| 2166 | struct mxt_dbg *dbg = &data->dbg; | 2206 | struct mxt_dbg *dbg = &data->dbg; |
| 2167 | unsigned int ofs, page; | 2207 | unsigned int ofs, page; |
| 2168 | unsigned int col = 0; | 2208 | unsigned int col = 0; |
| @@ -2490,7 +2530,7 @@ static const struct video_device mxt_video_device = { | |||
| 2490 | 2530 | ||
| 2491 | static void mxt_debug_init(struct mxt_data *data) | 2531 | static void mxt_debug_init(struct mxt_data *data) |
| 2492 | { | 2532 | { |
| 2493 | struct mxt_info *info = &data->info; | 2533 | struct mxt_info *info = data->info; |
| 2494 | struct mxt_dbg *dbg = &data->dbg; | 2534 | struct mxt_dbg *dbg = &data->dbg; |
| 2495 | struct mxt_object *object; | 2535 | struct mxt_object *object; |
| 2496 | int error; | 2536 | int error; |
| @@ -2576,7 +2616,6 @@ static int mxt_configure_objects(struct mxt_data *data, | |||
| 2576 | const struct firmware *cfg) | 2616 | const struct firmware *cfg) |
| 2577 | { | 2617 | { |
| 2578 | struct device *dev = &data->client->dev; | 2618 | struct device *dev = &data->client->dev; |
| 2579 | struct mxt_info *info = &data->info; | ||
| 2580 | int error; | 2619 | int error; |
| 2581 | 2620 | ||
| 2582 | error = mxt_init_t7_power_cfg(data); | 2621 | error = mxt_init_t7_power_cfg(data); |
| @@ -2601,11 +2640,6 @@ static int mxt_configure_objects(struct mxt_data *data, | |||
| 2601 | 2640 | ||
| 2602 | mxt_debug_init(data); | 2641 | mxt_debug_init(data); |
| 2603 | 2642 | ||
| 2604 | dev_info(dev, | ||
| 2605 | "Family: %u Variant: %u Firmware V%u.%u.%02X Objects: %u\n", | ||
| 2606 | info->family_id, info->variant_id, info->version >> 4, | ||
| 2607 | info->version & 0xf, info->build, info->object_num); | ||
| 2608 | |||
| 2609 | return 0; | 2643 | return 0; |
| 2610 | } | 2644 | } |
| 2611 | 2645 | ||
| @@ -2614,7 +2648,7 @@ static ssize_t mxt_fw_version_show(struct device *dev, | |||
| 2614 | struct device_attribute *attr, char *buf) | 2648 | struct device_attribute *attr, char *buf) |
| 2615 | { | 2649 | { |
| 2616 | struct mxt_data *data = dev_get_drvdata(dev); | 2650 | struct mxt_data *data = dev_get_drvdata(dev); |
| 2617 | struct mxt_info *info = &data->info; | 2651 | struct mxt_info *info = data->info; |
| 2618 | return scnprintf(buf, PAGE_SIZE, "%u.%u.%02X\n", | 2652 | return scnprintf(buf, PAGE_SIZE, "%u.%u.%02X\n", |
| 2619 | info->version >> 4, info->version & 0xf, info->build); | 2653 | info->version >> 4, info->version & 0xf, info->build); |
| 2620 | } | 2654 | } |
| @@ -2624,7 +2658,7 @@ static ssize_t mxt_hw_version_show(struct device *dev, | |||
| 2624 | struct device_attribute *attr, char *buf) | 2658 | struct device_attribute *attr, char *buf) |
| 2625 | { | 2659 | { |
| 2626 | struct mxt_data *data = dev_get_drvdata(dev); | 2660 | struct mxt_data *data = dev_get_drvdata(dev); |
| 2627 | struct mxt_info *info = &data->info; | 2661 | struct mxt_info *info = data->info; |
| 2628 | return scnprintf(buf, PAGE_SIZE, "%u.%u\n", | 2662 | return scnprintf(buf, PAGE_SIZE, "%u.%u\n", |
| 2629 | info->family_id, info->variant_id); | 2663 | info->family_id, info->variant_id); |
| 2630 | } | 2664 | } |
| @@ -2663,7 +2697,7 @@ static ssize_t mxt_object_show(struct device *dev, | |||
| 2663 | return -ENOMEM; | 2697 | return -ENOMEM; |
| 2664 | 2698 | ||
| 2665 | error = 0; | 2699 | error = 0; |
| 2666 | for (i = 0; i < data->info.object_num; i++) { | 2700 | for (i = 0; i < data->info->object_num; i++) { |
| 2667 | object = data->object_table + i; | 2701 | object = data->object_table + i; |
| 2668 | 2702 | ||
| 2669 | if (!mxt_object_readable(object->type)) | 2703 | if (!mxt_object_readable(object->type)) |
| @@ -3035,6 +3069,15 @@ static const struct dmi_system_id mxt_dmi_table[] = { | |||
| 3035 | .driver_data = samus_platform_data, | 3069 | .driver_data = samus_platform_data, |
| 3036 | }, | 3070 | }, |
| 3037 | { | 3071 | { |
| 3072 | /* Samsung Chromebook Pro */ | ||
| 3073 | .ident = "Samsung Chromebook Pro", | ||
| 3074 | .matches = { | ||
| 3075 | DMI_MATCH(DMI_SYS_VENDOR, "Google"), | ||
| 3076 | DMI_MATCH(DMI_PRODUCT_NAME, "Caroline"), | ||
| 3077 | }, | ||
| 3078 | .driver_data = samus_platform_data, | ||
| 3079 | }, | ||
| 3080 | { | ||
| 3038 | /* Other Google Chromebooks */ | 3081 | /* Other Google Chromebooks */ |
| 3039 | .ident = "Chromebook", | 3082 | .ident = "Chromebook", |
| 3040 | .matches = { | 3083 | .matches = { |
| @@ -3254,6 +3297,11 @@ static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume); | |||
| 3254 | 3297 | ||
| 3255 | static const struct of_device_id mxt_of_match[] = { | 3298 | static const struct of_device_id mxt_of_match[] = { |
| 3256 | { .compatible = "atmel,maxtouch", }, | 3299 | { .compatible = "atmel,maxtouch", }, |
| 3300 | /* Compatibles listed below are deprecated */ | ||
| 3301 | { .compatible = "atmel,qt602240_ts", }, | ||
| 3302 | { .compatible = "atmel,atmel_mxt_ts", }, | ||
| 3303 | { .compatible = "atmel,atmel_mxt_tp", }, | ||
| 3304 | { .compatible = "atmel,mXT224", }, | ||
| 3257 | {}, | 3305 | {}, |
| 3258 | }; | 3306 | }; |
| 3259 | MODULE_DEVICE_TABLE(of, mxt_of_match); | 3307 | MODULE_DEVICE_TABLE(of, mxt_of_match); |
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 2a99f0f14795..8fb8c737fffe 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
| @@ -83,7 +83,6 @@ | |||
| 83 | 83 | ||
| 84 | static DEFINE_SPINLOCK(amd_iommu_devtable_lock); | 84 | static DEFINE_SPINLOCK(amd_iommu_devtable_lock); |
| 85 | static DEFINE_SPINLOCK(pd_bitmap_lock); | 85 | static DEFINE_SPINLOCK(pd_bitmap_lock); |
| 86 | static DEFINE_SPINLOCK(iommu_table_lock); | ||
| 87 | 86 | ||
| 88 | /* List of all available dev_data structures */ | 87 | /* List of all available dev_data structures */ |
| 89 | static LLIST_HEAD(dev_data_list); | 88 | static LLIST_HEAD(dev_data_list); |
| @@ -3562,6 +3561,7 @@ EXPORT_SYMBOL(amd_iommu_device_info); | |||
| 3562 | *****************************************************************************/ | 3561 | *****************************************************************************/ |
| 3563 | 3562 | ||
| 3564 | static struct irq_chip amd_ir_chip; | 3563 | static struct irq_chip amd_ir_chip; |
| 3564 | static DEFINE_SPINLOCK(iommu_table_lock); | ||
| 3565 | 3565 | ||
| 3566 | static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table) | 3566 | static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table) |
| 3567 | { | 3567 | { |
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index f05f3cf90756..ddcbbdb5d658 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c | |||
| @@ -167,40 +167,16 @@ EXPORT_SYMBOL(iommu_put_dma_cookie); | |||
| 167 | * @list: Reserved region list from iommu_get_resv_regions() | 167 | * @list: Reserved region list from iommu_get_resv_regions() |
| 168 | * | 168 | * |
| 169 | * IOMMU drivers can use this to implement their .get_resv_regions callback | 169 | * IOMMU drivers can use this to implement their .get_resv_regions callback |
| 170 | * for general non-IOMMU-specific reservations. Currently, this covers host | 170 | * for general non-IOMMU-specific reservations. Currently, this covers GICv3 |
| 171 | * bridge windows for PCI devices and GICv3 ITS region reservation on ACPI | 171 | * ITS region reservation on ACPI based ARM platforms that may require HW MSI |
| 172 | * based ARM platforms that may require HW MSI reservation. | 172 | * reservation. |
| 173 | */ | 173 | */ |
| 174 | void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list) | 174 | void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list) |
| 175 | { | 175 | { |
| 176 | struct pci_host_bridge *bridge; | ||
| 177 | struct resource_entry *window; | ||
| 178 | |||
| 179 | if (!is_of_node(dev->iommu_fwspec->iommu_fwnode) && | ||
| 180 | iort_iommu_msi_get_resv_regions(dev, list) < 0) | ||
| 181 | return; | ||
| 182 | |||
| 183 | if (!dev_is_pci(dev)) | ||
| 184 | return; | ||
| 185 | |||
| 186 | bridge = pci_find_host_bridge(to_pci_dev(dev)->bus); | ||
| 187 | resource_list_for_each_entry(window, &bridge->windows) { | ||
| 188 | struct iommu_resv_region *region; | ||
| 189 | phys_addr_t start; | ||
| 190 | size_t length; | ||
| 191 | |||
| 192 | if (resource_type(window->res) != IORESOURCE_MEM) | ||
| 193 | continue; | ||
| 194 | 176 | ||
| 195 | start = window->res->start - window->offset; | 177 | if (!is_of_node(dev->iommu_fwspec->iommu_fwnode)) |
| 196 | length = window->res->end - window->res->start + 1; | 178 | iort_iommu_msi_get_resv_regions(dev, list); |
| 197 | region = iommu_alloc_resv_region(start, length, 0, | ||
| 198 | IOMMU_RESV_RESERVED); | ||
| 199 | if (!region) | ||
| 200 | return; | ||
| 201 | 179 | ||
| 202 | list_add_tail(®ion->list, list); | ||
| 203 | } | ||
| 204 | } | 180 | } |
| 205 | EXPORT_SYMBOL(iommu_dma_get_resv_regions); | 181 | EXPORT_SYMBOL(iommu_dma_get_resv_regions); |
| 206 | 182 | ||
| @@ -229,6 +205,23 @@ static int cookie_init_hw_msi_region(struct iommu_dma_cookie *cookie, | |||
| 229 | return 0; | 205 | return 0; |
| 230 | } | 206 | } |
| 231 | 207 | ||
| 208 | static void iova_reserve_pci_windows(struct pci_dev *dev, | ||
| 209 | struct iova_domain *iovad) | ||
| 210 | { | ||
| 211 | struct pci_host_bridge *bridge = pci_find_host_bridge(dev->bus); | ||
| 212 | struct resource_entry *window; | ||
| 213 | unsigned long lo, hi; | ||
| 214 | |||
| 215 | resource_list_for_each_entry(window, &bridge->windows) { | ||
| 216 | if (resource_type(window->res) != IORESOURCE_MEM) | ||
| 217 | continue; | ||
| 218 | |||
| 219 | lo = iova_pfn(iovad, window->res->start - window->offset); | ||
| 220 | hi = iova_pfn(iovad, window->res->end - window->offset); | ||
| 221 | reserve_iova(iovad, lo, hi); | ||
| 222 | } | ||
| 223 | } | ||
| 224 | |||
| 232 | static int iova_reserve_iommu_regions(struct device *dev, | 225 | static int iova_reserve_iommu_regions(struct device *dev, |
| 233 | struct iommu_domain *domain) | 226 | struct iommu_domain *domain) |
| 234 | { | 227 | { |
| @@ -238,6 +231,9 @@ static int iova_reserve_iommu_regions(struct device *dev, | |||
| 238 | LIST_HEAD(resv_regions); | 231 | LIST_HEAD(resv_regions); |
| 239 | int ret = 0; | 232 | int ret = 0; |
| 240 | 233 | ||
| 234 | if (dev_is_pci(dev)) | ||
| 235 | iova_reserve_pci_windows(to_pci_dev(dev), iovad); | ||
| 236 | |||
| 241 | iommu_get_resv_regions(dev, &resv_regions); | 237 | iommu_get_resv_regions(dev, &resv_regions); |
| 242 | list_for_each_entry(region, &resv_regions, list) { | 238 | list_for_each_entry(region, &resv_regions, list) { |
| 243 | unsigned long lo, hi; | 239 | unsigned long lo, hi; |
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index accf58388bdb..460bed4fc5b1 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c | |||
| @@ -1345,7 +1345,7 @@ void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, | |||
| 1345 | struct qi_desc desc; | 1345 | struct qi_desc desc; |
| 1346 | 1346 | ||
| 1347 | if (mask) { | 1347 | if (mask) { |
| 1348 | BUG_ON(addr & ((1 << (VTD_PAGE_SHIFT + mask)) - 1)); | 1348 | WARN_ON_ONCE(addr & ((1ULL << (VTD_PAGE_SHIFT + mask)) - 1)); |
| 1349 | addr |= (1ULL << (VTD_PAGE_SHIFT + mask - 1)) - 1; | 1349 | addr |= (1ULL << (VTD_PAGE_SHIFT + mask - 1)) - 1; |
| 1350 | desc.high = QI_DEV_IOTLB_ADDR(addr) | QI_DEV_IOTLB_SIZE; | 1350 | desc.high = QI_DEV_IOTLB_ADDR(addr) | QI_DEV_IOTLB_SIZE; |
| 1351 | } else | 1351 | } else |
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 66f69af2c219..3062a154a9fb 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c | |||
| @@ -1136,7 +1136,7 @@ static void intel_ir_reconfigure_irte(struct irq_data *irqd, bool force) | |||
| 1136 | irte->dest_id = IRTE_DEST(cfg->dest_apicid); | 1136 | irte->dest_id = IRTE_DEST(cfg->dest_apicid); |
| 1137 | 1137 | ||
| 1138 | /* Update the hardware only if the interrupt is in remapped mode. */ | 1138 | /* Update the hardware only if the interrupt is in remapped mode. */ |
| 1139 | if (!force || ir_data->irq_2_iommu.mode == IRQ_REMAPPING) | 1139 | if (force || ir_data->irq_2_iommu.mode == IRQ_REMAPPING) |
| 1140 | modify_irte(&ir_data->irq_2_iommu, irte); | 1140 | modify_irte(&ir_data->irq_2_iommu, irte); |
| 1141 | } | 1141 | } |
| 1142 | 1142 | ||
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 5fc8656c60f9..0468acfa131f 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c | |||
| @@ -1098,7 +1098,7 @@ static int rk_iommu_of_xlate(struct device *dev, | |||
| 1098 | data->iommu = platform_get_drvdata(iommu_dev); | 1098 | data->iommu = platform_get_drvdata(iommu_dev); |
| 1099 | dev->archdata.iommu = data; | 1099 | dev->archdata.iommu = data; |
| 1100 | 1100 | ||
| 1101 | of_dev_put(iommu_dev); | 1101 | platform_device_put(iommu_dev); |
| 1102 | 1102 | ||
| 1103 | return 0; | 1103 | return 0; |
| 1104 | } | 1104 | } |
| @@ -1175,8 +1175,15 @@ static int rk_iommu_probe(struct platform_device *pdev) | |||
| 1175 | for (i = 0; i < iommu->num_clocks; ++i) | 1175 | for (i = 0; i < iommu->num_clocks; ++i) |
| 1176 | iommu->clocks[i].id = rk_iommu_clocks[i]; | 1176 | iommu->clocks[i].id = rk_iommu_clocks[i]; |
| 1177 | 1177 | ||
| 1178 | /* | ||
| 1179 | * iommu clocks should be present for all new devices and devicetrees | ||
| 1180 | * but there are older devicetrees without clocks out in the wild. | ||
| 1181 | * So clocks as optional for the time being. | ||
| 1182 | */ | ||
| 1178 | err = devm_clk_bulk_get(iommu->dev, iommu->num_clocks, iommu->clocks); | 1183 | err = devm_clk_bulk_get(iommu->dev, iommu->num_clocks, iommu->clocks); |
| 1179 | if (err) | 1184 | if (err == -ENOENT) |
| 1185 | iommu->num_clocks = 0; | ||
| 1186 | else if (err) | ||
| 1180 | return err; | 1187 | return err; |
| 1181 | 1188 | ||
| 1182 | err = clk_bulk_prepare(iommu->num_clocks, iommu->clocks); | 1189 | err = clk_bulk_prepare(iommu->num_clocks, iommu->clocks); |
diff --git a/drivers/irqchip/qcom-irq-combiner.c b/drivers/irqchip/qcom-irq-combiner.c index f31265937439..7f0c0be322e0 100644 --- a/drivers/irqchip/qcom-irq-combiner.c +++ b/drivers/irqchip/qcom-irq-combiner.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. | 1 | /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. |
| 2 | * | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify | 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and | 4 | * it under the terms of the GNU General Public License version 2 and |
| @@ -68,7 +68,7 @@ static void combiner_handle_irq(struct irq_desc *desc) | |||
| 68 | 68 | ||
| 69 | bit = readl_relaxed(combiner->regs[reg].addr); | 69 | bit = readl_relaxed(combiner->regs[reg].addr); |
| 70 | status = bit & combiner->regs[reg].enabled; | 70 | status = bit & combiner->regs[reg].enabled; |
| 71 | if (!status) | 71 | if (bit && !status) |
| 72 | pr_warn_ratelimited("Unexpected IRQ on CPU%d: (%08x %08lx %p)\n", | 72 | pr_warn_ratelimited("Unexpected IRQ on CPU%d: (%08x %08lx %p)\n", |
| 73 | smp_processor_id(), bit, | 73 | smp_processor_id(), bit, |
| 74 | combiner->regs[reg].enabled, | 74 | combiner->regs[reg].enabled, |
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 004cc3cc6123..7fa2631b422c 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c | |||
| @@ -290,7 +290,7 @@ do { \ | |||
| 290 | if (kthread_should_stop() || \ | 290 | if (kthread_should_stop() || \ |
| 291 | test_bit(CACHE_SET_IO_DISABLE, &ca->set->flags)) { \ | 291 | test_bit(CACHE_SET_IO_DISABLE, &ca->set->flags)) { \ |
| 292 | set_current_state(TASK_RUNNING); \ | 292 | set_current_state(TASK_RUNNING); \ |
| 293 | return 0; \ | 293 | goto out; \ |
| 294 | } \ | 294 | } \ |
| 295 | \ | 295 | \ |
| 296 | schedule(); \ | 296 | schedule(); \ |
| @@ -378,6 +378,9 @@ retry_invalidate: | |||
| 378 | bch_prio_write(ca); | 378 | bch_prio_write(ca); |
| 379 | } | 379 | } |
| 380 | } | 380 | } |
| 381 | out: | ||
| 382 | wait_for_kthread_stop(); | ||
| 383 | return 0; | ||
| 381 | } | 384 | } |
| 382 | 385 | ||
| 383 | /* Allocation */ | 386 | /* Allocation */ |
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index d338b7086013..3a0cfb237af9 100644 --- a/drivers/md/bcache/bcache.h +++ b/drivers/md/bcache/bcache.h | |||
| @@ -392,6 +392,8 @@ struct cached_dev { | |||
| 392 | #define DEFAULT_CACHED_DEV_ERROR_LIMIT 64 | 392 | #define DEFAULT_CACHED_DEV_ERROR_LIMIT 64 |
| 393 | atomic_t io_errors; | 393 | atomic_t io_errors; |
| 394 | unsigned error_limit; | 394 | unsigned error_limit; |
| 395 | |||
| 396 | char backing_dev_name[BDEVNAME_SIZE]; | ||
| 395 | }; | 397 | }; |
| 396 | 398 | ||
| 397 | enum alloc_reserve { | 399 | enum alloc_reserve { |
| @@ -464,6 +466,8 @@ struct cache { | |||
| 464 | atomic_long_t meta_sectors_written; | 466 | atomic_long_t meta_sectors_written; |
| 465 | atomic_long_t btree_sectors_written; | 467 | atomic_long_t btree_sectors_written; |
| 466 | atomic_long_t sectors_written; | 468 | atomic_long_t sectors_written; |
| 469 | |||
| 470 | char cache_dev_name[BDEVNAME_SIZE]; | ||
| 467 | }; | 471 | }; |
| 468 | 472 | ||
| 469 | struct gc_stat { | 473 | struct gc_stat { |
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 028f7b386e01..4e63c6f6c04d 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c | |||
| @@ -106,7 +106,6 @@ void bch_btree_verify(struct btree *b) | |||
| 106 | 106 | ||
| 107 | void bch_data_verify(struct cached_dev *dc, struct bio *bio) | 107 | void bch_data_verify(struct cached_dev *dc, struct bio *bio) |
| 108 | { | 108 | { |
| 109 | char name[BDEVNAME_SIZE]; | ||
| 110 | struct bio *check; | 109 | struct bio *check; |
| 111 | struct bio_vec bv, cbv; | 110 | struct bio_vec bv, cbv; |
| 112 | struct bvec_iter iter, citer = { 0 }; | 111 | struct bvec_iter iter, citer = { 0 }; |
| @@ -134,7 +133,7 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) | |||
| 134 | bv.bv_len), | 133 | bv.bv_len), |
| 135 | dc->disk.c, | 134 | dc->disk.c, |
| 136 | "verify failed at dev %s sector %llu", | 135 | "verify failed at dev %s sector %llu", |
| 137 | bdevname(dc->bdev, name), | 136 | dc->backing_dev_name, |
| 138 | (uint64_t) bio->bi_iter.bi_sector); | 137 | (uint64_t) bio->bi_iter.bi_sector); |
| 139 | 138 | ||
| 140 | kunmap_atomic(p1); | 139 | kunmap_atomic(p1); |
diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c index 7fac97ae036e..2ddf8515e6a5 100644 --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c | |||
| @@ -52,7 +52,6 @@ void bch_submit_bbio(struct bio *bio, struct cache_set *c, | |||
| 52 | /* IO errors */ | 52 | /* IO errors */ |
| 53 | void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) | 53 | void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) |
| 54 | { | 54 | { |
| 55 | char buf[BDEVNAME_SIZE]; | ||
| 56 | unsigned errors; | 55 | unsigned errors; |
| 57 | 56 | ||
| 58 | WARN_ONCE(!dc, "NULL pointer of struct cached_dev"); | 57 | WARN_ONCE(!dc, "NULL pointer of struct cached_dev"); |
| @@ -60,7 +59,7 @@ void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) | |||
| 60 | errors = atomic_add_return(1, &dc->io_errors); | 59 | errors = atomic_add_return(1, &dc->io_errors); |
| 61 | if (errors < dc->error_limit) | 60 | if (errors < dc->error_limit) |
| 62 | pr_err("%s: IO error on backing device, unrecoverable", | 61 | pr_err("%s: IO error on backing device, unrecoverable", |
| 63 | bio_devname(bio, buf)); | 62 | dc->backing_dev_name); |
| 64 | else | 63 | else |
| 65 | bch_cached_dev_error(dc); | 64 | bch_cached_dev_error(dc); |
| 66 | } | 65 | } |
| @@ -105,19 +104,18 @@ void bch_count_io_errors(struct cache *ca, | |||
| 105 | } | 104 | } |
| 106 | 105 | ||
| 107 | if (error) { | 106 | if (error) { |
| 108 | char buf[BDEVNAME_SIZE]; | ||
| 109 | unsigned errors = atomic_add_return(1 << IO_ERROR_SHIFT, | 107 | unsigned errors = atomic_add_return(1 << IO_ERROR_SHIFT, |
| 110 | &ca->io_errors); | 108 | &ca->io_errors); |
| 111 | errors >>= IO_ERROR_SHIFT; | 109 | errors >>= IO_ERROR_SHIFT; |
| 112 | 110 | ||
| 113 | if (errors < ca->set->error_limit) | 111 | if (errors < ca->set->error_limit) |
| 114 | pr_err("%s: IO error on %s%s", | 112 | pr_err("%s: IO error on %s%s", |
| 115 | bdevname(ca->bdev, buf), m, | 113 | ca->cache_dev_name, m, |
| 116 | is_read ? ", recovering." : "."); | 114 | is_read ? ", recovering." : "."); |
| 117 | else | 115 | else |
| 118 | bch_cache_set_error(ca->set, | 116 | bch_cache_set_error(ca->set, |
| 119 | "%s: too many IO errors %s", | 117 | "%s: too many IO errors %s", |
| 120 | bdevname(ca->bdev, buf), m); | 118 | ca->cache_dev_name, m); |
| 121 | } | 119 | } |
| 122 | } | 120 | } |
| 123 | 121 | ||
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index a65e3365eeb9..8e3e8655ed63 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
| @@ -649,11 +649,8 @@ static void backing_request_endio(struct bio *bio) | |||
| 649 | */ | 649 | */ |
| 650 | if (unlikely(s->iop.writeback && | 650 | if (unlikely(s->iop.writeback && |
| 651 | bio->bi_opf & REQ_PREFLUSH)) { | 651 | bio->bi_opf & REQ_PREFLUSH)) { |
| 652 | char buf[BDEVNAME_SIZE]; | ||
| 653 | |||
| 654 | bio_devname(bio, buf); | ||
| 655 | pr_err("Can't flush %s: returned bi_status %i", | 652 | pr_err("Can't flush %s: returned bi_status %i", |
| 656 | buf, bio->bi_status); | 653 | dc->backing_dev_name, bio->bi_status); |
| 657 | } else { | 654 | } else { |
| 658 | /* set to orig_bio->bi_status in bio_complete() */ | 655 | /* set to orig_bio->bi_status in bio_complete() */ |
| 659 | s->iop.status = bio->bi_status; | 656 | s->iop.status = bio->bi_status; |
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index d90d9e59ca00..3dea06b41d43 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
| @@ -936,7 +936,6 @@ static void cancel_writeback_rate_update_dwork(struct cached_dev *dc) | |||
| 936 | static void cached_dev_detach_finish(struct work_struct *w) | 936 | static void cached_dev_detach_finish(struct work_struct *w) |
| 937 | { | 937 | { |
| 938 | struct cached_dev *dc = container_of(w, struct cached_dev, detach); | 938 | struct cached_dev *dc = container_of(w, struct cached_dev, detach); |
| 939 | char buf[BDEVNAME_SIZE]; | ||
| 940 | struct closure cl; | 939 | struct closure cl; |
| 941 | closure_init_stack(&cl); | 940 | closure_init_stack(&cl); |
| 942 | 941 | ||
| @@ -967,7 +966,7 @@ static void cached_dev_detach_finish(struct work_struct *w) | |||
| 967 | 966 | ||
| 968 | mutex_unlock(&bch_register_lock); | 967 | mutex_unlock(&bch_register_lock); |
| 969 | 968 | ||
| 970 | pr_info("Caching disabled for %s", bdevname(dc->bdev, buf)); | 969 | pr_info("Caching disabled for %s", dc->backing_dev_name); |
| 971 | 970 | ||
| 972 | /* Drop ref we took in cached_dev_detach() */ | 971 | /* Drop ref we took in cached_dev_detach() */ |
| 973 | closure_put(&dc->disk.cl); | 972 | closure_put(&dc->disk.cl); |
| @@ -999,29 +998,28 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, | |||
| 999 | { | 998 | { |
| 1000 | uint32_t rtime = cpu_to_le32(get_seconds()); | 999 | uint32_t rtime = cpu_to_le32(get_seconds()); |
| 1001 | struct uuid_entry *u; | 1000 | struct uuid_entry *u; |
| 1002 | char buf[BDEVNAME_SIZE]; | ||
| 1003 | struct cached_dev *exist_dc, *t; | 1001 | struct cached_dev *exist_dc, *t; |
| 1004 | 1002 | ||
| 1005 | bdevname(dc->bdev, buf); | ||
| 1006 | |||
| 1007 | if ((set_uuid && memcmp(set_uuid, c->sb.set_uuid, 16)) || | 1003 | if ((set_uuid && memcmp(set_uuid, c->sb.set_uuid, 16)) || |
| 1008 | (!set_uuid && memcmp(dc->sb.set_uuid, c->sb.set_uuid, 16))) | 1004 | (!set_uuid && memcmp(dc->sb.set_uuid, c->sb.set_uuid, 16))) |
| 1009 | return -ENOENT; | 1005 | return -ENOENT; |
| 1010 | 1006 | ||
| 1011 | if (dc->disk.c) { | 1007 | if (dc->disk.c) { |
| 1012 | pr_err("Can't attach %s: already attached", buf); | 1008 | pr_err("Can't attach %s: already attached", |
| 1009 | dc->backing_dev_name); | ||
| 1013 | return -EINVAL; | 1010 | return -EINVAL; |
| 1014 | } | 1011 | } |
| 1015 | 1012 | ||
| 1016 | if (test_bit(CACHE_SET_STOPPING, &c->flags)) { | 1013 | if (test_bit(CACHE_SET_STOPPING, &c->flags)) { |
| 1017 | pr_err("Can't attach %s: shutting down", buf); | 1014 | pr_err("Can't attach %s: shutting down", |
| 1015 | dc->backing_dev_name); | ||
| 1018 | return -EINVAL; | 1016 | return -EINVAL; |
| 1019 | } | 1017 | } |
| 1020 | 1018 | ||
| 1021 | if (dc->sb.block_size < c->sb.block_size) { | 1019 | if (dc->sb.block_size < c->sb.block_size) { |
| 1022 | /* Will die */ | 1020 | /* Will die */ |
| 1023 | pr_err("Couldn't attach %s: block size less than set's block size", | 1021 | pr_err("Couldn't attach %s: block size less than set's block size", |
| 1024 | buf); | 1022 | dc->backing_dev_name); |
| 1025 | return -EINVAL; | 1023 | return -EINVAL; |
| 1026 | } | 1024 | } |
| 1027 | 1025 | ||
| @@ -1029,7 +1027,7 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, | |||
| 1029 | list_for_each_entry_safe(exist_dc, t, &c->cached_devs, list) { | 1027 | list_for_each_entry_safe(exist_dc, t, &c->cached_devs, list) { |
| 1030 | if (!memcmp(dc->sb.uuid, exist_dc->sb.uuid, 16)) { | 1028 | if (!memcmp(dc->sb.uuid, exist_dc->sb.uuid, 16)) { |
| 1031 | pr_err("Tried to attach %s but duplicate UUID already attached", | 1029 | pr_err("Tried to attach %s but duplicate UUID already attached", |
| 1032 | buf); | 1030 | dc->backing_dev_name); |
| 1033 | 1031 | ||
| 1034 | return -EINVAL; | 1032 | return -EINVAL; |
| 1035 | } | 1033 | } |
| @@ -1047,13 +1045,15 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, | |||
| 1047 | 1045 | ||
| 1048 | if (!u) { | 1046 | if (!u) { |
| 1049 | if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) { | 1047 | if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) { |
| 1050 | pr_err("Couldn't find uuid for %s in set", buf); | 1048 | pr_err("Couldn't find uuid for %s in set", |
| 1049 | dc->backing_dev_name); | ||
| 1051 | return -ENOENT; | 1050 | return -ENOENT; |
| 1052 | } | 1051 | } |
| 1053 | 1052 | ||
| 1054 | u = uuid_find_empty(c); | 1053 | u = uuid_find_empty(c); |
| 1055 | if (!u) { | 1054 | if (!u) { |
| 1056 | pr_err("Not caching %s, no room for UUID", buf); | 1055 | pr_err("Not caching %s, no room for UUID", |
| 1056 | dc->backing_dev_name); | ||
| 1057 | return -EINVAL; | 1057 | return -EINVAL; |
| 1058 | } | 1058 | } |
| 1059 | } | 1059 | } |
| @@ -1112,7 +1112,8 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, | |||
| 1112 | up_write(&dc->writeback_lock); | 1112 | up_write(&dc->writeback_lock); |
| 1113 | 1113 | ||
| 1114 | pr_info("Caching %s as %s on set %pU", | 1114 | pr_info("Caching %s as %s on set %pU", |
| 1115 | bdevname(dc->bdev, buf), dc->disk.disk->disk_name, | 1115 | dc->backing_dev_name, |
| 1116 | dc->disk.disk->disk_name, | ||
| 1116 | dc->disk.c->sb.set_uuid); | 1117 | dc->disk.c->sb.set_uuid); |
| 1117 | return 0; | 1118 | return 0; |
| 1118 | } | 1119 | } |
| @@ -1225,10 +1226,10 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, | |||
| 1225 | struct block_device *bdev, | 1226 | struct block_device *bdev, |
| 1226 | struct cached_dev *dc) | 1227 | struct cached_dev *dc) |
| 1227 | { | 1228 | { |
| 1228 | char name[BDEVNAME_SIZE]; | ||
| 1229 | const char *err = "cannot allocate memory"; | 1229 | const char *err = "cannot allocate memory"; |
| 1230 | struct cache_set *c; | 1230 | struct cache_set *c; |
| 1231 | 1231 | ||
| 1232 | bdevname(bdev, dc->backing_dev_name); | ||
| 1232 | memcpy(&dc->sb, sb, sizeof(struct cache_sb)); | 1233 | memcpy(&dc->sb, sb, sizeof(struct cache_sb)); |
| 1233 | dc->bdev = bdev; | 1234 | dc->bdev = bdev; |
| 1234 | dc->bdev->bd_holder = dc; | 1235 | dc->bdev->bd_holder = dc; |
| @@ -1237,6 +1238,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, | |||
| 1237 | bio_first_bvec_all(&dc->sb_bio)->bv_page = sb_page; | 1238 | bio_first_bvec_all(&dc->sb_bio)->bv_page = sb_page; |
| 1238 | get_page(sb_page); | 1239 | get_page(sb_page); |
| 1239 | 1240 | ||
| 1241 | |||
| 1240 | if (cached_dev_init(dc, sb->block_size << 9)) | 1242 | if (cached_dev_init(dc, sb->block_size << 9)) |
| 1241 | goto err; | 1243 | goto err; |
| 1242 | 1244 | ||
| @@ -1247,7 +1249,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, | |||
| 1247 | if (bch_cache_accounting_add_kobjs(&dc->accounting, &dc->disk.kobj)) | 1249 | if (bch_cache_accounting_add_kobjs(&dc->accounting, &dc->disk.kobj)) |
| 1248 | goto err; | 1250 | goto err; |
| 1249 | 1251 | ||
| 1250 | pr_info("registered backing device %s", bdevname(bdev, name)); | 1252 | pr_info("registered backing device %s", dc->backing_dev_name); |
| 1251 | 1253 | ||
| 1252 | list_add(&dc->list, &uncached_devices); | 1254 | list_add(&dc->list, &uncached_devices); |
| 1253 | list_for_each_entry(c, &bch_cache_sets, list) | 1255 | list_for_each_entry(c, &bch_cache_sets, list) |
| @@ -1259,7 +1261,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, | |||
| 1259 | 1261 | ||
| 1260 | return; | 1262 | return; |
| 1261 | err: | 1263 | err: |
| 1262 | pr_notice("error %s: %s", bdevname(bdev, name), err); | 1264 | pr_notice("error %s: %s", dc->backing_dev_name, err); |
| 1263 | bcache_device_stop(&dc->disk); | 1265 | bcache_device_stop(&dc->disk); |
| 1264 | } | 1266 | } |
| 1265 | 1267 | ||
| @@ -1367,7 +1369,7 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size) | |||
| 1367 | 1369 | ||
| 1368 | bool bch_cached_dev_error(struct cached_dev *dc) | 1370 | bool bch_cached_dev_error(struct cached_dev *dc) |
| 1369 | { | 1371 | { |
| 1370 | char name[BDEVNAME_SIZE]; | 1372 | struct cache_set *c; |
| 1371 | 1373 | ||
| 1372 | if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) | 1374 | if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) |
| 1373 | return false; | 1375 | return false; |
| @@ -1377,7 +1379,22 @@ bool bch_cached_dev_error(struct cached_dev *dc) | |||
| 1377 | smp_mb(); | 1379 | smp_mb(); |
| 1378 | 1380 | ||
| 1379 | pr_err("stop %s: too many IO errors on backing device %s\n", | 1381 | pr_err("stop %s: too many IO errors on backing device %s\n", |
| 1380 | dc->disk.disk->disk_name, bdevname(dc->bdev, name)); | 1382 | dc->disk.disk->disk_name, dc->backing_dev_name); |
| 1383 | |||
| 1384 | /* | ||
| 1385 | * If the cached device is still attached to a cache set, | ||
| 1386 | * even dc->io_disable is true and no more I/O requests | ||
| 1387 | * accepted, cache device internal I/O (writeback scan or | ||
| 1388 | * garbage collection) may still prevent bcache device from | ||
| 1389 | * being stopped. So here CACHE_SET_IO_DISABLE should be | ||
| 1390 | * set to c->flags too, to make the internal I/O to cache | ||
| 1391 | * device rejected and stopped immediately. | ||
| 1392 | * If c is NULL, that means the bcache device is not attached | ||
| 1393 | * to any cache set, then no CACHE_SET_IO_DISABLE bit to set. | ||
| 1394 | */ | ||
| 1395 | c = dc->disk.c; | ||
| 1396 | if (c && test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) | ||
| 1397 | pr_info("CACHE_SET_IO_DISABLE already set"); | ||
| 1381 | 1398 | ||
| 1382 | bcache_device_stop(&dc->disk); | 1399 | bcache_device_stop(&dc->disk); |
| 1383 | return true; | 1400 | return true; |
| @@ -1395,7 +1412,7 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...) | |||
| 1395 | return false; | 1412 | return false; |
| 1396 | 1413 | ||
| 1397 | if (test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) | 1414 | if (test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) |
| 1398 | pr_warn("CACHE_SET_IO_DISABLE already set"); | 1415 | pr_info("CACHE_SET_IO_DISABLE already set"); |
| 1399 | 1416 | ||
| 1400 | /* XXX: we can be called from atomic context | 1417 | /* XXX: we can be called from atomic context |
| 1401 | acquire_console_sem(); | 1418 | acquire_console_sem(); |
| @@ -1539,6 +1556,20 @@ static void conditional_stop_bcache_device(struct cache_set *c, | |||
| 1539 | */ | 1556 | */ |
| 1540 | pr_warn("stop_when_cache_set_failed of %s is \"auto\" and cache is dirty, stop it to avoid potential data corruption.", | 1557 | pr_warn("stop_when_cache_set_failed of %s is \"auto\" and cache is dirty, stop it to avoid potential data corruption.", |
| 1541 | d->disk->disk_name); | 1558 | d->disk->disk_name); |
| 1559 | /* | ||
| 1560 | * There might be a small time gap that cache set is | ||
| 1561 | * released but bcache device is not. Inside this time | ||
| 1562 | * gap, regular I/O requests will directly go into | ||
| 1563 | * backing device as no cache set attached to. This | ||
| 1564 | * behavior may also introduce potential inconsistence | ||
| 1565 | * data in writeback mode while cache is dirty. | ||
| 1566 | * Therefore before calling bcache_device_stop() due | ||
| 1567 | * to a broken cache device, dc->io_disable should be | ||
| 1568 | * explicitly set to true. | ||
| 1569 | */ | ||
| 1570 | dc->io_disable = true; | ||
| 1571 | /* make others know io_disable is true earlier */ | ||
| 1572 | smp_mb(); | ||
| 1542 | bcache_device_stop(d); | 1573 | bcache_device_stop(d); |
| 1543 | } else { | 1574 | } else { |
| 1544 | /* | 1575 | /* |
| @@ -2003,12 +2034,10 @@ static int cache_alloc(struct cache *ca) | |||
| 2003 | static int register_cache(struct cache_sb *sb, struct page *sb_page, | 2034 | static int register_cache(struct cache_sb *sb, struct page *sb_page, |
| 2004 | struct block_device *bdev, struct cache *ca) | 2035 | struct block_device *bdev, struct cache *ca) |
| 2005 | { | 2036 | { |
| 2006 | char name[BDEVNAME_SIZE]; | ||
| 2007 | const char *err = NULL; /* must be set for any error case */ | 2037 | const char *err = NULL; /* must be set for any error case */ |
| 2008 | int ret = 0; | 2038 | int ret = 0; |
| 2009 | 2039 | ||
| 2010 | bdevname(bdev, name); | 2040 | bdevname(bdev, ca->cache_dev_name); |
| 2011 | |||
| 2012 | memcpy(&ca->sb, sb, sizeof(struct cache_sb)); | 2041 | memcpy(&ca->sb, sb, sizeof(struct cache_sb)); |
| 2013 | ca->bdev = bdev; | 2042 | ca->bdev = bdev; |
| 2014 | ca->bdev->bd_holder = ca; | 2043 | ca->bdev->bd_holder = ca; |
| @@ -2045,14 +2074,14 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page, | |||
| 2045 | goto out; | 2074 | goto out; |
| 2046 | } | 2075 | } |
| 2047 | 2076 | ||
| 2048 | pr_info("registered cache device %s", name); | 2077 | pr_info("registered cache device %s", ca->cache_dev_name); |
| 2049 | 2078 | ||
| 2050 | out: | 2079 | out: |
| 2051 | kobject_put(&ca->kobj); | 2080 | kobject_put(&ca->kobj); |
| 2052 | 2081 | ||
| 2053 | err: | 2082 | err: |
| 2054 | if (err) | 2083 | if (err) |
| 2055 | pr_notice("error %s: %s", name, err); | 2084 | pr_notice("error %s: %s", ca->cache_dev_name, err); |
| 2056 | 2085 | ||
| 2057 | return ret; | 2086 | return ret; |
| 2058 | } | 2087 | } |
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index 4a9547cdcdc5..ad45ebe1a74b 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c | |||
| @@ -244,8 +244,10 @@ static void dirty_endio(struct bio *bio) | |||
| 244 | struct keybuf_key *w = bio->bi_private; | 244 | struct keybuf_key *w = bio->bi_private; |
| 245 | struct dirty_io *io = w->private; | 245 | struct dirty_io *io = w->private; |
| 246 | 246 | ||
| 247 | if (bio->bi_status) | 247 | if (bio->bi_status) { |
| 248 | SET_KEY_DIRTY(&w->key, false); | 248 | SET_KEY_DIRTY(&w->key, false); |
| 249 | bch_count_backing_io_errors(io->dc, bio); | ||
| 250 | } | ||
| 249 | 251 | ||
| 250 | closure_put(&io->cl); | 252 | closure_put(&io->cl); |
| 251 | } | 253 | } |
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 12aa9ca21d8c..dc385b70e4c3 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c | |||
| @@ -1681,8 +1681,9 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign | |||
| 1681 | 1681 | ||
| 1682 | if (block_size <= KMALLOC_MAX_SIZE && | 1682 | if (block_size <= KMALLOC_MAX_SIZE && |
| 1683 | (block_size < PAGE_SIZE || !is_power_of_2(block_size))) { | 1683 | (block_size < PAGE_SIZE || !is_power_of_2(block_size))) { |
| 1684 | snprintf(slab_name, sizeof slab_name, "dm_bufio_cache-%u", c->block_size); | 1684 | unsigned align = min(1U << __ffs(block_size), (unsigned)PAGE_SIZE); |
| 1685 | c->slab_cache = kmem_cache_create(slab_name, c->block_size, ARCH_KMALLOC_MINALIGN, | 1685 | snprintf(slab_name, sizeof slab_name, "dm_bufio_cache-%u", block_size); |
| 1686 | c->slab_cache = kmem_cache_create(slab_name, block_size, align, | ||
| 1686 | SLAB_RECLAIM_ACCOUNT, NULL); | 1687 | SLAB_RECLAIM_ACCOUNT, NULL); |
| 1687 | if (!c->slab_cache) { | 1688 | if (!c->slab_cache) { |
| 1688 | r = -ENOMEM; | 1689 | r = -ENOMEM; |
diff --git a/drivers/md/dm-cache-background-tracker.c b/drivers/md/dm-cache-background-tracker.c index 1d0af0a21fc7..84814e819e4c 100644 --- a/drivers/md/dm-cache-background-tracker.c +++ b/drivers/md/dm-cache-background-tracker.c | |||
| @@ -166,7 +166,7 @@ static bool max_work_reached(struct background_tracker *b) | |||
| 166 | atomic_read(&b->pending_demotes) >= b->max_work; | 166 | atomic_read(&b->pending_demotes) >= b->max_work; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | struct bt_work *alloc_work(struct background_tracker *b) | 169 | static struct bt_work *alloc_work(struct background_tracker *b) |
| 170 | { | 170 | { |
| 171 | if (max_work_reached(b)) | 171 | if (max_work_reached(b)) |
| 172 | return NULL; | 172 | return NULL; |
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 77d9fe58dae2..514fb4aec5d1 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c | |||
| @@ -2440,7 +2440,7 @@ static void dm_integrity_free_journal_scatterlist(struct dm_integrity_c *ic, str | |||
| 2440 | unsigned i; | 2440 | unsigned i; |
| 2441 | for (i = 0; i < ic->journal_sections; i++) | 2441 | for (i = 0; i < ic->journal_sections; i++) |
| 2442 | kvfree(sl[i]); | 2442 | kvfree(sl[i]); |
| 2443 | kfree(sl); | 2443 | kvfree(sl); |
| 2444 | } | 2444 | } |
| 2445 | 2445 | ||
| 2446 | static struct scatterlist **dm_integrity_alloc_journal_scatterlist(struct dm_integrity_c *ic, struct page_list *pl) | 2446 | static struct scatterlist **dm_integrity_alloc_journal_scatterlist(struct dm_integrity_c *ic, struct page_list *pl) |
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 580c49cc8079..5903e492bb34 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | #define MAX_RECOVERY 1 /* Maximum number of regions recovered in parallel. */ | 24 | #define MAX_RECOVERY 1 /* Maximum number of regions recovered in parallel. */ |
| 25 | 25 | ||
| 26 | #define MAX_NR_MIRRORS (DM_KCOPYD_MAX_REGIONS + 1) | ||
| 27 | |||
| 26 | #define DM_RAID1_HANDLE_ERRORS 0x01 | 28 | #define DM_RAID1_HANDLE_ERRORS 0x01 |
| 27 | #define DM_RAID1_KEEP_LOG 0x02 | 29 | #define DM_RAID1_KEEP_LOG 0x02 |
| 28 | #define errors_handled(p) ((p)->features & DM_RAID1_HANDLE_ERRORS) | 30 | #define errors_handled(p) ((p)->features & DM_RAID1_HANDLE_ERRORS) |
| @@ -255,7 +257,7 @@ static int mirror_flush(struct dm_target *ti) | |||
| 255 | unsigned long error_bits; | 257 | unsigned long error_bits; |
| 256 | 258 | ||
| 257 | unsigned int i; | 259 | unsigned int i; |
| 258 | struct dm_io_region io[ms->nr_mirrors]; | 260 | struct dm_io_region io[MAX_NR_MIRRORS]; |
| 259 | struct mirror *m; | 261 | struct mirror *m; |
| 260 | struct dm_io_request io_req = { | 262 | struct dm_io_request io_req = { |
| 261 | .bi_op = REQ_OP_WRITE, | 263 | .bi_op = REQ_OP_WRITE, |
| @@ -651,7 +653,7 @@ static void write_callback(unsigned long error, void *context) | |||
| 651 | static void do_write(struct mirror_set *ms, struct bio *bio) | 653 | static void do_write(struct mirror_set *ms, struct bio *bio) |
| 652 | { | 654 | { |
| 653 | unsigned int i; | 655 | unsigned int i; |
| 654 | struct dm_io_region io[ms->nr_mirrors], *dest = io; | 656 | struct dm_io_region io[MAX_NR_MIRRORS], *dest = io; |
| 655 | struct mirror *m; | 657 | struct mirror *m; |
| 656 | struct dm_io_request io_req = { | 658 | struct dm_io_request io_req = { |
| 657 | .bi_op = REQ_OP_WRITE, | 659 | .bi_op = REQ_OP_WRITE, |
| @@ -1083,7 +1085,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
| 1083 | argc -= args_used; | 1085 | argc -= args_used; |
| 1084 | 1086 | ||
| 1085 | if (!argc || sscanf(argv[0], "%u%c", &nr_mirrors, &dummy) != 1 || | 1087 | if (!argc || sscanf(argv[0], "%u%c", &nr_mirrors, &dummy) != 1 || |
| 1086 | nr_mirrors < 2 || nr_mirrors > DM_KCOPYD_MAX_REGIONS + 1) { | 1088 | nr_mirrors < 2 || nr_mirrors > MAX_NR_MIRRORS) { |
| 1087 | ti->error = "Invalid number of mirrors"; | 1089 | ti->error = "Invalid number of mirrors"; |
| 1088 | dm_dirty_log_destroy(dl); | 1090 | dm_dirty_log_destroy(dl); |
| 1089 | return -EINVAL; | 1091 | return -EINVAL; |
| @@ -1404,7 +1406,7 @@ static void mirror_status(struct dm_target *ti, status_type_t type, | |||
| 1404 | int num_feature_args = 0; | 1406 | int num_feature_args = 0; |
| 1405 | struct mirror_set *ms = (struct mirror_set *) ti->private; | 1407 | struct mirror_set *ms = (struct mirror_set *) ti->private; |
| 1406 | struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh); | 1408 | struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh); |
| 1407 | char buffer[ms->nr_mirrors + 1]; | 1409 | char buffer[MAX_NR_MIRRORS + 1]; |
| 1408 | 1410 | ||
| 1409 | switch (type) { | 1411 | switch (type) { |
| 1410 | case STATUSTYPE_INFO: | 1412 | case STATUSTYPE_INFO: |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 4ea404dbcf0b..0a7b0107ca78 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
| @@ -1020,7 +1020,8 @@ int dm_set_target_max_io_len(struct dm_target *ti, sector_t len) | |||
| 1020 | EXPORT_SYMBOL_GPL(dm_set_target_max_io_len); | 1020 | EXPORT_SYMBOL_GPL(dm_set_target_max_io_len); |
| 1021 | 1021 | ||
| 1022 | static struct dm_target *dm_dax_get_live_target(struct mapped_device *md, | 1022 | static struct dm_target *dm_dax_get_live_target(struct mapped_device *md, |
| 1023 | sector_t sector, int *srcu_idx) | 1023 | sector_t sector, int *srcu_idx) |
| 1024 | __acquires(md->io_barrier) | ||
| 1024 | { | 1025 | { |
| 1025 | struct dm_table *map; | 1026 | struct dm_table *map; |
| 1026 | struct dm_target *ti; | 1027 | struct dm_target *ti; |
| @@ -1037,7 +1038,7 @@ static struct dm_target *dm_dax_get_live_target(struct mapped_device *md, | |||
| 1037 | } | 1038 | } |
| 1038 | 1039 | ||
| 1039 | static long dm_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, | 1040 | static long dm_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, |
| 1040 | long nr_pages, void **kaddr, pfn_t *pfn) | 1041 | long nr_pages, void **kaddr, pfn_t *pfn) |
| 1041 | { | 1042 | { |
| 1042 | struct mapped_device *md = dax_get_private(dax_dev); | 1043 | struct mapped_device *md = dax_get_private(dax_dev); |
| 1043 | sector_t sector = pgoff * PAGE_SECTORS; | 1044 | sector_t sector = pgoff * PAGE_SECTORS; |
| @@ -1065,7 +1066,7 @@ static long dm_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, | |||
| 1065 | } | 1066 | } |
| 1066 | 1067 | ||
| 1067 | static size_t dm_dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, | 1068 | static size_t dm_dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, |
| 1068 | void *addr, size_t bytes, struct iov_iter *i) | 1069 | void *addr, size_t bytes, struct iov_iter *i) |
| 1069 | { | 1070 | { |
| 1070 | struct mapped_device *md = dax_get_private(dax_dev); | 1071 | struct mapped_device *md = dax_get_private(dax_dev); |
| 1071 | sector_t sector = pgoff * PAGE_SECTORS; | 1072 | sector_t sector = pgoff * PAGE_SECTORS; |
diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index e216cd768409..b07114b5efb2 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | // | 20 | // |
| 21 | // VBI support (2004) and cleanups (2005) by Hans Verkuil <hverkuil@xs4all.nl> | 21 | // VBI support (2004) and cleanups (2005) by Hans Verkuil <hverkuil@xs4all.nl> |
| 22 | // | 22 | // |
| 23 | // Copyright (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 23 | // Copyright (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 24 | // SAA7111, SAA7113 and SAA7118 support | 24 | // SAA7111, SAA7113 and SAA7118 support |
| 25 | 25 | ||
| 26 | #include "saa711x_regs.h" | 26 | #include "saa711x_regs.h" |
diff --git a/drivers/media/i2c/saa711x_regs.h b/drivers/media/i2c/saa711x_regs.h index a50d480e101a..44fabe08234d 100644 --- a/drivers/media/i2c/saa711x_regs.h +++ b/drivers/media/i2c/saa711x_regs.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0+ | 2 | * SPDX-License-Identifier: GPL-2.0+ |
| 3 | * saa711x - Philips SAA711x video decoder register specifications | 3 | * saa711x - Philips SAA711x video decoder register specifications |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #define R_00_CHIP_VERSION 0x00 | 8 | #define R_00_CHIP_VERSION 0x00 |
diff --git a/drivers/media/i2c/tda7432.c b/drivers/media/i2c/tda7432.c index 1c5c61d829d6..9b4f21237810 100644 --- a/drivers/media/i2c/tda7432.c +++ b/drivers/media/i2c/tda7432.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | * Muting and tone control by Jonathan Isom <jisom@ematic.com> | 8 | * Muting and tone control by Jonathan Isom <jisom@ematic.com> |
| 9 | * | 9 | * |
| 10 | * Copyright (c) 2000 Eric Sandeen <eric_sandeen@bigfoot.com> | 10 | * Copyright (c) 2000 Eric Sandeen <eric_sandeen@bigfoot.com> |
| 11 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 11 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 12 | * This code is placed under the terms of the GNU General Public License | 12 | * This code is placed under the terms of the GNU General Public License |
| 13 | * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu) | 13 | * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu) |
| 14 | * Which was based on tda8425.c by Greg Alexander (c) 1998 | 14 | * Which was based on tda8425.c by Greg Alexander (c) 1998 |
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 2476d812f669..1734ed4ede33 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // | 2 | // |
| 3 | // tvp5150 - Texas Instruments TVP5150A/AM1 and TVP5151 video decoder driver | 3 | // tvp5150 - Texas Instruments TVP5150A/AM1 and TVP5151 video decoder driver |
| 4 | // | 4 | // |
| 5 | // Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | // Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | 6 | ||
| 7 | #include <dt-bindings/media/tvp5150.h> | 7 | #include <dt-bindings/media/tvp5150.h> |
| 8 | #include <linux/i2c.h> | 8 | #include <linux/i2c.h> |
diff --git a/drivers/media/i2c/tvp5150_reg.h b/drivers/media/i2c/tvp5150_reg.h index c43b7b844021..d3a764cae1a0 100644 --- a/drivers/media/i2c/tvp5150_reg.h +++ b/drivers/media/i2c/tvp5150_reg.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * | 3 | * |
| 4 | * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder registers | 4 | * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder registers |
| 5 | * | 5 | * |
| 6 | * Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 6 | * Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #define TVP5150_VD_IN_SRC_SEL_1 0x00 /* Video input source selection #1 */ | 9 | #define TVP5150_VD_IN_SRC_SEL_1 0x00 /* Video input source selection #1 */ |
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index a26c1a3f7183..4599b7e28a8d 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> | 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> |
| 6 | * | 6 | * |
| 7 | * This code is partially based upon the TVP5150 driver | 7 | * This code is partially based upon the TVP5150 driver |
| 8 | * written by Mauro Carvalho Chehab (mchehab@infradead.org), | 8 | * written by Mauro Carvalho Chehab <mchehab@kernel.org>, |
| 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> | 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> |
| 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14. Revisions by | 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14. Revisions by |
| 11 | * Muralidharan Karicheri and Snehaprabha Narnakaje (TI). | 11 | * Muralidharan Karicheri and Snehaprabha Narnakaje (TI). |
diff --git a/drivers/media/i2c/tvp7002_reg.h b/drivers/media/i2c/tvp7002_reg.h index 3c8c8b0a6a4c..7f56ba689dfe 100644 --- a/drivers/media/i2c/tvp7002_reg.h +++ b/drivers/media/i2c/tvp7002_reg.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> | 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> |
| 6 | * | 6 | * |
| 7 | * This code is partially based upon the TVP5150 driver | 7 | * This code is partially based upon the TVP5150 driver |
| 8 | * written by Mauro Carvalho Chehab (mchehab@infradead.org), | 8 | * written by Mauro Carvalho Chehab <mchehab@kernel.org>, |
| 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> | 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> |
| 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14 | 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14 |
| 11 | * | 11 | * |
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c index 67ac51eff15c..6b87a721dc49 100644 --- a/drivers/media/media-devnode.c +++ b/drivers/media/media-devnode.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Copyright (C) 2010 Nokia Corporation | 4 | * Copyright (C) 2010 Nokia Corporation |
| 5 | * | 5 | * |
| 6 | * Based on drivers/media/video/v4l2_dev.c code authored by | 6 | * Based on drivers/media/video/v4l2_dev.c code authored by |
| 7 | * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2) | 7 | * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2) |
| 8 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) | 8 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) |
| 9 | * | 9 | * |
| 10 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 10 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
diff --git a/drivers/media/pci/bt8xx/bttv-audio-hook.c b/drivers/media/pci/bt8xx/bttv-audio-hook.c index 9f1f9169fb5b..346fc7f58839 100644 --- a/drivers/media/pci/bt8xx/bttv-audio-hook.c +++ b/drivers/media/pci/bt8xx/bttv-audio-hook.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Handlers for board audio hooks, splitted from bttv-cards | 2 | * Handlers for board audio hooks, splitted from bttv-cards |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2006 Mauro Carvalho Chehab (mchehab@infradead.org) | 4 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | * This code is placed under the terms of the GNU General Public License | 5 | * This code is placed under the terms of the GNU General Public License |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
diff --git a/drivers/media/pci/bt8xx/bttv-audio-hook.h b/drivers/media/pci/bt8xx/bttv-audio-hook.h index 159d07adeff8..be16a537a03a 100644 --- a/drivers/media/pci/bt8xx/bttv-audio-hook.h +++ b/drivers/media/pci/bt8xx/bttv-audio-hook.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Handlers for board audio hooks, splitted from bttv-cards | 2 | * Handlers for board audio hooks, splitted from bttv-cards |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2006 Mauro Carvalho Chehab (mchehab@infradead.org) | 4 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | * This code is placed under the terms of the GNU General Public License | 5 | * This code is placed under the terms of the GNU General Public License |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c index 1902732f90e1..2616243b2c49 100644 --- a/drivers/media/pci/bt8xx/bttv-cards.c +++ b/drivers/media/pci/bt8xx/bttv-cards.c | |||
| @@ -2447,7 +2447,7 @@ struct tvcard bttv_tvcards[] = { | |||
| 2447 | }, | 2447 | }, |
| 2448 | /* ---- card 0x88---------------------------------- */ | 2448 | /* ---- card 0x88---------------------------------- */ |
| 2449 | [BTTV_BOARD_ACORP_Y878F] = { | 2449 | [BTTV_BOARD_ACORP_Y878F] = { |
| 2450 | /* Mauro Carvalho Chehab <mchehab@infradead.org> */ | 2450 | /* Mauro Carvalho Chehab <mchehab@kernel.org> */ |
| 2451 | .name = "Acorp Y878F", | 2451 | .name = "Acorp Y878F", |
| 2452 | .video_inputs = 3, | 2452 | .video_inputs = 3, |
| 2453 | /* .audio_inputs= 1, */ | 2453 | /* .audio_inputs= 1, */ |
| @@ -2688,7 +2688,7 @@ struct tvcard bttv_tvcards[] = { | |||
| 2688 | }, | 2688 | }, |
| 2689 | [BTTV_BOARD_ENLTV_FM_2] = { | 2689 | [BTTV_BOARD_ENLTV_FM_2] = { |
| 2690 | /* Encore TV Tuner Pro ENL TV-FM-2 | 2690 | /* Encore TV Tuner Pro ENL TV-FM-2 |
| 2691 | Mauro Carvalho Chehab <mchehab@infradead.org */ | 2691 | Mauro Carvalho Chehab <mchehab@kernel.org> */ |
| 2692 | .name = "Encore ENL TV-FM-2", | 2692 | .name = "Encore ENL TV-FM-2", |
| 2693 | .video_inputs = 3, | 2693 | .video_inputs = 3, |
| 2694 | /* .audio_inputs= 1, */ | 2694 | /* .audio_inputs= 1, */ |
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 707f57a9f940..de3f44b8dec6 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | (c) 2005-2006 Nickolay V. Shmyrev <nshmyrev@yandex.ru> | 13 | (c) 2005-2006 Nickolay V. Shmyrev <nshmyrev@yandex.ru> |
| 14 | 14 | ||
| 15 | Fixes to be fully V4L2 compliant by | 15 | Fixes to be fully V4L2 compliant by |
| 16 | (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 16 | (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 17 | 17 | ||
| 18 | Cropping and overscan support | 18 | Cropping and overscan support |
| 19 | Copyright (C) 2005, 2006 Michael H. Schimek <mschimek@gmx.at> | 19 | Copyright (C) 2005, 2006 Michael H. Schimek <mschimek@gmx.at> |
diff --git a/drivers/media/pci/bt8xx/bttv-i2c.c b/drivers/media/pci/bt8xx/bttv-i2c.c index eccd1e3d717a..c76823eb399d 100644 --- a/drivers/media/pci/bt8xx/bttv-i2c.c +++ b/drivers/media/pci/bt8xx/bttv-i2c.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | & Marcus Metzler (mocm@thp.uni-koeln.de) | 8 | & Marcus Metzler (mocm@thp.uni-koeln.de) |
| 9 | (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> | 9 | (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> |
| 10 | 10 | ||
| 11 | (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> | 11 | (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 12 | - Multituner support and i2c address binding | 12 | - Multituner support and i2c address binding |
| 13 | 13 | ||
| 14 | This program is free software; you can redistribute it and/or modify | 14 | This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/media/pci/cx23885/cx23885-input.c b/drivers/media/pci/cx23885/cx23885-input.c index be49589a61d2..395ff9bba759 100644 --- a/drivers/media/pci/cx23885/cx23885-input.c +++ b/drivers/media/pci/cx23885/cx23885-input.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | * Copyright (C) 2008 <srinivasa.deevi at conexant dot com> | 13 | * Copyright (C) 2008 <srinivasa.deevi at conexant dot com> |
| 14 | * Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 14 | * Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 15 | * Markus Rechberger <mrechberger@gmail.com> | 15 | * Markus Rechberger <mrechberger@gmail.com> |
| 16 | * Mauro Carvalho Chehab <mchehab@infradead.org> | 16 | * Mauro Carvalho Chehab <mchehab@kernel.org> |
| 17 | * Sascha Sommer <saschasommer@freenet.de> | 17 | * Sascha Sommer <saschasommer@freenet.de> |
| 18 | * Copyright (C) 2004, 2005 Chris Pascoe | 18 | * Copyright (C) 2004, 2005 Chris Pascoe |
| 19 | * Copyright (C) 2003, 2004 Gerd Knorr | 19 | * Copyright (C) 2003, 2004 Gerd Knorr |
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c index ab09bb55cf45..8a28fda703a2 100644 --- a/drivers/media/pci/cx88/cx88-alsa.c +++ b/drivers/media/pci/cx88/cx88-alsa.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * (c) 2007 Trent Piepho <xyzzy@speakeasy.org> | 5 | * (c) 2007 Trent Piepho <xyzzy@speakeasy.org> |
| 6 | * (c) 2005,2006 Ricardo Cerqueira <v4l@cerqueira.org> | 6 | * (c) 2005,2006 Ricardo Cerqueira <v4l@cerqueira.org> |
| 7 | * (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | * (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | * Based on a dummy cx88 module by Gerd Knorr <kraxel@bytesex.org> | 8 | * Based on a dummy cx88 module by Gerd Knorr <kraxel@bytesex.org> |
| 9 | * Based on dummy.c by Jaroslav Kysela <perex@perex.cz> | 9 | * Based on dummy.c by Jaroslav Kysela <perex@perex.cz> |
| 10 | * | 10 | * |
| @@ -103,7 +103,7 @@ MODULE_PARM_DESC(index, "Index value for cx88x capture interface(s)."); | |||
| 103 | 103 | ||
| 104 | MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards"); | 104 | MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards"); |
| 105 | MODULE_AUTHOR("Ricardo Cerqueira"); | 105 | MODULE_AUTHOR("Ricardo Cerqueira"); |
| 106 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 106 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 107 | MODULE_LICENSE("GPL"); | 107 | MODULE_LICENSE("GPL"); |
| 108 | MODULE_VERSION(CX88_VERSION); | 108 | MODULE_VERSION(CX88_VERSION); |
| 109 | 109 | ||
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index 0e0952e60795..7a4876cf9f08 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * (c) 2004 Jelle Foks <jelle@foks.us> | 5 | * (c) 2004 Jelle Foks <jelle@foks.us> |
| 6 | * (c) 2004 Gerd Knorr <kraxel@bytesex.org> | 6 | * (c) 2004 Gerd Knorr <kraxel@bytesex.org> |
| 7 | * | 7 | * |
| 8 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 8 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | * - video_ioctl2 conversion | 9 | * - video_ioctl2 conversion |
| 10 | * | 10 | * |
| 11 | * Includes parts from the ivtv driver <http://sourceforge.net/projects/ivtv/> | 11 | * Includes parts from the ivtv driver <http://sourceforge.net/projects/ivtv/> |
diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c index 8bfa5b7ed91b..60988e95b637 100644 --- a/drivers/media/pci/cx88/cx88-core.c +++ b/drivers/media/pci/cx88/cx88-core.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] | 5 | * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] |
| 6 | * | 6 | * |
| 7 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | * - Multituner support | 8 | * - Multituner support |
| 9 | * - video_ioctl2 conversion | 9 | * - video_ioctl2 conversion |
| 10 | * - PAL/M fixes | 10 | * - PAL/M fixes |
diff --git a/drivers/media/pci/cx88/cx88-i2c.c b/drivers/media/pci/cx88/cx88-i2c.c index f7692775fb5a..99f88a05a7c9 100644 --- a/drivers/media/pci/cx88/cx88-i2c.c +++ b/drivers/media/pci/cx88/cx88-i2c.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | * (c) 2002 Yurij Sysoev <yurij@naturesoft.net> | 8 | * (c) 2002 Yurij Sysoev <yurij@naturesoft.net> |
| 9 | * (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> | 9 | * (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> |
| 10 | * | 10 | * |
| 11 | * (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> | 11 | * (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 12 | * - Multituner support and i2c address binding | 12 | * - Multituner support and i2c address binding |
| 13 | * | 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 9be682cdb644..7b113bad70d2 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * | 5 | * |
| 6 | * (c) 2003-04 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] | 6 | * (c) 2003-04 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] |
| 7 | * | 7 | * |
| 8 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 8 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | * - Multituner support | 9 | * - Multituner support |
| 10 | * - video_ioctl2 conversion | 10 | * - video_ioctl2 conversion |
| 11 | * - PAL/M fixes | 11 | * - PAL/M fixes |
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 5ef635e72e10..4c52ac6d8bc5 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Copyright 1997 M. Kirkwood | 4 | * Copyright 1997 M. Kirkwood |
| 5 | * | 5 | * |
| 6 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 6 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 7 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | * Converted to new API by Alan Cox <alan@lxorguk.ukuu.org.uk> | 8 | * Converted to new API by Alan Cox <alan@lxorguk.ukuu.org.uk> |
| 9 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> | 9 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> |
| 10 | * | 10 | * |
diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c index 9e12c6027359..840b7d60462b 100644 --- a/drivers/media/radio/radio-aztech.c +++ b/drivers/media/radio/radio-aztech.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * radio-aztech.c - Aztech radio card driver | 2 | * radio-aztech.c - Aztech radio card driver |
| 3 | * | 3 | * |
| 4 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@xs4all.nl> | 4 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@xs4all.nl> |
| 5 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | * Adapted to support the Video for Linux API by | 6 | * Adapted to support the Video for Linux API by |
| 7 | * Russell Kroll <rkroll@exploits.org>. Based on original tuner code by: | 7 | * Russell Kroll <rkroll@exploits.org>. Based on original tuner code by: |
| 8 | * | 8 | * |
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index 3ff4c4e1435f..f051f8694ab9 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> | 15 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> |
| 16 | * | 16 | * |
| 17 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 17 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 18 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 18 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 19 | * | 19 | * |
| 20 | * Note: this card seems to swap the left and right audio channels! | 20 | * Note: this card seems to swap the left and right audio channels! |
| 21 | * | 21 | * |
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 95f06f3b35dc..e4e758739246 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | * BUGS: | 27 | * BUGS: |
| 28 | * - card unmutes if you change frequency | 28 | * - card unmutes if you change frequency |
| 29 | * | 29 | * |
| 30 | * (c) 2006, 2007 by Mauro Carvalho Chehab <mchehab@infradead.org>: | 30 | * (c) 2006, 2007 by Mauro Carvalho Chehab <mchehab@kernel.org>: |
| 31 | * - Conversion to V4L2 API | 31 | * - Conversion to V4L2 API |
| 32 | * - Uses video_ioctl2 for parsing and to add debug support | 32 | * - Uses video_ioctl2 for parsing and to add debug support |
| 33 | */ | 33 | */ |
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index abeaedd8d437..5a1470eb753e 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> | 7 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> |
| 8 | * | 8 | * |
| 9 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 9 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 10 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 10 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 11 | * | 11 | * |
| 12 | * Fully tested with actual hardware and the v4l2-compliance tool. | 12 | * Fully tested with actual hardware and the v4l2-compliance tool. |
| 13 | */ | 13 | */ |
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index fc4e63d36e4c..4f9b97edd9eb 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | * No volume control - only mute/unmute - you have to use line volume | 13 | * No volume control - only mute/unmute - you have to use line volume |
| 14 | * control on SB-part of SF16-FMI/SF16-FMP/SF16-FMD | 14 | * control on SB-part of SF16-FMI/SF16-FMP/SF16-FMD |
| 15 | * | 15 | * |
| 16 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 16 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include <linux/kernel.h> /* __setup */ | 19 | #include <linux/kernel.h> /* __setup */ |
diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index 4f116ea294fb..1af8f29cc7d1 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | * Volume Control is done digitally | 17 | * Volume Control is done digitally |
| 18 | * | 18 | * |
| 19 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 19 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 20 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 20 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include <linux/module.h> /* Modules */ | 23 | #include <linux/module.h> /* Modules */ |
diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c index 26a8c6002121..a4bad322ffff 100644 --- a/drivers/media/radio/radio-trust.c +++ b/drivers/media/radio/radio-trust.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | * Scott McGrath (smcgrath@twilight.vtc.vsc.edu) | 12 | * Scott McGrath (smcgrath@twilight.vtc.vsc.edu) |
| 13 | * William McGrath (wmcgrath@twilight.vtc.vsc.edu) | 13 | * William McGrath (wmcgrath@twilight.vtc.vsc.edu) |
| 14 | * | 14 | * |
| 15 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 15 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <stdarg.h> | 18 | #include <stdarg.h> |
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c index eb72a4d13758..d0d67ad85b8f 100644 --- a/drivers/media/radio/radio-typhoon.c +++ b/drivers/media/radio/radio-typhoon.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | * The frequency change is necessary since the card never seems to be | 25 | * The frequency change is necessary since the card never seems to be |
| 26 | * completely silent. | 26 | * completely silent. |
| 27 | * | 27 | * |
| 28 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 28 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 29 | */ | 29 | */ |
| 30 | 30 | ||
| 31 | #include <linux/module.h> /* Modules */ | 31 | #include <linux/module.h> /* Modules */ |
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index 026e88eef29c..6007cd09b328 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | * 2002-07-15 - Fix Stereo typo | 27 | * 2002-07-15 - Fix Stereo typo |
| 28 | * | 28 | * |
| 29 | * 2006-07-24 - Converted to V4L2 API | 29 | * 2006-07-24 - Converted to V4L2 API |
| 30 | * by Mauro Carvalho Chehab <mchehab@infradead.org> | 30 | * by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 31 | * | 31 | * |
| 32 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 32 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 33 | * | 33 | * |
diff --git a/drivers/media/rc/keymaps/rc-avermedia-m135a.c b/drivers/media/rc/keymaps/rc-avermedia-m135a.c index f6977df1a75b..d275d98d066a 100644 --- a/drivers/media/rc/keymaps/rc-avermedia-m135a.c +++ b/drivers/media/rc/keymaps/rc-avermedia-m135a.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | * | 12 | * |
| 13 | * On Avermedia M135A with IR model RM-JX, the same codes exist on both | 13 | * On Avermedia M135A with IR model RM-JX, the same codes exist on both |
| 14 | * Positivo (BR) and original IR, initial version and remote control codes | 14 | * Positivo (BR) and original IR, initial version and remote control codes |
| 15 | * added by Mauro Carvalho Chehab <mchehab@infradead.org> | 15 | * added by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 16 | * | 16 | * |
| 17 | * Positivo also ships Avermedia M135A with model RM-K6, extra control | 17 | * Positivo also ships Avermedia M135A with model RM-K6, extra control |
| 18 | * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br> | 18 | * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br> |
diff --git a/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c b/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c index e4e78c1f4123..057c13b765ef 100644 --- a/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c +++ b/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* Encore ENLTV-FM v5.3 | 11 | /* Encore ENLTV-FM v5.3 |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | static struct rc_map_table encore_enltv_fm53[] = { | 15 | static struct rc_map_table encore_enltv_fm53[] = { |
diff --git a/drivers/media/rc/keymaps/rc-encore-enltv2.c b/drivers/media/rc/keymaps/rc-encore-enltv2.c index c3d4437a6fda..cd0555924456 100644 --- a/drivers/media/rc/keymaps/rc-encore-enltv2.c +++ b/drivers/media/rc/keymaps/rc-encore-enltv2.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton | 11 | /* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> */ | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> */ |
| 13 | 13 | ||
| 14 | static struct rc_map_table encore_enltv2[] = { | 14 | static struct rc_map_table encore_enltv2[] = { |
| 15 | { 0x4c, KEY_POWER2 }, | 15 | { 0x4c, KEY_POWER2 }, |
diff --git a/drivers/media/rc/keymaps/rc-kaiomy.c b/drivers/media/rc/keymaps/rc-kaiomy.c index f0f88df18606..a00051339842 100644 --- a/drivers/media/rc/keymaps/rc-kaiomy.c +++ b/drivers/media/rc/keymaps/rc-kaiomy.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* Kaiomy TVnPC U2 | 11 | /* Kaiomy TVnPC U2 |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | static struct rc_map_table kaiomy[] = { | 15 | static struct rc_map_table kaiomy[] = { |
diff --git a/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c b/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c index 453e04377de7..db5edde3eeb1 100644 --- a/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c +++ b/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* Kworld Plus TV Analog Lite PCI IR | 11 | /* Kworld Plus TV Analog Lite PCI IR |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | static struct rc_map_table kworld_plus_tv_analog[] = { | 15 | static struct rc_map_table kworld_plus_tv_analog[] = { |
diff --git a/drivers/media/rc/keymaps/rc-pixelview-new.c b/drivers/media/rc/keymaps/rc-pixelview-new.c index 791130f108ff..e4e34f2ccf74 100644 --- a/drivers/media/rc/keymaps/rc-pixelview-new.c +++ b/drivers/media/rc/keymaps/rc-pixelview-new.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* | 11 | /* |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13 | present on PV MPEG 8000GT | 13 | present on PV MPEG 8000GT |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
diff --git a/drivers/media/tuners/tea5761.c b/drivers/media/tuners/tea5761.c index 88b3e80c38ad..d78a2bdb3e36 100644 --- a/drivers/media/tuners/tea5761.c +++ b/drivers/media/tuners/tea5761.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // For Philips TEA5761 FM Chip | 2 | // For Philips TEA5761 FM Chip |
| 3 | // I2C address is always 0x20 (0x10 at 7-bit mode). | 3 | // I2C address is always 0x20 (0x10 at 7-bit mode). |
| 4 | // | 4 | // |
| 5 | // Copyright (c) 2005-2007 Mauro Carvalho Chehab (mchehab@infradead.org) | 5 | // Copyright (c) 2005-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | 6 | ||
| 7 | #include <linux/i2c.h> | 7 | #include <linux/i2c.h> |
| 8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
| @@ -337,5 +337,5 @@ EXPORT_SYMBOL_GPL(tea5761_attach); | |||
| 337 | EXPORT_SYMBOL_GPL(tea5761_autodetection); | 337 | EXPORT_SYMBOL_GPL(tea5761_autodetection); |
| 338 | 338 | ||
| 339 | MODULE_DESCRIPTION("Philips TEA5761 FM tuner driver"); | 339 | MODULE_DESCRIPTION("Philips TEA5761 FM tuner driver"); |
| 340 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 340 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 341 | MODULE_LICENSE("GPL v2"); | 341 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/media/tuners/tea5767.c b/drivers/media/tuners/tea5767.c index 2b2c064d7dc3..016d0d5ec50b 100644 --- a/drivers/media/tuners/tea5767.c +++ b/drivers/media/tuners/tea5767.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview | 2 | // For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview |
| 3 | // I2C address is always 0xC0. | 3 | // I2C address is always 0xC0. |
| 4 | // | 4 | // |
| 5 | // Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@infradead.org) | 5 | // Copyright (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | // | 6 | // |
| 7 | // tea5767 autodetection thanks to Torsten Seeboth and Atsushi Nakagawa | 7 | // tea5767 autodetection thanks to Torsten Seeboth and Atsushi Nakagawa |
| 8 | // from their contributions on DScaler. | 8 | // from their contributions on DScaler. |
| @@ -469,5 +469,5 @@ EXPORT_SYMBOL_GPL(tea5767_attach); | |||
| 469 | EXPORT_SYMBOL_GPL(tea5767_autodetection); | 469 | EXPORT_SYMBOL_GPL(tea5767_autodetection); |
| 470 | 470 | ||
| 471 | MODULE_DESCRIPTION("Philips TEA5767 FM tuner driver"); | 471 | MODULE_DESCRIPTION("Philips TEA5767 FM tuner driver"); |
| 472 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 472 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 473 | MODULE_LICENSE("GPL v2"); | 473 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/media/tuners/tuner-xc2028-types.h b/drivers/media/tuners/tuner-xc2028-types.h index bb0437c36c03..50d017a4822a 100644 --- a/drivers/media/tuners/tuner-xc2028-types.h +++ b/drivers/media/tuners/tuner-xc2028-types.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * This file includes internal tipes to be used inside tuner-xc2028. | 5 | * This file includes internal tipes to be used inside tuner-xc2028. |
| 6 | * Shouldn't be included outside tuner-xc2028 | 6 | * Shouldn't be included outside tuner-xc2028 |
| 7 | * | 7 | * |
| 8 | * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org) | 8 | * Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | /* xc3028 firmware types */ | 11 | /* xc3028 firmware types */ |
diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index fca85e08ebd7..84744e138982 100644 --- a/drivers/media/tuners/tuner-xc2028.c +++ b/drivers/media/tuners/tuner-xc2028.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tuner-xc2028 | 2 | // tuner-xc2028 |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org) | 4 | // Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | // | 5 | // |
| 6 | // Copyright (c) 2007 Michel Ludwig (michel.ludwig@gmail.com) | 6 | // Copyright (c) 2007 Michel Ludwig (michel.ludwig@gmail.com) |
| 7 | // - frontend interface | 7 | // - frontend interface |
| @@ -1518,7 +1518,7 @@ EXPORT_SYMBOL(xc2028_attach); | |||
| 1518 | 1518 | ||
| 1519 | MODULE_DESCRIPTION("Xceive xc2028/xc3028 tuner driver"); | 1519 | MODULE_DESCRIPTION("Xceive xc2028/xc3028 tuner driver"); |
| 1520 | MODULE_AUTHOR("Michel Ludwig <michel.ludwig@gmail.com>"); | 1520 | MODULE_AUTHOR("Michel Ludwig <michel.ludwig@gmail.com>"); |
| 1521 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 1521 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 1522 | MODULE_LICENSE("GPL v2"); | 1522 | MODULE_LICENSE("GPL v2"); |
| 1523 | MODULE_FIRMWARE(XC2028_DEFAULT_FIRMWARE); | 1523 | MODULE_FIRMWARE(XC2028_DEFAULT_FIRMWARE); |
| 1524 | MODULE_FIRMWARE(XC3028L_DEFAULT_FIRMWARE); | 1524 | MODULE_FIRMWARE(XC3028L_DEFAULT_FIRMWARE); |
diff --git a/drivers/media/tuners/tuner-xc2028.h b/drivers/media/tuners/tuner-xc2028.h index 03fd6d4233a4..7b58bc06e35c 100644 --- a/drivers/media/tuners/tuner-xc2028.h +++ b/drivers/media/tuners/tuner-xc2028.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0 | 2 | * SPDX-License-Identifier: GPL-2.0 |
| 3 | * tuner-xc2028 | 3 | * tuner-xc2028 |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org) | 5 | * Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #ifndef __TUNER_XC2028_H__ | 8 | #ifndef __TUNER_XC2028_H__ |
diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 3c2694a16ed1..d1e66b503f4d 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // | 2 | // |
| 3 | // em28xx-camera.c - driver for Empia EM25xx/27xx/28xx USB video capture devices | 3 | // em28xx-camera.c - driver for Empia EM25xx/27xx/28xx USB video capture devices |
| 4 | // | 4 | // |
| 5 | // Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | // Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com> | 6 | // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 7 | // | 7 | // |
| 8 | // This program is free software; you can redistribute it and/or modify | 8 | // This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 6e0e67d23876..7c3203d7044b 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | // | 5 | // |
| 6 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 6 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 7 | // Markus Rechberger <mrechberger@gmail.com> | 7 | // Markus Rechberger <mrechberger@gmail.com> |
| 8 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 8 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | // Sascha Sommer <saschasommer@freenet.de> | 9 | // Sascha Sommer <saschasommer@freenet.de> |
| 10 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> | 10 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 11 | // | 11 | // |
diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index 36d341fb65dd..f28995383090 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | // | 4 | // |
| 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 6 | // Markus Rechberger <mrechberger@gmail.com> | 6 | // Markus Rechberger <mrechberger@gmail.com> |
| 7 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | // Sascha Sommer <saschasommer@freenet.de> | 8 | // Sascha Sommer <saschasommer@freenet.de> |
| 9 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> | 9 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 10 | // | 10 | // |
| @@ -32,7 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \ | 33 | #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \ |
| 34 | "Markus Rechberger <mrechberger@gmail.com>, " \ | 34 | "Markus Rechberger <mrechberger@gmail.com>, " \ |
| 35 | "Mauro Carvalho Chehab <mchehab@infradead.org>, " \ | 35 | "Mauro Carvalho Chehab <mchehab@kernel.org>, " \ |
| 36 | "Sascha Sommer <saschasommer@freenet.de>" | 36 | "Sascha Sommer <saschasommer@freenet.de>" |
| 37 | 37 | ||
| 38 | MODULE_AUTHOR(DRIVER_AUTHOR); | 38 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index a54cb8dc52c9..3f493e0b0716 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // | 2 | // |
| 3 | // DVB device driver for em28xx | 3 | // DVB device driver for em28xx |
| 4 | // | 4 | // |
| 5 | // (c) 2008-2011 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | // (c) 2008-2011 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | // | 6 | // |
| 7 | // (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com> | 7 | // (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com> |
| 8 | // - Fixes for the driver to properly work with HVR-950 | 8 | // - Fixes for the driver to properly work with HVR-950 |
| @@ -63,7 +63,7 @@ | |||
| 63 | #include "tc90522.h" | 63 | #include "tc90522.h" |
| 64 | #include "qm1d1c0042.h" | 64 | #include "qm1d1c0042.h" |
| 65 | 65 | ||
| 66 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 66 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 67 | MODULE_LICENSE("GPL v2"); | 67 | MODULE_LICENSE("GPL v2"); |
| 68 | MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface"); | 68 | MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface"); |
| 69 | MODULE_VERSION(EM28XX_VERSION); | 69 | MODULE_VERSION(EM28XX_VERSION); |
diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index 9151bccd859a..6458682bc6e2 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | // | 4 | // |
| 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 6 | // Markus Rechberger <mrechberger@gmail.com> | 6 | // Markus Rechberger <mrechberger@gmail.com> |
| 7 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | // Sascha Sommer <saschasommer@freenet.de> | 8 | // Sascha Sommer <saschasommer@freenet.de> |
| 9 | // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com> | 9 | // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 10 | // | 10 | // |
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c index 2dc1be00b8b8..f84a1208d5d3 100644 --- a/drivers/media/usb/em28xx/em28xx-input.c +++ b/drivers/media/usb/em28xx/em28xx-input.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | // | 4 | // |
| 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 6 | // Markus Rechberger <mrechberger@gmail.com> | 6 | // Markus Rechberger <mrechberger@gmail.com> |
| 7 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | // Sascha Sommer <saschasommer@freenet.de> | 8 | // Sascha Sommer <saschasommer@freenet.de> |
| 9 | // | 9 | // |
| 10 | // This program is free software; you can redistribute it and/or modify | 10 | // This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index d70ee13cc52e..68571bf36d28 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | // | 5 | // |
| 6 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 6 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 7 | // Markus Rechberger <mrechberger@gmail.com> | 7 | // Markus Rechberger <mrechberger@gmail.com> |
| 8 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 8 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | // Sascha Sommer <saschasommer@freenet.de> | 9 | // Sascha Sommer <saschasommer@freenet.de> |
| 10 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> | 10 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 11 | // | 11 | // |
| @@ -44,7 +44,7 @@ | |||
| 44 | 44 | ||
| 45 | #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \ | 45 | #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \ |
| 46 | "Markus Rechberger <mrechberger@gmail.com>, " \ | 46 | "Markus Rechberger <mrechberger@gmail.com>, " \ |
| 47 | "Mauro Carvalho Chehab <mchehab@infradead.org>, " \ | 47 | "Mauro Carvalho Chehab <mchehab@kernel.org>, " \ |
| 48 | "Sascha Sommer <saschasommer@freenet.de>" | 48 | "Sascha Sommer <saschasommer@freenet.de>" |
| 49 | 49 | ||
| 50 | static unsigned int isoc_debug; | 50 | static unsigned int isoc_debug; |
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 63c7c6124707..b0378e77ddff 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> | 5 | * Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> |
| 6 | * Ludovico Cavedon <cavedon@sssup.it> | 6 | * Ludovico Cavedon <cavedon@sssup.it> |
| 7 | * Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | * Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | * Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> | 8 | * Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 9 | * | 9 | * |
| 10 | * Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> | 10 | * Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> |
diff --git a/drivers/media/usb/gspca/zc3xx-reg.h b/drivers/media/usb/gspca/zc3xx-reg.h index a1bd94e8ce52..71fda38e85e0 100644 --- a/drivers/media/usb/gspca/zc3xx-reg.h +++ b/drivers/media/usb/gspca/zc3xx-reg.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * zc030x registers | 2 | * zc030x registers |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2008 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | * Copyright (c) 2008 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | * | 5 | * |
| 6 | * The register aliases used here came from this driver: | 6 | * The register aliases used here came from this driver: |
| 7 | * http://zc0302.sourceforge.net/zc0302.php | 7 | * http://zc0302.sourceforge.net/zc0302.php |
diff --git a/drivers/media/usb/tm6000/tm6000-cards.c b/drivers/media/usb/tm6000/tm6000-cards.c index 70939e96b856..23df50aa0a4a 100644 --- a/drivers/media/usb/tm6000/tm6000-cards.c +++ b/drivers/media/usb/tm6000/tm6000-cards.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tm6000-cards.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 2 | // tm6000-cards.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | 5 | ||
| 6 | #include <linux/init.h> | 6 | #include <linux/init.h> |
| 7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
diff --git a/drivers/media/usb/tm6000/tm6000-core.c b/drivers/media/usb/tm6000/tm6000-core.c index 23a1332d98e6..d3229aa45fcb 100644 --- a/drivers/media/usb/tm6000/tm6000-core.c +++ b/drivers/media/usb/tm6000/tm6000-core.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tm6000-core.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 2 | // tm6000-core.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | // | 5 | // |
| 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> | 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> |
| 7 | // - DVB-T support | 7 | // - DVB-T support |
diff --git a/drivers/media/usb/tm6000/tm6000-i2c.c b/drivers/media/usb/tm6000/tm6000-i2c.c index c9a62bbff27a..659b63febf85 100644 --- a/drivers/media/usb/tm6000/tm6000-i2c.c +++ b/drivers/media/usb/tm6000/tm6000-i2c.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tm6000-i2c.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 2 | // tm6000-i2c.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | // | 5 | // |
| 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> | 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> |
| 7 | // - Fix SMBus Read Byte command | 7 | // - Fix SMBus Read Byte command |
diff --git a/drivers/media/usb/tm6000/tm6000-regs.h b/drivers/media/usb/tm6000/tm6000-regs.h index 21587fcf11e3..d10424673db9 100644 --- a/drivers/media/usb/tm6000/tm6000-regs.h +++ b/drivers/media/usb/tm6000/tm6000-regs.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0 | 2 | * SPDX-License-Identifier: GPL-2.0 |
| 3 | * tm6000-regs.h - driver for TM5600/TM6000/TM6010 USB video capture devices | 3 | * tm6000-regs.h - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | /* | 8 | /* |
diff --git a/drivers/media/usb/tm6000/tm6000-usb-isoc.h b/drivers/media/usb/tm6000/tm6000-usb-isoc.h index 5c615b0a7a46..b275dbce3a1b 100644 --- a/drivers/media/usb/tm6000/tm6000-usb-isoc.h +++ b/drivers/media/usb/tm6000/tm6000-usb-isoc.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0 | 2 | * SPDX-License-Identifier: GPL-2.0 |
| 3 | * tm6000-buf.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 3 | * tm6000-buf.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/videodev2.h> | 8 | #include <linux/videodev2.h> |
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index b2399d4266da..aa85fe31c835 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tm6000-video.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 2 | // tm6000-video.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | // | 5 | // |
| 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> | 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> |
| 7 | // - Fixed module load/unload | 7 | // - Fixed module load/unload |
diff --git a/drivers/media/usb/tm6000/tm6000.h b/drivers/media/usb/tm6000/tm6000.h index e1e45770e28d..0864ed7314eb 100644 --- a/drivers/media/usb/tm6000/tm6000.h +++ b/drivers/media/usb/tm6000/tm6000.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0 | 2 | * SPDX-License-Identifier: GPL-2.0 |
| 3 | * tm6000.h - driver for TM5600/TM6000/TM6010 USB video capture devices | 3 | * tm6000.h - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | * | 6 | * |
| 7 | * Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> | 7 | * Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> |
| 8 | * - DVB-T support | 8 | * - DVB-T support |
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 1d0b2208e8fb..c080dcc75393 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
| 11 | * | 11 | * |
| 12 | * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) | 12 | * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) |
| 13 | * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2) | 13 | * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2) |
| 14 | * | 14 | * |
| 15 | * Fixes: 20000516 Claudio Matsuoka <claudio@conectiva.com> | 15 | * Fixes: 20000516 Claudio Matsuoka <claudio@conectiva.com> |
| 16 | * - Added procfs support | 16 | * - Added procfs support |
| @@ -1072,7 +1072,7 @@ static void __exit videodev_exit(void) | |||
| 1072 | subsys_initcall(videodev_init); | 1072 | subsys_initcall(videodev_init); |
| 1073 | module_exit(videodev_exit) | 1073 | module_exit(videodev_exit) |
| 1074 | 1074 | ||
| 1075 | MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab <mchehab@infradead.org>"); | 1075 | MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 1076 | MODULE_DESCRIPTION("Device registrar for Video4Linux drivers v2"); | 1076 | MODULE_DESCRIPTION("Device registrar for Video4Linux drivers v2"); |
| 1077 | MODULE_LICENSE("GPL"); | 1077 | MODULE_LICENSE("GPL"); |
| 1078 | MODULE_ALIAS_CHARDEV_MAJOR(VIDEO_MAJOR); | 1078 | MODULE_ALIAS_CHARDEV_MAJOR(VIDEO_MAJOR); |
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index f48c505550e0..de5d96dbe69e 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
| 10 | * | 10 | * |
| 11 | * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) | 11 | * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) |
| 12 | * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2) | 12 | * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2) |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
diff --git a/drivers/media/v4l2-core/videobuf-core.c b/drivers/media/v4l2-core/videobuf-core.c index 2b3981842b4b..7491b337002c 100644 --- a/drivers/media/v4l2-core/videobuf-core.c +++ b/drivers/media/v4l2-core/videobuf-core.c | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * generic helper functions for handling video4linux capture buffers | 2 | * generic helper functions for handling video4linux capture buffers |
| 3 | * | 3 | * |
| 4 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 4 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 5 | * | 5 | * |
| 6 | * Highly based on video-buf written originally by: | 6 | * Highly based on video-buf written originally by: |
| 7 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> | 7 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> |
| 8 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org> | 8 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 9 | * (c) 2006 Ted Walther and John Sokol | 9 | * (c) 2006 Ted Walther and John Sokol |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
| @@ -38,7 +38,7 @@ static int debug; | |||
| 38 | module_param(debug, int, 0644); | 38 | module_param(debug, int, 0644); |
| 39 | 39 | ||
| 40 | MODULE_DESCRIPTION("helper module to manage video4linux buffers"); | 40 | MODULE_DESCRIPTION("helper module to manage video4linux buffers"); |
| 41 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 41 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 42 | MODULE_LICENSE("GPL"); | 42 | MODULE_LICENSE("GPL"); |
| 43 | 43 | ||
| 44 | #define dprintk(level, fmt, arg...) \ | 44 | #define dprintk(level, fmt, arg...) \ |
diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c index e02353e340dd..f46132504d88 100644 --- a/drivers/media/v4l2-core/videobuf-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf-dma-contig.c | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | * Copyright (c) 2008 Magnus Damm | 7 | * Copyright (c) 2008 Magnus Damm |
| 8 | * | 8 | * |
| 9 | * Based on videobuf-vmalloc.c, | 9 | * Based on videobuf-vmalloc.c, |
| 10 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 10 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 11 | * | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c index add2edb23eac..7770034aae28 100644 --- a/drivers/media/v4l2-core/videobuf-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf-dma-sg.c | |||
| @@ -6,11 +6,11 @@ | |||
| 6 | * into PAGE_SIZE chunks). They also assume the driver does not need | 6 | * into PAGE_SIZE chunks). They also assume the driver does not need |
| 7 | * to touch the video data. | 7 | * to touch the video data. |
| 8 | * | 8 | * |
| 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 10 | * | 10 | * |
| 11 | * Highly based on video-buf written originally by: | 11 | * Highly based on video-buf written originally by: |
| 12 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> | 12 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> |
| 13 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org> | 13 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 14 | * (c) 2006 Ted Walther and John Sokol | 14 | * (c) 2006 Ted Walther and John Sokol |
| 15 | * | 15 | * |
| 16 | * This program is free software; you can redistribute it and/or modify | 16 | * This program is free software; you can redistribute it and/or modify |
| @@ -48,7 +48,7 @@ static int debug; | |||
| 48 | module_param(debug, int, 0644); | 48 | module_param(debug, int, 0644); |
| 49 | 49 | ||
| 50 | MODULE_DESCRIPTION("helper module to manage video4linux dma sg buffers"); | 50 | MODULE_DESCRIPTION("helper module to manage video4linux dma sg buffers"); |
| 51 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 51 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 52 | MODULE_LICENSE("GPL"); | 52 | MODULE_LICENSE("GPL"); |
| 53 | 53 | ||
| 54 | #define dprintk(level, fmt, arg...) \ | 54 | #define dprintk(level, fmt, arg...) \ |
diff --git a/drivers/media/v4l2-core/videobuf-vmalloc.c b/drivers/media/v4l2-core/videobuf-vmalloc.c index 2ff7fcc77b11..45fe781aeeec 100644 --- a/drivers/media/v4l2-core/videobuf-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf-vmalloc.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * into PAGE_SIZE chunks). They also assume the driver does not need | 6 | * into PAGE_SIZE chunks). They also assume the driver does not need |
| 7 | * to touch the video data. | 7 | * to touch the video data. |
| 8 | * | 8 | * |
| 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
| @@ -41,7 +41,7 @@ static int debug; | |||
| 41 | module_param(debug, int, 0644); | 41 | module_param(debug, int, 0644); |
| 42 | 42 | ||
| 43 | MODULE_DESCRIPTION("helper module to manage video4linux vmalloc buffers"); | 43 | MODULE_DESCRIPTION("helper module to manage video4linux vmalloc buffers"); |
| 44 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 44 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 45 | MODULE_LICENSE("GPL"); | 45 | MODULE_LICENSE("GPL"); |
| 46 | 46 | ||
| 47 | #define dprintk(level, fmt, arg...) \ | 47 | #define dprintk(level, fmt, arg...) \ |
diff --git a/drivers/mtd/nand/onenand/omap2.c b/drivers/mtd/nand/onenand/omap2.c index 9c159f0dd9a6..321137158ff3 100644 --- a/drivers/mtd/nand/onenand/omap2.c +++ b/drivers/mtd/nand/onenand/omap2.c | |||
| @@ -375,56 +375,42 @@ static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area, | |||
| 375 | { | 375 | { |
| 376 | struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd); | 376 | struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd); |
| 377 | struct onenand_chip *this = mtd->priv; | 377 | struct onenand_chip *this = mtd->priv; |
| 378 | dma_addr_t dma_src, dma_dst; | 378 | struct device *dev = &c->pdev->dev; |
| 379 | int bram_offset; | ||
| 380 | void *buf = (void *)buffer; | 379 | void *buf = (void *)buffer; |
| 380 | dma_addr_t dma_src, dma_dst; | ||
| 381 | int bram_offset, err; | ||
| 381 | size_t xtra; | 382 | size_t xtra; |
| 382 | int ret; | ||
| 383 | 383 | ||
| 384 | bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset; | 384 | bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset; |
| 385 | if (bram_offset & 3 || (size_t)buf & 3 || count < 384) | 385 | /* |
| 386 | goto out_copy; | 386 | * If the buffer address is not DMA-able, len is not long enough to make |
| 387 | 387 | * DMA transfers profitable or panic_write() may be in an interrupt | |
| 388 | /* panic_write() may be in an interrupt context */ | 388 | * context fallback to PIO mode. |
| 389 | if (in_interrupt() || oops_in_progress) | 389 | */ |
| 390 | if (!virt_addr_valid(buf) || bram_offset & 3 || (size_t)buf & 3 || | ||
| 391 | count < 384 || in_interrupt() || oops_in_progress ) | ||
| 390 | goto out_copy; | 392 | goto out_copy; |
| 391 | 393 | ||
| 392 | if (buf >= high_memory) { | ||
| 393 | struct page *p1; | ||
| 394 | |||
| 395 | if (((size_t)buf & PAGE_MASK) != | ||
| 396 | ((size_t)(buf + count - 1) & PAGE_MASK)) | ||
| 397 | goto out_copy; | ||
| 398 | p1 = vmalloc_to_page(buf); | ||
| 399 | if (!p1) | ||
| 400 | goto out_copy; | ||
| 401 | buf = page_address(p1) + ((size_t)buf & ~PAGE_MASK); | ||
| 402 | } | ||
| 403 | |||
| 404 | xtra = count & 3; | 394 | xtra = count & 3; |
| 405 | if (xtra) { | 395 | if (xtra) { |
| 406 | count -= xtra; | 396 | count -= xtra; |
| 407 | memcpy(buf + count, this->base + bram_offset + count, xtra); | 397 | memcpy(buf + count, this->base + bram_offset + count, xtra); |
| 408 | } | 398 | } |
| 409 | 399 | ||
| 400 | dma_dst = dma_map_single(dev, buf, count, DMA_FROM_DEVICE); | ||
| 410 | dma_src = c->phys_base + bram_offset; | 401 | dma_src = c->phys_base + bram_offset; |
| 411 | dma_dst = dma_map_single(&c->pdev->dev, buf, count, DMA_FROM_DEVICE); | ||
| 412 | if (dma_mapping_error(&c->pdev->dev, dma_dst)) { | ||
| 413 | dev_err(&c->pdev->dev, | ||
| 414 | "Couldn't DMA map a %d byte buffer\n", | ||
| 415 | count); | ||
| 416 | goto out_copy; | ||
| 417 | } | ||
| 418 | 402 | ||
| 419 | ret = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count); | 403 | if (dma_mapping_error(dev, dma_dst)) { |
| 420 | dma_unmap_single(&c->pdev->dev, dma_dst, count, DMA_FROM_DEVICE); | 404 | dev_err(dev, "Couldn't DMA map a %d byte buffer\n", count); |
| 421 | |||
| 422 | if (ret) { | ||
| 423 | dev_err(&c->pdev->dev, "timeout waiting for DMA\n"); | ||
| 424 | goto out_copy; | 405 | goto out_copy; |
| 425 | } | 406 | } |
| 426 | 407 | ||
| 427 | return 0; | 408 | err = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count); |
| 409 | dma_unmap_single(dev, dma_dst, count, DMA_FROM_DEVICE); | ||
| 410 | if (!err) | ||
| 411 | return 0; | ||
| 412 | |||
| 413 | dev_err(dev, "timeout waiting for DMA\n"); | ||
| 428 | 414 | ||
| 429 | out_copy: | 415 | out_copy: |
| 430 | memcpy(buf, this->base + bram_offset, count); | 416 | memcpy(buf, this->base + bram_offset, count); |
| @@ -437,49 +423,34 @@ static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area, | |||
| 437 | { | 423 | { |
| 438 | struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd); | 424 | struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd); |
| 439 | struct onenand_chip *this = mtd->priv; | 425 | struct onenand_chip *this = mtd->priv; |
| 440 | dma_addr_t dma_src, dma_dst; | 426 | struct device *dev = &c->pdev->dev; |
| 441 | int bram_offset; | ||
| 442 | void *buf = (void *)buffer; | 427 | void *buf = (void *)buffer; |
| 443 | int ret; | 428 | dma_addr_t dma_src, dma_dst; |
| 429 | int bram_offset, err; | ||
| 444 | 430 | ||
| 445 | bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset; | 431 | bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset; |
| 446 | if (bram_offset & 3 || (size_t)buf & 3 || count < 384) | 432 | /* |
| 447 | goto out_copy; | 433 | * If the buffer address is not DMA-able, len is not long enough to make |
| 448 | 434 | * DMA transfers profitable or panic_write() may be in an interrupt | |
| 449 | /* panic_write() may be in an interrupt context */ | 435 | * context fallback to PIO mode. |
| 450 | if (in_interrupt() || oops_in_progress) | 436 | */ |
| 437 | if (!virt_addr_valid(buf) || bram_offset & 3 || (size_t)buf & 3 || | ||
| 438 | count < 384 || in_interrupt() || oops_in_progress ) | ||
| 451 | goto out_copy; | 439 | goto out_copy; |
| 452 | 440 | ||
| 453 | if (buf >= high_memory) { | 441 | dma_src = dma_map_single(dev, buf, count, DMA_TO_DEVICE); |
| 454 | struct page *p1; | ||
| 455 | |||
| 456 | if (((size_t)buf & PAGE_MASK) != | ||
| 457 | ((size_t)(buf + count - 1) & PAGE_MASK)) | ||
| 458 | goto out_copy; | ||
| 459 | p1 = vmalloc_to_page(buf); | ||
| 460 | if (!p1) | ||
| 461 | goto out_copy; | ||
| 462 | buf = page_address(p1) + ((size_t)buf & ~PAGE_MASK); | ||
| 463 | } | ||
| 464 | |||
| 465 | dma_src = dma_map_single(&c->pdev->dev, buf, count, DMA_TO_DEVICE); | ||
| 466 | dma_dst = c->phys_base + bram_offset; | 442 | dma_dst = c->phys_base + bram_offset; |
| 467 | if (dma_mapping_error(&c->pdev->dev, dma_src)) { | 443 | if (dma_mapping_error(dev, dma_src)) { |
| 468 | dev_err(&c->pdev->dev, | 444 | dev_err(dev, "Couldn't DMA map a %d byte buffer\n", count); |
| 469 | "Couldn't DMA map a %d byte buffer\n", | ||
| 470 | count); | ||
| 471 | return -1; | ||
| 472 | } | ||
| 473 | |||
| 474 | ret = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count); | ||
| 475 | dma_unmap_single(&c->pdev->dev, dma_src, count, DMA_TO_DEVICE); | ||
| 476 | |||
| 477 | if (ret) { | ||
| 478 | dev_err(&c->pdev->dev, "timeout waiting for DMA\n"); | ||
| 479 | goto out_copy; | 445 | goto out_copy; |
| 480 | } | 446 | } |
| 481 | 447 | ||
| 482 | return 0; | 448 | err = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count); |
| 449 | dma_unmap_page(dev, dma_src, count, DMA_TO_DEVICE); | ||
| 450 | if (!err) | ||
| 451 | return 0; | ||
| 452 | |||
| 453 | dev_err(dev, "timeout waiting for DMA\n"); | ||
| 483 | 454 | ||
| 484 | out_copy: | 455 | out_copy: |
| 485 | memcpy(this->base + bram_offset, buf, count); | 456 | memcpy(this->base + bram_offset, buf, count); |
diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c index 1d779a35ac8e..db5ec4e8bde9 100644 --- a/drivers/mtd/nand/raw/marvell_nand.c +++ b/drivers/mtd/nand/raw/marvell_nand.c | |||
| @@ -1074,7 +1074,7 @@ static int marvell_nfc_hw_ecc_hmg_do_write_page(struct nand_chip *chip, | |||
| 1074 | return ret; | 1074 | return ret; |
| 1075 | 1075 | ||
| 1076 | ret = marvell_nfc_wait_op(chip, | 1076 | ret = marvell_nfc_wait_op(chip, |
| 1077 | chip->data_interface.timings.sdr.tPROG_max); | 1077 | PSEC_TO_MSEC(chip->data_interface.timings.sdr.tPROG_max)); |
| 1078 | return ret; | 1078 | return ret; |
| 1079 | } | 1079 | } |
| 1080 | 1080 | ||
| @@ -1408,6 +1408,7 @@ marvell_nfc_hw_ecc_bch_write_chunk(struct nand_chip *chip, int chunk, | |||
| 1408 | struct marvell_nand_chip *marvell_nand = to_marvell_nand(chip); | 1408 | struct marvell_nand_chip *marvell_nand = to_marvell_nand(chip); |
| 1409 | struct marvell_nfc *nfc = to_marvell_nfc(chip->controller); | 1409 | struct marvell_nfc *nfc = to_marvell_nfc(chip->controller); |
| 1410 | const struct marvell_hw_ecc_layout *lt = to_marvell_nand(chip)->layout; | 1410 | const struct marvell_hw_ecc_layout *lt = to_marvell_nand(chip)->layout; |
| 1411 | u32 xtype; | ||
| 1411 | int ret; | 1412 | int ret; |
| 1412 | struct marvell_nfc_op nfc_op = { | 1413 | struct marvell_nfc_op nfc_op = { |
| 1413 | .ndcb[0] = NDCB0_CMD_TYPE(TYPE_WRITE) | NDCB0_LEN_OVRD, | 1414 | .ndcb[0] = NDCB0_CMD_TYPE(TYPE_WRITE) | NDCB0_LEN_OVRD, |
| @@ -1423,7 +1424,12 @@ marvell_nfc_hw_ecc_bch_write_chunk(struct nand_chip *chip, int chunk, | |||
| 1423 | * last naked write. | 1424 | * last naked write. |
| 1424 | */ | 1425 | */ |
| 1425 | if (chunk == 0) { | 1426 | if (chunk == 0) { |
| 1426 | nfc_op.ndcb[0] |= NDCB0_CMD_XTYPE(XTYPE_WRITE_DISPATCH) | | 1427 | if (lt->nchunks == 1) |
| 1428 | xtype = XTYPE_MONOLITHIC_RW; | ||
| 1429 | else | ||
| 1430 | xtype = XTYPE_WRITE_DISPATCH; | ||
| 1431 | |||
| 1432 | nfc_op.ndcb[0] |= NDCB0_CMD_XTYPE(xtype) | | ||
| 1427 | NDCB0_ADDR_CYC(marvell_nand->addr_cyc) | | 1433 | NDCB0_ADDR_CYC(marvell_nand->addr_cyc) | |
| 1428 | NDCB0_CMD1(NAND_CMD_SEQIN); | 1434 | NDCB0_CMD1(NAND_CMD_SEQIN); |
| 1429 | nfc_op.ndcb[1] |= NDCB1_ADDRS_PAGE(page); | 1435 | nfc_op.ndcb[1] |= NDCB1_ADDRS_PAGE(page); |
| @@ -1494,7 +1500,7 @@ static int marvell_nfc_hw_ecc_bch_write_page(struct mtd_info *mtd, | |||
| 1494 | } | 1500 | } |
| 1495 | 1501 | ||
| 1496 | ret = marvell_nfc_wait_op(chip, | 1502 | ret = marvell_nfc_wait_op(chip, |
| 1497 | chip->data_interface.timings.sdr.tPROG_max); | 1503 | PSEC_TO_MSEC(chip->data_interface.timings.sdr.tPROG_max)); |
| 1498 | 1504 | ||
| 1499 | marvell_nfc_disable_hw_ecc(chip); | 1505 | marvell_nfc_disable_hw_ecc(chip); |
| 1500 | 1506 | ||
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 72f3a89da513..f28c3a555861 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c | |||
| @@ -706,12 +706,17 @@ static void nand_wait_status_ready(struct mtd_info *mtd, unsigned long timeo) | |||
| 706 | */ | 706 | */ |
| 707 | int nand_soft_waitrdy(struct nand_chip *chip, unsigned long timeout_ms) | 707 | int nand_soft_waitrdy(struct nand_chip *chip, unsigned long timeout_ms) |
| 708 | { | 708 | { |
| 709 | const struct nand_sdr_timings *timings; | ||
| 709 | u8 status = 0; | 710 | u8 status = 0; |
| 710 | int ret; | 711 | int ret; |
| 711 | 712 | ||
| 712 | if (!chip->exec_op) | 713 | if (!chip->exec_op) |
| 713 | return -ENOTSUPP; | 714 | return -ENOTSUPP; |
| 714 | 715 | ||
| 716 | /* Wait tWB before polling the STATUS reg. */ | ||
| 717 | timings = nand_get_sdr_timings(&chip->data_interface); | ||
| 718 | ndelay(PSEC_TO_NSEC(timings->tWB_max)); | ||
| 719 | |||
| 715 | ret = nand_status_op(chip, NULL); | 720 | ret = nand_status_op(chip, NULL); |
| 716 | if (ret) | 721 | if (ret) |
| 717 | return ret; | 722 | return ret; |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 1ed9529e7bd1..5eb0df2e5464 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
| @@ -450,7 +450,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
| 450 | { | 450 | { |
| 451 | int i; | 451 | int i; |
| 452 | 452 | ||
| 453 | if (!client_info->slave) | 453 | if (!client_info->slave || !is_valid_ether_addr(client_info->mac_dst)) |
| 454 | return; | 454 | return; |
| 455 | 455 | ||
| 456 | for (i = 0; i < RLB_ARP_BURST_SIZE; i++) { | 456 | for (i = 0; i < RLB_ARP_BURST_SIZE; i++) { |
| @@ -943,6 +943,10 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], | |||
| 943 | skb->priority = TC_PRIO_CONTROL; | 943 | skb->priority = TC_PRIO_CONTROL; |
| 944 | skb->dev = slave->dev; | 944 | skb->dev = slave->dev; |
| 945 | 945 | ||
| 946 | netdev_dbg(slave->bond->dev, | ||
| 947 | "Send learning packet: dev %s mac %pM vlan %d\n", | ||
| 948 | slave->dev->name, mac_addr, vid); | ||
| 949 | |||
| 946 | if (vid) | 950 | if (vid) |
| 947 | __vlan_hwaccel_put_tag(skb, vlan_proto, vid); | 951 | __vlan_hwaccel_put_tag(skb, vlan_proto, vid); |
| 948 | 952 | ||
| @@ -965,14 +969,13 @@ static int alb_upper_dev_walk(struct net_device *upper, void *_data) | |||
| 965 | u8 *mac_addr = data->mac_addr; | 969 | u8 *mac_addr = data->mac_addr; |
| 966 | struct bond_vlan_tag *tags; | 970 | struct bond_vlan_tag *tags; |
| 967 | 971 | ||
| 968 | if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0) { | 972 | if (is_vlan_dev(upper) && |
| 969 | if (strict_match && | 973 | bond->nest_level == vlan_get_encap_level(upper) - 1) { |
| 970 | ether_addr_equal_64bits(mac_addr, | 974 | if (upper->addr_assign_type == NET_ADDR_STOLEN) { |
| 971 | upper->dev_addr)) { | ||
| 972 | alb_send_lp_vid(slave, mac_addr, | 975 | alb_send_lp_vid(slave, mac_addr, |
| 973 | vlan_dev_vlan_proto(upper), | 976 | vlan_dev_vlan_proto(upper), |
| 974 | vlan_dev_vlan_id(upper)); | 977 | vlan_dev_vlan_id(upper)); |
| 975 | } else if (!strict_match) { | 978 | } else { |
| 976 | alb_send_lp_vid(slave, upper->dev_addr, | 979 | alb_send_lp_vid(slave, upper->dev_addr, |
| 977 | vlan_dev_vlan_proto(upper), | 980 | vlan_dev_vlan_proto(upper), |
| 978 | vlan_dev_vlan_id(upper)); | 981 | vlan_dev_vlan_id(upper)); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 718e4914e3a0..1f1e97b26f95 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -1738,6 +1738,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, | |||
| 1738 | if (bond_mode_uses_xmit_hash(bond)) | 1738 | if (bond_mode_uses_xmit_hash(bond)) |
| 1739 | bond_update_slave_arr(bond, NULL); | 1739 | bond_update_slave_arr(bond, NULL); |
| 1740 | 1740 | ||
| 1741 | bond->nest_level = dev_get_nest_level(bond_dev); | ||
| 1742 | |||
| 1741 | netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n", | 1743 | netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n", |
| 1742 | slave_dev->name, | 1744 | slave_dev->name, |
| 1743 | bond_is_active_slave(new_slave) ? "an active" : "a backup", | 1745 | bond_is_active_slave(new_slave) ? "an active" : "a backup", |
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index b1779566c5bb..3c71f1cb205f 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
| @@ -605,7 +605,7 @@ void can_bus_off(struct net_device *dev) | |||
| 605 | { | 605 | { |
| 606 | struct can_priv *priv = netdev_priv(dev); | 606 | struct can_priv *priv = netdev_priv(dev); |
| 607 | 607 | ||
| 608 | netdev_dbg(dev, "bus-off\n"); | 608 | netdev_info(dev, "bus-off\n"); |
| 609 | 609 | ||
| 610 | netif_carrier_off(dev); | 610 | netif_carrier_off(dev); |
| 611 | 611 | ||
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 634c51e6b8ae..d53a45bf2a72 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
| @@ -200,6 +200,7 @@ | |||
| 200 | #define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disable Memory error detection */ | 200 | #define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disable Memory error detection */ |
| 201 | #define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5) /* Use timestamp based offloading */ | 201 | #define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5) /* Use timestamp based offloading */ |
| 202 | #define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6) /* No interrupt for error passive */ | 202 | #define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6) /* No interrupt for error passive */ |
| 203 | #define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7) /* default to BE register access */ | ||
| 203 | 204 | ||
| 204 | /* Structure of the message buffer */ | 205 | /* Structure of the message buffer */ |
| 205 | struct flexcan_mb { | 206 | struct flexcan_mb { |
| @@ -288,6 +289,12 @@ struct flexcan_priv { | |||
| 288 | 289 | ||
| 289 | static const struct flexcan_devtype_data fsl_p1010_devtype_data = { | 290 | static const struct flexcan_devtype_data fsl_p1010_devtype_data = { |
| 290 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | | 291 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | |
| 292 | FLEXCAN_QUIRK_BROKEN_PERR_STATE | | ||
| 293 | FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN, | ||
| 294 | }; | ||
| 295 | |||
| 296 | static const struct flexcan_devtype_data fsl_imx25_devtype_data = { | ||
| 297 | .quirks = FLEXCAN_QUIRK_BROKEN_WERR_STATE | | ||
| 291 | FLEXCAN_QUIRK_BROKEN_PERR_STATE, | 298 | FLEXCAN_QUIRK_BROKEN_PERR_STATE, |
| 292 | }; | 299 | }; |
| 293 | 300 | ||
| @@ -1251,9 +1258,9 @@ static void unregister_flexcandev(struct net_device *dev) | |||
| 1251 | static const struct of_device_id flexcan_of_match[] = { | 1258 | static const struct of_device_id flexcan_of_match[] = { |
| 1252 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, | 1259 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, |
| 1253 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, | 1260 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, |
| 1254 | { .compatible = "fsl,imx53-flexcan", .data = &fsl_p1010_devtype_data, }, | 1261 | { .compatible = "fsl,imx53-flexcan", .data = &fsl_imx25_devtype_data, }, |
| 1255 | { .compatible = "fsl,imx35-flexcan", .data = &fsl_p1010_devtype_data, }, | 1262 | { .compatible = "fsl,imx35-flexcan", .data = &fsl_imx25_devtype_data, }, |
| 1256 | { .compatible = "fsl,imx25-flexcan", .data = &fsl_p1010_devtype_data, }, | 1263 | { .compatible = "fsl,imx25-flexcan", .data = &fsl_imx25_devtype_data, }, |
| 1257 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, | 1264 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, |
| 1258 | { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, | 1265 | { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, |
| 1259 | { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, | 1266 | { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, |
| @@ -1337,18 +1344,13 @@ static int flexcan_probe(struct platform_device *pdev) | |||
| 1337 | 1344 | ||
| 1338 | priv = netdev_priv(dev); | 1345 | priv = netdev_priv(dev); |
| 1339 | 1346 | ||
| 1340 | if (of_property_read_bool(pdev->dev.of_node, "big-endian")) { | 1347 | if (of_property_read_bool(pdev->dev.of_node, "big-endian") || |
| 1348 | devtype_data->quirks & FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN) { | ||
| 1341 | priv->read = flexcan_read_be; | 1349 | priv->read = flexcan_read_be; |
| 1342 | priv->write = flexcan_write_be; | 1350 | priv->write = flexcan_write_be; |
| 1343 | } else { | 1351 | } else { |
| 1344 | if (of_device_is_compatible(pdev->dev.of_node, | 1352 | priv->read = flexcan_read_le; |
| 1345 | "fsl,p1010-flexcan")) { | 1353 | priv->write = flexcan_write_le; |
| 1346 | priv->read = flexcan_read_be; | ||
| 1347 | priv->write = flexcan_write_be; | ||
| 1348 | } else { | ||
| 1349 | priv->read = flexcan_read_le; | ||
| 1350 | priv->write = flexcan_write_le; | ||
| 1351 | } | ||
| 1352 | } | 1354 | } |
| 1353 | 1355 | ||
| 1354 | priv->can.clock.freq = clock_freq; | 1356 | priv->can.clock.freq = clock_freq; |
diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c index 5590c559a8ca..53e320c92a8b 100644 --- a/drivers/net/can/spi/hi311x.c +++ b/drivers/net/can/spi/hi311x.c | |||
| @@ -91,6 +91,7 @@ | |||
| 91 | #define HI3110_STAT_BUSOFF BIT(2) | 91 | #define HI3110_STAT_BUSOFF BIT(2) |
| 92 | #define HI3110_STAT_ERRP BIT(3) | 92 | #define HI3110_STAT_ERRP BIT(3) |
| 93 | #define HI3110_STAT_ERRW BIT(4) | 93 | #define HI3110_STAT_ERRW BIT(4) |
| 94 | #define HI3110_STAT_TXMTY BIT(7) | ||
| 94 | 95 | ||
| 95 | #define HI3110_BTR0_SJW_SHIFT 6 | 96 | #define HI3110_BTR0_SJW_SHIFT 6 |
| 96 | #define HI3110_BTR0_BRP_SHIFT 0 | 97 | #define HI3110_BTR0_BRP_SHIFT 0 |
| @@ -427,8 +428,10 @@ static int hi3110_get_berr_counter(const struct net_device *net, | |||
| 427 | struct hi3110_priv *priv = netdev_priv(net); | 428 | struct hi3110_priv *priv = netdev_priv(net); |
| 428 | struct spi_device *spi = priv->spi; | 429 | struct spi_device *spi = priv->spi; |
| 429 | 430 | ||
| 431 | mutex_lock(&priv->hi3110_lock); | ||
| 430 | bec->txerr = hi3110_read(spi, HI3110_READ_TEC); | 432 | bec->txerr = hi3110_read(spi, HI3110_READ_TEC); |
| 431 | bec->rxerr = hi3110_read(spi, HI3110_READ_REC); | 433 | bec->rxerr = hi3110_read(spi, HI3110_READ_REC); |
| 434 | mutex_unlock(&priv->hi3110_lock); | ||
| 432 | 435 | ||
| 433 | return 0; | 436 | return 0; |
| 434 | } | 437 | } |
| @@ -735,10 +738,7 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) | |||
| 735 | } | 738 | } |
| 736 | } | 739 | } |
| 737 | 740 | ||
| 738 | if (intf == 0) | 741 | if (priv->tx_len && statf & HI3110_STAT_TXMTY) { |
| 739 | break; | ||
| 740 | |||
| 741 | if (intf & HI3110_INT_TXCPLT) { | ||
| 742 | net->stats.tx_packets++; | 742 | net->stats.tx_packets++; |
| 743 | net->stats.tx_bytes += priv->tx_len - 1; | 743 | net->stats.tx_bytes += priv->tx_len - 1; |
| 744 | can_led_event(net, CAN_LED_EVENT_TX); | 744 | can_led_event(net, CAN_LED_EVENT_TX); |
| @@ -748,6 +748,9 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) | |||
| 748 | } | 748 | } |
| 749 | netif_wake_queue(net); | 749 | netif_wake_queue(net); |
| 750 | } | 750 | } |
| 751 | |||
| 752 | if (intf == 0) | ||
| 753 | break; | ||
| 751 | } | 754 | } |
| 752 | mutex_unlock(&priv->hi3110_lock); | 755 | mutex_unlock(&priv->hi3110_lock); |
| 753 | return IRQ_HANDLED; | 756 | return IRQ_HANDLED; |
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index 63587b8e6825..daed57d3d209 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c | |||
| @@ -1179,7 +1179,7 @@ static void kvaser_usb_rx_can_msg(const struct kvaser_usb *dev, | |||
| 1179 | 1179 | ||
| 1180 | skb = alloc_can_skb(priv->netdev, &cf); | 1180 | skb = alloc_can_skb(priv->netdev, &cf); |
| 1181 | if (!skb) { | 1181 | if (!skb) { |
| 1182 | stats->tx_dropped++; | 1182 | stats->rx_dropped++; |
| 1183 | return; | 1183 | return; |
| 1184 | } | 1184 | } |
| 1185 | 1185 | ||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 3d2091099f7f..5b4374f21d76 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c | |||
| @@ -3370,6 +3370,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3370 | .num_internal_phys = 5, | 3370 | .num_internal_phys = 5, |
| 3371 | .max_vid = 4095, | 3371 | .max_vid = 4095, |
| 3372 | .port_base_addr = 0x10, | 3372 | .port_base_addr = 0x10, |
| 3373 | .phy_base_addr = 0x0, | ||
| 3373 | .global1_addr = 0x1b, | 3374 | .global1_addr = 0x1b, |
| 3374 | .global2_addr = 0x1c, | 3375 | .global2_addr = 0x1c, |
| 3375 | .age_time_coeff = 15000, | 3376 | .age_time_coeff = 15000, |
| @@ -3391,6 +3392,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3391 | .num_internal_phys = 0, | 3392 | .num_internal_phys = 0, |
| 3392 | .max_vid = 4095, | 3393 | .max_vid = 4095, |
| 3393 | .port_base_addr = 0x10, | 3394 | .port_base_addr = 0x10, |
| 3395 | .phy_base_addr = 0x0, | ||
| 3394 | .global1_addr = 0x1b, | 3396 | .global1_addr = 0x1b, |
| 3395 | .global2_addr = 0x1c, | 3397 | .global2_addr = 0x1c, |
| 3396 | .age_time_coeff = 15000, | 3398 | .age_time_coeff = 15000, |
| @@ -3410,6 +3412,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3410 | .num_internal_phys = 8, | 3412 | .num_internal_phys = 8, |
| 3411 | .max_vid = 4095, | 3413 | .max_vid = 4095, |
| 3412 | .port_base_addr = 0x10, | 3414 | .port_base_addr = 0x10, |
| 3415 | .phy_base_addr = 0x0, | ||
| 3413 | .global1_addr = 0x1b, | 3416 | .global1_addr = 0x1b, |
| 3414 | .global2_addr = 0x1c, | 3417 | .global2_addr = 0x1c, |
| 3415 | .age_time_coeff = 15000, | 3418 | .age_time_coeff = 15000, |
| @@ -3431,6 +3434,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3431 | .num_internal_phys = 5, | 3434 | .num_internal_phys = 5, |
| 3432 | .max_vid = 4095, | 3435 | .max_vid = 4095, |
| 3433 | .port_base_addr = 0x10, | 3436 | .port_base_addr = 0x10, |
| 3437 | .phy_base_addr = 0x0, | ||
| 3434 | .global1_addr = 0x1b, | 3438 | .global1_addr = 0x1b, |
| 3435 | .global2_addr = 0x1c, | 3439 | .global2_addr = 0x1c, |
| 3436 | .age_time_coeff = 15000, | 3440 | .age_time_coeff = 15000, |
| @@ -3452,6 +3456,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3452 | .num_internal_phys = 0, | 3456 | .num_internal_phys = 0, |
| 3453 | .max_vid = 4095, | 3457 | .max_vid = 4095, |
| 3454 | .port_base_addr = 0x10, | 3458 | .port_base_addr = 0x10, |
| 3459 | .phy_base_addr = 0x0, | ||
| 3455 | .global1_addr = 0x1b, | 3460 | .global1_addr = 0x1b, |
| 3456 | .global2_addr = 0x1c, | 3461 | .global2_addr = 0x1c, |
| 3457 | .age_time_coeff = 15000, | 3462 | .age_time_coeff = 15000, |
| @@ -3472,6 +3477,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3472 | .num_gpio = 11, | 3477 | .num_gpio = 11, |
| 3473 | .max_vid = 4095, | 3478 | .max_vid = 4095, |
| 3474 | .port_base_addr = 0x10, | 3479 | .port_base_addr = 0x10, |
| 3480 | .phy_base_addr = 0x10, | ||
| 3475 | .global1_addr = 0x1b, | 3481 | .global1_addr = 0x1b, |
| 3476 | .global2_addr = 0x1c, | 3482 | .global2_addr = 0x1c, |
| 3477 | .age_time_coeff = 3750, | 3483 | .age_time_coeff = 3750, |
| @@ -3493,6 +3499,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3493 | .num_internal_phys = 5, | 3499 | .num_internal_phys = 5, |
| 3494 | .max_vid = 4095, | 3500 | .max_vid = 4095, |
| 3495 | .port_base_addr = 0x10, | 3501 | .port_base_addr = 0x10, |
| 3502 | .phy_base_addr = 0x0, | ||
| 3496 | .global1_addr = 0x1b, | 3503 | .global1_addr = 0x1b, |
| 3497 | .global2_addr = 0x1c, | 3504 | .global2_addr = 0x1c, |
| 3498 | .age_time_coeff = 15000, | 3505 | .age_time_coeff = 15000, |
| @@ -3514,6 +3521,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3514 | .num_internal_phys = 0, | 3521 | .num_internal_phys = 0, |
| 3515 | .max_vid = 4095, | 3522 | .max_vid = 4095, |
| 3516 | .port_base_addr = 0x10, | 3523 | .port_base_addr = 0x10, |
| 3524 | .phy_base_addr = 0x0, | ||
| 3517 | .global1_addr = 0x1b, | 3525 | .global1_addr = 0x1b, |
| 3518 | .global2_addr = 0x1c, | 3526 | .global2_addr = 0x1c, |
| 3519 | .age_time_coeff = 15000, | 3527 | .age_time_coeff = 15000, |
| @@ -3535,6 +3543,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3535 | .num_internal_phys = 5, | 3543 | .num_internal_phys = 5, |
| 3536 | .max_vid = 4095, | 3544 | .max_vid = 4095, |
| 3537 | .port_base_addr = 0x10, | 3545 | .port_base_addr = 0x10, |
| 3546 | .phy_base_addr = 0x0, | ||
| 3538 | .global1_addr = 0x1b, | 3547 | .global1_addr = 0x1b, |
| 3539 | .global2_addr = 0x1c, | 3548 | .global2_addr = 0x1c, |
| 3540 | .age_time_coeff = 15000, | 3549 | .age_time_coeff = 15000, |
| @@ -3557,6 +3566,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3557 | .num_gpio = 15, | 3566 | .num_gpio = 15, |
| 3558 | .max_vid = 4095, | 3567 | .max_vid = 4095, |
| 3559 | .port_base_addr = 0x10, | 3568 | .port_base_addr = 0x10, |
| 3569 | .phy_base_addr = 0x0, | ||
| 3560 | .global1_addr = 0x1b, | 3570 | .global1_addr = 0x1b, |
| 3561 | .global2_addr = 0x1c, | 3571 | .global2_addr = 0x1c, |
| 3562 | .age_time_coeff = 15000, | 3572 | .age_time_coeff = 15000, |
| @@ -3578,6 +3588,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3578 | .num_internal_phys = 5, | 3588 | .num_internal_phys = 5, |
| 3579 | .max_vid = 4095, | 3589 | .max_vid = 4095, |
| 3580 | .port_base_addr = 0x10, | 3590 | .port_base_addr = 0x10, |
| 3591 | .phy_base_addr = 0x0, | ||
| 3581 | .global1_addr = 0x1b, | 3592 | .global1_addr = 0x1b, |
| 3582 | .global2_addr = 0x1c, | 3593 | .global2_addr = 0x1c, |
| 3583 | .age_time_coeff = 15000, | 3594 | .age_time_coeff = 15000, |
| @@ -3600,6 +3611,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3600 | .num_gpio = 15, | 3611 | .num_gpio = 15, |
| 3601 | .max_vid = 4095, | 3612 | .max_vid = 4095, |
| 3602 | .port_base_addr = 0x10, | 3613 | .port_base_addr = 0x10, |
| 3614 | .phy_base_addr = 0x0, | ||
| 3603 | .global1_addr = 0x1b, | 3615 | .global1_addr = 0x1b, |
| 3604 | .global2_addr = 0x1c, | 3616 | .global2_addr = 0x1c, |
| 3605 | .age_time_coeff = 15000, | 3617 | .age_time_coeff = 15000, |
| @@ -3621,6 +3633,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3621 | .num_internal_phys = 0, | 3633 | .num_internal_phys = 0, |
| 3622 | .max_vid = 4095, | 3634 | .max_vid = 4095, |
| 3623 | .port_base_addr = 0x10, | 3635 | .port_base_addr = 0x10, |
| 3636 | .phy_base_addr = 0x0, | ||
| 3624 | .global1_addr = 0x1b, | 3637 | .global1_addr = 0x1b, |
| 3625 | .global2_addr = 0x1c, | 3638 | .global2_addr = 0x1c, |
| 3626 | .age_time_coeff = 15000, | 3639 | .age_time_coeff = 15000, |
| @@ -3641,6 +3654,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3641 | .num_gpio = 16, | 3654 | .num_gpio = 16, |
| 3642 | .max_vid = 8191, | 3655 | .max_vid = 8191, |
| 3643 | .port_base_addr = 0x0, | 3656 | .port_base_addr = 0x0, |
| 3657 | .phy_base_addr = 0x0, | ||
| 3644 | .global1_addr = 0x1b, | 3658 | .global1_addr = 0x1b, |
| 3645 | .global2_addr = 0x1c, | 3659 | .global2_addr = 0x1c, |
| 3646 | .tag_protocol = DSA_TAG_PROTO_DSA, | 3660 | .tag_protocol = DSA_TAG_PROTO_DSA, |
| @@ -3663,6 +3677,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3663 | .num_gpio = 16, | 3677 | .num_gpio = 16, |
| 3664 | .max_vid = 8191, | 3678 | .max_vid = 8191, |
| 3665 | .port_base_addr = 0x0, | 3679 | .port_base_addr = 0x0, |
| 3680 | .phy_base_addr = 0x0, | ||
| 3666 | .global1_addr = 0x1b, | 3681 | .global1_addr = 0x1b, |
| 3667 | .global2_addr = 0x1c, | 3682 | .global2_addr = 0x1c, |
| 3668 | .age_time_coeff = 3750, | 3683 | .age_time_coeff = 3750, |
| @@ -3684,6 +3699,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3684 | .num_internal_phys = 11, | 3699 | .num_internal_phys = 11, |
| 3685 | .max_vid = 8191, | 3700 | .max_vid = 8191, |
| 3686 | .port_base_addr = 0x0, | 3701 | .port_base_addr = 0x0, |
| 3702 | .phy_base_addr = 0x0, | ||
| 3687 | .global1_addr = 0x1b, | 3703 | .global1_addr = 0x1b, |
| 3688 | .global2_addr = 0x1c, | 3704 | .global2_addr = 0x1c, |
| 3689 | .age_time_coeff = 3750, | 3705 | .age_time_coeff = 3750, |
| @@ -3707,6 +3723,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3707 | .num_gpio = 15, | 3723 | .num_gpio = 15, |
| 3708 | .max_vid = 4095, | 3724 | .max_vid = 4095, |
| 3709 | .port_base_addr = 0x10, | 3725 | .port_base_addr = 0x10, |
| 3726 | .phy_base_addr = 0x0, | ||
| 3710 | .global1_addr = 0x1b, | 3727 | .global1_addr = 0x1b, |
| 3711 | .global2_addr = 0x1c, | 3728 | .global2_addr = 0x1c, |
| 3712 | .age_time_coeff = 15000, | 3729 | .age_time_coeff = 15000, |
| @@ -3730,6 +3747,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3730 | .num_gpio = 16, | 3747 | .num_gpio = 16, |
| 3731 | .max_vid = 8191, | 3748 | .max_vid = 8191, |
| 3732 | .port_base_addr = 0x0, | 3749 | .port_base_addr = 0x0, |
| 3750 | .phy_base_addr = 0x0, | ||
| 3733 | .global1_addr = 0x1b, | 3751 | .global1_addr = 0x1b, |
| 3734 | .global2_addr = 0x1c, | 3752 | .global2_addr = 0x1c, |
| 3735 | .age_time_coeff = 3750, | 3753 | .age_time_coeff = 3750, |
| @@ -3753,6 +3771,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3753 | .num_gpio = 15, | 3771 | .num_gpio = 15, |
| 3754 | .max_vid = 4095, | 3772 | .max_vid = 4095, |
| 3755 | .port_base_addr = 0x10, | 3773 | .port_base_addr = 0x10, |
| 3774 | .phy_base_addr = 0x0, | ||
| 3756 | .global1_addr = 0x1b, | 3775 | .global1_addr = 0x1b, |
| 3757 | .global2_addr = 0x1c, | 3776 | .global2_addr = 0x1c, |
| 3758 | .age_time_coeff = 15000, | 3777 | .age_time_coeff = 15000, |
| @@ -3776,6 +3795,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3776 | .num_gpio = 15, | 3795 | .num_gpio = 15, |
| 3777 | .max_vid = 4095, | 3796 | .max_vid = 4095, |
| 3778 | .port_base_addr = 0x10, | 3797 | .port_base_addr = 0x10, |
| 3798 | .phy_base_addr = 0x0, | ||
| 3779 | .global1_addr = 0x1b, | 3799 | .global1_addr = 0x1b, |
| 3780 | .global2_addr = 0x1c, | 3800 | .global2_addr = 0x1c, |
| 3781 | .age_time_coeff = 15000, | 3801 | .age_time_coeff = 15000, |
| @@ -3798,6 +3818,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3798 | .num_gpio = 11, | 3818 | .num_gpio = 11, |
| 3799 | .max_vid = 4095, | 3819 | .max_vid = 4095, |
| 3800 | .port_base_addr = 0x10, | 3820 | .port_base_addr = 0x10, |
| 3821 | .phy_base_addr = 0x10, | ||
| 3801 | .global1_addr = 0x1b, | 3822 | .global1_addr = 0x1b, |
| 3802 | .global2_addr = 0x1c, | 3823 | .global2_addr = 0x1c, |
| 3803 | .age_time_coeff = 3750, | 3824 | .age_time_coeff = 3750, |
| @@ -3820,6 +3841,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3820 | .num_internal_phys = 5, | 3841 | .num_internal_phys = 5, |
| 3821 | .max_vid = 4095, | 3842 | .max_vid = 4095, |
| 3822 | .port_base_addr = 0x10, | 3843 | .port_base_addr = 0x10, |
| 3844 | .phy_base_addr = 0x0, | ||
| 3823 | .global1_addr = 0x1b, | 3845 | .global1_addr = 0x1b, |
| 3824 | .global2_addr = 0x1c, | 3846 | .global2_addr = 0x1c, |
| 3825 | .age_time_coeff = 15000, | 3847 | .age_time_coeff = 15000, |
| @@ -3841,6 +3863,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3841 | .num_internal_phys = 5, | 3863 | .num_internal_phys = 5, |
| 3842 | .max_vid = 4095, | 3864 | .max_vid = 4095, |
| 3843 | .port_base_addr = 0x10, | 3865 | .port_base_addr = 0x10, |
| 3866 | .phy_base_addr = 0x0, | ||
| 3844 | .global1_addr = 0x1b, | 3867 | .global1_addr = 0x1b, |
| 3845 | .global2_addr = 0x1c, | 3868 | .global2_addr = 0x1c, |
| 3846 | .age_time_coeff = 15000, | 3869 | .age_time_coeff = 15000, |
| @@ -3863,6 +3886,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3863 | .num_gpio = 15, | 3886 | .num_gpio = 15, |
| 3864 | .max_vid = 4095, | 3887 | .max_vid = 4095, |
| 3865 | .port_base_addr = 0x10, | 3888 | .port_base_addr = 0x10, |
| 3889 | .phy_base_addr = 0x0, | ||
| 3866 | .global1_addr = 0x1b, | 3890 | .global1_addr = 0x1b, |
| 3867 | .global2_addr = 0x1c, | 3891 | .global2_addr = 0x1c, |
| 3868 | .age_time_coeff = 15000, | 3892 | .age_time_coeff = 15000, |
| @@ -3885,6 +3909,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3885 | .num_gpio = 16, | 3909 | .num_gpio = 16, |
| 3886 | .max_vid = 8191, | 3910 | .max_vid = 8191, |
| 3887 | .port_base_addr = 0x0, | 3911 | .port_base_addr = 0x0, |
| 3912 | .phy_base_addr = 0x0, | ||
| 3888 | .global1_addr = 0x1b, | 3913 | .global1_addr = 0x1b, |
| 3889 | .global2_addr = 0x1c, | 3914 | .global2_addr = 0x1c, |
| 3890 | .age_time_coeff = 3750, | 3915 | .age_time_coeff = 3750, |
| @@ -3907,6 +3932,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { | |||
| 3907 | .num_gpio = 16, | 3932 | .num_gpio = 16, |
| 3908 | .max_vid = 8191, | 3933 | .max_vid = 8191, |
| 3909 | .port_base_addr = 0x0, | 3934 | .port_base_addr = 0x0, |
| 3935 | .phy_base_addr = 0x0, | ||
| 3910 | .global1_addr = 0x1b, | 3936 | .global1_addr = 0x1b, |
| 3911 | .global2_addr = 0x1c, | 3937 | .global2_addr = 0x1c, |
| 3912 | .age_time_coeff = 3750, | 3938 | .age_time_coeff = 3750, |
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index 80490f66bc06..12b7f4649b25 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h | |||
| @@ -114,6 +114,7 @@ struct mv88e6xxx_info { | |||
| 114 | unsigned int num_gpio; | 114 | unsigned int num_gpio; |
| 115 | unsigned int max_vid; | 115 | unsigned int max_vid; |
| 116 | unsigned int port_base_addr; | 116 | unsigned int port_base_addr; |
| 117 | unsigned int phy_base_addr; | ||
| 117 | unsigned int global1_addr; | 118 | unsigned int global1_addr; |
| 118 | unsigned int global2_addr; | 119 | unsigned int global2_addr; |
| 119 | unsigned int age_time_coeff; | 120 | unsigned int age_time_coeff; |
diff --git a/drivers/net/dsa/mv88e6xxx/global2.c b/drivers/net/dsa/mv88e6xxx/global2.c index 0ce627fded48..8d22d66d84b7 100644 --- a/drivers/net/dsa/mv88e6xxx/global2.c +++ b/drivers/net/dsa/mv88e6xxx/global2.c | |||
| @@ -1118,7 +1118,7 @@ int mv88e6xxx_g2_irq_mdio_setup(struct mv88e6xxx_chip *chip, | |||
| 1118 | err = irq; | 1118 | err = irq; |
| 1119 | goto out; | 1119 | goto out; |
| 1120 | } | 1120 | } |
| 1121 | bus->irq[chip->info->port_base_addr + phy] = irq; | 1121 | bus->irq[chip->info->phy_base_addr + phy] = irq; |
| 1122 | } | 1122 | } |
| 1123 | return 0; | 1123 | return 0; |
| 1124 | out: | 1124 | out: |
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c index 32f6d2e24d66..1a1a6380c128 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c | |||
| @@ -95,6 +95,7 @@ void aq_nic_cfg_start(struct aq_nic_s *self) | |||
| 95 | /*rss rings */ | 95 | /*rss rings */ |
| 96 | cfg->vecs = min(cfg->aq_hw_caps->vecs, AQ_CFG_VECS_DEF); | 96 | cfg->vecs = min(cfg->aq_hw_caps->vecs, AQ_CFG_VECS_DEF); |
| 97 | cfg->vecs = min(cfg->vecs, num_online_cpus()); | 97 | cfg->vecs = min(cfg->vecs, num_online_cpus()); |
| 98 | cfg->vecs = min(cfg->vecs, self->irqvecs); | ||
| 98 | /* cfg->vecs should be power of 2 for RSS */ | 99 | /* cfg->vecs should be power of 2 for RSS */ |
| 99 | if (cfg->vecs >= 8U) | 100 | if (cfg->vecs >= 8U) |
| 100 | cfg->vecs = 8U; | 101 | cfg->vecs = 8U; |
| @@ -246,6 +247,8 @@ void aq_nic_ndev_init(struct aq_nic_s *self) | |||
| 246 | 247 | ||
| 247 | self->ndev->hw_features |= aq_hw_caps->hw_features; | 248 | self->ndev->hw_features |= aq_hw_caps->hw_features; |
| 248 | self->ndev->features = aq_hw_caps->hw_features; | 249 | self->ndev->features = aq_hw_caps->hw_features; |
| 250 | self->ndev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM | | ||
| 251 | NETIF_F_RXHASH | NETIF_F_SG | NETIF_F_LRO; | ||
| 249 | self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; | 252 | self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; |
| 250 | self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; | 253 | self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; |
| 251 | 254 | ||
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h index 219b550d1665..faa533a0ec47 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h | |||
| @@ -80,6 +80,7 @@ struct aq_nic_s { | |||
| 80 | 80 | ||
| 81 | struct pci_dev *pdev; | 81 | struct pci_dev *pdev; |
| 82 | unsigned int msix_entry_mask; | 82 | unsigned int msix_entry_mask; |
| 83 | u32 irqvecs; | ||
| 83 | }; | 84 | }; |
| 84 | 85 | ||
| 85 | static inline struct device *aq_nic_get_dev(struct aq_nic_s *self) | 86 | static inline struct device *aq_nic_get_dev(struct aq_nic_s *self) |
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c index ecc6306f940f..a50e08bb4748 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | |||
| @@ -267,16 +267,16 @@ static int aq_pci_probe(struct pci_dev *pdev, | |||
| 267 | numvecs = min(numvecs, num_online_cpus()); | 267 | numvecs = min(numvecs, num_online_cpus()); |
| 268 | /*enable interrupts */ | 268 | /*enable interrupts */ |
| 269 | #if !AQ_CFG_FORCE_LEGACY_INT | 269 | #if !AQ_CFG_FORCE_LEGACY_INT |
| 270 | err = pci_alloc_irq_vectors(self->pdev, numvecs, numvecs, | 270 | numvecs = pci_alloc_irq_vectors(self->pdev, 1, numvecs, |
| 271 | PCI_IRQ_MSIX); | 271 | PCI_IRQ_MSIX | PCI_IRQ_MSI | |
| 272 | 272 | PCI_IRQ_LEGACY); | |
| 273 | if (err < 0) { | 273 | |
| 274 | err = pci_alloc_irq_vectors(self->pdev, 1, 1, | 274 | if (numvecs < 0) { |
| 275 | PCI_IRQ_MSI | PCI_IRQ_LEGACY); | 275 | err = numvecs; |
| 276 | if (err < 0) | 276 | goto err_hwinit; |
| 277 | goto err_hwinit; | ||
| 278 | } | 277 | } |
| 279 | #endif | 278 | #endif |
| 279 | self->irqvecs = numvecs; | ||
| 280 | 280 | ||
| 281 | /* net device init */ | 281 | /* net device init */ |
| 282 | aq_nic_cfg_start(self); | 282 | aq_nic_cfg_start(self); |
| @@ -298,9 +298,9 @@ err_free_aq_hw: | |||
| 298 | kfree(self->aq_hw); | 298 | kfree(self->aq_hw); |
| 299 | err_ioremap: | 299 | err_ioremap: |
| 300 | free_netdev(ndev); | 300 | free_netdev(ndev); |
| 301 | err_pci_func: | ||
| 302 | pci_release_regions(pdev); | ||
| 303 | err_ndev: | 301 | err_ndev: |
| 302 | pci_release_regions(pdev); | ||
| 303 | err_pci_func: | ||
| 304 | pci_disable_device(pdev); | 304 | pci_disable_device(pdev); |
| 305 | return err; | 305 | return err; |
| 306 | } | 306 | } |
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index f9a3c1a76d5d..f33b25fbca63 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
| @@ -2144,14 +2144,21 @@ static const struct net_device_ops bcm_sysport_netdev_ops = { | |||
| 2144 | .ndo_select_queue = bcm_sysport_select_queue, | 2144 | .ndo_select_queue = bcm_sysport_select_queue, |
| 2145 | }; | 2145 | }; |
| 2146 | 2146 | ||
| 2147 | static int bcm_sysport_map_queues(struct net_device *dev, | 2147 | static int bcm_sysport_map_queues(struct notifier_block *nb, |
| 2148 | struct dsa_notifier_register_info *info) | 2148 | struct dsa_notifier_register_info *info) |
| 2149 | { | 2149 | { |
| 2150 | struct bcm_sysport_priv *priv = netdev_priv(dev); | ||
| 2151 | struct bcm_sysport_tx_ring *ring; | 2150 | struct bcm_sysport_tx_ring *ring; |
| 2151 | struct bcm_sysport_priv *priv; | ||
| 2152 | struct net_device *slave_dev; | 2152 | struct net_device *slave_dev; |
| 2153 | unsigned int num_tx_queues; | 2153 | unsigned int num_tx_queues; |
| 2154 | unsigned int q, start, port; | 2154 | unsigned int q, start, port; |
| 2155 | struct net_device *dev; | ||
| 2156 | |||
| 2157 | priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier); | ||
| 2158 | if (priv->netdev != info->master) | ||
| 2159 | return 0; | ||
| 2160 | |||
| 2161 | dev = info->master; | ||
| 2155 | 2162 | ||
| 2156 | /* We can't be setting up queue inspection for non directly attached | 2163 | /* We can't be setting up queue inspection for non directly attached |
| 2157 | * switches | 2164 | * switches |
| @@ -2174,11 +2181,12 @@ static int bcm_sysport_map_queues(struct net_device *dev, | |||
| 2174 | if (priv->is_lite) | 2181 | if (priv->is_lite) |
| 2175 | netif_set_real_num_tx_queues(slave_dev, | 2182 | netif_set_real_num_tx_queues(slave_dev, |
| 2176 | slave_dev->num_tx_queues / 2); | 2183 | slave_dev->num_tx_queues / 2); |
| 2184 | |||
| 2177 | num_tx_queues = slave_dev->real_num_tx_queues; | 2185 | num_tx_queues = slave_dev->real_num_tx_queues; |
| 2178 | 2186 | ||
| 2179 | if (priv->per_port_num_tx_queues && | 2187 | if (priv->per_port_num_tx_queues && |
| 2180 | priv->per_port_num_tx_queues != num_tx_queues) | 2188 | priv->per_port_num_tx_queues != num_tx_queues) |
| 2181 | netdev_warn(slave_dev, "asymetric number of per-port queues\n"); | 2189 | netdev_warn(slave_dev, "asymmetric number of per-port queues\n"); |
| 2182 | 2190 | ||
| 2183 | priv->per_port_num_tx_queues = num_tx_queues; | 2191 | priv->per_port_num_tx_queues = num_tx_queues; |
| 2184 | 2192 | ||
| @@ -2201,7 +2209,7 @@ static int bcm_sysport_map_queues(struct net_device *dev, | |||
| 2201 | return 0; | 2209 | return 0; |
| 2202 | } | 2210 | } |
| 2203 | 2211 | ||
| 2204 | static int bcm_sysport_dsa_notifier(struct notifier_block *unused, | 2212 | static int bcm_sysport_dsa_notifier(struct notifier_block *nb, |
| 2205 | unsigned long event, void *ptr) | 2213 | unsigned long event, void *ptr) |
| 2206 | { | 2214 | { |
| 2207 | struct dsa_notifier_register_info *info; | 2215 | struct dsa_notifier_register_info *info; |
| @@ -2211,7 +2219,7 @@ static int bcm_sysport_dsa_notifier(struct notifier_block *unused, | |||
| 2211 | 2219 | ||
| 2212 | info = ptr; | 2220 | info = ptr; |
| 2213 | 2221 | ||
| 2214 | return notifier_from_errno(bcm_sysport_map_queues(info->master, info)); | 2222 | return notifier_from_errno(bcm_sysport_map_queues(nb, info)); |
| 2215 | } | 2223 | } |
| 2216 | 2224 | ||
| 2217 | #define REV_FMT "v%2x.%02x" | 2225 | #define REV_FMT "v%2x.%02x" |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 08bbb639be1a..9f59b1270a7c 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
| @@ -8733,14 +8733,15 @@ static void tg3_free_consistent(struct tg3 *tp) | |||
| 8733 | tg3_mem_rx_release(tp); | 8733 | tg3_mem_rx_release(tp); |
| 8734 | tg3_mem_tx_release(tp); | 8734 | tg3_mem_tx_release(tp); |
| 8735 | 8735 | ||
| 8736 | /* Protect tg3_get_stats64() from reading freed tp->hw_stats. */ | 8736 | /* tp->hw_stats can be referenced safely: |
| 8737 | tg3_full_lock(tp, 0); | 8737 | * 1. under rtnl_lock |
| 8738 | * 2. or under tp->lock if TG3_FLAG_INIT_COMPLETE is set. | ||
| 8739 | */ | ||
| 8738 | if (tp->hw_stats) { | 8740 | if (tp->hw_stats) { |
| 8739 | dma_free_coherent(&tp->pdev->dev, sizeof(struct tg3_hw_stats), | 8741 | dma_free_coherent(&tp->pdev->dev, sizeof(struct tg3_hw_stats), |
| 8740 | tp->hw_stats, tp->stats_mapping); | 8742 | tp->hw_stats, tp->stats_mapping); |
| 8741 | tp->hw_stats = NULL; | 8743 | tp->hw_stats = NULL; |
| 8742 | } | 8744 | } |
| 8743 | tg3_full_unlock(tp); | ||
| 8744 | } | 8745 | } |
| 8745 | 8746 | ||
| 8746 | /* | 8747 | /* |
| @@ -14178,7 +14179,7 @@ static void tg3_get_stats64(struct net_device *dev, | |||
| 14178 | struct tg3 *tp = netdev_priv(dev); | 14179 | struct tg3 *tp = netdev_priv(dev); |
| 14179 | 14180 | ||
| 14180 | spin_lock_bh(&tp->lock); | 14181 | spin_lock_bh(&tp->lock); |
| 14181 | if (!tp->hw_stats) { | 14182 | if (!tp->hw_stats || !tg3_flag(tp, INIT_COMPLETE)) { |
| 14182 | *stats = tp->net_stats_prev; | 14183 | *stats = tp->net_stats_prev; |
| 14183 | spin_unlock_bh(&tp->lock); | 14184 | spin_unlock_bh(&tp->lock); |
| 14184 | return; | 14185 | return; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 24d2865b8806..005283c7cdfe 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
| @@ -3433,8 +3433,8 @@ static int adap_config_hma(struct adapter *adapter) | |||
| 3433 | sgl = adapter->hma.sgt->sgl; | 3433 | sgl = adapter->hma.sgt->sgl; |
| 3434 | node = dev_to_node(adapter->pdev_dev); | 3434 | node = dev_to_node(adapter->pdev_dev); |
| 3435 | for_each_sg(sgl, iter, sgt->orig_nents, i) { | 3435 | for_each_sg(sgl, iter, sgt->orig_nents, i) { |
| 3436 | newpage = alloc_pages_node(node, __GFP_NOWARN | GFP_KERNEL, | 3436 | newpage = alloc_pages_node(node, __GFP_NOWARN | GFP_KERNEL | |
| 3437 | page_order); | 3437 | __GFP_ZERO, page_order); |
| 3438 | if (!newpage) { | 3438 | if (!newpage) { |
| 3439 | dev_err(adapter->pdev_dev, | 3439 | dev_err(adapter->pdev_dev, |
| 3440 | "Not enough memory for HMA page allocation\n"); | 3440 | "Not enough memory for HMA page allocation\n"); |
| @@ -5474,6 +5474,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 5474 | } | 5474 | } |
| 5475 | spin_lock_init(&adapter->mbox_lock); | 5475 | spin_lock_init(&adapter->mbox_lock); |
| 5476 | INIT_LIST_HEAD(&adapter->mlist.list); | 5476 | INIT_LIST_HEAD(&adapter->mlist.list); |
| 5477 | adapter->mbox_log->size = T4_OS_LOG_MBOX_CMDS; | ||
| 5477 | pci_set_drvdata(pdev, adapter); | 5478 | pci_set_drvdata(pdev, adapter); |
| 5478 | 5479 | ||
| 5479 | if (func != ent->driver_data) { | 5480 | if (func != ent->driver_data) { |
| @@ -5508,8 +5509,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 5508 | goto out_free_adapter; | 5509 | goto out_free_adapter; |
| 5509 | } | 5510 | } |
| 5510 | 5511 | ||
| 5511 | adapter->mbox_log->size = T4_OS_LOG_MBOX_CMDS; | ||
| 5512 | |||
| 5513 | /* PCI device has been enabled */ | 5512 | /* PCI device has been enabled */ |
| 5514 | adapter->flags |= DEV_ENABLED; | 5513 | adapter->flags |= DEV_ENABLED; |
| 5515 | memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map)); | 5514 | memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map)); |
diff --git a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c index 4df282ed22c7..0beee2cc2ddd 100644 --- a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c +++ b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c | |||
| @@ -61,7 +61,7 @@ static const char hw_stat_gstrings[][ETH_GSTRING_LEN] = { | |||
| 61 | static const char tx_fw_stat_gstrings[][ETH_GSTRING_LEN] = { | 61 | static const char tx_fw_stat_gstrings[][ETH_GSTRING_LEN] = { |
| 62 | "tx-single-collision", | 62 | "tx-single-collision", |
| 63 | "tx-multiple-collision", | 63 | "tx-multiple-collision", |
| 64 | "tx-late-collsion", | 64 | "tx-late-collision", |
| 65 | "tx-aborted-frames", | 65 | "tx-aborted-frames", |
| 66 | "tx-lost-frames", | 66 | "tx-lost-frames", |
| 67 | "tx-carrier-sense-errors", | 67 | "tx-carrier-sense-errors", |
diff --git a/drivers/net/ethernet/intel/ice/ice_controlq.c b/drivers/net/ethernet/intel/ice/ice_controlq.c index 5909a4407e38..7c511f144ed6 100644 --- a/drivers/net/ethernet/intel/ice/ice_controlq.c +++ b/drivers/net/ethernet/intel/ice/ice_controlq.c | |||
| @@ -1014,10 +1014,10 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq, | |||
| 1014 | desc = ICE_CTL_Q_DESC(cq->rq, ntc); | 1014 | desc = ICE_CTL_Q_DESC(cq->rq, ntc); |
| 1015 | desc_idx = ntc; | 1015 | desc_idx = ntc; |
| 1016 | 1016 | ||
| 1017 | cq->rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval); | ||
| 1017 | flags = le16_to_cpu(desc->flags); | 1018 | flags = le16_to_cpu(desc->flags); |
| 1018 | if (flags & ICE_AQ_FLAG_ERR) { | 1019 | if (flags & ICE_AQ_FLAG_ERR) { |
| 1019 | ret_code = ICE_ERR_AQ_ERROR; | 1020 | ret_code = ICE_ERR_AQ_ERROR; |
| 1020 | cq->rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval); | ||
| 1021 | ice_debug(hw, ICE_DBG_AQ_MSG, | 1021 | ice_debug(hw, ICE_DBG_AQ_MSG, |
| 1022 | "Control Receive Queue Event received with error 0x%x\n", | 1022 | "Control Receive Queue Event received with error 0x%x\n", |
| 1023 | cq->rq_last_status); | 1023 | cq->rq_last_status); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c index 68af127987bc..cead23e3db0c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | |||
| @@ -943,8 +943,8 @@ err2: | |||
| 943 | kfree(ipsec->ip_tbl); | 943 | kfree(ipsec->ip_tbl); |
| 944 | kfree(ipsec->rx_tbl); | 944 | kfree(ipsec->rx_tbl); |
| 945 | kfree(ipsec->tx_tbl); | 945 | kfree(ipsec->tx_tbl); |
| 946 | kfree(ipsec); | ||
| 946 | err1: | 947 | err1: |
| 947 | kfree(adapter->ipsec); | ||
| 948 | netdev_err(adapter->netdev, "Unable to allocate memory for SA tables"); | 948 | netdev_err(adapter->netdev, "Unable to allocate memory for SA tables"); |
| 949 | } | 949 | } |
| 950 | 950 | ||
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c index 3123267dfba9..9592f3e3e42e 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | |||
| @@ -3427,6 +3427,9 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) | |||
| 3427 | hw->phy.sfp_setup_needed = false; | 3427 | hw->phy.sfp_setup_needed = false; |
| 3428 | } | 3428 | } |
| 3429 | 3429 | ||
| 3430 | if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) | ||
| 3431 | return status; | ||
| 3432 | |||
| 3430 | /* Reset PHY */ | 3433 | /* Reset PHY */ |
| 3431 | if (!hw->phy.reset_disable && hw->phy.ops.reset) | 3434 | if (!hw->phy.reset_disable && hw->phy.ops.reset) |
| 3432 | hw->phy.ops.reset(hw); | 3435 | hw->phy.ops.reset(hw); |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index e3d04f226d57..850f8af95e49 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
| @@ -4137,7 +4137,7 @@ out_drop: | |||
| 4137 | return NETDEV_TX_OK; | 4137 | return NETDEV_TX_OK; |
| 4138 | } | 4138 | } |
| 4139 | 4139 | ||
| 4140 | static int ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 4140 | static netdev_tx_t ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev) |
| 4141 | { | 4141 | { |
| 4142 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | 4142 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); |
| 4143 | struct ixgbevf_ring *tx_ring; | 4143 | struct ixgbevf_ring *tx_ring; |
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index 4202f9b5b966..6f410235987c 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c | |||
| @@ -942,6 +942,7 @@ struct mvpp2 { | |||
| 942 | struct clk *pp_clk; | 942 | struct clk *pp_clk; |
| 943 | struct clk *gop_clk; | 943 | struct clk *gop_clk; |
| 944 | struct clk *mg_clk; | 944 | struct clk *mg_clk; |
| 945 | struct clk *mg_core_clk; | ||
| 945 | struct clk *axi_clk; | 946 | struct clk *axi_clk; |
| 946 | 947 | ||
| 947 | /* List of pointers to port structures */ | 948 | /* List of pointers to port structures */ |
| @@ -8768,18 +8769,27 @@ static int mvpp2_probe(struct platform_device *pdev) | |||
| 8768 | err = clk_prepare_enable(priv->mg_clk); | 8769 | err = clk_prepare_enable(priv->mg_clk); |
| 8769 | if (err < 0) | 8770 | if (err < 0) |
| 8770 | goto err_gop_clk; | 8771 | goto err_gop_clk; |
| 8772 | |||
| 8773 | priv->mg_core_clk = devm_clk_get(&pdev->dev, "mg_core_clk"); | ||
| 8774 | if (IS_ERR(priv->mg_core_clk)) { | ||
| 8775 | priv->mg_core_clk = NULL; | ||
| 8776 | } else { | ||
| 8777 | err = clk_prepare_enable(priv->mg_core_clk); | ||
| 8778 | if (err < 0) | ||
| 8779 | goto err_mg_clk; | ||
| 8780 | } | ||
| 8771 | } | 8781 | } |
| 8772 | 8782 | ||
| 8773 | priv->axi_clk = devm_clk_get(&pdev->dev, "axi_clk"); | 8783 | priv->axi_clk = devm_clk_get(&pdev->dev, "axi_clk"); |
| 8774 | if (IS_ERR(priv->axi_clk)) { | 8784 | if (IS_ERR(priv->axi_clk)) { |
| 8775 | err = PTR_ERR(priv->axi_clk); | 8785 | err = PTR_ERR(priv->axi_clk); |
| 8776 | if (err == -EPROBE_DEFER) | 8786 | if (err == -EPROBE_DEFER) |
| 8777 | goto err_gop_clk; | 8787 | goto err_mg_core_clk; |
| 8778 | priv->axi_clk = NULL; | 8788 | priv->axi_clk = NULL; |
| 8779 | } else { | 8789 | } else { |
| 8780 | err = clk_prepare_enable(priv->axi_clk); | 8790 | err = clk_prepare_enable(priv->axi_clk); |
| 8781 | if (err < 0) | 8791 | if (err < 0) |
| 8782 | goto err_gop_clk; | 8792 | goto err_mg_core_clk; |
| 8783 | } | 8793 | } |
| 8784 | 8794 | ||
| 8785 | /* Get system's tclk rate */ | 8795 | /* Get system's tclk rate */ |
| @@ -8793,7 +8803,7 @@ static int mvpp2_probe(struct platform_device *pdev) | |||
| 8793 | if (priv->hw_version == MVPP22) { | 8803 | if (priv->hw_version == MVPP22) { |
| 8794 | err = dma_set_mask(&pdev->dev, MVPP2_DESC_DMA_MASK); | 8804 | err = dma_set_mask(&pdev->dev, MVPP2_DESC_DMA_MASK); |
| 8795 | if (err) | 8805 | if (err) |
| 8796 | goto err_mg_clk; | 8806 | goto err_axi_clk; |
| 8797 | /* Sadly, the BM pools all share the same register to | 8807 | /* Sadly, the BM pools all share the same register to |
| 8798 | * store the high 32 bits of their address. So they | 8808 | * store the high 32 bits of their address. So they |
| 8799 | * must all have the same high 32 bits, which forces | 8809 | * must all have the same high 32 bits, which forces |
| @@ -8801,14 +8811,14 @@ static int mvpp2_probe(struct platform_device *pdev) | |||
| 8801 | */ | 8811 | */ |
| 8802 | err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | 8812 | err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); |
| 8803 | if (err) | 8813 | if (err) |
| 8804 | goto err_mg_clk; | 8814 | goto err_axi_clk; |
| 8805 | } | 8815 | } |
| 8806 | 8816 | ||
| 8807 | /* Initialize network controller */ | 8817 | /* Initialize network controller */ |
| 8808 | err = mvpp2_init(pdev, priv); | 8818 | err = mvpp2_init(pdev, priv); |
| 8809 | if (err < 0) { | 8819 | if (err < 0) { |
| 8810 | dev_err(&pdev->dev, "failed to initialize controller\n"); | 8820 | dev_err(&pdev->dev, "failed to initialize controller\n"); |
| 8811 | goto err_mg_clk; | 8821 | goto err_axi_clk; |
| 8812 | } | 8822 | } |
| 8813 | 8823 | ||
| 8814 | /* Initialize ports */ | 8824 | /* Initialize ports */ |
| @@ -8821,7 +8831,7 @@ static int mvpp2_probe(struct platform_device *pdev) | |||
| 8821 | if (priv->port_count == 0) { | 8831 | if (priv->port_count == 0) { |
| 8822 | dev_err(&pdev->dev, "no ports enabled\n"); | 8832 | dev_err(&pdev->dev, "no ports enabled\n"); |
| 8823 | err = -ENODEV; | 8833 | err = -ENODEV; |
| 8824 | goto err_mg_clk; | 8834 | goto err_axi_clk; |
| 8825 | } | 8835 | } |
| 8826 | 8836 | ||
| 8827 | /* Statistics must be gathered regularly because some of them (like | 8837 | /* Statistics must be gathered regularly because some of them (like |
| @@ -8849,8 +8859,13 @@ err_port_probe: | |||
| 8849 | mvpp2_port_remove(priv->port_list[i]); | 8859 | mvpp2_port_remove(priv->port_list[i]); |
| 8850 | i++; | 8860 | i++; |
| 8851 | } | 8861 | } |
| 8852 | err_mg_clk: | 8862 | err_axi_clk: |
| 8853 | clk_disable_unprepare(priv->axi_clk); | 8863 | clk_disable_unprepare(priv->axi_clk); |
| 8864 | |||
| 8865 | err_mg_core_clk: | ||
| 8866 | if (priv->hw_version == MVPP22) | ||
| 8867 | clk_disable_unprepare(priv->mg_core_clk); | ||
| 8868 | err_mg_clk: | ||
| 8854 | if (priv->hw_version == MVPP22) | 8869 | if (priv->hw_version == MVPP22) |
| 8855 | clk_disable_unprepare(priv->mg_clk); | 8870 | clk_disable_unprepare(priv->mg_clk); |
| 8856 | err_gop_clk: | 8871 | err_gop_clk: |
| @@ -8897,6 +8912,7 @@ static int mvpp2_remove(struct platform_device *pdev) | |||
| 8897 | return 0; | 8912 | return 0; |
| 8898 | 8913 | ||
| 8899 | clk_disable_unprepare(priv->axi_clk); | 8914 | clk_disable_unprepare(priv->axi_clk); |
| 8915 | clk_disable_unprepare(priv->mg_core_clk); | ||
| 8900 | clk_disable_unprepare(priv->mg_clk); | 8916 | clk_disable_unprepare(priv->mg_clk); |
| 8901 | clk_disable_unprepare(priv->pp_clk); | 8917 | clk_disable_unprepare(priv->pp_clk); |
| 8902 | clk_disable_unprepare(priv->gop_clk); | 8918 | clk_disable_unprepare(priv->gop_clk); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index a30a2e95d13f..f11b45001cad 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | |||
| @@ -1027,6 +1027,22 @@ static int mlx4_en_set_coalesce(struct net_device *dev, | |||
| 1027 | if (!coal->tx_max_coalesced_frames_irq) | 1027 | if (!coal->tx_max_coalesced_frames_irq) |
| 1028 | return -EINVAL; | 1028 | return -EINVAL; |
| 1029 | 1029 | ||
| 1030 | if (coal->tx_coalesce_usecs > MLX4_EN_MAX_COAL_TIME || | ||
| 1031 | coal->rx_coalesce_usecs > MLX4_EN_MAX_COAL_TIME || | ||
| 1032 | coal->rx_coalesce_usecs_low > MLX4_EN_MAX_COAL_TIME || | ||
| 1033 | coal->rx_coalesce_usecs_high > MLX4_EN_MAX_COAL_TIME) { | ||
| 1034 | netdev_info(dev, "%s: maximum coalesce time supported is %d usecs\n", | ||
| 1035 | __func__, MLX4_EN_MAX_COAL_TIME); | ||
| 1036 | return -ERANGE; | ||
| 1037 | } | ||
| 1038 | |||
| 1039 | if (coal->tx_max_coalesced_frames > MLX4_EN_MAX_COAL_PKTS || | ||
| 1040 | coal->rx_max_coalesced_frames > MLX4_EN_MAX_COAL_PKTS) { | ||
| 1041 | netdev_info(dev, "%s: maximum coalesced frames supported is %d\n", | ||
| 1042 | __func__, MLX4_EN_MAX_COAL_PKTS); | ||
| 1043 | return -ERANGE; | ||
| 1044 | } | ||
| 1045 | |||
| 1030 | priv->rx_frames = (coal->rx_max_coalesced_frames == | 1046 | priv->rx_frames = (coal->rx_max_coalesced_frames == |
| 1031 | MLX4_EN_AUTO_CONF) ? | 1047 | MLX4_EN_AUTO_CONF) ? |
| 1032 | MLX4_EN_RX_COAL_TARGET : | 1048 | MLX4_EN_RX_COAL_TARGET : |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index e0adac4a9a19..9670b33fc9b1 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
| @@ -3324,12 +3324,11 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
| 3324 | MAX_TX_RINGS, GFP_KERNEL); | 3324 | MAX_TX_RINGS, GFP_KERNEL); |
| 3325 | if (!priv->tx_ring[t]) { | 3325 | if (!priv->tx_ring[t]) { |
| 3326 | err = -ENOMEM; | 3326 | err = -ENOMEM; |
| 3327 | goto err_free_tx; | 3327 | goto out; |
| 3328 | } | 3328 | } |
| 3329 | priv->tx_cq[t] = kzalloc(sizeof(struct mlx4_en_cq *) * | 3329 | priv->tx_cq[t] = kzalloc(sizeof(struct mlx4_en_cq *) * |
| 3330 | MAX_TX_RINGS, GFP_KERNEL); | 3330 | MAX_TX_RINGS, GFP_KERNEL); |
| 3331 | if (!priv->tx_cq[t]) { | 3331 | if (!priv->tx_cq[t]) { |
| 3332 | kfree(priv->tx_ring[t]); | ||
| 3333 | err = -ENOMEM; | 3332 | err = -ENOMEM; |
| 3334 | goto out; | 3333 | goto out; |
| 3335 | } | 3334 | } |
| @@ -3582,11 +3581,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
| 3582 | 3581 | ||
| 3583 | return 0; | 3582 | return 0; |
| 3584 | 3583 | ||
| 3585 | err_free_tx: | ||
| 3586 | while (t--) { | ||
| 3587 | kfree(priv->tx_ring[t]); | ||
| 3588 | kfree(priv->tx_cq[t]); | ||
| 3589 | } | ||
| 3590 | out: | 3584 | out: |
| 3591 | mlx4_en_destroy_netdev(dev); | 3585 | mlx4_en_destroy_netdev(dev); |
| 3592 | return err; | 3586 | return err; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index bfef69235d71..211578ffc70d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
| @@ -1317,7 +1317,7 @@ static int mlx4_mf_unbond(struct mlx4_dev *dev) | |||
| 1317 | 1317 | ||
| 1318 | ret = mlx4_unbond_fs_rules(dev); | 1318 | ret = mlx4_unbond_fs_rules(dev); |
| 1319 | if (ret) | 1319 | if (ret) |
| 1320 | mlx4_warn(dev, "multifunction unbond for flow rules failedi (%d)\n", ret); | 1320 | mlx4_warn(dev, "multifunction unbond for flow rules failed (%d)\n", ret); |
| 1321 | ret1 = mlx4_unbond_mac_table(dev); | 1321 | ret1 = mlx4_unbond_mac_table(dev); |
| 1322 | if (ret1) { | 1322 | if (ret1) { |
| 1323 | mlx4_warn(dev, "multifunction unbond for MAC table failed (%d)\n", ret1); | 1323 | mlx4_warn(dev, "multifunction unbond for MAC table failed (%d)\n", ret1); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index f7c81133594f..ace6545f82e6 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
| @@ -132,6 +132,9 @@ | |||
| 132 | #define MLX4_EN_TX_COAL_PKTS 16 | 132 | #define MLX4_EN_TX_COAL_PKTS 16 |
| 133 | #define MLX4_EN_TX_COAL_TIME 0x10 | 133 | #define MLX4_EN_TX_COAL_TIME 0x10 |
| 134 | 134 | ||
| 135 | #define MLX4_EN_MAX_COAL_PKTS U16_MAX | ||
| 136 | #define MLX4_EN_MAX_COAL_TIME U16_MAX | ||
| 137 | |||
| 135 | #define MLX4_EN_RX_RATE_LOW 400000 | 138 | #define MLX4_EN_RX_RATE_LOW 400000 |
| 136 | #define MLX4_EN_RX_COAL_TIME_LOW 0 | 139 | #define MLX4_EN_RX_COAL_TIME_LOW 0 |
| 137 | #define MLX4_EN_RX_RATE_HIGH 450000 | 140 | #define MLX4_EN_RX_RATE_HIGH 450000 |
| @@ -552,8 +555,8 @@ struct mlx4_en_priv { | |||
| 552 | u16 rx_usecs_low; | 555 | u16 rx_usecs_low; |
| 553 | u32 pkt_rate_high; | 556 | u32 pkt_rate_high; |
| 554 | u16 rx_usecs_high; | 557 | u16 rx_usecs_high; |
| 555 | u16 sample_interval; | 558 | u32 sample_interval; |
| 556 | u16 adaptive_rx_coal; | 559 | u32 adaptive_rx_coal; |
| 557 | u32 msg_enable; | 560 | u32 msg_enable; |
| 558 | u32 loopback_ok; | 561 | u32 loopback_ok; |
| 559 | u32 validate_loopback; | 562 | u32 validate_loopback; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c index 3d46ef48d5b8..c641d5656b2d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | |||
| @@ -1007,12 +1007,14 @@ static void mlx5e_trust_update_sq_inline_mode(struct mlx5e_priv *priv) | |||
| 1007 | 1007 | ||
| 1008 | mutex_lock(&priv->state_lock); | 1008 | mutex_lock(&priv->state_lock); |
| 1009 | 1009 | ||
| 1010 | if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) | ||
| 1011 | goto out; | ||
| 1012 | |||
| 1013 | new_channels.params = priv->channels.params; | 1010 | new_channels.params = priv->channels.params; |
| 1014 | mlx5e_trust_update_tx_min_inline_mode(priv, &new_channels.params); | 1011 | mlx5e_trust_update_tx_min_inline_mode(priv, &new_channels.params); |
| 1015 | 1012 | ||
| 1013 | if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) { | ||
| 1014 | priv->channels.params = new_channels.params; | ||
| 1015 | goto out; | ||
| 1016 | } | ||
| 1017 | |||
| 1016 | /* Skip if tx_min_inline is the same */ | 1018 | /* Skip if tx_min_inline is the same */ |
| 1017 | if (new_channels.params.tx_min_inline_mode == | 1019 | if (new_channels.params.tx_min_inline_mode == |
| 1018 | priv->channels.params.tx_min_inline_mode) | 1020 | priv->channels.params.tx_min_inline_mode) |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index d8f68e4d1018..876c3e4c6193 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | |||
| @@ -877,13 +877,14 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = { | |||
| 877 | }; | 877 | }; |
| 878 | 878 | ||
| 879 | static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev, | 879 | static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev, |
| 880 | struct mlx5e_params *params) | 880 | struct mlx5e_params *params, u16 mtu) |
| 881 | { | 881 | { |
| 882 | u8 cq_period_mode = MLX5_CAP_GEN(mdev, cq_period_start_from_cqe) ? | 882 | u8 cq_period_mode = MLX5_CAP_GEN(mdev, cq_period_start_from_cqe) ? |
| 883 | MLX5_CQ_PERIOD_MODE_START_FROM_CQE : | 883 | MLX5_CQ_PERIOD_MODE_START_FROM_CQE : |
| 884 | MLX5_CQ_PERIOD_MODE_START_FROM_EQE; | 884 | MLX5_CQ_PERIOD_MODE_START_FROM_EQE; |
| 885 | 885 | ||
| 886 | params->hard_mtu = MLX5E_ETH_HARD_MTU; | 886 | params->hard_mtu = MLX5E_ETH_HARD_MTU; |
| 887 | params->sw_mtu = mtu; | ||
| 887 | params->log_sq_size = MLX5E_REP_PARAMS_LOG_SQ_SIZE; | 888 | params->log_sq_size = MLX5E_REP_PARAMS_LOG_SQ_SIZE; |
| 888 | params->rq_wq_type = MLX5_WQ_TYPE_LINKED_LIST; | 889 | params->rq_wq_type = MLX5_WQ_TYPE_LINKED_LIST; |
| 889 | params->log_rq_mtu_frames = MLX5E_REP_PARAMS_LOG_RQ_SIZE; | 890 | params->log_rq_mtu_frames = MLX5E_REP_PARAMS_LOG_RQ_SIZE; |
| @@ -931,7 +932,7 @@ static void mlx5e_init_rep(struct mlx5_core_dev *mdev, | |||
| 931 | 932 | ||
| 932 | priv->channels.params.num_channels = profile->max_nch(mdev); | 933 | priv->channels.params.num_channels = profile->max_nch(mdev); |
| 933 | 934 | ||
| 934 | mlx5e_build_rep_params(mdev, &priv->channels.params); | 935 | mlx5e_build_rep_params(mdev, &priv->channels.params, netdev->mtu); |
| 935 | mlx5e_build_rep_netdev(netdev); | 936 | mlx5e_build_rep_netdev(netdev); |
| 936 | 937 | ||
| 937 | mlx5e_timestamp_init(priv); | 938 | mlx5e_timestamp_init(priv); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c index 707976482c09..027f54ac1ca2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c | |||
| @@ -290,7 +290,7 @@ static int mlx5e_test_loopback(struct mlx5e_priv *priv) | |||
| 290 | 290 | ||
| 291 | if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) { | 291 | if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) { |
| 292 | netdev_err(priv->netdev, | 292 | netdev_err(priv->netdev, |
| 293 | "\tCan't perform loobpack test while device is down\n"); | 293 | "\tCan't perform loopback test while device is down\n"); |
| 294 | return -ENODEV; | 294 | return -ENODEV; |
| 295 | } | 295 | } |
| 296 | 296 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 4197001f9801..b94276db3ce9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | |||
| @@ -1261,6 +1261,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, | |||
| 1261 | f->mask); | 1261 | f->mask); |
| 1262 | addr_type = key->addr_type; | 1262 | addr_type = key->addr_type; |
| 1263 | 1263 | ||
| 1264 | /* the HW doesn't support frag first/later */ | ||
| 1265 | if (mask->flags & FLOW_DIS_FIRST_FRAG) | ||
| 1266 | return -EOPNOTSUPP; | ||
| 1267 | |||
| 1264 | if (mask->flags & FLOW_DIS_IS_FRAGMENT) { | 1268 | if (mask->flags & FLOW_DIS_IS_FRAGMENT) { |
| 1265 | MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1); | 1269 | MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1); |
| 1266 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, | 1270 | MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, |
| @@ -1864,7 +1868,8 @@ static bool modify_header_match_supported(struct mlx5_flow_spec *spec, | |||
| 1864 | } | 1868 | } |
| 1865 | 1869 | ||
| 1866 | ip_proto = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ip_protocol); | 1870 | ip_proto = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ip_protocol); |
| 1867 | if (modify_ip_header && ip_proto != IPPROTO_TCP && ip_proto != IPPROTO_UDP) { | 1871 | if (modify_ip_header && ip_proto != IPPROTO_TCP && |
| 1872 | ip_proto != IPPROTO_UDP && ip_proto != IPPROTO_ICMP) { | ||
| 1868 | pr_info("can't offload re-write of ip proto %d\n", ip_proto); | 1873 | pr_info("can't offload re-write of ip proto %d\n", ip_proto); |
| 1869 | return false; | 1874 | return false; |
| 1870 | } | 1875 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index 20297108528a..5532aa3675c7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | |||
| @@ -255,7 +255,7 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb, | |||
| 255 | dma_addr = dma_map_single(sq->pdev, skb_data, headlen, | 255 | dma_addr = dma_map_single(sq->pdev, skb_data, headlen, |
| 256 | DMA_TO_DEVICE); | 256 | DMA_TO_DEVICE); |
| 257 | if (unlikely(dma_mapping_error(sq->pdev, dma_addr))) | 257 | if (unlikely(dma_mapping_error(sq->pdev, dma_addr))) |
| 258 | return -ENOMEM; | 258 | goto dma_unmap_wqe_err; |
| 259 | 259 | ||
| 260 | dseg->addr = cpu_to_be64(dma_addr); | 260 | dseg->addr = cpu_to_be64(dma_addr); |
| 261 | dseg->lkey = sq->mkey_be; | 261 | dseg->lkey = sq->mkey_be; |
| @@ -273,7 +273,7 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb, | |||
| 273 | dma_addr = skb_frag_dma_map(sq->pdev, frag, 0, fsz, | 273 | dma_addr = skb_frag_dma_map(sq->pdev, frag, 0, fsz, |
| 274 | DMA_TO_DEVICE); | 274 | DMA_TO_DEVICE); |
| 275 | if (unlikely(dma_mapping_error(sq->pdev, dma_addr))) | 275 | if (unlikely(dma_mapping_error(sq->pdev, dma_addr))) |
| 276 | return -ENOMEM; | 276 | goto dma_unmap_wqe_err; |
| 277 | 277 | ||
| 278 | dseg->addr = cpu_to_be64(dma_addr); | 278 | dseg->addr = cpu_to_be64(dma_addr); |
| 279 | dseg->lkey = sq->mkey_be; | 279 | dseg->lkey = sq->mkey_be; |
| @@ -285,6 +285,10 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb, | |||
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | return num_dma; | 287 | return num_dma; |
| 288 | |||
| 289 | dma_unmap_wqe_err: | ||
| 290 | mlx5e_dma_unmap_wqe_err(sq, num_dma); | ||
| 291 | return -ENOMEM; | ||
| 288 | } | 292 | } |
| 289 | 293 | ||
| 290 | static inline void | 294 | static inline void |
| @@ -380,17 +384,15 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, | |||
| 380 | num_dma = mlx5e_txwqe_build_dsegs(sq, skb, skb_data, headlen, | 384 | num_dma = mlx5e_txwqe_build_dsegs(sq, skb, skb_data, headlen, |
| 381 | (struct mlx5_wqe_data_seg *)cseg + ds_cnt); | 385 | (struct mlx5_wqe_data_seg *)cseg + ds_cnt); |
| 382 | if (unlikely(num_dma < 0)) | 386 | if (unlikely(num_dma < 0)) |
| 383 | goto dma_unmap_wqe_err; | 387 | goto err_drop; |
| 384 | 388 | ||
| 385 | mlx5e_txwqe_complete(sq, skb, opcode, ds_cnt + num_dma, | 389 | mlx5e_txwqe_complete(sq, skb, opcode, ds_cnt + num_dma, |
| 386 | num_bytes, num_dma, wi, cseg); | 390 | num_bytes, num_dma, wi, cseg); |
| 387 | 391 | ||
| 388 | return NETDEV_TX_OK; | 392 | return NETDEV_TX_OK; |
| 389 | 393 | ||
| 390 | dma_unmap_wqe_err: | 394 | err_drop: |
| 391 | sq->stats.dropped++; | 395 | sq->stats.dropped++; |
| 392 | mlx5e_dma_unmap_wqe_err(sq, wi->num_dma); | ||
| 393 | |||
| 394 | dev_kfree_skb_any(skb); | 396 | dev_kfree_skb_any(skb); |
| 395 | 397 | ||
| 396 | return NETDEV_TX_OK; | 398 | return NETDEV_TX_OK; |
| @@ -645,17 +647,15 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, | |||
| 645 | num_dma = mlx5e_txwqe_build_dsegs(sq, skb, skb_data, headlen, | 647 | num_dma = mlx5e_txwqe_build_dsegs(sq, skb, skb_data, headlen, |
| 646 | (struct mlx5_wqe_data_seg *)cseg + ds_cnt); | 648 | (struct mlx5_wqe_data_seg *)cseg + ds_cnt); |
| 647 | if (unlikely(num_dma < 0)) | 649 | if (unlikely(num_dma < 0)) |
| 648 | goto dma_unmap_wqe_err; | 650 | goto err_drop; |
| 649 | 651 | ||
| 650 | mlx5e_txwqe_complete(sq, skb, opcode, ds_cnt + num_dma, | 652 | mlx5e_txwqe_complete(sq, skb, opcode, ds_cnt + num_dma, |
| 651 | num_bytes, num_dma, wi, cseg); | 653 | num_bytes, num_dma, wi, cseg); |
| 652 | 654 | ||
| 653 | return NETDEV_TX_OK; | 655 | return NETDEV_TX_OK; |
| 654 | 656 | ||
| 655 | dma_unmap_wqe_err: | 657 | err_drop: |
| 656 | sq->stats.dropped++; | 658 | sq->stats.dropped++; |
| 657 | mlx5e_dma_unmap_wqe_err(sq, wi->num_dma); | ||
| 658 | |||
| 659 | dev_kfree_skb_any(skb); | 659 | dev_kfree_skb_any(skb); |
| 660 | 660 | ||
| 661 | return NETDEV_TX_OK; | 661 | return NETDEV_TX_OK; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index c1c94974e16b..1814f803bd2c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c | |||
| @@ -34,6 +34,9 @@ | |||
| 34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
| 35 | #include <linux/mlx5/driver.h> | 35 | #include <linux/mlx5/driver.h> |
| 36 | #include <linux/mlx5/cmd.h> | 36 | #include <linux/mlx5/cmd.h> |
| 37 | #ifdef CONFIG_RFS_ACCEL | ||
| 38 | #include <linux/cpu_rmap.h> | ||
| 39 | #endif | ||
| 37 | #include "mlx5_core.h" | 40 | #include "mlx5_core.h" |
| 38 | #include "fpga/core.h" | 41 | #include "fpga/core.h" |
| 39 | #include "eswitch.h" | 42 | #include "eswitch.h" |
| @@ -923,3 +926,28 @@ int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, | |||
| 923 | MLX5_SET(query_eq_in, in, eq_number, eq->eqn); | 926 | MLX5_SET(query_eq_in, in, eq_number, eq->eqn); |
| 924 | return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen); | 927 | return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen); |
| 925 | } | 928 | } |
| 929 | |||
| 930 | /* This function should only be called after mlx5_cmd_force_teardown_hca */ | ||
| 931 | void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev) | ||
| 932 | { | ||
| 933 | struct mlx5_eq_table *table = &dev->priv.eq_table; | ||
| 934 | struct mlx5_eq *eq; | ||
| 935 | |||
| 936 | #ifdef CONFIG_RFS_ACCEL | ||
| 937 | if (dev->rmap) { | ||
| 938 | free_irq_cpu_rmap(dev->rmap); | ||
| 939 | dev->rmap = NULL; | ||
| 940 | } | ||
| 941 | #endif | ||
| 942 | list_for_each_entry(eq, &table->comp_eqs_list, list) | ||
| 943 | free_irq(eq->irqn, eq); | ||
| 944 | |||
| 945 | free_irq(table->pages_eq.irqn, &table->pages_eq); | ||
| 946 | free_irq(table->async_eq.irqn, &table->async_eq); | ||
| 947 | free_irq(table->cmd_eq.irqn, &table->cmd_eq); | ||
| 948 | #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING | ||
| 949 | if (MLX5_CAP_GEN(dev, pg)) | ||
| 950 | free_irq(table->pfault_eq.irqn, &table->pfault_eq); | ||
| 951 | #endif | ||
| 952 | pci_free_irq_vectors(dev->pdev); | ||
| 953 | } | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 332bc56306bf..1352d13eedb3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | |||
| @@ -2175,26 +2175,35 @@ int mlx5_eswitch_get_vport_stats(struct mlx5_eswitch *esw, | |||
| 2175 | memset(vf_stats, 0, sizeof(*vf_stats)); | 2175 | memset(vf_stats, 0, sizeof(*vf_stats)); |
| 2176 | vf_stats->rx_packets = | 2176 | vf_stats->rx_packets = |
| 2177 | MLX5_GET_CTR(out, received_eth_unicast.packets) + | 2177 | MLX5_GET_CTR(out, received_eth_unicast.packets) + |
| 2178 | MLX5_GET_CTR(out, received_ib_unicast.packets) + | ||
| 2178 | MLX5_GET_CTR(out, received_eth_multicast.packets) + | 2179 | MLX5_GET_CTR(out, received_eth_multicast.packets) + |
| 2180 | MLX5_GET_CTR(out, received_ib_multicast.packets) + | ||
| 2179 | MLX5_GET_CTR(out, received_eth_broadcast.packets); | 2181 | MLX5_GET_CTR(out, received_eth_broadcast.packets); |
| 2180 | 2182 | ||
| 2181 | vf_stats->rx_bytes = | 2183 | vf_stats->rx_bytes = |
| 2182 | MLX5_GET_CTR(out, received_eth_unicast.octets) + | 2184 | MLX5_GET_CTR(out, received_eth_unicast.octets) + |
| 2185 | MLX5_GET_CTR(out, received_ib_unicast.octets) + | ||
| 2183 | MLX5_GET_CTR(out, received_eth_multicast.octets) + | 2186 | MLX5_GET_CTR(out, received_eth_multicast.octets) + |
| 2187 | MLX5_GET_CTR(out, received_ib_multicast.octets) + | ||
| 2184 | MLX5_GET_CTR(out, received_eth_broadcast.octets); | 2188 | MLX5_GET_CTR(out, received_eth_broadcast.octets); |
| 2185 | 2189 | ||
| 2186 | vf_stats->tx_packets = | 2190 | vf_stats->tx_packets = |
| 2187 | MLX5_GET_CTR(out, transmitted_eth_unicast.packets) + | 2191 | MLX5_GET_CTR(out, transmitted_eth_unicast.packets) + |
| 2192 | MLX5_GET_CTR(out, transmitted_ib_unicast.packets) + | ||
| 2188 | MLX5_GET_CTR(out, transmitted_eth_multicast.packets) + | 2193 | MLX5_GET_CTR(out, transmitted_eth_multicast.packets) + |
| 2194 | MLX5_GET_CTR(out, transmitted_ib_multicast.packets) + | ||
| 2189 | MLX5_GET_CTR(out, transmitted_eth_broadcast.packets); | 2195 | MLX5_GET_CTR(out, transmitted_eth_broadcast.packets); |
| 2190 | 2196 | ||
| 2191 | vf_stats->tx_bytes = | 2197 | vf_stats->tx_bytes = |
| 2192 | MLX5_GET_CTR(out, transmitted_eth_unicast.octets) + | 2198 | MLX5_GET_CTR(out, transmitted_eth_unicast.octets) + |
| 2199 | MLX5_GET_CTR(out, transmitted_ib_unicast.octets) + | ||
| 2193 | MLX5_GET_CTR(out, transmitted_eth_multicast.octets) + | 2200 | MLX5_GET_CTR(out, transmitted_eth_multicast.octets) + |
| 2201 | MLX5_GET_CTR(out, transmitted_ib_multicast.octets) + | ||
| 2194 | MLX5_GET_CTR(out, transmitted_eth_broadcast.octets); | 2202 | MLX5_GET_CTR(out, transmitted_eth_broadcast.octets); |
| 2195 | 2203 | ||
| 2196 | vf_stats->multicast = | 2204 | vf_stats->multicast = |
| 2197 | MLX5_GET_CTR(out, received_eth_multicast.packets); | 2205 | MLX5_GET_CTR(out, received_eth_multicast.packets) + |
| 2206 | MLX5_GET_CTR(out, received_ib_multicast.packets); | ||
| 2198 | 2207 | ||
| 2199 | vf_stats->broadcast = | 2208 | vf_stats->broadcast = |
| 2200 | MLX5_GET_CTR(out, received_eth_broadcast.packets); | 2209 | MLX5_GET_CTR(out, received_eth_broadcast.packets); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index de51e7c39bc8..c39c1692e674 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | |||
| @@ -187,6 +187,7 @@ static void del_sw_ns(struct fs_node *node); | |||
| 187 | static void del_sw_hw_rule(struct fs_node *node); | 187 | static void del_sw_hw_rule(struct fs_node *node); |
| 188 | static bool mlx5_flow_dests_cmp(struct mlx5_flow_destination *d1, | 188 | static bool mlx5_flow_dests_cmp(struct mlx5_flow_destination *d1, |
| 189 | struct mlx5_flow_destination *d2); | 189 | struct mlx5_flow_destination *d2); |
| 190 | static void cleanup_root_ns(struct mlx5_flow_root_namespace *root_ns); | ||
| 190 | static struct mlx5_flow_rule * | 191 | static struct mlx5_flow_rule * |
| 191 | find_flow_rule(struct fs_fte *fte, | 192 | find_flow_rule(struct fs_fte *fte, |
| 192 | struct mlx5_flow_destination *dest); | 193 | struct mlx5_flow_destination *dest); |
| @@ -481,7 +482,8 @@ static void del_sw_hw_rule(struct fs_node *node) | |||
| 481 | 482 | ||
| 482 | if (rule->dest_attr.type == MLX5_FLOW_DESTINATION_TYPE_COUNTER && | 483 | if (rule->dest_attr.type == MLX5_FLOW_DESTINATION_TYPE_COUNTER && |
| 483 | --fte->dests_size) { | 484 | --fte->dests_size) { |
| 484 | modify_mask = BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_ACTION); | 485 | modify_mask = BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_ACTION) | |
| 486 | BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_FLOW_COUNTERS); | ||
| 485 | fte->action.action &= ~MLX5_FLOW_CONTEXT_ACTION_COUNT; | 487 | fte->action.action &= ~MLX5_FLOW_CONTEXT_ACTION_COUNT; |
| 486 | update_fte = true; | 488 | update_fte = true; |
| 487 | goto out; | 489 | goto out; |
| @@ -2351,23 +2353,27 @@ static int create_anchor_flow_table(struct mlx5_flow_steering *steering) | |||
| 2351 | 2353 | ||
| 2352 | static int init_root_ns(struct mlx5_flow_steering *steering) | 2354 | static int init_root_ns(struct mlx5_flow_steering *steering) |
| 2353 | { | 2355 | { |
| 2356 | int err; | ||
| 2357 | |||
| 2354 | steering->root_ns = create_root_ns(steering, FS_FT_NIC_RX); | 2358 | steering->root_ns = create_root_ns(steering, FS_FT_NIC_RX); |
| 2355 | if (!steering->root_ns) | 2359 | if (!steering->root_ns) |
| 2356 | goto cleanup; | 2360 | return -ENOMEM; |
| 2357 | 2361 | ||
| 2358 | if (init_root_tree(steering, &root_fs, &steering->root_ns->ns.node)) | 2362 | err = init_root_tree(steering, &root_fs, &steering->root_ns->ns.node); |
| 2359 | goto cleanup; | 2363 | if (err) |
| 2364 | goto out_err; | ||
| 2360 | 2365 | ||
| 2361 | set_prio_attrs(steering->root_ns); | 2366 | set_prio_attrs(steering->root_ns); |
| 2362 | 2367 | err = create_anchor_flow_table(steering); | |
| 2363 | if (create_anchor_flow_table(steering)) | 2368 | if (err) |
| 2364 | goto cleanup; | 2369 | goto out_err; |
| 2365 | 2370 | ||
| 2366 | return 0; | 2371 | return 0; |
| 2367 | 2372 | ||
| 2368 | cleanup: | 2373 | out_err: |
| 2369 | mlx5_cleanup_fs(steering->dev); | 2374 | cleanup_root_ns(steering->root_ns); |
| 2370 | return -ENOMEM; | 2375 | steering->root_ns = NULL; |
| 2376 | return err; | ||
| 2371 | } | 2377 | } |
| 2372 | 2378 | ||
| 2373 | static void clean_tree(struct fs_node *node) | 2379 | static void clean_tree(struct fs_node *node) |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 63a8ea31601c..e2c465b0b3f8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
| @@ -1587,6 +1587,14 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev *dev) | |||
| 1587 | 1587 | ||
| 1588 | mlx5_enter_error_state(dev, true); | 1588 | mlx5_enter_error_state(dev, true); |
| 1589 | 1589 | ||
| 1590 | /* Some platforms requiring freeing the IRQ's in the shutdown | ||
| 1591 | * flow. If they aren't freed they can't be allocated after | ||
| 1592 | * kexec. There is no need to cleanup the mlx5_core software | ||
| 1593 | * contexts. | ||
| 1594 | */ | ||
| 1595 | mlx5_irq_clear_affinity_hints(dev); | ||
| 1596 | mlx5_core_eq_free_irqs(dev); | ||
| 1597 | |||
| 1590 | return 0; | 1598 | return 0; |
| 1591 | } | 1599 | } |
| 1592 | 1600 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h index 7d001fe6e631..023882d9a22e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h | |||
| @@ -128,6 +128,8 @@ int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, | |||
| 128 | u32 *out, int outlen); | 128 | u32 *out, int outlen); |
| 129 | int mlx5_start_eqs(struct mlx5_core_dev *dev); | 129 | int mlx5_start_eqs(struct mlx5_core_dev *dev); |
| 130 | void mlx5_stop_eqs(struct mlx5_core_dev *dev); | 130 | void mlx5_stop_eqs(struct mlx5_core_dev *dev); |
| 131 | /* This function should only be called after mlx5_cmd_force_teardown_hca */ | ||
| 132 | void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev); | ||
| 131 | struct mlx5_eq *mlx5_eqn2eq(struct mlx5_core_dev *dev, int eqn); | 133 | struct mlx5_eq *mlx5_eqn2eq(struct mlx5_core_dev *dev, int eqn); |
| 132 | u32 mlx5_eq_poll_irq_disabled(struct mlx5_eq *eq); | 134 | u32 mlx5_eq_poll_irq_disabled(struct mlx5_eq *eq); |
| 133 | void mlx5_cq_tasklet_cb(unsigned long data); | 135 | void mlx5_cq_tasklet_cb(unsigned long data); |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 93ea56620a24..e13ac3b8dff7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c | |||
| @@ -1100,11 +1100,11 @@ err_emad_init: | |||
| 1100 | err_alloc_lag_mapping: | 1100 | err_alloc_lag_mapping: |
| 1101 | mlxsw_ports_fini(mlxsw_core); | 1101 | mlxsw_ports_fini(mlxsw_core); |
| 1102 | err_ports_init: | 1102 | err_ports_init: |
| 1103 | mlxsw_bus->fini(bus_priv); | ||
| 1104 | err_bus_init: | ||
| 1105 | if (!reload) | 1103 | if (!reload) |
| 1106 | devlink_resources_unregister(devlink, NULL); | 1104 | devlink_resources_unregister(devlink, NULL); |
| 1107 | err_register_resources: | 1105 | err_register_resources: |
| 1106 | mlxsw_bus->fini(bus_priv); | ||
| 1107 | err_bus_init: | ||
| 1108 | if (!reload) | 1108 | if (!reload) |
| 1109 | devlink_free(devlink); | 1109 | devlink_free(devlink); |
| 1110 | err_devlink_alloc: | 1110 | err_devlink_alloc: |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index c11c9a635866..4ed01182a82c 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | |||
| @@ -1718,13 +1718,11 @@ __mlxsw_sp_port_mdb_del(struct mlxsw_sp_port *mlxsw_sp_port, | |||
| 1718 | struct net_device *dev = mlxsw_sp_port->dev; | 1718 | struct net_device *dev = mlxsw_sp_port->dev; |
| 1719 | int err; | 1719 | int err; |
| 1720 | 1720 | ||
| 1721 | if (bridge_port->bridge_device->multicast_enabled) { | 1721 | if (bridge_port->bridge_device->multicast_enabled && |
| 1722 | if (bridge_port->bridge_device->multicast_enabled) { | 1722 | !bridge_port->mrouter) { |
| 1723 | err = mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, | 1723 | err = mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, false); |
| 1724 | false); | 1724 | if (err) |
| 1725 | if (err) | 1725 | netdev_err(dev, "Unable to remove port from SMID\n"); |
| 1726 | netdev_err(dev, "Unable to remove port from SMID\n"); | ||
| 1727 | } | ||
| 1728 | } | 1726 | } |
| 1729 | 1727 | ||
| 1730 | err = mlxsw_sp_port_remove_from_mid(mlxsw_sp_port, mid); | 1728 | err = mlxsw_sp_port_remove_from_mid(mlxsw_sp_port, mid); |
diff --git a/drivers/net/ethernet/netronome/nfp/flower/action.c b/drivers/net/ethernet/netronome/nfp/flower/action.c index b3567a596fc1..80df9a5d4217 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/action.c +++ b/drivers/net/ethernet/netronome/nfp/flower/action.c | |||
| @@ -183,17 +183,21 @@ static int | |||
| 183 | nfp_fl_set_ipv4_udp_tun(struct nfp_fl_set_ipv4_udp_tun *set_tun, | 183 | nfp_fl_set_ipv4_udp_tun(struct nfp_fl_set_ipv4_udp_tun *set_tun, |
| 184 | const struct tc_action *action, | 184 | const struct tc_action *action, |
| 185 | struct nfp_fl_pre_tunnel *pre_tun, | 185 | struct nfp_fl_pre_tunnel *pre_tun, |
| 186 | enum nfp_flower_tun_type tun_type) | 186 | enum nfp_flower_tun_type tun_type, |
| 187 | struct net_device *netdev) | ||
| 187 | { | 188 | { |
| 188 | size_t act_size = sizeof(struct nfp_fl_set_ipv4_udp_tun); | 189 | size_t act_size = sizeof(struct nfp_fl_set_ipv4_udp_tun); |
| 189 | struct ip_tunnel_info *ip_tun = tcf_tunnel_info(action); | 190 | struct ip_tunnel_info *ip_tun = tcf_tunnel_info(action); |
| 190 | u32 tmp_set_ip_tun_type_index = 0; | 191 | u32 tmp_set_ip_tun_type_index = 0; |
| 191 | /* Currently support one pre-tunnel so index is always 0. */ | 192 | /* Currently support one pre-tunnel so index is always 0. */ |
| 192 | int pretun_idx = 0; | 193 | int pretun_idx = 0; |
| 194 | struct net *net; | ||
| 193 | 195 | ||
| 194 | if (ip_tun->options_len) | 196 | if (ip_tun->options_len) |
| 195 | return -EOPNOTSUPP; | 197 | return -EOPNOTSUPP; |
| 196 | 198 | ||
| 199 | net = dev_net(netdev); | ||
| 200 | |||
| 197 | set_tun->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV4_TUNNEL; | 201 | set_tun->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV4_TUNNEL; |
| 198 | set_tun->head.len_lw = act_size >> NFP_FL_LW_SIZ; | 202 | set_tun->head.len_lw = act_size >> NFP_FL_LW_SIZ; |
| 199 | 203 | ||
| @@ -204,6 +208,7 @@ nfp_fl_set_ipv4_udp_tun(struct nfp_fl_set_ipv4_udp_tun *set_tun, | |||
| 204 | 208 | ||
| 205 | set_tun->tun_type_index = cpu_to_be32(tmp_set_ip_tun_type_index); | 209 | set_tun->tun_type_index = cpu_to_be32(tmp_set_ip_tun_type_index); |
| 206 | set_tun->tun_id = ip_tun->key.tun_id; | 210 | set_tun->tun_id = ip_tun->key.tun_id; |
| 211 | set_tun->ttl = net->ipv4.sysctl_ip_default_ttl; | ||
| 207 | 212 | ||
| 208 | /* Complete pre_tunnel action. */ | 213 | /* Complete pre_tunnel action. */ |
| 209 | pre_tun->ipv4_dst = ip_tun->key.u.ipv4.dst; | 214 | pre_tun->ipv4_dst = ip_tun->key.u.ipv4.dst; |
| @@ -511,7 +516,8 @@ nfp_flower_loop_action(const struct tc_action *a, | |||
| 511 | *a_len += sizeof(struct nfp_fl_pre_tunnel); | 516 | *a_len += sizeof(struct nfp_fl_pre_tunnel); |
| 512 | 517 | ||
| 513 | set_tun = (void *)&nfp_fl->action_data[*a_len]; | 518 | set_tun = (void *)&nfp_fl->action_data[*a_len]; |
| 514 | err = nfp_fl_set_ipv4_udp_tun(set_tun, a, pre_tun, *tun_type); | 519 | err = nfp_fl_set_ipv4_udp_tun(set_tun, a, pre_tun, *tun_type, |
| 520 | netdev); | ||
| 515 | if (err) | 521 | if (err) |
| 516 | return err; | 522 | return err; |
| 517 | *a_len += sizeof(struct nfp_fl_set_ipv4_udp_tun); | 523 | *a_len += sizeof(struct nfp_fl_set_ipv4_udp_tun); |
diff --git a/drivers/net/ethernet/netronome/nfp/flower/cmsg.h b/drivers/net/ethernet/netronome/nfp/flower/cmsg.h index b6c0fd053a50..bee4367a2c38 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/cmsg.h +++ b/drivers/net/ethernet/netronome/nfp/flower/cmsg.h | |||
| @@ -190,7 +190,10 @@ struct nfp_fl_set_ipv4_udp_tun { | |||
| 190 | __be16 reserved; | 190 | __be16 reserved; |
| 191 | __be64 tun_id __packed; | 191 | __be64 tun_id __packed; |
| 192 | __be32 tun_type_index; | 192 | __be32 tun_type_index; |
| 193 | __be32 extra[3]; | 193 | __be16 reserved2; |
| 194 | u8 ttl; | ||
| 195 | u8 reserved3; | ||
| 196 | __be32 extra[2]; | ||
| 194 | }; | 197 | }; |
| 195 | 198 | ||
| 196 | /* Metadata with L2 (1W/4B) | 199 | /* Metadata with L2 (1W/4B) |
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c index ad02592a82b7..84e3b9f5abb1 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/main.c +++ b/drivers/net/ethernet/netronome/nfp/flower/main.c | |||
| @@ -52,8 +52,6 @@ | |||
| 52 | 52 | ||
| 53 | #define NFP_FLOWER_ALLOWED_VER 0x0001000000010000UL | 53 | #define NFP_FLOWER_ALLOWED_VER 0x0001000000010000UL |
| 54 | 54 | ||
| 55 | #define NFP_FLOWER_FRAME_HEADROOM 158 | ||
| 56 | |||
| 57 | static const char *nfp_flower_extra_cap(struct nfp_app *app, struct nfp_net *nn) | 55 | static const char *nfp_flower_extra_cap(struct nfp_app *app, struct nfp_net *nn) |
| 58 | { | 56 | { |
| 59 | return "FLOWER"; | 57 | return "FLOWER"; |
| @@ -360,7 +358,7 @@ nfp_flower_spawn_phy_reprs(struct nfp_app *app, struct nfp_flower_priv *priv) | |||
| 360 | } | 358 | } |
| 361 | 359 | ||
| 362 | SET_NETDEV_DEV(repr, &priv->nn->pdev->dev); | 360 | SET_NETDEV_DEV(repr, &priv->nn->pdev->dev); |
| 363 | nfp_net_get_mac_addr(app->pf, port); | 361 | nfp_net_get_mac_addr(app->pf, repr, port); |
| 364 | 362 | ||
| 365 | cmsg_port_id = nfp_flower_cmsg_phys_port(phys_port); | 363 | cmsg_port_id = nfp_flower_cmsg_phys_port(phys_port); |
| 366 | err = nfp_repr_init(app, repr, | 364 | err = nfp_repr_init(app, repr, |
| @@ -559,22 +557,6 @@ static void nfp_flower_clean(struct nfp_app *app) | |||
| 559 | app->priv = NULL; | 557 | app->priv = NULL; |
| 560 | } | 558 | } |
| 561 | 559 | ||
| 562 | static int | ||
| 563 | nfp_flower_check_mtu(struct nfp_app *app, struct net_device *netdev, | ||
| 564 | int new_mtu) | ||
| 565 | { | ||
| 566 | /* The flower fw reserves NFP_FLOWER_FRAME_HEADROOM bytes of the | ||
| 567 | * supported max MTU to allow for appending tunnel headers. To prevent | ||
| 568 | * unexpected behaviour this needs to be accounted for. | ||
| 569 | */ | ||
| 570 | if (new_mtu > netdev->max_mtu - NFP_FLOWER_FRAME_HEADROOM) { | ||
| 571 | nfp_err(app->cpp, "New MTU (%d) is not valid\n", new_mtu); | ||
| 572 | return -EINVAL; | ||
| 573 | } | ||
| 574 | |||
| 575 | return 0; | ||
| 576 | } | ||
| 577 | |||
| 578 | static bool nfp_flower_check_ack(struct nfp_flower_priv *app_priv) | 560 | static bool nfp_flower_check_ack(struct nfp_flower_priv *app_priv) |
| 579 | { | 561 | { |
| 580 | bool ret; | 562 | bool ret; |
| @@ -656,7 +638,6 @@ const struct nfp_app_type app_flower = { | |||
| 656 | .init = nfp_flower_init, | 638 | .init = nfp_flower_init, |
| 657 | .clean = nfp_flower_clean, | 639 | .clean = nfp_flower_clean, |
| 658 | 640 | ||
| 659 | .check_mtu = nfp_flower_check_mtu, | ||
| 660 | .repr_change_mtu = nfp_flower_repr_change_mtu, | 641 | .repr_change_mtu = nfp_flower_repr_change_mtu, |
| 661 | 642 | ||
| 662 | .vnic_alloc = nfp_flower_vnic_alloc, | 643 | .vnic_alloc = nfp_flower_vnic_alloc, |
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_app_nic.c b/drivers/net/ethernet/netronome/nfp/nfp_app_nic.c index 2a2f2fbc8850..b9618c37403f 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_app_nic.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_app_nic.c | |||
| @@ -69,7 +69,7 @@ int nfp_app_nic_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, | |||
| 69 | if (err) | 69 | if (err) |
| 70 | return err < 0 ? err : 0; | 70 | return err < 0 ? err : 0; |
| 71 | 71 | ||
| 72 | nfp_net_get_mac_addr(app->pf, nn->port); | 72 | nfp_net_get_mac_addr(app->pf, nn->dp.netdev, nn->port); |
| 73 | 73 | ||
| 74 | return 0; | 74 | return 0; |
| 75 | } | 75 | } |
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.h b/drivers/net/ethernet/netronome/nfp/nfp_main.h index add46e28212b..42211083b51f 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.h | |||
| @@ -171,7 +171,9 @@ void nfp_net_pci_remove(struct nfp_pf *pf); | |||
| 171 | int nfp_hwmon_register(struct nfp_pf *pf); | 171 | int nfp_hwmon_register(struct nfp_pf *pf); |
| 172 | void nfp_hwmon_unregister(struct nfp_pf *pf); | 172 | void nfp_hwmon_unregister(struct nfp_pf *pf); |
| 173 | 173 | ||
| 174 | void nfp_net_get_mac_addr(struct nfp_pf *pf, struct nfp_port *port); | 174 | void |
| 175 | nfp_net_get_mac_addr(struct nfp_pf *pf, struct net_device *netdev, | ||
| 176 | struct nfp_port *port); | ||
| 175 | 177 | ||
| 176 | bool nfp_ctrl_tx(struct nfp_net *nn, struct sk_buff *skb); | 178 | bool nfp_ctrl_tx(struct nfp_net *nn, struct sk_buff *skb); |
| 177 | 179 | ||
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c index 15fa47f622aa..45cd2092e498 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c | |||
| @@ -67,23 +67,26 @@ | |||
| 67 | /** | 67 | /** |
| 68 | * nfp_net_get_mac_addr() - Get the MAC address. | 68 | * nfp_net_get_mac_addr() - Get the MAC address. |
| 69 | * @pf: NFP PF handle | 69 | * @pf: NFP PF handle |
| 70 | * @netdev: net_device to set MAC address on | ||
| 70 | * @port: NFP port structure | 71 | * @port: NFP port structure |
| 71 | * | 72 | * |
| 72 | * First try to get the MAC address from NSP ETH table. If that | 73 | * First try to get the MAC address from NSP ETH table. If that |
| 73 | * fails generate a random address. | 74 | * fails generate a random address. |
| 74 | */ | 75 | */ |
| 75 | void nfp_net_get_mac_addr(struct nfp_pf *pf, struct nfp_port *port) | 76 | void |
| 77 | nfp_net_get_mac_addr(struct nfp_pf *pf, struct net_device *netdev, | ||
| 78 | struct nfp_port *port) | ||
| 76 | { | 79 | { |
| 77 | struct nfp_eth_table_port *eth_port; | 80 | struct nfp_eth_table_port *eth_port; |
| 78 | 81 | ||
| 79 | eth_port = __nfp_port_get_eth_port(port); | 82 | eth_port = __nfp_port_get_eth_port(port); |
| 80 | if (!eth_port) { | 83 | if (!eth_port) { |
| 81 | eth_hw_addr_random(port->netdev); | 84 | eth_hw_addr_random(netdev); |
| 82 | return; | 85 | return; |
| 83 | } | 86 | } |
| 84 | 87 | ||
| 85 | ether_addr_copy(port->netdev->dev_addr, eth_port->mac_addr); | 88 | ether_addr_copy(netdev->dev_addr, eth_port->mac_addr); |
| 86 | ether_addr_copy(port->netdev->perm_addr, eth_port->mac_addr); | 89 | ether_addr_copy(netdev->perm_addr, eth_port->mac_addr); |
| 87 | } | 90 | } |
| 88 | 91 | ||
| 89 | static struct nfp_eth_table_port * | 92 | static struct nfp_eth_table_port * |
| @@ -511,16 +514,18 @@ static int nfp_net_pci_map_mem(struct nfp_pf *pf) | |||
| 511 | return PTR_ERR(mem); | 514 | return PTR_ERR(mem); |
| 512 | } | 515 | } |
| 513 | 516 | ||
| 514 | min_size = NFP_MAC_STATS_SIZE * (pf->eth_tbl->max_index + 1); | 517 | if (pf->eth_tbl) { |
| 515 | pf->mac_stats_mem = nfp_rtsym_map(pf->rtbl, "_mac_stats", | 518 | min_size = NFP_MAC_STATS_SIZE * (pf->eth_tbl->max_index + 1); |
| 516 | "net.macstats", min_size, | 519 | pf->mac_stats_mem = nfp_rtsym_map(pf->rtbl, "_mac_stats", |
| 517 | &pf->mac_stats_bar); | 520 | "net.macstats", min_size, |
| 518 | if (IS_ERR(pf->mac_stats_mem)) { | 521 | &pf->mac_stats_bar); |
| 519 | if (PTR_ERR(pf->mac_stats_mem) != -ENOENT) { | 522 | if (IS_ERR(pf->mac_stats_mem)) { |
| 520 | err = PTR_ERR(pf->mac_stats_mem); | 523 | if (PTR_ERR(pf->mac_stats_mem) != -ENOENT) { |
| 521 | goto err_unmap_ctrl; | 524 | err = PTR_ERR(pf->mac_stats_mem); |
| 525 | goto err_unmap_ctrl; | ||
| 526 | } | ||
| 527 | pf->mac_stats_mem = NULL; | ||
| 522 | } | 528 | } |
| 523 | pf->mac_stats_mem = NULL; | ||
| 524 | } | 529 | } |
| 525 | 530 | ||
| 526 | pf->vf_cfg_mem = nfp_net_pf_map_rtsym(pf, "net.vfcfg", | 531 | pf->vf_cfg_mem = nfp_net_pf_map_rtsym(pf, "net.vfcfg", |
diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c index 27364b7572fc..b092894dd128 100644 --- a/drivers/net/ethernet/ni/nixge.c +++ b/drivers/net/ethernet/ni/nixge.c | |||
| @@ -1170,7 +1170,7 @@ static void *nixge_get_nvmem_address(struct device *dev) | |||
| 1170 | 1170 | ||
| 1171 | cell = nvmem_cell_get(dev, "address"); | 1171 | cell = nvmem_cell_get(dev, "address"); |
| 1172 | if (IS_ERR(cell)) | 1172 | if (IS_ERR(cell)) |
| 1173 | return cell; | 1173 | return NULL; |
| 1174 | 1174 | ||
| 1175 | mac = nvmem_cell_read(cell, &cell_size); | 1175 | mac = nvmem_cell_read(cell, &cell_size); |
| 1176 | nvmem_cell_put(cell); | 1176 | nvmem_cell_put(cell); |
| @@ -1183,7 +1183,7 @@ static int nixge_probe(struct platform_device *pdev) | |||
| 1183 | struct nixge_priv *priv; | 1183 | struct nixge_priv *priv; |
| 1184 | struct net_device *ndev; | 1184 | struct net_device *ndev; |
| 1185 | struct resource *dmares; | 1185 | struct resource *dmares; |
| 1186 | const char *mac_addr; | 1186 | const u8 *mac_addr; |
| 1187 | int err; | 1187 | int err; |
| 1188 | 1188 | ||
| 1189 | ndev = alloc_etherdev(sizeof(*priv)); | 1189 | ndev = alloc_etherdev(sizeof(*priv)); |
| @@ -1202,10 +1202,12 @@ static int nixge_probe(struct platform_device *pdev) | |||
| 1202 | ndev->max_mtu = NIXGE_JUMBO_MTU; | 1202 | ndev->max_mtu = NIXGE_JUMBO_MTU; |
| 1203 | 1203 | ||
| 1204 | mac_addr = nixge_get_nvmem_address(&pdev->dev); | 1204 | mac_addr = nixge_get_nvmem_address(&pdev->dev); |
| 1205 | if (mac_addr && is_valid_ether_addr(mac_addr)) | 1205 | if (mac_addr && is_valid_ether_addr(mac_addr)) { |
| 1206 | ether_addr_copy(ndev->dev_addr, mac_addr); | 1206 | ether_addr_copy(ndev->dev_addr, mac_addr); |
| 1207 | else | 1207 | kfree(mac_addr); |
| 1208 | } else { | ||
| 1208 | eth_hw_addr_random(ndev); | 1209 | eth_hw_addr_random(ndev); |
| 1210 | } | ||
| 1209 | 1211 | ||
| 1210 | priv = netdev_priv(ndev); | 1212 | priv = netdev_priv(ndev); |
| 1211 | priv->ndev = ndev; | 1213 | priv->ndev = ndev; |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c index e874504e8b28..8667799d0069 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c | |||
| @@ -115,8 +115,7 @@ int qed_l2_alloc(struct qed_hwfn *p_hwfn) | |||
| 115 | 115 | ||
| 116 | void qed_l2_setup(struct qed_hwfn *p_hwfn) | 116 | void qed_l2_setup(struct qed_hwfn *p_hwfn) |
| 117 | { | 117 | { |
| 118 | if (p_hwfn->hw_info.personality != QED_PCI_ETH && | 118 | if (!QED_IS_L2_PERSONALITY(p_hwfn)) |
| 119 | p_hwfn->hw_info.personality != QED_PCI_ETH_ROCE) | ||
| 120 | return; | 119 | return; |
| 121 | 120 | ||
| 122 | mutex_init(&p_hwfn->p_l2_info->lock); | 121 | mutex_init(&p_hwfn->p_l2_info->lock); |
| @@ -126,8 +125,7 @@ void qed_l2_free(struct qed_hwfn *p_hwfn) | |||
| 126 | { | 125 | { |
| 127 | u32 i; | 126 | u32 i; |
| 128 | 127 | ||
| 129 | if (p_hwfn->hw_info.personality != QED_PCI_ETH && | 128 | if (!QED_IS_L2_PERSONALITY(p_hwfn)) |
| 130 | p_hwfn->hw_info.personality != QED_PCI_ETH_ROCE) | ||
| 131 | return; | 129 | return; |
| 132 | 130 | ||
| 133 | if (!p_hwfn->p_l2_info) | 131 | if (!p_hwfn->p_l2_info) |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index 74fc626b1ec1..38502815d681 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c | |||
| @@ -2370,7 +2370,7 @@ static int qed_ll2_start_xmit(struct qed_dev *cdev, struct sk_buff *skb) | |||
| 2370 | u8 flags = 0; | 2370 | u8 flags = 0; |
| 2371 | 2371 | ||
| 2372 | if (unlikely(skb->ip_summed != CHECKSUM_NONE)) { | 2372 | if (unlikely(skb->ip_summed != CHECKSUM_NONE)) { |
| 2373 | DP_INFO(cdev, "Cannot transmit a checksumed packet\n"); | 2373 | DP_INFO(cdev, "Cannot transmit a checksummed packet\n"); |
| 2374 | return -EINVAL; | 2374 | return -EINVAL; |
| 2375 | } | 2375 | } |
| 2376 | 2376 | ||
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 9854aa9139af..7870ae2a6f7e 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c | |||
| @@ -680,7 +680,7 @@ static int qed_nic_stop(struct qed_dev *cdev) | |||
| 680 | tasklet_disable(p_hwfn->sp_dpc); | 680 | tasklet_disable(p_hwfn->sp_dpc); |
| 681 | p_hwfn->b_sp_dpc_enabled = false; | 681 | p_hwfn->b_sp_dpc_enabled = false; |
| 682 | DP_VERBOSE(cdev, NETIF_MSG_IFDOWN, | 682 | DP_VERBOSE(cdev, NETIF_MSG_IFDOWN, |
| 683 | "Disabled sp taskelt [hwfn %d] at %p\n", | 683 | "Disabled sp tasklet [hwfn %d] at %p\n", |
| 684 | i, p_hwfn->sp_dpc); | 684 | i, p_hwfn->sp_dpc); |
| 685 | } | 685 | } |
| 686 | } | 686 | } |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c index fb7c2d1562ae..6acfd43c1a4f 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_roce.c +++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c | |||
| @@ -848,7 +848,7 @@ int qed_roce_query_qp(struct qed_hwfn *p_hwfn, | |||
| 848 | 848 | ||
| 849 | if (!(qp->resp_offloaded)) { | 849 | if (!(qp->resp_offloaded)) { |
| 850 | DP_NOTICE(p_hwfn, | 850 | DP_NOTICE(p_hwfn, |
| 851 | "The responder's qp should be offloded before requester's\n"); | 851 | "The responder's qp should be offloaded before requester's\n"); |
| 852 | return -EINVAL; | 852 | return -EINVAL; |
| 853 | } | 853 | } |
| 854 | 854 | ||
diff --git a/drivers/net/ethernet/qlogic/qede/qede_rdma.c b/drivers/net/ethernet/qlogic/qede/qede_rdma.c index 50b142fad6b8..1900bf7e67d1 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_rdma.c +++ b/drivers/net/ethernet/qlogic/qede/qede_rdma.c | |||
| @@ -238,7 +238,7 @@ qede_rdma_get_free_event_node(struct qede_dev *edev) | |||
| 238 | } | 238 | } |
| 239 | 239 | ||
| 240 | if (!found) { | 240 | if (!found) { |
| 241 | event_node = kzalloc(sizeof(*event_node), GFP_KERNEL); | 241 | event_node = kzalloc(sizeof(*event_node), GFP_ATOMIC); |
| 242 | if (!event_node) { | 242 | if (!event_node) { |
| 243 | DP_NOTICE(edev, | 243 | DP_NOTICE(edev, |
| 244 | "qedr: Could not allocate memory for rdma work\n"); | 244 | "qedr: Could not allocate memory for rdma work\n"); |
diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c index d24b47b8e0b2..d118da5a10a2 100644 --- a/drivers/net/ethernet/realtek/8139too.c +++ b/drivers/net/ethernet/realtek/8139too.c | |||
| @@ -2224,7 +2224,7 @@ static void rtl8139_poll_controller(struct net_device *dev) | |||
| 2224 | struct rtl8139_private *tp = netdev_priv(dev); | 2224 | struct rtl8139_private *tp = netdev_priv(dev); |
| 2225 | const int irq = tp->pci_dev->irq; | 2225 | const int irq = tp->pci_dev->irq; |
| 2226 | 2226 | ||
| 2227 | disable_irq(irq); | 2227 | disable_irq_nosync(irq); |
| 2228 | rtl8139_interrupt(irq, dev); | 2228 | rtl8139_interrupt(irq, dev); |
| 2229 | enable_irq(irq); | 2229 | enable_irq(irq); |
| 2230 | } | 2230 | } |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 604ae78381ae..c7aac1fc99e8 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
| @@ -4981,6 +4981,9 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) | |||
| 4981 | static void rtl_pll_power_up(struct rtl8169_private *tp) | 4981 | static void rtl_pll_power_up(struct rtl8169_private *tp) |
| 4982 | { | 4982 | { |
| 4983 | rtl_generic_op(tp, tp->pll_power_ops.up); | 4983 | rtl_generic_op(tp, tp->pll_power_ops.up); |
| 4984 | |||
| 4985 | /* give MAC/PHY some time to resume */ | ||
| 4986 | msleep(20); | ||
| 4984 | } | 4987 | } |
| 4985 | 4988 | ||
| 4986 | static void rtl_init_pll_power_ops(struct rtl8169_private *tp) | 4989 | static void rtl_init_pll_power_ops(struct rtl8169_private *tp) |
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 63036d9bf3e6..d90a7b1f4088 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
| @@ -4784,8 +4784,9 @@ expire: | |||
| 4784 | * will set rule->filter_id to EFX_ARFS_FILTER_ID_PENDING, meaning that | 4784 | * will set rule->filter_id to EFX_ARFS_FILTER_ID_PENDING, meaning that |
| 4785 | * the rule is not removed by efx_rps_hash_del() below. | 4785 | * the rule is not removed by efx_rps_hash_del() below. |
| 4786 | */ | 4786 | */ |
| 4787 | ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority, | 4787 | if (ret) |
| 4788 | filter_idx, true) == 0; | 4788 | ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority, |
| 4789 | filter_idx, true) == 0; | ||
| 4789 | /* While we can't safely dereference rule (we dropped the lock), we can | 4790 | /* While we can't safely dereference rule (we dropped the lock), we can |
| 4790 | * still test it for NULL. | 4791 | * still test it for NULL. |
| 4791 | */ | 4792 | */ |
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index 64a94f242027..d2e254f2f72b 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c | |||
| @@ -839,6 +839,8 @@ static void efx_filter_rfs_work(struct work_struct *data) | |||
| 839 | int rc; | 839 | int rc; |
| 840 | 840 | ||
| 841 | rc = efx->type->filter_insert(efx, &req->spec, true); | 841 | rc = efx->type->filter_insert(efx, &req->spec, true); |
| 842 | if (rc >= 0) | ||
| 843 | rc %= efx->type->max_rx_ip_filters; | ||
| 842 | if (efx->rps_hash_table) { | 844 | if (efx->rps_hash_table) { |
| 843 | spin_lock_bh(&efx->rps_hash_lock); | 845 | spin_lock_bh(&efx->rps_hash_lock); |
| 844 | rule = efx_rps_hash_find(efx, &req->spec); | 846 | rule = efx_rps_hash_find(efx, &req->spec); |
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index f081de4f38d7..88c12474a0c3 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c | |||
| @@ -3443,7 +3443,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, | |||
| 3443 | 3443 | ||
| 3444 | len = (val & RCR_ENTRY_L2_LEN) >> | 3444 | len = (val & RCR_ENTRY_L2_LEN) >> |
| 3445 | RCR_ENTRY_L2_LEN_SHIFT; | 3445 | RCR_ENTRY_L2_LEN_SHIFT; |
| 3446 | len -= ETH_FCS_LEN; | 3446 | append_size = len + ETH_HLEN + ETH_FCS_LEN; |
| 3447 | 3447 | ||
| 3448 | addr = (val & RCR_ENTRY_PKT_BUF_ADDR) << | 3448 | addr = (val & RCR_ENTRY_PKT_BUF_ADDR) << |
| 3449 | RCR_ENTRY_PKT_BUF_ADDR_SHIFT; | 3449 | RCR_ENTRY_PKT_BUF_ADDR_SHIFT; |
| @@ -3453,7 +3453,6 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, | |||
| 3453 | RCR_ENTRY_PKTBUFSZ_SHIFT]; | 3453 | RCR_ENTRY_PKTBUFSZ_SHIFT]; |
| 3454 | 3454 | ||
| 3455 | off = addr & ~PAGE_MASK; | 3455 | off = addr & ~PAGE_MASK; |
| 3456 | append_size = rcr_size; | ||
| 3457 | if (num_rcr == 1) { | 3456 | if (num_rcr == 1) { |
| 3458 | int ptype; | 3457 | int ptype; |
| 3459 | 3458 | ||
| @@ -3466,7 +3465,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, | |||
| 3466 | else | 3465 | else |
| 3467 | skb_checksum_none_assert(skb); | 3466 | skb_checksum_none_assert(skb); |
| 3468 | } else if (!(val & RCR_ENTRY_MULTI)) | 3467 | } else if (!(val & RCR_ENTRY_MULTI)) |
| 3469 | append_size = len - skb->len; | 3468 | append_size = append_size - skb->len; |
| 3470 | 3469 | ||
| 3471 | niu_rx_skb_append(skb, page, off, append_size, rcr_size); | 3470 | niu_rx_skb_append(skb, page, off, append_size, rcr_size); |
| 3472 | if ((page->index + rp->rbr_block_size) - rcr_size == addr) { | 3471 | if ((page->index + rp->rbr_block_size) - rcr_size == addr) { |
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 74f828412055..28d893b93d30 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
| @@ -1340,6 +1340,8 @@ static inline void cpsw_add_dual_emac_def_ale_entries( | |||
| 1340 | cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr, | 1340 | cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr, |
| 1341 | HOST_PORT_NUM, ALE_VLAN | | 1341 | HOST_PORT_NUM, ALE_VLAN | |
| 1342 | ALE_SECURE, slave->port_vlan); | 1342 | ALE_SECURE, slave->port_vlan); |
| 1343 | cpsw_ale_control_set(cpsw->ale, slave_port, | ||
| 1344 | ALE_PORT_DROP_UNKNOWN_VLAN, 1); | ||
| 1343 | } | 1345 | } |
| 1344 | 1346 | ||
| 1345 | static void soft_reset_slave(struct cpsw_slave *slave) | 1347 | static void soft_reset_slave(struct cpsw_slave *slave) |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index ecc84954c511..da07ccdf84bf 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
| @@ -1840,7 +1840,8 @@ static int netvsc_vf_join(struct net_device *vf_netdev, | |||
| 1840 | goto rx_handler_failed; | 1840 | goto rx_handler_failed; |
| 1841 | } | 1841 | } |
| 1842 | 1842 | ||
| 1843 | ret = netdev_upper_dev_link(vf_netdev, ndev, NULL); | 1843 | ret = netdev_master_upper_dev_link(vf_netdev, ndev, |
| 1844 | NULL, NULL, NULL); | ||
| 1844 | if (ret != 0) { | 1845 | if (ret != 0) { |
| 1845 | netdev_err(vf_netdev, | 1846 | netdev_err(vf_netdev, |
| 1846 | "can not set master device %s (err = %d)\n", | 1847 | "can not set master device %s (err = %d)\n", |
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 6b127be781d9..e7ca5b5f39ed 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c | |||
| @@ -1288,7 +1288,7 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, | |||
| 1288 | rndis_device->link_state ? "down" : "up"); | 1288 | rndis_device->link_state ? "down" : "up"); |
| 1289 | 1289 | ||
| 1290 | if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5) | 1290 | if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5) |
| 1291 | return net_device; | 1291 | goto out; |
| 1292 | 1292 | ||
| 1293 | rndis_filter_query_link_speed(rndis_device, net_device); | 1293 | rndis_filter_query_link_speed(rndis_device, net_device); |
| 1294 | 1294 | ||
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c index 9fb9b565a002..4f684cbcdc57 100644 --- a/drivers/net/ieee802154/atusb.c +++ b/drivers/net/ieee802154/atusb.c | |||
| @@ -1045,7 +1045,7 @@ static int atusb_probe(struct usb_interface *interface, | |||
| 1045 | atusb->tx_dr.bRequest = ATUSB_TX; | 1045 | atusb->tx_dr.bRequest = ATUSB_TX; |
| 1046 | atusb->tx_dr.wValue = cpu_to_le16(0); | 1046 | atusb->tx_dr.wValue = cpu_to_le16(0); |
| 1047 | 1047 | ||
| 1048 | atusb->tx_urb = usb_alloc_urb(0, GFP_ATOMIC); | 1048 | atusb->tx_urb = usb_alloc_urb(0, GFP_KERNEL); |
| 1049 | if (!atusb->tx_urb) | 1049 | if (!atusb->tx_urb) |
| 1050 | goto fail; | 1050 | goto fail; |
| 1051 | 1051 | ||
diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c index 55a22c761808..de0d7f28a181 100644 --- a/drivers/net/ieee802154/mcr20a.c +++ b/drivers/net/ieee802154/mcr20a.c | |||
| @@ -1267,7 +1267,7 @@ mcr20a_probe(struct spi_device *spi) | |||
| 1267 | ret = mcr20a_get_platform_data(spi, pdata); | 1267 | ret = mcr20a_get_platform_data(spi, pdata); |
| 1268 | if (ret < 0) { | 1268 | if (ret < 0) { |
| 1269 | dev_crit(&spi->dev, "mcr20a_get_platform_data failed.\n"); | 1269 | dev_crit(&spi->dev, "mcr20a_get_platform_data failed.\n"); |
| 1270 | return ret; | 1270 | goto free_pdata; |
| 1271 | } | 1271 | } |
| 1272 | 1272 | ||
| 1273 | /* init reset gpio */ | 1273 | /* init reset gpio */ |
| @@ -1275,7 +1275,7 @@ mcr20a_probe(struct spi_device *spi) | |||
| 1275 | ret = devm_gpio_request_one(&spi->dev, pdata->rst_gpio, | 1275 | ret = devm_gpio_request_one(&spi->dev, pdata->rst_gpio, |
| 1276 | GPIOF_OUT_INIT_HIGH, "reset"); | 1276 | GPIOF_OUT_INIT_HIGH, "reset"); |
| 1277 | if (ret) | 1277 | if (ret) |
| 1278 | return ret; | 1278 | goto free_pdata; |
| 1279 | } | 1279 | } |
| 1280 | 1280 | ||
| 1281 | /* reset mcr20a */ | 1281 | /* reset mcr20a */ |
| @@ -1291,7 +1291,8 @@ mcr20a_probe(struct spi_device *spi) | |||
| 1291 | hw = ieee802154_alloc_hw(sizeof(*lp), &mcr20a_hw_ops); | 1291 | hw = ieee802154_alloc_hw(sizeof(*lp), &mcr20a_hw_ops); |
| 1292 | if (!hw) { | 1292 | if (!hw) { |
| 1293 | dev_crit(&spi->dev, "ieee802154_alloc_hw failed\n"); | 1293 | dev_crit(&spi->dev, "ieee802154_alloc_hw failed\n"); |
| 1294 | return -ENOMEM; | 1294 | ret = -ENOMEM; |
| 1295 | goto free_pdata; | ||
| 1295 | } | 1296 | } |
| 1296 | 1297 | ||
| 1297 | /* init mcr20a local data */ | 1298 | /* init mcr20a local data */ |
| @@ -1308,8 +1309,10 @@ mcr20a_probe(struct spi_device *spi) | |||
| 1308 | /* init buf */ | 1309 | /* init buf */ |
| 1309 | lp->buf = devm_kzalloc(&spi->dev, SPI_COMMAND_BUFFER, GFP_KERNEL); | 1310 | lp->buf = devm_kzalloc(&spi->dev, SPI_COMMAND_BUFFER, GFP_KERNEL); |
| 1310 | 1311 | ||
| 1311 | if (!lp->buf) | 1312 | if (!lp->buf) { |
| 1312 | return -ENOMEM; | 1313 | ret = -ENOMEM; |
| 1314 | goto free_dev; | ||
| 1315 | } | ||
| 1313 | 1316 | ||
| 1314 | mcr20a_setup_tx_spi_messages(lp); | 1317 | mcr20a_setup_tx_spi_messages(lp); |
| 1315 | mcr20a_setup_rx_spi_messages(lp); | 1318 | mcr20a_setup_rx_spi_messages(lp); |
| @@ -1366,6 +1369,8 @@ mcr20a_probe(struct spi_device *spi) | |||
| 1366 | 1369 | ||
| 1367 | free_dev: | 1370 | free_dev: |
| 1368 | ieee802154_free_hw(lp->hw); | 1371 | ieee802154_free_hw(lp->hw); |
| 1372 | free_pdata: | ||
| 1373 | kfree(pdata); | ||
| 1369 | 1374 | ||
| 1370 | return ret; | 1375 | return ret; |
| 1371 | } | 1376 | } |
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 3bb6b66dc7bf..f9c25912eb98 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c | |||
| @@ -720,6 +720,15 @@ static struct phy_driver broadcom_drivers[] = { | |||
| 720 | .get_strings = bcm_phy_get_strings, | 720 | .get_strings = bcm_phy_get_strings, |
| 721 | .get_stats = bcm53xx_phy_get_stats, | 721 | .get_stats = bcm53xx_phy_get_stats, |
| 722 | .probe = bcm53xx_phy_probe, | 722 | .probe = bcm53xx_phy_probe, |
| 723 | }, { | ||
| 724 | .phy_id = PHY_ID_BCM89610, | ||
| 725 | .phy_id_mask = 0xfffffff0, | ||
| 726 | .name = "Broadcom BCM89610", | ||
| 727 | .features = PHY_GBIT_FEATURES, | ||
| 728 | .flags = PHY_HAS_INTERRUPT, | ||
| 729 | .config_init = bcm54xx_config_init, | ||
| 730 | .ack_interrupt = bcm_phy_ack_intr, | ||
| 731 | .config_intr = bcm_phy_config_intr, | ||
| 723 | } }; | 732 | } }; |
| 724 | 733 | ||
| 725 | module_phy_driver(broadcom_drivers); | 734 | module_phy_driver(broadcom_drivers); |
| @@ -741,6 +750,7 @@ static struct mdio_device_id __maybe_unused broadcom_tbl[] = { | |||
| 741 | { PHY_ID_BCMAC131, 0xfffffff0 }, | 750 | { PHY_ID_BCMAC131, 0xfffffff0 }, |
| 742 | { PHY_ID_BCM5241, 0xfffffff0 }, | 751 | { PHY_ID_BCM5241, 0xfffffff0 }, |
| 743 | { PHY_ID_BCM5395, 0xfffffff0 }, | 752 | { PHY_ID_BCM5395, 0xfffffff0 }, |
| 753 | { PHY_ID_BCM89610, 0xfffffff0 }, | ||
| 744 | { } | 754 | { } |
| 745 | }; | 755 | }; |
| 746 | 756 | ||
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ac23322a32e1..9e4ba8e80a18 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
| @@ -535,8 +535,17 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, | |||
| 535 | 535 | ||
| 536 | /* Grab the bits from PHYIR1, and put them in the upper half */ | 536 | /* Grab the bits from PHYIR1, and put them in the upper half */ |
| 537 | phy_reg = mdiobus_read(bus, addr, MII_PHYSID1); | 537 | phy_reg = mdiobus_read(bus, addr, MII_PHYSID1); |
| 538 | if (phy_reg < 0) | 538 | if (phy_reg < 0) { |
| 539 | /* if there is no device, return without an error so scanning | ||
| 540 | * the bus works properly | ||
| 541 | */ | ||
| 542 | if (phy_reg == -EIO || phy_reg == -ENODEV) { | ||
| 543 | *phy_id = 0xffffffff; | ||
| 544 | return 0; | ||
| 545 | } | ||
| 546 | |||
| 539 | return -EIO; | 547 | return -EIO; |
| 548 | } | ||
| 540 | 549 | ||
| 541 | *phy_id = (phy_reg & 0xffff) << 16; | 550 | *phy_id = (phy_reg & 0xffff) << 16; |
| 542 | 551 | ||
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c index 0381da78d228..fd6c23f69c2f 100644 --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c | |||
| @@ -125,7 +125,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, | |||
| 125 | if (id->base.br_nominal) { | 125 | if (id->base.br_nominal) { |
| 126 | if (id->base.br_nominal != 255) { | 126 | if (id->base.br_nominal != 255) { |
| 127 | br_nom = id->base.br_nominal * 100; | 127 | br_nom = id->base.br_nominal * 100; |
| 128 | br_min = br_nom + id->base.br_nominal * id->ext.br_min; | 128 | br_min = br_nom - id->base.br_nominal * id->ext.br_min; |
| 129 | br_max = br_nom + id->base.br_nominal * id->ext.br_max; | 129 | br_max = br_nom + id->base.br_nominal * id->ext.br_max; |
| 130 | } else if (id->ext.br_max) { | 130 | } else if (id->ext.br_max) { |
| 131 | br_nom = 250 * id->ext.br_max; | 131 | br_nom = 250 * id->ext.br_max; |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index c853e7410f5a..42565dd33aa6 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -1098,6 +1098,7 @@ static const struct usb_device_id products[] = { | |||
| 1098 | {QMI_FIXED_INTF(0x05c6, 0x9080, 8)}, | 1098 | {QMI_FIXED_INTF(0x05c6, 0x9080, 8)}, |
| 1099 | {QMI_FIXED_INTF(0x05c6, 0x9083, 3)}, | 1099 | {QMI_FIXED_INTF(0x05c6, 0x9083, 3)}, |
| 1100 | {QMI_FIXED_INTF(0x05c6, 0x9084, 4)}, | 1100 | {QMI_FIXED_INTF(0x05c6, 0x9084, 4)}, |
| 1101 | {QMI_FIXED_INTF(0x05c6, 0x90b2, 3)}, /* ublox R410M */ | ||
| 1101 | {QMI_FIXED_INTF(0x05c6, 0x920d, 0)}, | 1102 | {QMI_FIXED_INTF(0x05c6, 0x920d, 0)}, |
| 1102 | {QMI_FIXED_INTF(0x05c6, 0x920d, 5)}, | 1103 | {QMI_FIXED_INTF(0x05c6, 0x920d, 5)}, |
| 1103 | {QMI_QUIRK_SET_DTR(0x05c6, 0x9625, 4)}, /* YUGA CLM920-NC5 */ | 1104 | {QMI_QUIRK_SET_DTR(0x05c6, 0x9625, 4)}, /* YUGA CLM920-NC5 */ |
| @@ -1343,6 +1344,18 @@ static int qmi_wwan_probe(struct usb_interface *intf, | |||
| 1343 | id->driver_info = (unsigned long)&qmi_wwan_info; | 1344 | id->driver_info = (unsigned long)&qmi_wwan_info; |
| 1344 | } | 1345 | } |
| 1345 | 1346 | ||
| 1347 | /* There are devices where the same interface number can be | ||
| 1348 | * configured as different functions. We should only bind to | ||
| 1349 | * vendor specific functions when matching on interface number | ||
| 1350 | */ | ||
| 1351 | if (id->match_flags & USB_DEVICE_ID_MATCH_INT_NUMBER && | ||
| 1352 | desc->bInterfaceClass != USB_CLASS_VENDOR_SPEC) { | ||
| 1353 | dev_dbg(&intf->dev, | ||
| 1354 | "Rejecting interface number match for class %02x\n", | ||
| 1355 | desc->bInterfaceClass); | ||
| 1356 | return -ENODEV; | ||
| 1357 | } | ||
| 1358 | |||
| 1346 | /* Quectel EC20 quirk where we've QMI on interface 4 instead of 0 */ | 1359 | /* Quectel EC20 quirk where we've QMI on interface 4 instead of 0 */ |
| 1347 | if (quectel_ec20_detected(intf) && desc->bInterfaceNumber == 0) { | 1360 | if (quectel_ec20_detected(intf) && desc->bInterfaceNumber == 0) { |
| 1348 | dev_dbg(&intf->dev, "Quectel EC20 quirk, skipping interface 0\n"); | 1361 | dev_dbg(&intf->dev, "Quectel EC20 quirk, skipping interface 0\n"); |
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c index 9277f4c2bfeb..94e177d7c9b5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | |||
| @@ -459,7 +459,7 @@ static void brcmf_fw_free_request(struct brcmf_fw_request *req) | |||
| 459 | kfree(req); | 459 | kfree(req); |
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) | 462 | static int brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) |
| 463 | { | 463 | { |
| 464 | struct brcmf_fw *fwctx = ctx; | 464 | struct brcmf_fw *fwctx = ctx; |
| 465 | struct brcmf_fw_item *cur; | 465 | struct brcmf_fw_item *cur; |
| @@ -498,13 +498,10 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) | |||
| 498 | brcmf_dbg(TRACE, "nvram %p len %d\n", nvram, nvram_length); | 498 | brcmf_dbg(TRACE, "nvram %p len %d\n", nvram, nvram_length); |
| 499 | cur->nv_data.data = nvram; | 499 | cur->nv_data.data = nvram; |
| 500 | cur->nv_data.len = nvram_length; | 500 | cur->nv_data.len = nvram_length; |
| 501 | return; | 501 | return 0; |
| 502 | 502 | ||
| 503 | fail: | 503 | fail: |
| 504 | brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev)); | 504 | return -ENOENT; |
| 505 | fwctx->done(fwctx->dev, -ENOENT, NULL); | ||
| 506 | brcmf_fw_free_request(fwctx->req); | ||
| 507 | kfree(fwctx); | ||
| 508 | } | 505 | } |
| 509 | 506 | ||
| 510 | static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async) | 507 | static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async) |
| @@ -553,20 +550,27 @@ static void brcmf_fw_request_done(const struct firmware *fw, void *ctx) | |||
| 553 | brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path, | 550 | brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path, |
| 554 | fw ? "" : "not "); | 551 | fw ? "" : "not "); |
| 555 | 552 | ||
| 556 | if (fw) { | 553 | if (!fw) |
| 557 | if (cur->type == BRCMF_FW_TYPE_BINARY) | ||
| 558 | cur->binary = fw; | ||
| 559 | else if (cur->type == BRCMF_FW_TYPE_NVRAM) | ||
| 560 | brcmf_fw_request_nvram_done(fw, fwctx); | ||
| 561 | else | ||
| 562 | release_firmware(fw); | ||
| 563 | } else if (cur->type == BRCMF_FW_TYPE_NVRAM) { | ||
| 564 | brcmf_fw_request_nvram_done(NULL, fwctx); | ||
| 565 | } else if (!(cur->flags & BRCMF_FW_REQF_OPTIONAL)) { | ||
| 566 | ret = -ENOENT; | 554 | ret = -ENOENT; |
| 555 | |||
| 556 | switch (cur->type) { | ||
| 557 | case BRCMF_FW_TYPE_NVRAM: | ||
| 558 | ret = brcmf_fw_request_nvram_done(fw, fwctx); | ||
| 559 | break; | ||
| 560 | case BRCMF_FW_TYPE_BINARY: | ||
| 561 | cur->binary = fw; | ||
| 562 | break; | ||
| 563 | default: | ||
| 564 | /* something fishy here so bail out early */ | ||
| 565 | brcmf_err("unknown fw type: %d\n", cur->type); | ||
| 566 | release_firmware(fw); | ||
| 567 | ret = -EINVAL; | ||
| 567 | goto fail; | 568 | goto fail; |
| 568 | } | 569 | } |
| 569 | 570 | ||
| 571 | if (ret < 0 && !(cur->flags & BRCMF_FW_REQF_OPTIONAL)) | ||
| 572 | goto fail; | ||
| 573 | |||
| 570 | do { | 574 | do { |
| 571 | if (++fwctx->curpos == fwctx->req->n_items) { | 575 | if (++fwctx->curpos == fwctx->req->n_items) { |
| 572 | ret = 0; | 576 | ret = 0; |
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h index 7af3a0f51b77..a17c4a79b8d4 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
| 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
| 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
| 11 | * Copyright(c) 2018 Intel Corporation | ||
| 11 | * | 12 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of version 2 of the GNU General Public License as | 14 | * it under the terms of version 2 of the GNU General Public License as |
| @@ -30,7 +31,7 @@ | |||
| 30 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
| 31 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 32 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
| 32 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | 33 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
| 33 | * Copyright(c) 2018 Intel Corporation | 34 | * Copyright(c) 2018 Intel Corporation |
| 34 | * All rights reserved. | 35 | * All rights reserved. |
| 35 | * | 36 | * |
| 36 | * Redistribution and use in source and binary forms, with or without | 37 | * Redistribution and use in source and binary forms, with or without |
| @@ -749,13 +750,9 @@ struct iwl_scan_req_umac { | |||
| 749 | } __packed; | 750 | } __packed; |
| 750 | 751 | ||
| 751 | #define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac) | 752 | #define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac) |
| 752 | #define IWL_SCAN_REQ_UMAC_SIZE_V7 (sizeof(struct iwl_scan_req_umac) - \ | 753 | #define IWL_SCAN_REQ_UMAC_SIZE_V7 48 |
| 753 | 4 * sizeof(u8)) | 754 | #define IWL_SCAN_REQ_UMAC_SIZE_V6 44 |
| 754 | #define IWL_SCAN_REQ_UMAC_SIZE_V6 (sizeof(struct iwl_scan_req_umac) - \ | 755 | #define IWL_SCAN_REQ_UMAC_SIZE_V1 36 |
| 755 | 2 * sizeof(u8) - sizeof(__le16)) | ||
| 756 | #define IWL_SCAN_REQ_UMAC_SIZE_V1 (sizeof(struct iwl_scan_req_umac) - \ | ||
| 757 | 2 * sizeof(__le32) - 2 * sizeof(u8) - \ | ||
| 758 | sizeof(__le16)) | ||
| 759 | 756 | ||
| 760 | /** | 757 | /** |
| 761 | * struct iwl_umac_scan_abort | 758 | * struct iwl_umac_scan_abort |
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index 8928613e033e..ca0174680af9 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | |||
| @@ -76,6 +76,7 @@ | |||
| 76 | #include "iwl-io.h" | 76 | #include "iwl-io.h" |
| 77 | #include "iwl-csr.h" | 77 | #include "iwl-csr.h" |
| 78 | #include "fw/acpi.h" | 78 | #include "fw/acpi.h" |
| 79 | #include "fw/api/nvm-reg.h" | ||
| 79 | 80 | ||
| 80 | /* NVM offsets (in words) definitions */ | 81 | /* NVM offsets (in words) definitions */ |
| 81 | enum nvm_offsets { | 82 | enum nvm_offsets { |
| @@ -146,8 +147,8 @@ static const u8 iwl_ext_nvm_channels[] = { | |||
| 146 | 149, 153, 157, 161, 165, 169, 173, 177, 181 | 147 | 149, 153, 157, 161, 165, 169, 173, 177, 181 |
| 147 | }; | 148 | }; |
| 148 | 149 | ||
| 149 | #define IWL_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels) | 150 | #define IWL_NVM_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels) |
| 150 | #define IWL_NUM_CHANNELS_EXT ARRAY_SIZE(iwl_ext_nvm_channels) | 151 | #define IWL_NVM_NUM_CHANNELS_EXT ARRAY_SIZE(iwl_ext_nvm_channels) |
| 151 | #define NUM_2GHZ_CHANNELS 14 | 152 | #define NUM_2GHZ_CHANNELS 14 |
| 152 | #define NUM_2GHZ_CHANNELS_EXT 14 | 153 | #define NUM_2GHZ_CHANNELS_EXT 14 |
| 153 | #define FIRST_2GHZ_HT_MINUS 5 | 154 | #define FIRST_2GHZ_HT_MINUS 5 |
| @@ -301,11 +302,11 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, | |||
| 301 | const u8 *nvm_chan; | 302 | const u8 *nvm_chan; |
| 302 | 303 | ||
| 303 | if (cfg->nvm_type != IWL_NVM_EXT) { | 304 | if (cfg->nvm_type != IWL_NVM_EXT) { |
| 304 | num_of_ch = IWL_NUM_CHANNELS; | 305 | num_of_ch = IWL_NVM_NUM_CHANNELS; |
| 305 | nvm_chan = &iwl_nvm_channels[0]; | 306 | nvm_chan = &iwl_nvm_channels[0]; |
| 306 | num_2ghz_channels = NUM_2GHZ_CHANNELS; | 307 | num_2ghz_channels = NUM_2GHZ_CHANNELS; |
| 307 | } else { | 308 | } else { |
| 308 | num_of_ch = IWL_NUM_CHANNELS_EXT; | 309 | num_of_ch = IWL_NVM_NUM_CHANNELS_EXT; |
| 309 | nvm_chan = &iwl_ext_nvm_channels[0]; | 310 | nvm_chan = &iwl_ext_nvm_channels[0]; |
| 310 | num_2ghz_channels = NUM_2GHZ_CHANNELS_EXT; | 311 | num_2ghz_channels = NUM_2GHZ_CHANNELS_EXT; |
| 311 | } | 312 | } |
| @@ -720,12 +721,12 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
| 720 | if (cfg->nvm_type != IWL_NVM_EXT) | 721 | if (cfg->nvm_type != IWL_NVM_EXT) |
| 721 | data = kzalloc(sizeof(*data) + | 722 | data = kzalloc(sizeof(*data) + |
| 722 | sizeof(struct ieee80211_channel) * | 723 | sizeof(struct ieee80211_channel) * |
| 723 | IWL_NUM_CHANNELS, | 724 | IWL_NVM_NUM_CHANNELS, |
| 724 | GFP_KERNEL); | 725 | GFP_KERNEL); |
| 725 | else | 726 | else |
| 726 | data = kzalloc(sizeof(*data) + | 727 | data = kzalloc(sizeof(*data) + |
| 727 | sizeof(struct ieee80211_channel) * | 728 | sizeof(struct ieee80211_channel) * |
| 728 | IWL_NUM_CHANNELS_EXT, | 729 | IWL_NVM_NUM_CHANNELS_EXT, |
| 729 | GFP_KERNEL); | 730 | GFP_KERNEL); |
| 730 | if (!data) | 731 | if (!data) |
| 731 | return NULL; | 732 | return NULL; |
| @@ -842,24 +843,34 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u8 *nvm_chan, | |||
| 842 | return flags; | 843 | return flags; |
| 843 | } | 844 | } |
| 844 | 845 | ||
| 846 | struct regdb_ptrs { | ||
| 847 | struct ieee80211_wmm_rule *rule; | ||
| 848 | u32 token; | ||
| 849 | }; | ||
| 850 | |||
| 845 | struct ieee80211_regdomain * | 851 | struct ieee80211_regdomain * |
| 846 | iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, | 852 | iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, |
| 847 | int num_of_ch, __le32 *channels, u16 fw_mcc) | 853 | int num_of_ch, __le32 *channels, u16 fw_mcc, |
| 854 | u16 geo_info) | ||
| 848 | { | 855 | { |
| 849 | int ch_idx; | 856 | int ch_idx; |
| 850 | u16 ch_flags; | 857 | u16 ch_flags; |
| 851 | u32 reg_rule_flags, prev_reg_rule_flags = 0; | 858 | u32 reg_rule_flags, prev_reg_rule_flags = 0; |
| 852 | const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ? | 859 | const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ? |
| 853 | iwl_ext_nvm_channels : iwl_nvm_channels; | 860 | iwl_ext_nvm_channels : iwl_nvm_channels; |
| 854 | struct ieee80211_regdomain *regd; | 861 | struct ieee80211_regdomain *regd, *copy_rd; |
| 855 | int size_of_regd; | 862 | int size_of_regd, regd_to_copy, wmms_to_copy; |
| 863 | int size_of_wmms = 0; | ||
| 856 | struct ieee80211_reg_rule *rule; | 864 | struct ieee80211_reg_rule *rule; |
| 865 | struct ieee80211_wmm_rule *wmm_rule, *d_wmm, *s_wmm; | ||
| 866 | struct regdb_ptrs *regdb_ptrs; | ||
| 857 | enum nl80211_band band; | 867 | enum nl80211_band band; |
| 858 | int center_freq, prev_center_freq = 0; | 868 | int center_freq, prev_center_freq = 0; |
| 859 | int valid_rules = 0; | 869 | int valid_rules = 0, n_wmms = 0; |
| 870 | int i; | ||
| 860 | bool new_rule; | 871 | bool new_rule; |
| 861 | int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ? | 872 | int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ? |
| 862 | IWL_NUM_CHANNELS_EXT : IWL_NUM_CHANNELS; | 873 | IWL_NVM_NUM_CHANNELS_EXT : IWL_NVM_NUM_CHANNELS; |
| 863 | 874 | ||
| 864 | if (WARN_ON_ONCE(num_of_ch > NL80211_MAX_SUPP_REG_RULES)) | 875 | if (WARN_ON_ONCE(num_of_ch > NL80211_MAX_SUPP_REG_RULES)) |
| 865 | return ERR_PTR(-EINVAL); | 876 | return ERR_PTR(-EINVAL); |
| @@ -875,10 +886,26 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, | |||
| 875 | sizeof(struct ieee80211_regdomain) + | 886 | sizeof(struct ieee80211_regdomain) + |
| 876 | num_of_ch * sizeof(struct ieee80211_reg_rule); | 887 | num_of_ch * sizeof(struct ieee80211_reg_rule); |
| 877 | 888 | ||
| 878 | regd = kzalloc(size_of_regd, GFP_KERNEL); | 889 | if (geo_info & GEO_WMM_ETSI_5GHZ_INFO) |
| 890 | size_of_wmms = | ||
| 891 | num_of_ch * sizeof(struct ieee80211_wmm_rule); | ||
| 892 | |||
| 893 | regd = kzalloc(size_of_regd + size_of_wmms, GFP_KERNEL); | ||
| 879 | if (!regd) | 894 | if (!regd) |
| 880 | return ERR_PTR(-ENOMEM); | 895 | return ERR_PTR(-ENOMEM); |
| 881 | 896 | ||
| 897 | regdb_ptrs = kcalloc(num_of_ch, sizeof(*regdb_ptrs), GFP_KERNEL); | ||
| 898 | if (!regdb_ptrs) { | ||
| 899 | copy_rd = ERR_PTR(-ENOMEM); | ||
| 900 | goto out; | ||
| 901 | } | ||
| 902 | |||
| 903 | /* set alpha2 from FW. */ | ||
| 904 | regd->alpha2[0] = fw_mcc >> 8; | ||
| 905 | regd->alpha2[1] = fw_mcc & 0xff; | ||
| 906 | |||
| 907 | wmm_rule = (struct ieee80211_wmm_rule *)((u8 *)regd + size_of_regd); | ||
| 908 | |||
| 882 | for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) { | 909 | for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) { |
| 883 | ch_flags = (u16)__le32_to_cpup(channels + ch_idx); | 910 | ch_flags = (u16)__le32_to_cpup(channels + ch_idx); |
| 884 | band = (ch_idx < NUM_2GHZ_CHANNELS) ? | 911 | band = (ch_idx < NUM_2GHZ_CHANNELS) ? |
| @@ -927,14 +954,66 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, | |||
| 927 | 954 | ||
| 928 | iwl_nvm_print_channel_flags(dev, IWL_DL_LAR, | 955 | iwl_nvm_print_channel_flags(dev, IWL_DL_LAR, |
| 929 | nvm_chan[ch_idx], ch_flags); | 956 | nvm_chan[ch_idx], ch_flags); |
| 957 | |||
| 958 | if (!(geo_info & GEO_WMM_ETSI_5GHZ_INFO) || | ||
| 959 | band == NL80211_BAND_2GHZ) | ||
| 960 | continue; | ||
| 961 | |||
| 962 | if (!reg_query_regdb_wmm(regd->alpha2, center_freq, | ||
| 963 | ®db_ptrs[n_wmms].token, wmm_rule)) { | ||
| 964 | /* Add only new rules */ | ||
| 965 | for (i = 0; i < n_wmms; i++) { | ||
| 966 | if (regdb_ptrs[i].token == | ||
| 967 | regdb_ptrs[n_wmms].token) { | ||
| 968 | rule->wmm_rule = regdb_ptrs[i].rule; | ||
| 969 | break; | ||
| 970 | } | ||
| 971 | } | ||
| 972 | if (i == n_wmms) { | ||
| 973 | rule->wmm_rule = wmm_rule; | ||
| 974 | regdb_ptrs[n_wmms++].rule = wmm_rule; | ||
| 975 | wmm_rule++; | ||
| 976 | } | ||
| 977 | } | ||
| 930 | } | 978 | } |
| 931 | 979 | ||
| 932 | regd->n_reg_rules = valid_rules; | 980 | regd->n_reg_rules = valid_rules; |
| 981 | regd->n_wmm_rules = n_wmms; | ||
| 933 | 982 | ||
| 934 | /* set alpha2 from FW. */ | 983 | /* |
| 935 | regd->alpha2[0] = fw_mcc >> 8; | 984 | * Narrow down regdom for unused regulatory rules to prevent hole |
| 936 | regd->alpha2[1] = fw_mcc & 0xff; | 985 | * between reg rules to wmm rules. |
| 986 | */ | ||
| 987 | regd_to_copy = sizeof(struct ieee80211_regdomain) + | ||
| 988 | valid_rules * sizeof(struct ieee80211_reg_rule); | ||
| 989 | |||
| 990 | wmms_to_copy = sizeof(struct ieee80211_wmm_rule) * n_wmms; | ||
| 991 | |||
| 992 | copy_rd = kzalloc(regd_to_copy + wmms_to_copy, GFP_KERNEL); | ||
| 993 | if (!copy_rd) { | ||
| 994 | copy_rd = ERR_PTR(-ENOMEM); | ||
| 995 | goto out; | ||
| 996 | } | ||
| 997 | |||
| 998 | memcpy(copy_rd, regd, regd_to_copy); | ||
| 999 | memcpy((u8 *)copy_rd + regd_to_copy, (u8 *)regd + size_of_regd, | ||
| 1000 | wmms_to_copy); | ||
| 1001 | |||
| 1002 | d_wmm = (struct ieee80211_wmm_rule *)((u8 *)copy_rd + regd_to_copy); | ||
| 1003 | s_wmm = (struct ieee80211_wmm_rule *)((u8 *)regd + size_of_regd); | ||
| 1004 | |||
| 1005 | for (i = 0; i < regd->n_reg_rules; i++) { | ||
| 1006 | if (!regd->reg_rules[i].wmm_rule) | ||
| 1007 | continue; | ||
| 1008 | |||
| 1009 | copy_rd->reg_rules[i].wmm_rule = d_wmm + | ||
| 1010 | (regd->reg_rules[i].wmm_rule - s_wmm) / | ||
| 1011 | sizeof(struct ieee80211_wmm_rule); | ||
| 1012 | } | ||
| 937 | 1013 | ||
| 938 | return regd; | 1014 | out: |
| 1015 | kfree(regdb_ptrs); | ||
| 1016 | kfree(regd); | ||
| 1017 | return copy_rd; | ||
| 939 | } | 1018 | } |
| 940 | IWL_EXPORT_SYMBOL(iwl_parse_nvm_mcc_info); | 1019 | IWL_EXPORT_SYMBOL(iwl_parse_nvm_mcc_info); |
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h index 306736c7a042..3071a23b7606 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h | |||
| @@ -101,12 +101,14 @@ void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, | |||
| 101 | * | 101 | * |
| 102 | * This function parses the regulatory channel data received as a | 102 | * This function parses the regulatory channel data received as a |
| 103 | * MCC_UPDATE_CMD command. It returns a newly allocation regulatory domain, | 103 | * MCC_UPDATE_CMD command. It returns a newly allocation regulatory domain, |
| 104 | * to be fed into the regulatory core. An ERR_PTR is returned on error. | 104 | * to be fed into the regulatory core. In case the geo_info is set handle |
| 105 | * accordingly. An ERR_PTR is returned on error. | ||
| 105 | * If not given to the regulatory core, the user is responsible for freeing | 106 | * If not given to the regulatory core, the user is responsible for freeing |
| 106 | * the regdomain returned here with kfree. | 107 | * the regdomain returned here with kfree. |
| 107 | */ | 108 | */ |
| 108 | struct ieee80211_regdomain * | 109 | struct ieee80211_regdomain * |
| 109 | iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, | 110 | iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, |
| 110 | int num_of_ch, __le32 *channels, u16 fw_mcc); | 111 | int num_of_ch, __le32 *channels, u16 fw_mcc, |
| 112 | u16 geo_info); | ||
| 111 | 113 | ||
| 112 | #endif /* __iwl_nvm_parse_h__ */ | 114 | #endif /* __iwl_nvm_parse_h__ */ |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 51b30424575b..90f8c89ea59c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | |||
| @@ -311,7 +311,8 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy, | |||
| 311 | regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg, | 311 | regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg, |
| 312 | __le32_to_cpu(resp->n_channels), | 312 | __le32_to_cpu(resp->n_channels), |
| 313 | resp->channels, | 313 | resp->channels, |
| 314 | __le16_to_cpu(resp->mcc)); | 314 | __le16_to_cpu(resp->mcc), |
| 315 | __le16_to_cpu(resp->geo_info)); | ||
| 315 | /* Store the return source id */ | 316 | /* Store the return source id */ |
| 316 | src_id = resp->source_id; | 317 | src_id = resp->source_id; |
| 317 | kfree(resp); | 318 | kfree(resp); |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 96d26cfae90b..4a017a0d71ea 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
| @@ -3236,6 +3236,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) | |||
| 3236 | GENL_SET_ERR_MSG(info,"MAC is no valid source addr"); | 3236 | GENL_SET_ERR_MSG(info,"MAC is no valid source addr"); |
| 3237 | NL_SET_BAD_ATTR(info->extack, | 3237 | NL_SET_BAD_ATTR(info->extack, |
| 3238 | info->attrs[HWSIM_ATTR_PERM_ADDR]); | 3238 | info->attrs[HWSIM_ATTR_PERM_ADDR]); |
| 3239 | kfree(hwname); | ||
| 3239 | return -EINVAL; | 3240 | return -EINVAL; |
| 3240 | } | 3241 | } |
| 3241 | 3242 | ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c index 8b6b07a936f5..b026e80940a4 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | |||
| @@ -158,16 +158,6 @@ static u8 halbtc_get_wifi_central_chnl(struct btc_coexist *btcoexist) | |||
| 158 | 158 | ||
| 159 | static u8 rtl_get_hwpg_single_ant_path(struct rtl_priv *rtlpriv) | 159 | static u8 rtl_get_hwpg_single_ant_path(struct rtl_priv *rtlpriv) |
| 160 | { | 160 | { |
| 161 | struct rtl_mod_params *mod_params = rtlpriv->cfg->mod_params; | ||
| 162 | |||
| 163 | /* override ant_num / ant_path */ | ||
| 164 | if (mod_params->ant_sel) { | ||
| 165 | rtlpriv->btcoexist.btc_info.ant_num = | ||
| 166 | (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1); | ||
| 167 | |||
| 168 | rtlpriv->btcoexist.btc_info.single_ant_path = | ||
| 169 | (mod_params->ant_sel == 1 ? 0 : 1); | ||
| 170 | } | ||
| 171 | return rtlpriv->btcoexist.btc_info.single_ant_path; | 161 | return rtlpriv->btcoexist.btc_info.single_ant_path; |
| 172 | } | 162 | } |
| 173 | 163 | ||
| @@ -178,7 +168,6 @@ static u8 rtl_get_hwpg_bt_type(struct rtl_priv *rtlpriv) | |||
| 178 | 168 | ||
| 179 | static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv) | 169 | static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv) |
| 180 | { | 170 | { |
| 181 | struct rtl_mod_params *mod_params = rtlpriv->cfg->mod_params; | ||
| 182 | u8 num; | 171 | u8 num; |
| 183 | 172 | ||
| 184 | if (rtlpriv->btcoexist.btc_info.ant_num == ANT_X2) | 173 | if (rtlpriv->btcoexist.btc_info.ant_num == ANT_X2) |
| @@ -186,10 +175,6 @@ static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv) | |||
| 186 | else | 175 | else |
| 187 | num = 1; | 176 | num = 1; |
| 188 | 177 | ||
| 189 | /* override ant_num / ant_path */ | ||
| 190 | if (mod_params->ant_sel) | ||
| 191 | num = (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1) + 1; | ||
| 192 | |||
| 193 | return num; | 178 | return num; |
| 194 | } | 179 | } |
| 195 | 180 | ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c index e7bbbc95cdb1..b4f3f91b590e 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | |||
| @@ -848,6 +848,9 @@ static bool _rtl8723be_init_mac(struct ieee80211_hw *hw) | |||
| 848 | return false; | 848 | return false; |
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | if (rtlpriv->cfg->ops->get_btc_status()) | ||
| 852 | rtlpriv->btcoexist.btc_ops->btc_power_on_setting(rtlpriv); | ||
| 853 | |||
| 851 | bytetmp = rtl_read_byte(rtlpriv, REG_MULTI_FUNC_CTRL); | 854 | bytetmp = rtl_read_byte(rtlpriv, REG_MULTI_FUNC_CTRL); |
| 852 | rtl_write_byte(rtlpriv, REG_MULTI_FUNC_CTRL, bytetmp | BIT(3)); | 855 | rtl_write_byte(rtlpriv, REG_MULTI_FUNC_CTRL, bytetmp | BIT(3)); |
| 853 | 856 | ||
| @@ -2696,21 +2699,21 @@ void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, | |||
| 2696 | rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B; | 2699 | rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B; |
| 2697 | rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1); | 2700 | rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1); |
| 2698 | rtlpriv->btcoexist.btc_info.single_ant_path = | 2701 | rtlpriv->btcoexist.btc_info.single_ant_path = |
| 2699 | (value & 0x40); /*0xc3[6]*/ | 2702 | (value & 0x40 ? ANT_AUX : ANT_MAIN); /*0xc3[6]*/ |
| 2700 | } else { | 2703 | } else { |
| 2701 | rtlpriv->btcoexist.btc_info.btcoexist = 0; | 2704 | rtlpriv->btcoexist.btc_info.btcoexist = 0; |
| 2702 | rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B; | 2705 | rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B; |
| 2703 | rtlpriv->btcoexist.btc_info.ant_num = ANT_X2; | 2706 | rtlpriv->btcoexist.btc_info.ant_num = ANT_X2; |
| 2704 | rtlpriv->btcoexist.btc_info.single_ant_path = 0; | 2707 | rtlpriv->btcoexist.btc_info.single_ant_path = ANT_MAIN; |
| 2705 | } | 2708 | } |
| 2706 | 2709 | ||
| 2707 | /* override ant_num / ant_path */ | 2710 | /* override ant_num / ant_path */ |
| 2708 | if (mod_params->ant_sel) { | 2711 | if (mod_params->ant_sel) { |
| 2709 | rtlpriv->btcoexist.btc_info.ant_num = | 2712 | rtlpriv->btcoexist.btc_info.ant_num = |
| 2710 | (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1); | 2713 | (mod_params->ant_sel == 1 ? ANT_X1 : ANT_X2); |
| 2711 | 2714 | ||
| 2712 | rtlpriv->btcoexist.btc_info.single_ant_path = | 2715 | rtlpriv->btcoexist.btc_info.single_ant_path = |
| 2713 | (mod_params->ant_sel == 1 ? 0 : 1); | 2716 | (mod_params->ant_sel == 1 ? ANT_AUX : ANT_MAIN); |
| 2714 | } | 2717 | } |
| 2715 | } | 2718 | } |
| 2716 | 2719 | ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index d27e33960e77..ce1754054a07 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h | |||
| @@ -2823,6 +2823,11 @@ enum bt_ant_num { | |||
| 2823 | ANT_X1 = 1, | 2823 | ANT_X1 = 1, |
| 2824 | }; | 2824 | }; |
| 2825 | 2825 | ||
| 2826 | enum bt_ant_path { | ||
| 2827 | ANT_MAIN = 0, | ||
| 2828 | ANT_AUX = 1, | ||
| 2829 | }; | ||
| 2830 | |||
| 2826 | enum bt_co_type { | 2831 | enum bt_co_type { |
| 2827 | BT_2WIRE = 0, | 2832 | BT_2WIRE = 0, |
| 2828 | BT_ISSC_3WIRE = 1, | 2833 | BT_ISSC_3WIRE = 1, |
diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig index b979cf3bce65..88a8b5916624 100644 --- a/drivers/nvme/host/Kconfig +++ b/drivers/nvme/host/Kconfig | |||
| @@ -27,7 +27,7 @@ config NVME_FABRICS | |||
| 27 | 27 | ||
| 28 | config NVME_RDMA | 28 | config NVME_RDMA |
| 29 | tristate "NVM Express over Fabrics RDMA host driver" | 29 | tristate "NVM Express over Fabrics RDMA host driver" |
| 30 | depends on INFINIBAND && BLOCK | 30 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS && BLOCK |
| 31 | select NVME_CORE | 31 | select NVME_CORE |
| 32 | select NVME_FABRICS | 32 | select NVME_FABRICS |
| 33 | select SG_POOL | 33 | select SG_POOL |
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 9df4f71e58ca..99b857e5a7a9 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
| @@ -99,6 +99,7 @@ static struct class *nvme_subsys_class; | |||
| 99 | 99 | ||
| 100 | static void nvme_ns_remove(struct nvme_ns *ns); | 100 | static void nvme_ns_remove(struct nvme_ns *ns); |
| 101 | static int nvme_revalidate_disk(struct gendisk *disk); | 101 | static int nvme_revalidate_disk(struct gendisk *disk); |
| 102 | static void nvme_put_subsystem(struct nvme_subsystem *subsys); | ||
| 102 | 103 | ||
| 103 | int nvme_reset_ctrl(struct nvme_ctrl *ctrl) | 104 | int nvme_reset_ctrl(struct nvme_ctrl *ctrl) |
| 104 | { | 105 | { |
| @@ -117,7 +118,8 @@ int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl) | |||
| 117 | ret = nvme_reset_ctrl(ctrl); | 118 | ret = nvme_reset_ctrl(ctrl); |
| 118 | if (!ret) { | 119 | if (!ret) { |
| 119 | flush_work(&ctrl->reset_work); | 120 | flush_work(&ctrl->reset_work); |
| 120 | if (ctrl->state != NVME_CTRL_LIVE) | 121 | if (ctrl->state != NVME_CTRL_LIVE && |
| 122 | ctrl->state != NVME_CTRL_ADMIN_ONLY) | ||
| 121 | ret = -ENETRESET; | 123 | ret = -ENETRESET; |
| 122 | } | 124 | } |
| 123 | 125 | ||
| @@ -350,6 +352,7 @@ static void nvme_free_ns_head(struct kref *ref) | |||
| 350 | ida_simple_remove(&head->subsys->ns_ida, head->instance); | 352 | ida_simple_remove(&head->subsys->ns_ida, head->instance); |
| 351 | list_del_init(&head->entry); | 353 | list_del_init(&head->entry); |
| 352 | cleanup_srcu_struct(&head->srcu); | 354 | cleanup_srcu_struct(&head->srcu); |
| 355 | nvme_put_subsystem(head->subsys); | ||
| 353 | kfree(head); | 356 | kfree(head); |
| 354 | } | 357 | } |
| 355 | 358 | ||
| @@ -764,6 +767,7 @@ static int nvme_submit_user_cmd(struct request_queue *q, | |||
| 764 | ret = PTR_ERR(meta); | 767 | ret = PTR_ERR(meta); |
| 765 | goto out_unmap; | 768 | goto out_unmap; |
| 766 | } | 769 | } |
| 770 | req->cmd_flags |= REQ_INTEGRITY; | ||
| 767 | } | 771 | } |
| 768 | } | 772 | } |
| 769 | 773 | ||
| @@ -2860,6 +2864,9 @@ static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl, | |||
| 2860 | goto out_cleanup_srcu; | 2864 | goto out_cleanup_srcu; |
| 2861 | 2865 | ||
| 2862 | list_add_tail(&head->entry, &ctrl->subsys->nsheads); | 2866 | list_add_tail(&head->entry, &ctrl->subsys->nsheads); |
| 2867 | |||
| 2868 | kref_get(&ctrl->subsys->ref); | ||
| 2869 | |||
| 2863 | return head; | 2870 | return head; |
| 2864 | out_cleanup_srcu: | 2871 | out_cleanup_srcu: |
| 2865 | cleanup_srcu_struct(&head->srcu); | 2872 | cleanup_srcu_struct(&head->srcu); |
| @@ -2997,31 +3004,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
| 2997 | if (nvme_init_ns_head(ns, nsid, id)) | 3004 | if (nvme_init_ns_head(ns, nsid, id)) |
| 2998 | goto out_free_id; | 3005 | goto out_free_id; |
| 2999 | nvme_setup_streams_ns(ctrl, ns); | 3006 | nvme_setup_streams_ns(ctrl, ns); |
| 3000 | 3007 | nvme_set_disk_name(disk_name, ns, ctrl, &flags); | |
| 3001 | #ifdef CONFIG_NVME_MULTIPATH | ||
| 3002 | /* | ||
| 3003 | * If multipathing is enabled we need to always use the subsystem | ||
| 3004 | * instance number for numbering our devices to avoid conflicts | ||
| 3005 | * between subsystems that have multiple controllers and thus use | ||
| 3006 | * the multipath-aware subsystem node and those that have a single | ||
| 3007 | * controller and use the controller node directly. | ||
| 3008 | */ | ||
| 3009 | if (ns->head->disk) { | ||
| 3010 | sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance, | ||
| 3011 | ctrl->cntlid, ns->head->instance); | ||
| 3012 | flags = GENHD_FL_HIDDEN; | ||
| 3013 | } else { | ||
| 3014 | sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance, | ||
| 3015 | ns->head->instance); | ||
| 3016 | } | ||
| 3017 | #else | ||
| 3018 | /* | ||
| 3019 | * But without the multipath code enabled, multiple controller per | ||
| 3020 | * subsystems are visible as devices and thus we cannot use the | ||
| 3021 | * subsystem instance. | ||
| 3022 | */ | ||
| 3023 | sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); | ||
| 3024 | #endif | ||
| 3025 | 3008 | ||
| 3026 | if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) { | 3009 | if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) { |
| 3027 | if (nvme_nvm_register(ns, disk_name, node)) { | 3010 | if (nvme_nvm_register(ns, disk_name, node)) { |
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 124c458806df..7ae732a77fe8 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c | |||
| @@ -668,6 +668,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 668 | ret = -ENOMEM; | 668 | ret = -ENOMEM; |
| 669 | goto out; | 669 | goto out; |
| 670 | } | 670 | } |
| 671 | kfree(opts->transport); | ||
| 671 | opts->transport = p; | 672 | opts->transport = p; |
| 672 | break; | 673 | break; |
| 673 | case NVMF_OPT_NQN: | 674 | case NVMF_OPT_NQN: |
| @@ -676,6 +677,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 676 | ret = -ENOMEM; | 677 | ret = -ENOMEM; |
| 677 | goto out; | 678 | goto out; |
| 678 | } | 679 | } |
| 680 | kfree(opts->subsysnqn); | ||
| 679 | opts->subsysnqn = p; | 681 | opts->subsysnqn = p; |
| 680 | nqnlen = strlen(opts->subsysnqn); | 682 | nqnlen = strlen(opts->subsysnqn); |
| 681 | if (nqnlen >= NVMF_NQN_SIZE) { | 683 | if (nqnlen >= NVMF_NQN_SIZE) { |
| @@ -698,6 +700,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 698 | ret = -ENOMEM; | 700 | ret = -ENOMEM; |
| 699 | goto out; | 701 | goto out; |
| 700 | } | 702 | } |
| 703 | kfree(opts->traddr); | ||
| 701 | opts->traddr = p; | 704 | opts->traddr = p; |
| 702 | break; | 705 | break; |
| 703 | case NVMF_OPT_TRSVCID: | 706 | case NVMF_OPT_TRSVCID: |
| @@ -706,6 +709,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 706 | ret = -ENOMEM; | 709 | ret = -ENOMEM; |
| 707 | goto out; | 710 | goto out; |
| 708 | } | 711 | } |
| 712 | kfree(opts->trsvcid); | ||
| 709 | opts->trsvcid = p; | 713 | opts->trsvcid = p; |
| 710 | break; | 714 | break; |
| 711 | case NVMF_OPT_QUEUE_SIZE: | 715 | case NVMF_OPT_QUEUE_SIZE: |
| @@ -792,6 +796,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 792 | ret = -EINVAL; | 796 | ret = -EINVAL; |
| 793 | goto out; | 797 | goto out; |
| 794 | } | 798 | } |
| 799 | nvmf_host_put(opts->host); | ||
| 795 | opts->host = nvmf_host_add(p); | 800 | opts->host = nvmf_host_add(p); |
| 796 | kfree(p); | 801 | kfree(p); |
| 797 | if (!opts->host) { | 802 | if (!opts->host) { |
| @@ -817,6 +822,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 817 | ret = -ENOMEM; | 822 | ret = -ENOMEM; |
| 818 | goto out; | 823 | goto out; |
| 819 | } | 824 | } |
| 825 | kfree(opts->host_traddr); | ||
| 820 | opts->host_traddr = p; | 826 | opts->host_traddr = p; |
| 821 | break; | 827 | break; |
| 822 | case NVMF_OPT_HOST_ID: | 828 | case NVMF_OPT_HOST_ID: |
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 956e0b8e9c4d..d7b664ae5923 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c | |||
| @@ -15,10 +15,32 @@ | |||
| 15 | #include "nvme.h" | 15 | #include "nvme.h" |
| 16 | 16 | ||
| 17 | static bool multipath = true; | 17 | static bool multipath = true; |
| 18 | module_param(multipath, bool, 0644); | 18 | module_param(multipath, bool, 0444); |
| 19 | MODULE_PARM_DESC(multipath, | 19 | MODULE_PARM_DESC(multipath, |
| 20 | "turn on native support for multiple controllers per subsystem"); | 20 | "turn on native support for multiple controllers per subsystem"); |
| 21 | 21 | ||
| 22 | /* | ||
| 23 | * If multipathing is enabled we need to always use the subsystem instance | ||
| 24 | * number for numbering our devices to avoid conflicts between subsystems that | ||
| 25 | * have multiple controllers and thus use the multipath-aware subsystem node | ||
| 26 | * and those that have a single controller and use the controller node | ||
| 27 | * directly. | ||
| 28 | */ | ||
| 29 | void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, | ||
| 30 | struct nvme_ctrl *ctrl, int *flags) | ||
| 31 | { | ||
| 32 | if (!multipath) { | ||
| 33 | sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); | ||
| 34 | } else if (ns->head->disk) { | ||
| 35 | sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance, | ||
| 36 | ctrl->cntlid, ns->head->instance); | ||
| 37 | *flags = GENHD_FL_HIDDEN; | ||
| 38 | } else { | ||
| 39 | sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance, | ||
| 40 | ns->head->instance); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 22 | void nvme_failover_req(struct request *req) | 44 | void nvme_failover_req(struct request *req) |
| 23 | { | 45 | { |
| 24 | struct nvme_ns *ns = req->q->queuedata; | 46 | struct nvme_ns *ns = req->q->queuedata; |
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 061fecfd44f5..17d2f7cf3fed 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h | |||
| @@ -84,6 +84,11 @@ enum nvme_quirks { | |||
| 84 | * Supports the LighNVM command set if indicated in vs[1]. | 84 | * Supports the LighNVM command set if indicated in vs[1]. |
| 85 | */ | 85 | */ |
| 86 | NVME_QUIRK_LIGHTNVM = (1 << 6), | 86 | NVME_QUIRK_LIGHTNVM = (1 << 6), |
| 87 | |||
| 88 | /* | ||
| 89 | * Set MEDIUM priority on SQ creation | ||
| 90 | */ | ||
| 91 | NVME_QUIRK_MEDIUM_PRIO_SQ = (1 << 7), | ||
| 87 | }; | 92 | }; |
| 88 | 93 | ||
| 89 | /* | 94 | /* |
| @@ -436,6 +441,8 @@ extern const struct attribute_group nvme_ns_id_attr_group; | |||
| 436 | extern const struct block_device_operations nvme_ns_head_ops; | 441 | extern const struct block_device_operations nvme_ns_head_ops; |
| 437 | 442 | ||
| 438 | #ifdef CONFIG_NVME_MULTIPATH | 443 | #ifdef CONFIG_NVME_MULTIPATH |
| 444 | void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, | ||
| 445 | struct nvme_ctrl *ctrl, int *flags); | ||
| 439 | void nvme_failover_req(struct request *req); | 446 | void nvme_failover_req(struct request *req); |
| 440 | bool nvme_req_needs_failover(struct request *req, blk_status_t error); | 447 | bool nvme_req_needs_failover(struct request *req, blk_status_t error); |
| 441 | void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl); | 448 | void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl); |
| @@ -461,6 +468,16 @@ static inline void nvme_mpath_check_last_path(struct nvme_ns *ns) | |||
| 461 | } | 468 | } |
| 462 | 469 | ||
| 463 | #else | 470 | #else |
| 471 | /* | ||
| 472 | * Without the multipath code enabled, multiple controller per subsystems are | ||
| 473 | * visible as devices and thus we cannot use the subsystem instance. | ||
| 474 | */ | ||
| 475 | static inline void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, | ||
| 476 | struct nvme_ctrl *ctrl, int *flags) | ||
| 477 | { | ||
| 478 | sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); | ||
| 479 | } | ||
| 480 | |||
| 464 | static inline void nvme_failover_req(struct request *req) | 481 | static inline void nvme_failover_req(struct request *req) |
| 465 | { | 482 | { |
| 466 | } | 483 | } |
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index fbc71fac6f1e..17a0190bd88f 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
| @@ -1093,10 +1093,19 @@ static int adapter_alloc_cq(struct nvme_dev *dev, u16 qid, | |||
| 1093 | static int adapter_alloc_sq(struct nvme_dev *dev, u16 qid, | 1093 | static int adapter_alloc_sq(struct nvme_dev *dev, u16 qid, |
| 1094 | struct nvme_queue *nvmeq) | 1094 | struct nvme_queue *nvmeq) |
| 1095 | { | 1095 | { |
| 1096 | struct nvme_ctrl *ctrl = &dev->ctrl; | ||
| 1096 | struct nvme_command c; | 1097 | struct nvme_command c; |
| 1097 | int flags = NVME_QUEUE_PHYS_CONTIG; | 1098 | int flags = NVME_QUEUE_PHYS_CONTIG; |
| 1098 | 1099 | ||
| 1099 | /* | 1100 | /* |
| 1101 | * Some drives have a bug that auto-enables WRRU if MEDIUM isn't | ||
| 1102 | * set. Since URGENT priority is zeroes, it makes all queues | ||
| 1103 | * URGENT. | ||
| 1104 | */ | ||
| 1105 | if (ctrl->quirks & NVME_QUIRK_MEDIUM_PRIO_SQ) | ||
| 1106 | flags |= NVME_SQ_PRIO_MEDIUM; | ||
| 1107 | |||
| 1108 | /* | ||
| 1100 | * Note: we (ab)use the fact that the prp fields survive if no data | 1109 | * Note: we (ab)use the fact that the prp fields survive if no data |
| 1101 | * is attached to the request. | 1110 | * is attached to the request. |
| 1102 | */ | 1111 | */ |
| @@ -2701,7 +2710,8 @@ static const struct pci_device_id nvme_id_table[] = { | |||
| 2701 | .driver_data = NVME_QUIRK_STRIPE_SIZE | | 2710 | .driver_data = NVME_QUIRK_STRIPE_SIZE | |
| 2702 | NVME_QUIRK_DEALLOCATE_ZEROES, }, | 2711 | NVME_QUIRK_DEALLOCATE_ZEROES, }, |
| 2703 | { PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */ | 2712 | { PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */ |
| 2704 | .driver_data = NVME_QUIRK_NO_DEEPEST_PS }, | 2713 | .driver_data = NVME_QUIRK_NO_DEEPEST_PS | |
| 2714 | NVME_QUIRK_MEDIUM_PRIO_SQ }, | ||
| 2705 | { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */ | 2715 | { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */ |
| 2706 | .driver_data = NVME_QUIRK_IDENTIFY_CNS, }, | 2716 | .driver_data = NVME_QUIRK_IDENTIFY_CNS, }, |
| 2707 | { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */ | 2717 | { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */ |
diff --git a/drivers/nvme/target/Kconfig b/drivers/nvme/target/Kconfig index 5f4f8b16685f..3c7b61ddb0d1 100644 --- a/drivers/nvme/target/Kconfig +++ b/drivers/nvme/target/Kconfig | |||
| @@ -27,7 +27,7 @@ config NVME_TARGET_LOOP | |||
| 27 | 27 | ||
| 28 | config NVME_TARGET_RDMA | 28 | config NVME_TARGET_RDMA |
| 29 | tristate "NVMe over Fabrics RDMA target support" | 29 | tristate "NVMe over Fabrics RDMA target support" |
| 30 | depends on INFINIBAND | 30 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS |
| 31 | depends on NVME_TARGET | 31 | depends on NVME_TARGET |
| 32 | select SGL_ALLOC | 32 | select SGL_ALLOC |
| 33 | help | 33 | help |
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 31fdfba556a8..27a8561c0cb9 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c | |||
| @@ -469,6 +469,12 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work) | |||
| 469 | nvme_stop_ctrl(&ctrl->ctrl); | 469 | nvme_stop_ctrl(&ctrl->ctrl); |
| 470 | nvme_loop_shutdown_ctrl(ctrl); | 470 | nvme_loop_shutdown_ctrl(ctrl); |
| 471 | 471 | ||
| 472 | if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) { | ||
| 473 | /* state change failure should never happen */ | ||
| 474 | WARN_ON_ONCE(1); | ||
| 475 | return; | ||
| 476 | } | ||
| 477 | |||
| 472 | ret = nvme_loop_configure_admin_queue(ctrl); | 478 | ret = nvme_loop_configure_admin_queue(ctrl); |
| 473 | if (ret) | 479 | if (ret) |
| 474 | goto out_disable; | 480 | goto out_disable; |
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index b35fe88f1851..7baa53e5b1d7 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c | |||
| @@ -102,12 +102,28 @@ static DEFINE_IDR(ovcs_idr); | |||
| 102 | 102 | ||
| 103 | static BLOCKING_NOTIFIER_HEAD(overlay_notify_chain); | 103 | static BLOCKING_NOTIFIER_HEAD(overlay_notify_chain); |
| 104 | 104 | ||
| 105 | /** | ||
| 106 | * of_overlay_notifier_register() - Register notifier for overlay operations | ||
| 107 | * @nb: Notifier block to register | ||
| 108 | * | ||
| 109 | * Register for notification on overlay operations on device tree nodes. The | ||
| 110 | * reported actions definied by @of_reconfig_change. The notifier callback | ||
| 111 | * furthermore receives a pointer to the affected device tree node. | ||
| 112 | * | ||
| 113 | * Note that a notifier callback is not supposed to store pointers to a device | ||
| 114 | * tree node or its content beyond @OF_OVERLAY_POST_REMOVE corresponding to the | ||
| 115 | * respective node it received. | ||
| 116 | */ | ||
| 105 | int of_overlay_notifier_register(struct notifier_block *nb) | 117 | int of_overlay_notifier_register(struct notifier_block *nb) |
| 106 | { | 118 | { |
| 107 | return blocking_notifier_chain_register(&overlay_notify_chain, nb); | 119 | return blocking_notifier_chain_register(&overlay_notify_chain, nb); |
| 108 | } | 120 | } |
| 109 | EXPORT_SYMBOL_GPL(of_overlay_notifier_register); | 121 | EXPORT_SYMBOL_GPL(of_overlay_notifier_register); |
| 110 | 122 | ||
| 123 | /** | ||
| 124 | * of_overlay_notifier_register() - Unregister notifier for overlay operations | ||
| 125 | * @nb: Notifier block to unregister | ||
| 126 | */ | ||
| 111 | int of_overlay_notifier_unregister(struct notifier_block *nb) | 127 | int of_overlay_notifier_unregister(struct notifier_block *nb) |
| 112 | { | 128 | { |
| 113 | return blocking_notifier_chain_unregister(&overlay_notify_chain, nb); | 129 | return blocking_notifier_chain_unregister(&overlay_notify_chain, nb); |
| @@ -671,17 +687,13 @@ static void free_overlay_changeset(struct overlay_changeset *ovcs) | |||
| 671 | of_node_put(ovcs->fragments[i].overlay); | 687 | of_node_put(ovcs->fragments[i].overlay); |
| 672 | } | 688 | } |
| 673 | kfree(ovcs->fragments); | 689 | kfree(ovcs->fragments); |
| 674 | |||
| 675 | /* | 690 | /* |
| 676 | * TODO | 691 | * There should be no live pointers into ovcs->overlay_tree and |
| 677 | * | 692 | * ovcs->fdt due to the policy that overlay notifiers are not allowed |
| 678 | * would like to: kfree(ovcs->overlay_tree); | 693 | * to retain pointers into the overlay devicetree. |
| 679 | * but can not since drivers may have pointers into this data | ||
| 680 | * | ||
| 681 | * would like to: kfree(ovcs->fdt); | ||
| 682 | * but can not since drivers may have pointers into this data | ||
| 683 | */ | 694 | */ |
| 684 | 695 | kfree(ovcs->overlay_tree); | |
| 696 | kfree(ovcs->fdt); | ||
| 685 | kfree(ovcs); | 697 | kfree(ovcs); |
| 686 | } | 698 | } |
| 687 | 699 | ||
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index acba1f56af3e..126cf19e869b 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c | |||
| @@ -1263,7 +1263,7 @@ static struct parisc_driver ccio_driver __refdata = { | |||
| 1263 | * I/O Page Directory, the resource map, and initalizing the | 1263 | * I/O Page Directory, the resource map, and initalizing the |
| 1264 | * U2/Uturn chip into virtual mode. | 1264 | * U2/Uturn chip into virtual mode. |
| 1265 | */ | 1265 | */ |
| 1266 | static void | 1266 | static void __init |
| 1267 | ccio_ioc_init(struct ioc *ioc) | 1267 | ccio_ioc_init(struct ioc *ioc) |
| 1268 | { | 1268 | { |
| 1269 | int i; | 1269 | int i; |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index a04197ce767d..dbfe7c4f3776 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -1910,7 +1910,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable) | |||
| 1910 | EXPORT_SYMBOL(pci_pme_active); | 1910 | EXPORT_SYMBOL(pci_pme_active); |
| 1911 | 1911 | ||
| 1912 | /** | 1912 | /** |
| 1913 | * pci_enable_wake - enable PCI device as wakeup event source | 1913 | * __pci_enable_wake - enable PCI device as wakeup event source |
| 1914 | * @dev: PCI device affected | 1914 | * @dev: PCI device affected |
| 1915 | * @state: PCI state from which device will issue wakeup events | 1915 | * @state: PCI state from which device will issue wakeup events |
| 1916 | * @enable: True to enable event generation; false to disable | 1916 | * @enable: True to enable event generation; false to disable |
| @@ -1928,7 +1928,7 @@ EXPORT_SYMBOL(pci_pme_active); | |||
| 1928 | * Error code depending on the platform is returned if both the platform and | 1928 | * Error code depending on the platform is returned if both the platform and |
| 1929 | * the native mechanism fail to enable the generation of wake-up events | 1929 | * the native mechanism fail to enable the generation of wake-up events |
| 1930 | */ | 1930 | */ |
| 1931 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable) | 1931 | static int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable) |
| 1932 | { | 1932 | { |
| 1933 | int ret = 0; | 1933 | int ret = 0; |
| 1934 | 1934 | ||
| @@ -1969,6 +1969,23 @@ int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable) | |||
| 1969 | 1969 | ||
| 1970 | return ret; | 1970 | return ret; |
| 1971 | } | 1971 | } |
| 1972 | |||
| 1973 | /** | ||
| 1974 | * pci_enable_wake - change wakeup settings for a PCI device | ||
| 1975 | * @pci_dev: Target device | ||
| 1976 | * @state: PCI state from which device will issue wakeup events | ||
| 1977 | * @enable: Whether or not to enable event generation | ||
| 1978 | * | ||
| 1979 | * If @enable is set, check device_may_wakeup() for the device before calling | ||
| 1980 | * __pci_enable_wake() for it. | ||
| 1981 | */ | ||
| 1982 | int pci_enable_wake(struct pci_dev *pci_dev, pci_power_t state, bool enable) | ||
| 1983 | { | ||
| 1984 | if (enable && !device_may_wakeup(&pci_dev->dev)) | ||
| 1985 | return -EINVAL; | ||
| 1986 | |||
| 1987 | return __pci_enable_wake(pci_dev, state, enable); | ||
| 1988 | } | ||
| 1972 | EXPORT_SYMBOL(pci_enable_wake); | 1989 | EXPORT_SYMBOL(pci_enable_wake); |
| 1973 | 1990 | ||
| 1974 | /** | 1991 | /** |
| @@ -1981,9 +1998,9 @@ EXPORT_SYMBOL(pci_enable_wake); | |||
| 1981 | * should not be called twice in a row to enable wake-up due to PCI PM vs ACPI | 1998 | * should not be called twice in a row to enable wake-up due to PCI PM vs ACPI |
| 1982 | * ordering constraints. | 1999 | * ordering constraints. |
| 1983 | * | 2000 | * |
| 1984 | * This function only returns error code if the device is not capable of | 2001 | * This function only returns error code if the device is not allowed to wake |
| 1985 | * generating PME# from both D3_hot and D3_cold, and the platform is unable to | 2002 | * up the system from sleep or it is not capable of generating PME# from both |
| 1986 | * enable wake-up power for it. | 2003 | * D3_hot and D3_cold and the platform is unable to enable wake-up power for it. |
| 1987 | */ | 2004 | */ |
| 1988 | int pci_wake_from_d3(struct pci_dev *dev, bool enable) | 2005 | int pci_wake_from_d3(struct pci_dev *dev, bool enable) |
| 1989 | { | 2006 | { |
| @@ -2114,7 +2131,7 @@ int pci_finish_runtime_suspend(struct pci_dev *dev) | |||
| 2114 | 2131 | ||
| 2115 | dev->runtime_d3cold = target_state == PCI_D3cold; | 2132 | dev->runtime_d3cold = target_state == PCI_D3cold; |
| 2116 | 2133 | ||
| 2117 | pci_enable_wake(dev, target_state, pci_dev_run_wake(dev)); | 2134 | __pci_enable_wake(dev, target_state, pci_dev_run_wake(dev)); |
| 2118 | 2135 | ||
| 2119 | error = pci_set_power_state(dev, target_state); | 2136 | error = pci_set_power_state(dev, target_state); |
| 2120 | 2137 | ||
| @@ -2138,16 +2155,16 @@ bool pci_dev_run_wake(struct pci_dev *dev) | |||
| 2138 | { | 2155 | { |
| 2139 | struct pci_bus *bus = dev->bus; | 2156 | struct pci_bus *bus = dev->bus; |
| 2140 | 2157 | ||
| 2141 | if (device_can_wakeup(&dev->dev)) | ||
| 2142 | return true; | ||
| 2143 | |||
| 2144 | if (!dev->pme_support) | 2158 | if (!dev->pme_support) |
| 2145 | return false; | 2159 | return false; |
| 2146 | 2160 | ||
| 2147 | /* PME-capable in principle, but not from the target power state */ | 2161 | /* PME-capable in principle, but not from the target power state */ |
| 2148 | if (!pci_pme_capable(dev, pci_target_state(dev, false))) | 2162 | if (!pci_pme_capable(dev, pci_target_state(dev, true))) |
| 2149 | return false; | 2163 | return false; |
| 2150 | 2164 | ||
| 2165 | if (device_can_wakeup(&dev->dev)) | ||
| 2166 | return true; | ||
| 2167 | |||
| 2151 | while (bus->parent) { | 2168 | while (bus->parent) { |
| 2152 | struct pci_dev *bridge = bus->self; | 2169 | struct pci_dev *bridge = bus->self; |
| 2153 | 2170 | ||
diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index b1ae1618fefe..fee9225ca559 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c | |||
| @@ -1622,22 +1622,30 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq) | |||
| 1622 | 1622 | ||
| 1623 | if (!need_valid_mask) { | 1623 | if (!need_valid_mask) { |
| 1624 | irq_base = devm_irq_alloc_descs(pctrl->dev, -1, 0, | 1624 | irq_base = devm_irq_alloc_descs(pctrl->dev, -1, 0, |
| 1625 | chip->ngpio, NUMA_NO_NODE); | 1625 | community->npins, NUMA_NO_NODE); |
| 1626 | if (irq_base < 0) { | 1626 | if (irq_base < 0) { |
| 1627 | dev_err(pctrl->dev, "Failed to allocate IRQ numbers\n"); | 1627 | dev_err(pctrl->dev, "Failed to allocate IRQ numbers\n"); |
| 1628 | return irq_base; | 1628 | return irq_base; |
| 1629 | } | 1629 | } |
| 1630 | } else { | ||
| 1631 | irq_base = 0; | ||
| 1632 | } | 1630 | } |
| 1633 | 1631 | ||
| 1634 | ret = gpiochip_irqchip_add(chip, &chv_gpio_irqchip, irq_base, | 1632 | ret = gpiochip_irqchip_add(chip, &chv_gpio_irqchip, 0, |
| 1635 | handle_bad_irq, IRQ_TYPE_NONE); | 1633 | handle_bad_irq, IRQ_TYPE_NONE); |
| 1636 | if (ret) { | 1634 | if (ret) { |
| 1637 | dev_err(pctrl->dev, "failed to add IRQ chip\n"); | 1635 | dev_err(pctrl->dev, "failed to add IRQ chip\n"); |
| 1638 | return ret; | 1636 | return ret; |
| 1639 | } | 1637 | } |
| 1640 | 1638 | ||
| 1639 | if (!need_valid_mask) { | ||
| 1640 | for (i = 0; i < community->ngpio_ranges; i++) { | ||
| 1641 | range = &community->gpio_ranges[i]; | ||
| 1642 | |||
| 1643 | irq_domain_associate_many(chip->irq.domain, irq_base, | ||
| 1644 | range->base, range->npins); | ||
| 1645 | irq_base += range->npins; | ||
| 1646 | } | ||
| 1647 | } | ||
| 1648 | |||
| 1641 | gpiochip_set_chained_irqchip(chip, &chv_gpio_irqchip, irq, | 1649 | gpiochip_set_chained_irqchip(chip, &chv_gpio_irqchip, irq, |
| 1642 | chv_gpio_irq_handler); | 1650 | chv_gpio_irq_handler); |
| 1643 | return 0; | 1651 | return 0; |
diff --git a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c index 8870a4100164..fee3435a6f15 100644 --- a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c +++ b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c | |||
| @@ -36,6 +36,27 @@ | |||
| 36 | .npins = ((e) - (s) + 1), \ | 36 | .npins = ((e) - (s) + 1), \ |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | #define SPTH_GPP(r, s, e, g) \ | ||
| 40 | { \ | ||
| 41 | .reg_num = (r), \ | ||
| 42 | .base = (s), \ | ||
| 43 | .size = ((e) - (s) + 1), \ | ||
| 44 | .gpio_base = (g), \ | ||
| 45 | } | ||
| 46 | |||
| 47 | #define SPTH_COMMUNITY(b, s, e, g) \ | ||
| 48 | { \ | ||
| 49 | .barno = (b), \ | ||
| 50 | .padown_offset = SPT_PAD_OWN, \ | ||
| 51 | .padcfglock_offset = SPT_PADCFGLOCK, \ | ||
| 52 | .hostown_offset = SPT_HOSTSW_OWN, \ | ||
| 53 | .ie_offset = SPT_GPI_IE, \ | ||
| 54 | .pin_base = (s), \ | ||
| 55 | .npins = ((e) - (s) + 1), \ | ||
| 56 | .gpps = (g), \ | ||
| 57 | .ngpps = ARRAY_SIZE(g), \ | ||
| 58 | } | ||
| 59 | |||
| 39 | /* Sunrisepoint-LP */ | 60 | /* Sunrisepoint-LP */ |
| 40 | static const struct pinctrl_pin_desc sptlp_pins[] = { | 61 | static const struct pinctrl_pin_desc sptlp_pins[] = { |
| 41 | /* GPP_A */ | 62 | /* GPP_A */ |
| @@ -531,10 +552,28 @@ static const struct intel_function spth_functions[] = { | |||
| 531 | FUNCTION("i2c2", spth_i2c2_groups), | 552 | FUNCTION("i2c2", spth_i2c2_groups), |
| 532 | }; | 553 | }; |
| 533 | 554 | ||
| 555 | static const struct intel_padgroup spth_community0_gpps[] = { | ||
| 556 | SPTH_GPP(0, 0, 23, 0), /* GPP_A */ | ||
| 557 | SPTH_GPP(1, 24, 47, 24), /* GPP_B */ | ||
| 558 | }; | ||
| 559 | |||
| 560 | static const struct intel_padgroup spth_community1_gpps[] = { | ||
| 561 | SPTH_GPP(0, 48, 71, 48), /* GPP_C */ | ||
| 562 | SPTH_GPP(1, 72, 95, 72), /* GPP_D */ | ||
| 563 | SPTH_GPP(2, 96, 108, 96), /* GPP_E */ | ||
| 564 | SPTH_GPP(3, 109, 132, 120), /* GPP_F */ | ||
| 565 | SPTH_GPP(4, 133, 156, 144), /* GPP_G */ | ||
| 566 | SPTH_GPP(5, 157, 180, 168), /* GPP_H */ | ||
| 567 | }; | ||
| 568 | |||
| 569 | static const struct intel_padgroup spth_community3_gpps[] = { | ||
| 570 | SPTH_GPP(0, 181, 191, 192), /* GPP_I */ | ||
| 571 | }; | ||
| 572 | |||
| 534 | static const struct intel_community spth_communities[] = { | 573 | static const struct intel_community spth_communities[] = { |
| 535 | SPT_COMMUNITY(0, 0, 47), | 574 | SPTH_COMMUNITY(0, 0, 47, spth_community0_gpps), |
| 536 | SPT_COMMUNITY(1, 48, 180), | 575 | SPTH_COMMUNITY(1, 48, 180, spth_community1_gpps), |
| 537 | SPT_COMMUNITY(2, 181, 191), | 576 | SPTH_COMMUNITY(2, 181, 191, spth_community3_gpps), |
| 538 | }; | 577 | }; |
| 539 | 578 | ||
| 540 | static const struct intel_pinctrl_soc_data spth_soc_data = { | 579 | static const struct intel_pinctrl_soc_data spth_soc_data = { |
diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c index 4b91ff74779b..99a6ceac8e53 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-axg.c +++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c | |||
| @@ -898,7 +898,7 @@ static struct meson_bank meson_axg_periphs_banks[] = { | |||
| 898 | 898 | ||
| 899 | static struct meson_bank meson_axg_aobus_banks[] = { | 899 | static struct meson_bank meson_axg_aobus_banks[] = { |
| 900 | /* name first last irq pullen pull dir out in */ | 900 | /* name first last irq pullen pull dir out in */ |
| 901 | BANK("AO", GPIOAO_0, GPIOAO_9, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0), | 901 | BANK("AO", GPIOAO_0, GPIOAO_13, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0), |
| 902 | }; | 902 | }; |
| 903 | 903 | ||
| 904 | static struct meson_pmx_bank meson_axg_periphs_pmx_banks[] = { | 904 | static struct meson_pmx_bank meson_axg_periphs_pmx_banks[] = { |
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 39d06dd1f63a..bc309c5327ff 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
| @@ -154,7 +154,7 @@ config DELL_LAPTOP | |||
| 154 | depends on ACPI_VIDEO || ACPI_VIDEO = n | 154 | depends on ACPI_VIDEO || ACPI_VIDEO = n |
| 155 | depends on RFKILL || RFKILL = n | 155 | depends on RFKILL || RFKILL = n |
| 156 | depends on SERIO_I8042 | 156 | depends on SERIO_I8042 |
| 157 | select DELL_SMBIOS | 157 | depends on DELL_SMBIOS |
| 158 | select POWER_SUPPLY | 158 | select POWER_SUPPLY |
| 159 | select LEDS_CLASS | 159 | select LEDS_CLASS |
| 160 | select NEW_LEDS | 160 | select NEW_LEDS |
diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c index d4aeac3477f5..f086469ea740 100644 --- a/drivers/platform/x86/asus-wireless.c +++ b/drivers/platform/x86/asus-wireless.c | |||
| @@ -178,8 +178,10 @@ static int asus_wireless_remove(struct acpi_device *adev) | |||
| 178 | { | 178 | { |
| 179 | struct asus_wireless_data *data = acpi_driver_data(adev); | 179 | struct asus_wireless_data *data = acpi_driver_data(adev); |
| 180 | 180 | ||
| 181 | if (data->wq) | 181 | if (data->wq) { |
| 182 | devm_led_classdev_unregister(&adev->dev, &data->led); | ||
| 182 | destroy_workqueue(data->wq); | 183 | destroy_workqueue(data->wq); |
| 184 | } | ||
| 183 | return 0; | 185 | return 0; |
| 184 | } | 186 | } |
| 185 | 187 | ||
diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 8e70a627e0bb..cbbafdcaaecb 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c | |||
| @@ -1083,6 +1083,7 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) | |||
| 1083 | dev_err(qproc->dev, "unable to resolve mba region\n"); | 1083 | dev_err(qproc->dev, "unable to resolve mba region\n"); |
| 1084 | return ret; | 1084 | return ret; |
| 1085 | } | 1085 | } |
| 1086 | of_node_put(node); | ||
| 1086 | 1087 | ||
| 1087 | qproc->mba_phys = r.start; | 1088 | qproc->mba_phys = r.start; |
| 1088 | qproc->mba_size = resource_size(&r); | 1089 | qproc->mba_size = resource_size(&r); |
| @@ -1100,6 +1101,7 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) | |||
| 1100 | dev_err(qproc->dev, "unable to resolve mpss region\n"); | 1101 | dev_err(qproc->dev, "unable to resolve mpss region\n"); |
| 1101 | return ret; | 1102 | return ret; |
| 1102 | } | 1103 | } |
| 1104 | of_node_put(node); | ||
| 1103 | 1105 | ||
| 1104 | qproc->mpss_phys = qproc->mpss_reloc = r.start; | 1106 | qproc->mpss_phys = qproc->mpss_reloc = r.start; |
| 1105 | qproc->mpss_size = resource_size(&r); | 1107 | qproc->mpss_size = resource_size(&r); |
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 6d9c5832ce47..a9609d971f7f 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
| @@ -1163,7 +1163,7 @@ int rproc_trigger_recovery(struct rproc *rproc) | |||
| 1163 | if (ret) | 1163 | if (ret) |
| 1164 | return ret; | 1164 | return ret; |
| 1165 | 1165 | ||
| 1166 | ret = rproc_stop(rproc, false); | 1166 | ret = rproc_stop(rproc, true); |
| 1167 | if (ret) | 1167 | if (ret) |
| 1168 | goto unlock_mutex; | 1168 | goto unlock_mutex; |
| 1169 | 1169 | ||
| @@ -1316,7 +1316,7 @@ void rproc_shutdown(struct rproc *rproc) | |||
| 1316 | if (!atomic_dec_and_test(&rproc->power)) | 1316 | if (!atomic_dec_and_test(&rproc->power)) |
| 1317 | goto out; | 1317 | goto out; |
| 1318 | 1318 | ||
| 1319 | ret = rproc_stop(rproc, true); | 1319 | ret = rproc_stop(rproc, false); |
| 1320 | if (ret) { | 1320 | if (ret) { |
| 1321 | atomic_inc(&rproc->power); | 1321 | atomic_inc(&rproc->power); |
| 1322 | goto out; | 1322 | goto out; |
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index 64b6de9763ee..1efdf9ff8679 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c | |||
| @@ -581,4 +581,6 @@ static void rpmsg_chrdev_exit(void) | |||
| 581 | unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); | 581 | unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); |
| 582 | } | 582 | } |
| 583 | module_exit(rpmsg_chrdev_exit); | 583 | module_exit(rpmsg_chrdev_exit); |
| 584 | |||
| 585 | MODULE_ALIAS("rpmsg:rpmsg_chrdev"); | ||
| 584 | MODULE_LICENSE("GPL v2"); | 586 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/sbus/char/oradax.c b/drivers/sbus/char/oradax.c index c44d7c7ffc92..1754f55e2fac 100644 --- a/drivers/sbus/char/oradax.c +++ b/drivers/sbus/char/oradax.c | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * | 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation, either version 3 of the License, or | 6 | * the Free Software Foundation, either version 2 of the License, or |
| 7 | * (at your option) any later version. | 7 | * (at your option) any later version. |
| 8 | * | 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
diff --git a/drivers/scsi/isci/port_config.c b/drivers/scsi/isci/port_config.c index edb7be786c65..9e8de1462593 100644 --- a/drivers/scsi/isci/port_config.c +++ b/drivers/scsi/isci/port_config.c | |||
| @@ -291,7 +291,7 @@ sci_mpc_agent_validate_phy_configuration(struct isci_host *ihost, | |||
| 291 | * Note: We have not moved the current phy_index so we will actually | 291 | * Note: We have not moved the current phy_index so we will actually |
| 292 | * compare the startting phy with itself. | 292 | * compare the startting phy with itself. |
| 293 | * This is expected and required to add the phy to the port. */ | 293 | * This is expected and required to add the phy to the port. */ |
| 294 | while (phy_index < SCI_MAX_PHYS) { | 294 | for (; phy_index < SCI_MAX_PHYS; phy_index++) { |
| 295 | if ((phy_mask & (1 << phy_index)) == 0) | 295 | if ((phy_mask & (1 << phy_index)) == 0) |
| 296 | continue; | 296 | continue; |
| 297 | sci_phy_get_sas_address(&ihost->phys[phy_index], | 297 | sci_phy_get_sas_address(&ihost->phys[phy_index], |
| @@ -311,7 +311,6 @@ sci_mpc_agent_validate_phy_configuration(struct isci_host *ihost, | |||
| 311 | &ihost->phys[phy_index]); | 311 | &ihost->phys[phy_index]); |
| 312 | 312 | ||
| 313 | assigned_phy_mask |= (1 << phy_index); | 313 | assigned_phy_mask |= (1 << phy_index); |
| 314 | phy_index++; | ||
| 315 | } | 314 | } |
| 316 | 315 | ||
| 317 | } | 316 | } |
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 8c51d628b52e..a2ec0bc9e9fa 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c | |||
| @@ -1722,11 +1722,14 @@ static int storvsc_probe(struct hv_device *device, | |||
| 1722 | max_targets = STORVSC_MAX_TARGETS; | 1722 | max_targets = STORVSC_MAX_TARGETS; |
| 1723 | max_channels = STORVSC_MAX_CHANNELS; | 1723 | max_channels = STORVSC_MAX_CHANNELS; |
| 1724 | /* | 1724 | /* |
| 1725 | * On Windows8 and above, we support sub-channels for storage. | 1725 | * On Windows8 and above, we support sub-channels for storage |
| 1726 | * on SCSI and FC controllers. | ||
| 1726 | * The number of sub-channels offerred is based on the number of | 1727 | * The number of sub-channels offerred is based on the number of |
| 1727 | * VCPUs in the guest. | 1728 | * VCPUs in the guest. |
| 1728 | */ | 1729 | */ |
| 1729 | max_sub_channels = (num_cpus / storvsc_vcpus_per_sub_channel); | 1730 | if (!dev_is_ide) |
| 1731 | max_sub_channels = | ||
| 1732 | (num_cpus - 1) / storvsc_vcpus_per_sub_channel; | ||
| 1730 | } | 1733 | } |
| 1731 | 1734 | ||
| 1732 | scsi_driver.can_queue = (max_outstanding_req_per_channel * | 1735 | scsi_driver.can_queue = (max_outstanding_req_per_channel * |
diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 16cab40156ca..aeab05f682d9 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c | |||
| @@ -1799,7 +1799,7 @@ static int imx_csi_probe(struct platform_device *pdev) | |||
| 1799 | priv->dev->of_node = pdata->of_node; | 1799 | priv->dev->of_node = pdata->of_node; |
| 1800 | pinctrl = devm_pinctrl_get_select_default(priv->dev); | 1800 | pinctrl = devm_pinctrl_get_select_default(priv->dev); |
| 1801 | if (IS_ERR(pinctrl)) { | 1801 | if (IS_ERR(pinctrl)) { |
| 1802 | ret = PTR_ERR(priv->vdev); | 1802 | ret = PTR_ERR(pinctrl); |
| 1803 | dev_dbg(priv->dev, | 1803 | dev_dbg(priv->dev, |
| 1804 | "devm_pinctrl_get_select_default() failed: %d\n", ret); | 1804 | "devm_pinctrl_get_select_default() failed: %d\n", ret); |
| 1805 | if (ret != -ENODEV) | 1805 | if (ret != -ENODEV) |
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 07c814c42648..60429011292a 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c | |||
| @@ -427,8 +427,8 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd) | |||
| 427 | { | 427 | { |
| 428 | struct se_device *dev = cmd->se_dev; | 428 | struct se_device *dev = cmd->se_dev; |
| 429 | struct scatterlist *sg = &cmd->t_data_sg[0]; | 429 | struct scatterlist *sg = &cmd->t_data_sg[0]; |
| 430 | unsigned char *buf, zero = 0x00, *p = &zero; | 430 | unsigned char *buf, *not_zero; |
| 431 | int rc, ret; | 431 | int ret; |
| 432 | 432 | ||
| 433 | buf = kmap(sg_page(sg)) + sg->offset; | 433 | buf = kmap(sg_page(sg)) + sg->offset; |
| 434 | if (!buf) | 434 | if (!buf) |
| @@ -437,10 +437,10 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd) | |||
| 437 | * Fall back to block_execute_write_same() slow-path if | 437 | * Fall back to block_execute_write_same() slow-path if |
| 438 | * incoming WRITE_SAME payload does not contain zeros. | 438 | * incoming WRITE_SAME payload does not contain zeros. |
| 439 | */ | 439 | */ |
| 440 | rc = memcmp(buf, p, cmd->data_length); | 440 | not_zero = memchr_inv(buf, 0x00, cmd->data_length); |
| 441 | kunmap(sg_page(sg)); | 441 | kunmap(sg_page(sg)); |
| 442 | 442 | ||
| 443 | if (rc) | 443 | if (not_zero) |
| 444 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 444 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; |
| 445 | 445 | ||
| 446 | ret = blkdev_issue_zeroout(bdev, | 446 | ret = blkdev_issue_zeroout(bdev, |
diff --git a/drivers/thermal/int340x_thermal/int3403_thermal.c b/drivers/thermal/int340x_thermal/int3403_thermal.c index 8a7f24dd9315..0c19fcd56a0d 100644 --- a/drivers/thermal/int340x_thermal/int3403_thermal.c +++ b/drivers/thermal/int340x_thermal/int3403_thermal.c | |||
| @@ -194,6 +194,7 @@ static int int3403_cdev_add(struct int3403_priv *priv) | |||
| 194 | return -EFAULT; | 194 | return -EFAULT; |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | priv->priv = obj; | ||
| 197 | obj->max_state = p->package.count - 1; | 198 | obj->max_state = p->package.count - 1; |
| 198 | obj->cdev = | 199 | obj->cdev = |
| 199 | thermal_cooling_device_register(acpi_device_bid(priv->adev), | 200 | thermal_cooling_device_register(acpi_device_bid(priv->adev), |
| @@ -201,8 +202,6 @@ static int int3403_cdev_add(struct int3403_priv *priv) | |||
| 201 | if (IS_ERR(obj->cdev)) | 202 | if (IS_ERR(obj->cdev)) |
| 202 | result = PTR_ERR(obj->cdev); | 203 | result = PTR_ERR(obj->cdev); |
| 203 | 204 | ||
| 204 | priv->priv = obj; | ||
| 205 | |||
| 206 | kfree(buf.pointer); | 205 | kfree(buf.pointer); |
| 207 | /* TODO: add ACPI notification support */ | 206 | /* TODO: add ACPI notification support */ |
| 208 | 207 | ||
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index ed805c7c5ace..ac83f721db24 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
| @@ -185,6 +185,7 @@ | |||
| 185 | * @regulator: pointer to the TMU regulator structure. | 185 | * @regulator: pointer to the TMU regulator structure. |
| 186 | * @reg_conf: pointer to structure to register with core thermal. | 186 | * @reg_conf: pointer to structure to register with core thermal. |
| 187 | * @ntrip: number of supported trip points. | 187 | * @ntrip: number of supported trip points. |
| 188 | * @enabled: current status of TMU device | ||
| 188 | * @tmu_initialize: SoC specific TMU initialization method | 189 | * @tmu_initialize: SoC specific TMU initialization method |
| 189 | * @tmu_control: SoC specific TMU control method | 190 | * @tmu_control: SoC specific TMU control method |
| 190 | * @tmu_read: SoC specific TMU temperature read method | 191 | * @tmu_read: SoC specific TMU temperature read method |
| @@ -205,6 +206,7 @@ struct exynos_tmu_data { | |||
| 205 | struct regulator *regulator; | 206 | struct regulator *regulator; |
| 206 | struct thermal_zone_device *tzd; | 207 | struct thermal_zone_device *tzd; |
| 207 | unsigned int ntrip; | 208 | unsigned int ntrip; |
| 209 | bool enabled; | ||
| 208 | 210 | ||
| 209 | int (*tmu_initialize)(struct platform_device *pdev); | 211 | int (*tmu_initialize)(struct platform_device *pdev); |
| 210 | void (*tmu_control)(struct platform_device *pdev, bool on); | 212 | void (*tmu_control)(struct platform_device *pdev, bool on); |
| @@ -398,6 +400,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) | |||
| 398 | mutex_lock(&data->lock); | 400 | mutex_lock(&data->lock); |
| 399 | clk_enable(data->clk); | 401 | clk_enable(data->clk); |
| 400 | data->tmu_control(pdev, on); | 402 | data->tmu_control(pdev, on); |
| 403 | data->enabled = on; | ||
| 401 | clk_disable(data->clk); | 404 | clk_disable(data->clk); |
| 402 | mutex_unlock(&data->lock); | 405 | mutex_unlock(&data->lock); |
| 403 | } | 406 | } |
| @@ -889,19 +892,24 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on) | |||
| 889 | static int exynos_get_temp(void *p, int *temp) | 892 | static int exynos_get_temp(void *p, int *temp) |
| 890 | { | 893 | { |
| 891 | struct exynos_tmu_data *data = p; | 894 | struct exynos_tmu_data *data = p; |
| 895 | int value, ret = 0; | ||
| 892 | 896 | ||
| 893 | if (!data || !data->tmu_read) | 897 | if (!data || !data->tmu_read || !data->enabled) |
| 894 | return -EINVAL; | 898 | return -EINVAL; |
| 895 | 899 | ||
| 896 | mutex_lock(&data->lock); | 900 | mutex_lock(&data->lock); |
| 897 | clk_enable(data->clk); | 901 | clk_enable(data->clk); |
| 898 | 902 | ||
| 899 | *temp = code_to_temp(data, data->tmu_read(data)) * MCELSIUS; | 903 | value = data->tmu_read(data); |
| 904 | if (value < 0) | ||
| 905 | ret = value; | ||
| 906 | else | ||
| 907 | *temp = code_to_temp(data, value) * MCELSIUS; | ||
| 900 | 908 | ||
| 901 | clk_disable(data->clk); | 909 | clk_disable(data->clk); |
| 902 | mutex_unlock(&data->lock); | 910 | mutex_unlock(&data->lock); |
| 903 | 911 | ||
| 904 | return 0; | 912 | return ret; |
| 905 | } | 913 | } |
| 906 | 914 | ||
| 907 | #ifdef CONFIG_THERMAL_EMULATION | 915 | #ifdef CONFIG_THERMAL_EMULATION |
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index c821b4b9647e..7b5cb28ffb35 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
| @@ -191,7 +191,9 @@ static const unsigned short full_speed_maxpacket_maxes[4] = { | |||
| 191 | static const unsigned short high_speed_maxpacket_maxes[4] = { | 191 | static const unsigned short high_speed_maxpacket_maxes[4] = { |
| 192 | [USB_ENDPOINT_XFER_CONTROL] = 64, | 192 | [USB_ENDPOINT_XFER_CONTROL] = 64, |
| 193 | [USB_ENDPOINT_XFER_ISOC] = 1024, | 193 | [USB_ENDPOINT_XFER_ISOC] = 1024, |
| 194 | [USB_ENDPOINT_XFER_BULK] = 512, | 194 | |
| 195 | /* Bulk should be 512, but some devices use 1024: we will warn below */ | ||
| 196 | [USB_ENDPOINT_XFER_BULK] = 1024, | ||
| 195 | [USB_ENDPOINT_XFER_INT] = 1024, | 197 | [USB_ENDPOINT_XFER_INT] = 1024, |
| 196 | }; | 198 | }; |
| 197 | static const unsigned short super_speed_maxpacket_maxes[4] = { | 199 | static const unsigned short super_speed_maxpacket_maxes[4] = { |
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index d83be5651f87..a666e0758a99 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h | |||
| @@ -985,6 +985,7 @@ struct dwc2_hsotg { | |||
| 985 | 985 | ||
| 986 | /* DWC OTG HW Release versions */ | 986 | /* DWC OTG HW Release versions */ |
| 987 | #define DWC2_CORE_REV_2_71a 0x4f54271a | 987 | #define DWC2_CORE_REV_2_71a 0x4f54271a |
| 988 | #define DWC2_CORE_REV_2_72a 0x4f54272a | ||
| 988 | #define DWC2_CORE_REV_2_80a 0x4f54280a | 989 | #define DWC2_CORE_REV_2_80a 0x4f54280a |
| 989 | #define DWC2_CORE_REV_2_90a 0x4f54290a | 990 | #define DWC2_CORE_REV_2_90a 0x4f54290a |
| 990 | #define DWC2_CORE_REV_2_91a 0x4f54291a | 991 | #define DWC2_CORE_REV_2_91a 0x4f54291a |
| @@ -992,6 +993,7 @@ struct dwc2_hsotg { | |||
| 992 | #define DWC2_CORE_REV_2_94a 0x4f54294a | 993 | #define DWC2_CORE_REV_2_94a 0x4f54294a |
| 993 | #define DWC2_CORE_REV_3_00a 0x4f54300a | 994 | #define DWC2_CORE_REV_3_00a 0x4f54300a |
| 994 | #define DWC2_CORE_REV_3_10a 0x4f54310a | 995 | #define DWC2_CORE_REV_3_10a 0x4f54310a |
| 996 | #define DWC2_CORE_REV_4_00a 0x4f54400a | ||
| 995 | #define DWC2_FS_IOT_REV_1_00a 0x5531100a | 997 | #define DWC2_FS_IOT_REV_1_00a 0x5531100a |
| 996 | #define DWC2_HS_IOT_REV_1_00a 0x5532100a | 998 | #define DWC2_HS_IOT_REV_1_00a 0x5532100a |
| 997 | 999 | ||
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 6c32bf26e48e..83cb5577a52f 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
| @@ -3928,6 +3928,27 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep, | |||
| 3928 | if (index && !hs_ep->isochronous) | 3928 | if (index && !hs_ep->isochronous) |
| 3929 | epctrl |= DXEPCTL_SETD0PID; | 3929 | epctrl |= DXEPCTL_SETD0PID; |
| 3930 | 3930 | ||
| 3931 | /* WA for Full speed ISOC IN in DDMA mode. | ||
| 3932 | * By Clear NAK status of EP, core will send ZLP | ||
| 3933 | * to IN token and assert NAK interrupt relying | ||
| 3934 | * on TxFIFO status only | ||
| 3935 | */ | ||
| 3936 | |||
| 3937 | if (hsotg->gadget.speed == USB_SPEED_FULL && | ||
| 3938 | hs_ep->isochronous && dir_in) { | ||
| 3939 | /* The WA applies only to core versions from 2.72a | ||
| 3940 | * to 4.00a (including both). Also for FS_IOT_1.00a | ||
| 3941 | * and HS_IOT_1.00a. | ||
| 3942 | */ | ||
| 3943 | u32 gsnpsid = dwc2_readl(hsotg->regs + GSNPSID); | ||
| 3944 | |||
| 3945 | if ((gsnpsid >= DWC2_CORE_REV_2_72a && | ||
| 3946 | gsnpsid <= DWC2_CORE_REV_4_00a) || | ||
| 3947 | gsnpsid == DWC2_FS_IOT_REV_1_00a || | ||
| 3948 | gsnpsid == DWC2_HS_IOT_REV_1_00a) | ||
| 3949 | epctrl |= DXEPCTL_CNAK; | ||
| 3950 | } | ||
| 3951 | |||
| 3931 | dev_dbg(hsotg->dev, "%s: write DxEPCTL=0x%08x\n", | 3952 | dev_dbg(hsotg->dev, "%s: write DxEPCTL=0x%08x\n", |
| 3932 | __func__, epctrl); | 3953 | __func__, epctrl); |
| 3933 | 3954 | ||
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 190f95964000..c51b73b3e048 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
| @@ -358,9 +358,14 @@ static void dwc2_gusbcfg_init(struct dwc2_hsotg *hsotg) | |||
| 358 | 358 | ||
| 359 | static int dwc2_vbus_supply_init(struct dwc2_hsotg *hsotg) | 359 | static int dwc2_vbus_supply_init(struct dwc2_hsotg *hsotg) |
| 360 | { | 360 | { |
| 361 | int ret; | ||
| 362 | |||
| 361 | hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus"); | 363 | hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus"); |
| 362 | if (IS_ERR(hsotg->vbus_supply)) | 364 | if (IS_ERR(hsotg->vbus_supply)) { |
| 363 | return 0; | 365 | ret = PTR_ERR(hsotg->vbus_supply); |
| 366 | hsotg->vbus_supply = NULL; | ||
| 367 | return ret == -ENODEV ? 0 : ret; | ||
| 368 | } | ||
| 364 | 369 | ||
| 365 | return regulator_enable(hsotg->vbus_supply); | 370 | return regulator_enable(hsotg->vbus_supply); |
| 366 | } | 371 | } |
| @@ -4342,9 +4347,7 @@ static int _dwc2_hcd_start(struct usb_hcd *hcd) | |||
| 4342 | 4347 | ||
| 4343 | spin_unlock_irqrestore(&hsotg->lock, flags); | 4348 | spin_unlock_irqrestore(&hsotg->lock, flags); |
| 4344 | 4349 | ||
| 4345 | dwc2_vbus_supply_init(hsotg); | 4350 | return dwc2_vbus_supply_init(hsotg); |
| 4346 | |||
| 4347 | return 0; | ||
| 4348 | } | 4351 | } |
| 4349 | 4352 | ||
| 4350 | /* | 4353 | /* |
diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c index 7f21747007f1..bea2e8ec0369 100644 --- a/drivers/usb/dwc2/pci.c +++ b/drivers/usb/dwc2/pci.c | |||
| @@ -141,8 +141,10 @@ static int dwc2_pci_probe(struct pci_dev *pci, | |||
| 141 | goto err; | 141 | goto err; |
| 142 | 142 | ||
| 143 | glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); | 143 | glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); |
| 144 | if (!glue) | 144 | if (!glue) { |
| 145 | ret = -ENOMEM; | ||
| 145 | goto err; | 146 | goto err; |
| 147 | } | ||
| 146 | 148 | ||
| 147 | ret = platform_device_add(dwc2); | 149 | ret = platform_device_add(dwc2); |
| 148 | if (ret) { | 150 | if (ret) { |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8796a5ee9bb9..0dedf8a799f4 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
| @@ -166,7 +166,7 @@ static void dwc3_ep_inc_deq(struct dwc3_ep *dep) | |||
| 166 | dwc3_ep_inc_trb(&dep->trb_dequeue); | 166 | dwc3_ep_inc_trb(&dep->trb_dequeue); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep, | 169 | static void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep, |
| 170 | struct dwc3_request *req, int status) | 170 | struct dwc3_request *req, int status) |
| 171 | { | 171 | { |
| 172 | struct dwc3 *dwc = dep->dwc; | 172 | struct dwc3 *dwc = dep->dwc; |
| @@ -1424,7 +1424,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, | |||
| 1424 | dwc->lock); | 1424 | dwc->lock); |
| 1425 | 1425 | ||
| 1426 | if (!r->trb) | 1426 | if (!r->trb) |
| 1427 | goto out1; | 1427 | goto out0; |
| 1428 | 1428 | ||
| 1429 | if (r->num_pending_sgs) { | 1429 | if (r->num_pending_sgs) { |
| 1430 | struct dwc3_trb *trb; | 1430 | struct dwc3_trb *trb; |
diff --git a/drivers/usb/gadget/function/f_phonet.c b/drivers/usb/gadget/function/f_phonet.c index 7889bcc0509a..8b72b192c747 100644 --- a/drivers/usb/gadget/function/f_phonet.c +++ b/drivers/usb/gadget/function/f_phonet.c | |||
| @@ -221,7 +221,7 @@ static void pn_tx_complete(struct usb_ep *ep, struct usb_request *req) | |||
| 221 | netif_wake_queue(dev); | 221 | netif_wake_queue(dev); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | static int pn_net_xmit(struct sk_buff *skb, struct net_device *dev) | 224 | static netdev_tx_t pn_net_xmit(struct sk_buff *skb, struct net_device *dev) |
| 225 | { | 225 | { |
| 226 | struct phonet_port *port = netdev_priv(dev); | 226 | struct phonet_port *port = netdev_priv(dev); |
| 227 | struct f_phonet *fp; | 227 | struct f_phonet *fp; |
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 4c6c08b675b5..21307d862af6 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c | |||
| @@ -73,9 +73,10 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) | |||
| 73 | if (!qh) | 73 | if (!qh) |
| 74 | goto done; | 74 | goto done; |
| 75 | qh->hw = (struct ehci_qh_hw *) | 75 | qh->hw = (struct ehci_qh_hw *) |
| 76 | dma_pool_zalloc(ehci->qh_pool, flags, &dma); | 76 | dma_pool_alloc(ehci->qh_pool, flags, &dma); |
| 77 | if (!qh->hw) | 77 | if (!qh->hw) |
| 78 | goto fail; | 78 | goto fail; |
| 79 | memset(qh->hw, 0, sizeof *qh->hw); | ||
| 79 | qh->qh_dma = dma; | 80 | qh->qh_dma = dma; |
| 80 | // INIT_LIST_HEAD (&qh->qh_list); | 81 | // INIT_LIST_HEAD (&qh->qh_list); |
| 81 | INIT_LIST_HEAD (&qh->qtd_list); | 82 | INIT_LIST_HEAD (&qh->qtd_list); |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 28e2a338b481..e56db44708bc 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
| @@ -1287,7 +1287,7 @@ itd_urb_transaction( | |||
| 1287 | } else { | 1287 | } else { |
| 1288 | alloc_itd: | 1288 | alloc_itd: |
| 1289 | spin_unlock_irqrestore(&ehci->lock, flags); | 1289 | spin_unlock_irqrestore(&ehci->lock, flags); |
| 1290 | itd = dma_pool_zalloc(ehci->itd_pool, mem_flags, | 1290 | itd = dma_pool_alloc(ehci->itd_pool, mem_flags, |
| 1291 | &itd_dma); | 1291 | &itd_dma); |
| 1292 | spin_lock_irqsave(&ehci->lock, flags); | 1292 | spin_lock_irqsave(&ehci->lock, flags); |
| 1293 | if (!itd) { | 1293 | if (!itd) { |
| @@ -1297,6 +1297,7 @@ itd_urb_transaction( | |||
| 1297 | } | 1297 | } |
| 1298 | } | 1298 | } |
| 1299 | 1299 | ||
| 1300 | memset(itd, 0, sizeof(*itd)); | ||
| 1300 | itd->itd_dma = itd_dma; | 1301 | itd->itd_dma = itd_dma; |
| 1301 | itd->frame = NO_FRAME; | 1302 | itd->frame = NO_FRAME; |
| 1302 | list_add(&itd->itd_list, &sched->td_list); | 1303 | list_add(&itd->itd_list, &sched->td_list); |
| @@ -2080,7 +2081,7 @@ sitd_urb_transaction( | |||
| 2080 | } else { | 2081 | } else { |
| 2081 | alloc_sitd: | 2082 | alloc_sitd: |
| 2082 | spin_unlock_irqrestore(&ehci->lock, flags); | 2083 | spin_unlock_irqrestore(&ehci->lock, flags); |
| 2083 | sitd = dma_pool_zalloc(ehci->sitd_pool, mem_flags, | 2084 | sitd = dma_pool_alloc(ehci->sitd_pool, mem_flags, |
| 2084 | &sitd_dma); | 2085 | &sitd_dma); |
| 2085 | spin_lock_irqsave(&ehci->lock, flags); | 2086 | spin_lock_irqsave(&ehci->lock, flags); |
| 2086 | if (!sitd) { | 2087 | if (!sitd) { |
| @@ -2090,6 +2091,7 @@ sitd_urb_transaction( | |||
| 2090 | } | 2091 | } |
| 2091 | } | 2092 | } |
| 2092 | 2093 | ||
| 2094 | memset(sitd, 0, sizeof(*sitd)); | ||
| 2093 | sitd->sitd_dma = sitd_dma; | 2095 | sitd->sitd_dma = sitd_dma; |
| 2094 | sitd->frame = NO_FRAME; | 2096 | sitd->frame = NO_FRAME; |
| 2095 | list_add(&sitd->sitd_list, &iso_sched->td_list); | 2097 | list_add(&sitd->sitd_list, &iso_sched->td_list); |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 9b27798ecce5..711da3306b14 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -3621,6 +3621,7 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev) | |||
| 3621 | del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); | 3621 | del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); |
| 3622 | } | 3622 | } |
| 3623 | xhci_debugfs_remove_slot(xhci, udev->slot_id); | 3623 | xhci_debugfs_remove_slot(xhci, udev->slot_id); |
| 3624 | virt_dev->udev = NULL; | ||
| 3624 | ret = xhci_disable_slot(xhci, udev->slot_id); | 3625 | ret = xhci_disable_slot(xhci, udev->slot_id); |
| 3625 | if (ret) | 3626 | if (ret) |
| 3626 | xhci_free_virt_device(xhci, udev->slot_id); | 3627 | xhci_free_virt_device(xhci, udev->slot_id); |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index e564695c6c8d..71c5835ea9cd 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
| @@ -417,7 +417,6 @@ void musb_g_tx(struct musb *musb, u8 epnum) | |||
| 417 | req = next_request(musb_ep); | 417 | req = next_request(musb_ep); |
| 418 | request = &req->request; | 418 | request = &req->request; |
| 419 | 419 | ||
| 420 | trace_musb_req_tx(req); | ||
| 421 | csr = musb_readw(epio, MUSB_TXCSR); | 420 | csr = musb_readw(epio, MUSB_TXCSR); |
| 422 | musb_dbg(musb, "<== %s, txcsr %04x", musb_ep->end_point.name, csr); | 421 | musb_dbg(musb, "<== %s, txcsr %04x", musb_ep->end_point.name, csr); |
| 423 | 422 | ||
| @@ -456,6 +455,8 @@ void musb_g_tx(struct musb *musb, u8 epnum) | |||
| 456 | u8 is_dma = 0; | 455 | u8 is_dma = 0; |
| 457 | bool short_packet = false; | 456 | bool short_packet = false; |
| 458 | 457 | ||
| 458 | trace_musb_req_tx(req); | ||
| 459 | |||
| 459 | if (dma && (csr & MUSB_TXCSR_DMAENAB)) { | 460 | if (dma && (csr & MUSB_TXCSR_DMAENAB)) { |
| 460 | is_dma = 1; | 461 | is_dma = 1; |
| 461 | csr |= MUSB_TXCSR_P_WZC_BITS; | 462 | csr |= MUSB_TXCSR_P_WZC_BITS; |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 4fa372c845e1..e7f99d55922a 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -990,7 +990,9 @@ static void musb_bulk_nak_timeout(struct musb *musb, struct musb_hw_ep *ep, | |||
| 990 | /* set tx_reinit and schedule the next qh */ | 990 | /* set tx_reinit and schedule the next qh */ |
| 991 | ep->tx_reinit = 1; | 991 | ep->tx_reinit = 1; |
| 992 | } | 992 | } |
| 993 | musb_start_urb(musb, is_in, next_qh); | 993 | |
| 994 | if (next_qh) | ||
| 995 | musb_start_urb(musb, is_in, next_qh); | ||
| 994 | } | 996 | } |
| 995 | } | 997 | } |
| 996 | 998 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index c3f252283ab9..2058852a87fa 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -233,6 +233,8 @@ static void option_instat_callback(struct urb *urb); | |||
| 233 | /* These Quectel products use Qualcomm's vendor ID */ | 233 | /* These Quectel products use Qualcomm's vendor ID */ |
| 234 | #define QUECTEL_PRODUCT_UC20 0x9003 | 234 | #define QUECTEL_PRODUCT_UC20 0x9003 |
| 235 | #define QUECTEL_PRODUCT_UC15 0x9090 | 235 | #define QUECTEL_PRODUCT_UC15 0x9090 |
| 236 | /* These u-blox products use Qualcomm's vendor ID */ | ||
| 237 | #define UBLOX_PRODUCT_R410M 0x90b2 | ||
| 236 | /* These Yuga products use Qualcomm's vendor ID */ | 238 | /* These Yuga products use Qualcomm's vendor ID */ |
| 237 | #define YUGA_PRODUCT_CLM920_NC5 0x9625 | 239 | #define YUGA_PRODUCT_CLM920_NC5 0x9625 |
| 238 | 240 | ||
| @@ -1065,6 +1067,9 @@ static const struct usb_device_id option_ids[] = { | |||
| 1065 | /* Yuga products use Qualcomm vendor ID */ | 1067 | /* Yuga products use Qualcomm vendor ID */ |
| 1066 | { USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5), | 1068 | { USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5), |
| 1067 | .driver_info = RSVD(1) | RSVD(4) }, | 1069 | .driver_info = RSVD(1) | RSVD(4) }, |
| 1070 | /* u-blox products using Qualcomm vendor ID */ | ||
| 1071 | { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), | ||
| 1072 | .driver_info = RSVD(1) | RSVD(3) }, | ||
| 1068 | /* Quectel products using Quectel vendor ID */ | 1073 | /* Quectel products using Quectel vendor ID */ |
| 1069 | { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), | 1074 | { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), |
| 1070 | .driver_info = RSVD(4) }, | 1075 | .driver_info = RSVD(4) }, |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index f5373ed2cd45..8ddbecc25d89 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
| @@ -335,47 +335,48 @@ static int palm_os_3_probe(struct usb_serial *serial, | |||
| 335 | goto exit; | 335 | goto exit; |
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | if (retval == sizeof(*connection_info)) { | 338 | if (retval != sizeof(*connection_info)) { |
| 339 | connection_info = (struct visor_connection_info *) | 339 | dev_err(dev, "Invalid connection information received from device\n"); |
| 340 | transfer_buffer; | 340 | retval = -ENODEV; |
| 341 | 341 | goto exit; | |
| 342 | num_ports = le16_to_cpu(connection_info->num_ports); | ||
| 343 | for (i = 0; i < num_ports; ++i) { | ||
| 344 | switch ( | ||
| 345 | connection_info->connections[i].port_function_id) { | ||
| 346 | case VISOR_FUNCTION_GENERIC: | ||
| 347 | string = "Generic"; | ||
| 348 | break; | ||
| 349 | case VISOR_FUNCTION_DEBUGGER: | ||
| 350 | string = "Debugger"; | ||
| 351 | break; | ||
| 352 | case VISOR_FUNCTION_HOTSYNC: | ||
| 353 | string = "HotSync"; | ||
| 354 | break; | ||
| 355 | case VISOR_FUNCTION_CONSOLE: | ||
| 356 | string = "Console"; | ||
| 357 | break; | ||
| 358 | case VISOR_FUNCTION_REMOTE_FILE_SYS: | ||
| 359 | string = "Remote File System"; | ||
| 360 | break; | ||
| 361 | default: | ||
| 362 | string = "unknown"; | ||
| 363 | break; | ||
| 364 | } | ||
| 365 | dev_info(dev, "%s: port %d, is for %s use\n", | ||
| 366 | serial->type->description, | ||
| 367 | connection_info->connections[i].port, string); | ||
| 368 | } | ||
| 369 | } | 342 | } |
| 370 | /* | 343 | |
| 371 | * Handle devices that report invalid stuff here. | 344 | connection_info = (struct visor_connection_info *)transfer_buffer; |
| 372 | */ | 345 | |
| 346 | num_ports = le16_to_cpu(connection_info->num_ports); | ||
| 347 | |||
| 348 | /* Handle devices that report invalid stuff here. */ | ||
| 373 | if (num_ports == 0 || num_ports > 2) { | 349 | if (num_ports == 0 || num_ports > 2) { |
| 374 | dev_warn(dev, "%s: No valid connect info available\n", | 350 | dev_warn(dev, "%s: No valid connect info available\n", |
| 375 | serial->type->description); | 351 | serial->type->description); |
| 376 | num_ports = 2; | 352 | num_ports = 2; |
| 377 | } | 353 | } |
| 378 | 354 | ||
| 355 | for (i = 0; i < num_ports; ++i) { | ||
| 356 | switch (connection_info->connections[i].port_function_id) { | ||
| 357 | case VISOR_FUNCTION_GENERIC: | ||
| 358 | string = "Generic"; | ||
| 359 | break; | ||
| 360 | case VISOR_FUNCTION_DEBUGGER: | ||
| 361 | string = "Debugger"; | ||
| 362 | break; | ||
| 363 | case VISOR_FUNCTION_HOTSYNC: | ||
| 364 | string = "HotSync"; | ||
| 365 | break; | ||
| 366 | case VISOR_FUNCTION_CONSOLE: | ||
| 367 | string = "Console"; | ||
| 368 | break; | ||
| 369 | case VISOR_FUNCTION_REMOTE_FILE_SYS: | ||
| 370 | string = "Remote File System"; | ||
| 371 | break; | ||
| 372 | default: | ||
| 373 | string = "unknown"; | ||
| 374 | break; | ||
| 375 | } | ||
| 376 | dev_info(dev, "%s: port %d, is for %s use\n", | ||
| 377 | serial->type->description, | ||
| 378 | connection_info->connections[i].port, string); | ||
| 379 | } | ||
| 379 | dev_info(dev, "%s: Number of ports: %d\n", serial->type->description, | 380 | dev_info(dev, "%s: Number of ports: %d\n", serial->type->description, |
| 380 | num_ports); | 381 | num_ports); |
| 381 | 382 | ||
diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 677d12138dbd..ded49e3bf2b0 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c | |||
| @@ -3725,6 +3725,7 @@ void tcpm_unregister_port(struct tcpm_port *port) | |||
| 3725 | for (i = 0; i < ARRAY_SIZE(port->port_altmode); i++) | 3725 | for (i = 0; i < ARRAY_SIZE(port->port_altmode); i++) |
| 3726 | typec_unregister_altmode(port->port_altmode[i]); | 3726 | typec_unregister_altmode(port->port_altmode[i]); |
| 3727 | typec_unregister_port(port->typec_port); | 3727 | typec_unregister_port(port->typec_port); |
| 3728 | usb_role_switch_put(port->role_sw); | ||
| 3728 | tcpm_debugfs_exit(port); | 3729 | tcpm_debugfs_exit(port); |
| 3729 | destroy_workqueue(port->wq); | 3730 | destroy_workqueue(port->wq); |
| 3730 | } | 3731 | } |
diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c index 8b8406867c02..4b4c8d271b27 100644 --- a/drivers/usb/typec/tps6598x.c +++ b/drivers/usb/typec/tps6598x.c | |||
| @@ -73,6 +73,7 @@ struct tps6598x { | |||
| 73 | struct device *dev; | 73 | struct device *dev; |
| 74 | struct regmap *regmap; | 74 | struct regmap *regmap; |
| 75 | struct mutex lock; /* device lock */ | 75 | struct mutex lock; /* device lock */ |
| 76 | u8 i2c_protocol:1; | ||
| 76 | 77 | ||
| 77 | struct typec_port *port; | 78 | struct typec_port *port; |
| 78 | struct typec_partner *partner; | 79 | struct typec_partner *partner; |
| @@ -80,19 +81,39 @@ struct tps6598x { | |||
| 80 | struct typec_capability typec_cap; | 81 | struct typec_capability typec_cap; |
| 81 | }; | 82 | }; |
| 82 | 83 | ||
| 84 | static int | ||
| 85 | tps6598x_block_read(struct tps6598x *tps, u8 reg, void *val, size_t len) | ||
| 86 | { | ||
| 87 | u8 data[len + 1]; | ||
| 88 | int ret; | ||
| 89 | |||
| 90 | if (!tps->i2c_protocol) | ||
| 91 | return regmap_raw_read(tps->regmap, reg, val, len); | ||
| 92 | |||
| 93 | ret = regmap_raw_read(tps->regmap, reg, data, sizeof(data)); | ||
| 94 | if (ret) | ||
| 95 | return ret; | ||
| 96 | |||
| 97 | if (data[0] < len) | ||
| 98 | return -EIO; | ||
| 99 | |||
| 100 | memcpy(val, &data[1], len); | ||
| 101 | return 0; | ||
| 102 | } | ||
| 103 | |||
| 83 | static inline int tps6598x_read16(struct tps6598x *tps, u8 reg, u16 *val) | 104 | static inline int tps6598x_read16(struct tps6598x *tps, u8 reg, u16 *val) |
| 84 | { | 105 | { |
| 85 | return regmap_raw_read(tps->regmap, reg, val, sizeof(u16)); | 106 | return tps6598x_block_read(tps, reg, val, sizeof(u16)); |
| 86 | } | 107 | } |
| 87 | 108 | ||
| 88 | static inline int tps6598x_read32(struct tps6598x *tps, u8 reg, u32 *val) | 109 | static inline int tps6598x_read32(struct tps6598x *tps, u8 reg, u32 *val) |
| 89 | { | 110 | { |
| 90 | return regmap_raw_read(tps->regmap, reg, val, sizeof(u32)); | 111 | return tps6598x_block_read(tps, reg, val, sizeof(u32)); |
| 91 | } | 112 | } |
| 92 | 113 | ||
| 93 | static inline int tps6598x_read64(struct tps6598x *tps, u8 reg, u64 *val) | 114 | static inline int tps6598x_read64(struct tps6598x *tps, u8 reg, u64 *val) |
| 94 | { | 115 | { |
| 95 | return regmap_raw_read(tps->regmap, reg, val, sizeof(u64)); | 116 | return tps6598x_block_read(tps, reg, val, sizeof(u64)); |
| 96 | } | 117 | } |
| 97 | 118 | ||
| 98 | static inline int tps6598x_write16(struct tps6598x *tps, u8 reg, u16 val) | 119 | static inline int tps6598x_write16(struct tps6598x *tps, u8 reg, u16 val) |
| @@ -121,8 +142,8 @@ static int tps6598x_read_partner_identity(struct tps6598x *tps) | |||
| 121 | struct tps6598x_rx_identity_reg id; | 142 | struct tps6598x_rx_identity_reg id; |
| 122 | int ret; | 143 | int ret; |
| 123 | 144 | ||
| 124 | ret = regmap_raw_read(tps->regmap, TPS_REG_RX_IDENTITY_SOP, | 145 | ret = tps6598x_block_read(tps, TPS_REG_RX_IDENTITY_SOP, |
| 125 | &id, sizeof(id)); | 146 | &id, sizeof(id)); |
| 126 | if (ret) | 147 | if (ret) |
| 127 | return ret; | 148 | return ret; |
| 128 | 149 | ||
| @@ -224,13 +245,13 @@ static int tps6598x_exec_cmd(struct tps6598x *tps, const char *cmd, | |||
| 224 | } while (val); | 245 | } while (val); |
| 225 | 246 | ||
| 226 | if (out_len) { | 247 | if (out_len) { |
| 227 | ret = regmap_raw_read(tps->regmap, TPS_REG_DATA1, | 248 | ret = tps6598x_block_read(tps, TPS_REG_DATA1, |
| 228 | out_data, out_len); | 249 | out_data, out_len); |
| 229 | if (ret) | 250 | if (ret) |
| 230 | return ret; | 251 | return ret; |
| 231 | val = out_data[0]; | 252 | val = out_data[0]; |
| 232 | } else { | 253 | } else { |
| 233 | ret = regmap_read(tps->regmap, TPS_REG_DATA1, &val); | 254 | ret = tps6598x_block_read(tps, TPS_REG_DATA1, &val, sizeof(u8)); |
| 234 | if (ret) | 255 | if (ret) |
| 235 | return ret; | 256 | return ret; |
| 236 | } | 257 | } |
| @@ -385,6 +406,16 @@ static int tps6598x_probe(struct i2c_client *client) | |||
| 385 | if (!vid) | 406 | if (!vid) |
| 386 | return -ENODEV; | 407 | return -ENODEV; |
| 387 | 408 | ||
| 409 | /* | ||
| 410 | * Checking can the adapter handle SMBus protocol. If it can not, the | ||
| 411 | * driver needs to take care of block reads separately. | ||
| 412 | * | ||
| 413 | * FIXME: Testing with I2C_FUNC_I2C. regmap-i2c uses I2C protocol | ||
| 414 | * unconditionally if the adapter has I2C_FUNC_I2C set. | ||
| 415 | */ | ||
| 416 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) | ||
| 417 | tps->i2c_protocol = true; | ||
| 418 | |||
| 388 | ret = tps6598x_read32(tps, TPS_REG_STATUS, &status); | 419 | ret = tps6598x_read32(tps, TPS_REG_STATUS, &status); |
| 389 | if (ret < 0) | 420 | if (ret < 0) |
| 390 | return ret; | 421 | return ret; |
