diff options
| author | Ingo Molnar <mingo@kernel.org> | 2015-01-28 09:30:32 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-01-28 09:30:32 -0500 |
| commit | 41ca5d4e9be11ea6ae040b51d9628a189fd82896 (patch) | |
| tree | f9c35cc37b9622f6cccd91b94548f44b9a534029 /drivers | |
| parent | 0fcedc8631ec28ca25d3c0b116e8fa0c19dd5f6d (diff) | |
| parent | 3669ef9fa7d35f573ec9c0e0341b29251c2734a7 (diff) | |
Merge commit 3669ef9fa7d3 ("x86, tls: Interpret an all-zero struct user_desc as 'no segment'") into x86/asm
Pick up the latestest asm fixes before advancing it any further.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers')
67 files changed, 534 insertions, 209 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 5277a0ee5704..b1def411c0b8 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
| @@ -512,7 +512,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev) | |||
| 512 | dev_dbg(&dev->dev, "PCI INT %c disabled\n", pin_name(pin)); | 512 | dev_dbg(&dev->dev, "PCI INT %c disabled\n", pin_name(pin)); |
| 513 | if (gsi >= 0) { | 513 | if (gsi >= 0) { |
| 514 | acpi_unregister_gsi(gsi); | 514 | acpi_unregister_gsi(gsi); |
| 515 | dev->irq = 0; | ||
| 516 | dev->irq_managed = 0; | 515 | dev->irq_managed = 0; |
| 517 | } | 516 | } |
| 518 | } | 517 | } |
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index 860da40b78ef..0ce5e2d65a06 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c | |||
| @@ -1312,6 +1312,9 @@ static int cci_probe(void) | |||
| 1312 | if (!np) | 1312 | if (!np) |
| 1313 | return -ENODEV; | 1313 | return -ENODEV; |
| 1314 | 1314 | ||
| 1315 | if (!of_device_is_available(np)) | ||
| 1316 | return -ENODEV; | ||
| 1317 | |||
| 1315 | cci_config = of_match_node(arm_cci_matches, np)->data; | 1318 | cci_config = of_match_node(arm_cci_matches, np)->data; |
| 1316 | if (!cci_config) | 1319 | if (!cci_config) |
| 1317 | return -ENODEV; | 1320 | return -ENODEV; |
diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index 32f7c1b36204..2f13bd5246b5 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c | |||
| @@ -70,6 +70,7 @@ struct clk_sam9x5_slow { | |||
| 70 | 70 | ||
| 71 | #define to_clk_sam9x5_slow(hw) container_of(hw, struct clk_sam9x5_slow, hw) | 71 | #define to_clk_sam9x5_slow(hw) container_of(hw, struct clk_sam9x5_slow, hw) |
| 72 | 72 | ||
| 73 | static struct clk *slow_clk; | ||
| 73 | 74 | ||
| 74 | static int clk_slow_osc_prepare(struct clk_hw *hw) | 75 | static int clk_slow_osc_prepare(struct clk_hw *hw) |
| 75 | { | 76 | { |
| @@ -357,6 +358,8 @@ at91_clk_register_sam9x5_slow(void __iomem *sckcr, | |||
| 357 | clk = clk_register(NULL, &slowck->hw); | 358 | clk = clk_register(NULL, &slowck->hw); |
| 358 | if (IS_ERR(clk)) | 359 | if (IS_ERR(clk)) |
| 359 | kfree(slowck); | 360 | kfree(slowck); |
| 361 | else | ||
| 362 | slow_clk = clk; | ||
| 360 | 363 | ||
| 361 | return clk; | 364 | return clk; |
| 362 | } | 365 | } |
| @@ -433,6 +436,8 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc, | |||
| 433 | clk = clk_register(NULL, &slowck->hw); | 436 | clk = clk_register(NULL, &slowck->hw); |
| 434 | if (IS_ERR(clk)) | 437 | if (IS_ERR(clk)) |
| 435 | kfree(slowck); | 438 | kfree(slowck); |
| 439 | else | ||
| 440 | slow_clk = clk; | ||
| 436 | 441 | ||
| 437 | return clk; | 442 | return clk; |
| 438 | } | 443 | } |
| @@ -465,3 +470,25 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np, | |||
| 465 | 470 | ||
| 466 | of_clk_add_provider(np, of_clk_src_simple_get, clk); | 471 | of_clk_add_provider(np, of_clk_src_simple_get, clk); |
| 467 | } | 472 | } |
| 473 | |||
| 474 | /* | ||
| 475 | * FIXME: All slow clk users are not properly claiming it (get + prepare + | ||
| 476 | * enable) before using it. | ||
| 477 | * If all users properly claiming this clock decide that they don't need it | ||
| 478 | * anymore (or are removed), it is disabled while faulty users are still | ||
| 479 | * requiring it, and the system hangs. | ||
| 480 | * Prevent this clock from being disabled until all users are properly | ||
| 481 | * requesting it. | ||
| 482 | * Once this is done we should remove this function and the slow_clk variable. | ||
| 483 | */ | ||
| 484 | static int __init of_at91_clk_slow_retain(void) | ||
| 485 | { | ||
| 486 | if (!slow_clk) | ||
| 487 | return 0; | ||
| 488 | |||
| 489 | __clk_get(slow_clk); | ||
| 490 | clk_prepare_enable(slow_clk); | ||
| 491 | |||
| 492 | return 0; | ||
| 493 | } | ||
| 494 | arch_initcall(of_at91_clk_slow_retain); | ||
diff --git a/drivers/clk/berlin/bg2q.c b/drivers/clk/berlin/bg2q.c index 21784e4eb3f0..440ef81ab15c 100644 --- a/drivers/clk/berlin/bg2q.c +++ b/drivers/clk/berlin/bg2q.c | |||
| @@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { | |||
| 285 | { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, | 285 | { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, |
| 286 | { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, | 286 | { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, |
| 287 | { "nfc", "perif", 18 }, | 287 | { "nfc", "perif", 18 }, |
| 288 | { "smemc", "perif", 19 }, | ||
| 289 | { "pcie", "perif", 22 }, | 288 | { "pcie", "perif", 22 }, |
| 290 | }; | 289 | }; |
| 291 | 290 | ||
diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c index b6e6c85507a5..0a47d6f49cd6 100644 --- a/drivers/clk/clk-ppc-corenet.c +++ b/drivers/clk/clk-ppc-corenet.c | |||
| @@ -291,7 +291,7 @@ static const struct of_device_id ppc_clk_ids[] __initconst = { | |||
| 291 | {} | 291 | {} |
| 292 | }; | 292 | }; |
| 293 | 293 | ||
| 294 | static struct platform_driver ppc_corenet_clk_driver __initdata = { | 294 | static struct platform_driver ppc_corenet_clk_driver = { |
| 295 | .driver = { | 295 | .driver = { |
| 296 | .name = "ppc_corenet_clock", | 296 | .name = "ppc_corenet_clock", |
| 297 | .of_match_table = ppc_clk_ids, | 297 | .of_match_table = ppc_clk_ids, |
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index f4963b7d4e17..d48ac71c6c8b 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
| @@ -1366,7 +1366,7 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate) | |||
| 1366 | new_rate = clk->ops->determine_rate(clk->hw, rate, | 1366 | new_rate = clk->ops->determine_rate(clk->hw, rate, |
| 1367 | &best_parent_rate, | 1367 | &best_parent_rate, |
| 1368 | &parent_hw); | 1368 | &parent_hw); |
| 1369 | parent = parent_hw->clk; | 1369 | parent = parent_hw ? parent_hw->clk : NULL; |
| 1370 | } else if (clk->ops->round_rate) { | 1370 | } else if (clk->ops->round_rate) { |
| 1371 | new_rate = clk->ops->round_rate(clk->hw, rate, | 1371 | new_rate = clk->ops->round_rate(clk->hw, rate, |
| 1372 | &best_parent_rate); | 1372 | &best_parent_rate); |
diff --git a/drivers/clk/rockchip/clk-cpu.c b/drivers/clk/rockchip/clk-cpu.c index 75c8c45ef728..8539c4fd34cc 100644 --- a/drivers/clk/rockchip/clk-cpu.c +++ b/drivers/clk/rockchip/clk-cpu.c | |||
| @@ -124,10 +124,11 @@ static int rockchip_cpuclk_pre_rate_change(struct rockchip_cpuclk *cpuclk, | |||
| 124 | { | 124 | { |
| 125 | const struct rockchip_cpuclk_reg_data *reg_data = cpuclk->reg_data; | 125 | const struct rockchip_cpuclk_reg_data *reg_data = cpuclk->reg_data; |
| 126 | unsigned long alt_prate, alt_div; | 126 | unsigned long alt_prate, alt_div; |
| 127 | unsigned long flags; | ||
| 127 | 128 | ||
| 128 | alt_prate = clk_get_rate(cpuclk->alt_parent); | 129 | alt_prate = clk_get_rate(cpuclk->alt_parent); |
| 129 | 130 | ||
| 130 | spin_lock(cpuclk->lock); | 131 | spin_lock_irqsave(cpuclk->lock, flags); |
| 131 | 132 | ||
| 132 | /* | 133 | /* |
| 133 | * If the old parent clock speed is less than the clock speed | 134 | * If the old parent clock speed is less than the clock speed |
| @@ -164,7 +165,7 @@ static int rockchip_cpuclk_pre_rate_change(struct rockchip_cpuclk *cpuclk, | |||
| 164 | cpuclk->reg_base + reg_data->core_reg); | 165 | cpuclk->reg_base + reg_data->core_reg); |
| 165 | } | 166 | } |
| 166 | 167 | ||
| 167 | spin_unlock(cpuclk->lock); | 168 | spin_unlock_irqrestore(cpuclk->lock, flags); |
| 168 | return 0; | 169 | return 0; |
| 169 | } | 170 | } |
| 170 | 171 | ||
| @@ -173,6 +174,7 @@ static int rockchip_cpuclk_post_rate_change(struct rockchip_cpuclk *cpuclk, | |||
| 173 | { | 174 | { |
| 174 | const struct rockchip_cpuclk_reg_data *reg_data = cpuclk->reg_data; | 175 | const struct rockchip_cpuclk_reg_data *reg_data = cpuclk->reg_data; |
| 175 | const struct rockchip_cpuclk_rate_table *rate; | 176 | const struct rockchip_cpuclk_rate_table *rate; |
| 177 | unsigned long flags; | ||
| 176 | 178 | ||
| 177 | rate = rockchip_get_cpuclk_settings(cpuclk, ndata->new_rate); | 179 | rate = rockchip_get_cpuclk_settings(cpuclk, ndata->new_rate); |
| 178 | if (!rate) { | 180 | if (!rate) { |
| @@ -181,7 +183,7 @@ static int rockchip_cpuclk_post_rate_change(struct rockchip_cpuclk *cpuclk, | |||
| 181 | return -EINVAL; | 183 | return -EINVAL; |
| 182 | } | 184 | } |
| 183 | 185 | ||
| 184 | spin_lock(cpuclk->lock); | 186 | spin_lock_irqsave(cpuclk->lock, flags); |
| 185 | 187 | ||
| 186 | if (ndata->old_rate < ndata->new_rate) | 188 | if (ndata->old_rate < ndata->new_rate) |
| 187 | rockchip_cpuclk_set_dividers(cpuclk, rate); | 189 | rockchip_cpuclk_set_dividers(cpuclk, rate); |
| @@ -201,7 +203,7 @@ static int rockchip_cpuclk_post_rate_change(struct rockchip_cpuclk *cpuclk, | |||
| 201 | if (ndata->old_rate > ndata->new_rate) | 203 | if (ndata->old_rate > ndata->new_rate) |
| 202 | rockchip_cpuclk_set_dividers(cpuclk, rate); | 204 | rockchip_cpuclk_set_dividers(cpuclk, rate); |
| 203 | 205 | ||
| 204 | spin_unlock(cpuclk->lock); | 206 | spin_unlock_irqrestore(cpuclk->lock, flags); |
| 205 | return 0; | 207 | return 0; |
| 206 | } | 208 | } |
| 207 | 209 | ||
diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c index c54078960847..7eb684c50d42 100644 --- a/drivers/clk/rockchip/clk-rk3188.c +++ b/drivers/clk/rockchip/clk-rk3188.c | |||
| @@ -210,6 +210,17 @@ PNAME(mux_sclk_hsadc_p) = { "hsadc_src", "hsadc_frac", "ext_hsadc" }; | |||
| 210 | PNAME(mux_mac_p) = { "gpll", "dpll" }; | 210 | PNAME(mux_mac_p) = { "gpll", "dpll" }; |
| 211 | PNAME(mux_sclk_macref_p) = { "mac_src", "ext_rmii" }; | 211 | PNAME(mux_sclk_macref_p) = { "mac_src", "ext_rmii" }; |
| 212 | 212 | ||
| 213 | static struct rockchip_pll_clock rk3066_pll_clks[] __initdata = { | ||
| 214 | [apll] = PLL(pll_rk3066, PLL_APLL, "apll", mux_pll_p, 0, RK2928_PLL_CON(0), | ||
| 215 | RK2928_MODE_CON, 0, 5, 0, rk3188_pll_rates), | ||
| 216 | [dpll] = PLL(pll_rk3066, PLL_DPLL, "dpll", mux_pll_p, 0, RK2928_PLL_CON(4), | ||
| 217 | RK2928_MODE_CON, 4, 4, 0, NULL), | ||
| 218 | [cpll] = PLL(pll_rk3066, PLL_CPLL, "cpll", mux_pll_p, 0, RK2928_PLL_CON(8), | ||
| 219 | RK2928_MODE_CON, 8, 6, ROCKCHIP_PLL_SYNC_RATE, rk3188_pll_rates), | ||
| 220 | [gpll] = PLL(pll_rk3066, PLL_GPLL, "gpll", mux_pll_p, 0, RK2928_PLL_CON(12), | ||
| 221 | RK2928_MODE_CON, 12, 7, ROCKCHIP_PLL_SYNC_RATE, rk3188_pll_rates), | ||
| 222 | }; | ||
| 223 | |||
| 213 | static struct rockchip_pll_clock rk3188_pll_clks[] __initdata = { | 224 | static struct rockchip_pll_clock rk3188_pll_clks[] __initdata = { |
| 214 | [apll] = PLL(pll_rk3066, PLL_APLL, "apll", mux_pll_p, 0, RK2928_PLL_CON(0), | 225 | [apll] = PLL(pll_rk3066, PLL_APLL, "apll", mux_pll_p, 0, RK2928_PLL_CON(0), |
| 215 | RK2928_MODE_CON, 0, 6, 0, rk3188_pll_rates), | 226 | RK2928_MODE_CON, 0, 6, 0, rk3188_pll_rates), |
| @@ -427,11 +438,11 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = { | |||
| 427 | /* hclk_peri gates */ | 438 | /* hclk_peri gates */ |
| 428 | GATE(0, "hclk_peri_axi_matrix", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 0, GFLAGS), | 439 | GATE(0, "hclk_peri_axi_matrix", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 0, GFLAGS), |
| 429 | GATE(0, "hclk_peri_ahb_arbi", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 6, GFLAGS), | 440 | GATE(0, "hclk_peri_ahb_arbi", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 6, GFLAGS), |
| 430 | GATE(0, "hclk_emem_peri", "hclk_peri", 0, RK2928_CLKGATE_CON(4), 7, GFLAGS), | 441 | GATE(0, "hclk_emem_peri", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 7, GFLAGS), |
| 431 | GATE(HCLK_EMAC, "hclk_emac", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 0, GFLAGS), | 442 | GATE(HCLK_EMAC, "hclk_emac", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 0, GFLAGS), |
| 432 | GATE(HCLK_NANDC0, "hclk_nandc0", "hclk_peri", 0, RK2928_CLKGATE_CON(5), 9, GFLAGS), | 443 | GATE(HCLK_NANDC0, "hclk_nandc0", "hclk_peri", 0, RK2928_CLKGATE_CON(5), 9, GFLAGS), |
| 433 | GATE(0, "hclk_usb_peri", "hclk_peri", 0, RK2928_CLKGATE_CON(4), 5, GFLAGS), | 444 | GATE(0, "hclk_usb_peri", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 5, GFLAGS), |
| 434 | GATE(HCLK_OTG0, "hclk_usbotg0", "hclk_peri", 0, RK2928_CLKGATE_CON(5), 13, GFLAGS), | 445 | GATE(HCLK_OTG0, "hclk_usbotg0", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(5), 13, GFLAGS), |
| 435 | GATE(HCLK_HSADC, "hclk_hsadc", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 5, GFLAGS), | 446 | GATE(HCLK_HSADC, "hclk_hsadc", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 5, GFLAGS), |
| 436 | GATE(HCLK_PIDF, "hclk_pidfilter", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 6, GFLAGS), | 447 | GATE(HCLK_PIDF, "hclk_pidfilter", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 6, GFLAGS), |
| 437 | GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0, RK2928_CLKGATE_CON(5), 10, GFLAGS), | 448 | GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0, RK2928_CLKGATE_CON(5), 10, GFLAGS), |
| @@ -592,7 +603,8 @@ static struct rockchip_clk_branch rk3066a_clk_branches[] __initdata = { | |||
| 592 | GATE(0, "hclk_cif1", "hclk_cpu", 0, RK2928_CLKGATE_CON(6), 6, GFLAGS), | 603 | GATE(0, "hclk_cif1", "hclk_cpu", 0, RK2928_CLKGATE_CON(6), 6, GFLAGS), |
| 593 | GATE(0, "hclk_hdmi", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 14, GFLAGS), | 604 | GATE(0, "hclk_hdmi", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 14, GFLAGS), |
| 594 | 605 | ||
| 595 | GATE(HCLK_OTG1, "hclk_usbotg1", "hclk_peri", 0, RK2928_CLKGATE_CON(5), 14, GFLAGS), | 606 | GATE(HCLK_OTG1, "hclk_usbotg1", "hclk_peri", CLK_IGNORE_UNUSED, |
| 607 | RK2928_CLKGATE_CON(5), 14, GFLAGS), | ||
| 596 | 608 | ||
| 597 | GATE(0, "aclk_cif1", "aclk_vio1", 0, RK2928_CLKGATE_CON(6), 7, GFLAGS), | 609 | GATE(0, "aclk_cif1", "aclk_vio1", 0, RK2928_CLKGATE_CON(6), 7, GFLAGS), |
| 598 | 610 | ||
| @@ -680,7 +692,8 @@ static struct rockchip_clk_branch rk3188_clk_branches[] __initdata = { | |||
| 680 | GATE(0, "hclk_imem0", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 14, GFLAGS), | 692 | GATE(0, "hclk_imem0", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 14, GFLAGS), |
| 681 | GATE(0, "hclk_imem1", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 15, GFLAGS), | 693 | GATE(0, "hclk_imem1", "hclk_cpu", 0, RK2928_CLKGATE_CON(4), 15, GFLAGS), |
| 682 | 694 | ||
| 683 | GATE(HCLK_OTG1, "hclk_usbotg1", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 3, GFLAGS), | 695 | GATE(HCLK_OTG1, "hclk_usbotg1", "hclk_peri", CLK_IGNORE_UNUSED, |
| 696 | RK2928_CLKGATE_CON(7), 3, GFLAGS), | ||
| 684 | GATE(HCLK_HSIC, "hclk_hsic", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 4, GFLAGS), | 697 | GATE(HCLK_HSIC, "hclk_hsic", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 4, GFLAGS), |
| 685 | 698 | ||
| 686 | GATE(PCLK_TIMER3, "pclk_timer3", "pclk_cpu", 0, RK2928_CLKGATE_CON(7), 9, GFLAGS), | 699 | GATE(PCLK_TIMER3, "pclk_timer3", "pclk_cpu", 0, RK2928_CLKGATE_CON(7), 9, GFLAGS), |
| @@ -735,8 +748,8 @@ static void __init rk3188_common_clk_init(struct device_node *np) | |||
| 735 | static void __init rk3066a_clk_init(struct device_node *np) | 748 | static void __init rk3066a_clk_init(struct device_node *np) |
| 736 | { | 749 | { |
| 737 | rk3188_common_clk_init(np); | 750 | rk3188_common_clk_init(np); |
| 738 | rockchip_clk_register_plls(rk3188_pll_clks, | 751 | rockchip_clk_register_plls(rk3066_pll_clks, |
| 739 | ARRAY_SIZE(rk3188_pll_clks), | 752 | ARRAY_SIZE(rk3066_pll_clks), |
| 740 | RK3066_GRF_SOC_STATUS); | 753 | RK3066_GRF_SOC_STATUS); |
| 741 | rockchip_clk_register_branches(rk3066a_clk_branches, | 754 | rockchip_clk_register_branches(rk3066a_clk_branches, |
| 742 | ARRAY_SIZE(rk3066a_clk_branches)); | 755 | ARRAY_SIZE(rk3066a_clk_branches)); |
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c index ac6be7c0132d..11194b8329fe 100644 --- a/drivers/clk/rockchip/clk-rk3288.c +++ b/drivers/clk/rockchip/clk-rk3288.c | |||
| @@ -145,20 +145,20 @@ struct rockchip_pll_rate_table rk3288_pll_rates[] = { | |||
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | static struct rockchip_cpuclk_rate_table rk3288_cpuclk_rates[] __initdata = { | 147 | static struct rockchip_cpuclk_rate_table rk3288_cpuclk_rates[] __initdata = { |
| 148 | RK3288_CPUCLK_RATE(1800000000, 2, 4, 2, 4, 4), | 148 | RK3288_CPUCLK_RATE(1800000000, 1, 3, 1, 3, 3), |
| 149 | RK3288_CPUCLK_RATE(1704000000, 2, 4, 2, 4, 4), | 149 | RK3288_CPUCLK_RATE(1704000000, 1, 3, 1, 3, 3), |
| 150 | RK3288_CPUCLK_RATE(1608000000, 2, 4, 2, 4, 4), | 150 | RK3288_CPUCLK_RATE(1608000000, 1, 3, 1, 3, 3), |
| 151 | RK3288_CPUCLK_RATE(1512000000, 2, 4, 2, 4, 4), | 151 | RK3288_CPUCLK_RATE(1512000000, 1, 3, 1, 3, 3), |
| 152 | RK3288_CPUCLK_RATE(1416000000, 2, 4, 2, 4, 4), | 152 | RK3288_CPUCLK_RATE(1416000000, 1, 3, 1, 3, 3), |
| 153 | RK3288_CPUCLK_RATE(1200000000, 2, 4, 2, 4, 4), | 153 | RK3288_CPUCLK_RATE(1200000000, 1, 3, 1, 3, 3), |
| 154 | RK3288_CPUCLK_RATE(1008000000, 2, 4, 2, 4, 4), | 154 | RK3288_CPUCLK_RATE(1008000000, 1, 3, 1, 3, 3), |
| 155 | RK3288_CPUCLK_RATE( 816000000, 2, 4, 2, 4, 4), | 155 | RK3288_CPUCLK_RATE( 816000000, 1, 3, 1, 3, 3), |
| 156 | RK3288_CPUCLK_RATE( 696000000, 2, 4, 2, 4, 4), | 156 | RK3288_CPUCLK_RATE( 696000000, 1, 3, 1, 3, 3), |
| 157 | RK3288_CPUCLK_RATE( 600000000, 2, 4, 2, 4, 4), | 157 | RK3288_CPUCLK_RATE( 600000000, 1, 3, 1, 3, 3), |
| 158 | RK3288_CPUCLK_RATE( 408000000, 2, 4, 2, 4, 4), | 158 | RK3288_CPUCLK_RATE( 408000000, 1, 3, 1, 3, 3), |
| 159 | RK3288_CPUCLK_RATE( 312000000, 2, 4, 2, 4, 4), | 159 | RK3288_CPUCLK_RATE( 312000000, 1, 3, 1, 3, 3), |
| 160 | RK3288_CPUCLK_RATE( 216000000, 2, 4, 2, 4, 4), | 160 | RK3288_CPUCLK_RATE( 216000000, 1, 3, 1, 3, 3), |
| 161 | RK3288_CPUCLK_RATE( 126000000, 2, 4, 2, 4, 4), | 161 | RK3288_CPUCLK_RATE( 126000000, 1, 3, 1, 3, 3), |
| 162 | }; | 162 | }; |
| 163 | 163 | ||
| 164 | static const struct rockchip_cpuclk_reg_data rk3288_cpuclk_data = { | 164 | static const struct rockchip_cpuclk_reg_data rk3288_cpuclk_data = { |
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 380478562b7d..5c062548957c 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c | |||
| @@ -1505,7 +1505,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) | |||
| 1505 | dw->regs = chip->regs; | 1505 | dw->regs = chip->regs; |
| 1506 | chip->dw = dw; | 1506 | chip->dw = dw; |
| 1507 | 1507 | ||
| 1508 | pm_runtime_enable(chip->dev); | ||
| 1509 | pm_runtime_get_sync(chip->dev); | 1508 | pm_runtime_get_sync(chip->dev); |
| 1510 | 1509 | ||
| 1511 | dw_params = dma_read_byaddr(chip->regs, DW_PARAMS); | 1510 | dw_params = dma_read_byaddr(chip->regs, DW_PARAMS); |
| @@ -1703,7 +1702,6 @@ int dw_dma_remove(struct dw_dma_chip *chip) | |||
| 1703 | } | 1702 | } |
| 1704 | 1703 | ||
| 1705 | pm_runtime_put_sync_suspend(chip->dev); | 1704 | pm_runtime_put_sync_suspend(chip->dev); |
| 1706 | pm_runtime_disable(chip->dev); | ||
| 1707 | return 0; | 1705 | return 0; |
| 1708 | } | 1706 | } |
| 1709 | EXPORT_SYMBOL_GPL(dw_dma_remove); | 1707 | EXPORT_SYMBOL_GPL(dw_dma_remove); |
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index a630161473a4..32ea1aca7a0e 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
| 17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
| 18 | #include <linux/pm_runtime.h> | ||
| 18 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
| 19 | #include <linux/dmaengine.h> | 20 | #include <linux/dmaengine.h> |
| 20 | #include <linux/dma-mapping.h> | 21 | #include <linux/dma-mapping.h> |
| @@ -185,6 +186,8 @@ static int dw_probe(struct platform_device *pdev) | |||
| 185 | if (err) | 186 | if (err) |
| 186 | return err; | 187 | return err; |
| 187 | 188 | ||
| 189 | pm_runtime_enable(&pdev->dev); | ||
| 190 | |||
| 188 | err = dw_dma_probe(chip, pdata); | 191 | err = dw_dma_probe(chip, pdata); |
| 189 | if (err) | 192 | if (err) |
| 190 | goto err_dw_dma_probe; | 193 | goto err_dw_dma_probe; |
| @@ -205,6 +208,7 @@ static int dw_probe(struct platform_device *pdev) | |||
| 205 | return 0; | 208 | return 0; |
| 206 | 209 | ||
| 207 | err_dw_dma_probe: | 210 | err_dw_dma_probe: |
| 211 | pm_runtime_disable(&pdev->dev); | ||
| 208 | clk_disable_unprepare(chip->clk); | 212 | clk_disable_unprepare(chip->clk); |
| 209 | return err; | 213 | return err; |
| 210 | } | 214 | } |
| @@ -217,6 +221,7 @@ static int dw_remove(struct platform_device *pdev) | |||
| 217 | of_dma_controller_free(pdev->dev.of_node); | 221 | of_dma_controller_free(pdev->dev.of_node); |
| 218 | 222 | ||
| 219 | dw_dma_remove(chip); | 223 | dw_dma_remove(chip); |
| 224 | pm_runtime_disable(&pdev->dev); | ||
| 220 | clk_disable_unprepare(chip->clk); | 225 | clk_disable_unprepare(chip->clk); |
| 221 | 226 | ||
| 222 | return 0; | 227 | return 0; |
diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c index e37412da15f5..b99de00e57b8 100644 --- a/drivers/iio/adc/ad799x.c +++ b/drivers/iio/adc/ad799x.c | |||
| @@ -143,9 +143,15 @@ static int ad799x_write_config(struct ad799x_state *st, u16 val) | |||
| 143 | case ad7998: | 143 | case ad7998: |
| 144 | return i2c_smbus_write_word_swapped(st->client, AD7998_CONF_REG, | 144 | return i2c_smbus_write_word_swapped(st->client, AD7998_CONF_REG, |
| 145 | val); | 145 | val); |
| 146 | default: | 146 | case ad7992: |
| 147 | case ad7993: | ||
| 148 | case ad7994: | ||
| 147 | return i2c_smbus_write_byte_data(st->client, AD7998_CONF_REG, | 149 | return i2c_smbus_write_byte_data(st->client, AD7998_CONF_REG, |
| 148 | val); | 150 | val); |
| 151 | default: | ||
| 152 | /* Will be written when doing a conversion */ | ||
| 153 | st->config = val; | ||
| 154 | return 0; | ||
| 149 | } | 155 | } |
| 150 | } | 156 | } |
| 151 | 157 | ||
| @@ -155,8 +161,13 @@ static int ad799x_read_config(struct ad799x_state *st) | |||
| 155 | case ad7997: | 161 | case ad7997: |
| 156 | case ad7998: | 162 | case ad7998: |
| 157 | return i2c_smbus_read_word_swapped(st->client, AD7998_CONF_REG); | 163 | return i2c_smbus_read_word_swapped(st->client, AD7998_CONF_REG); |
| 158 | default: | 164 | case ad7992: |
| 165 | case ad7993: | ||
| 166 | case ad7994: | ||
| 159 | return i2c_smbus_read_byte_data(st->client, AD7998_CONF_REG); | 167 | return i2c_smbus_read_byte_data(st->client, AD7998_CONF_REG); |
| 168 | default: | ||
| 169 | /* No readback support */ | ||
| 170 | return st->config; | ||
| 160 | } | 171 | } |
| 161 | } | 172 | } |
| 162 | 173 | ||
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 866fe904cba2..90c8cb727cc7 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c | |||
| @@ -449,6 +449,9 @@ static int iio_channel_read(struct iio_channel *chan, int *val, int *val2, | |||
| 449 | if (val2 == NULL) | 449 | if (val2 == NULL) |
| 450 | val2 = &unused; | 450 | val2 = &unused; |
| 451 | 451 | ||
| 452 | if(!iio_channel_has_info(chan->channel, info)) | ||
| 453 | return -EINVAL; | ||
| 454 | |||
| 452 | if (chan->indio_dev->info->read_raw_multi) { | 455 | if (chan->indio_dev->info->read_raw_multi) { |
| 453 | ret = chan->indio_dev->info->read_raw_multi(chan->indio_dev, | 456 | ret = chan->indio_dev->info->read_raw_multi(chan->indio_dev, |
| 454 | chan->channel, INDIO_MAX_RAW_ELEMENTS, | 457 | chan->channel, INDIO_MAX_RAW_ELEMENTS, |
diff --git a/drivers/mcb/mcb-internal.h b/drivers/mcb/mcb-internal.h index f956ef26c0ce..fb7493dcfb79 100644 --- a/drivers/mcb/mcb-internal.h +++ b/drivers/mcb/mcb-internal.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #define PCI_DEVICE_ID_MEN_CHAMELEON 0x4d45 | 7 | #define PCI_DEVICE_ID_MEN_CHAMELEON 0x4d45 |
| 8 | #define CHAMELEON_FILENAME_LEN 12 | 8 | #define CHAMELEON_FILENAME_LEN 12 |
| 9 | #define CHAMELEONV2_MAGIC 0xabce | 9 | #define CHAMELEONV2_MAGIC 0xabce |
| 10 | #define CHAM_HEADER_SIZE 0x200 | ||
| 10 | 11 | ||
| 11 | enum chameleon_descriptor_type { | 12 | enum chameleon_descriptor_type { |
| 12 | CHAMELEON_DTYPE_GENERAL = 0x0, | 13 | CHAMELEON_DTYPE_GENERAL = 0x0, |
diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c index b59181965643..5e1bd5db02c8 100644 --- a/drivers/mcb/mcb-pci.c +++ b/drivers/mcb/mcb-pci.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | struct priv { | 18 | struct priv { |
| 19 | struct mcb_bus *bus; | 19 | struct mcb_bus *bus; |
| 20 | phys_addr_t mapbase; | ||
| 20 | void __iomem *base; | 21 | void __iomem *base; |
| 21 | }; | 22 | }; |
| 22 | 23 | ||
| @@ -31,8 +32,8 @@ static int mcb_pci_get_irq(struct mcb_device *mdev) | |||
| 31 | 32 | ||
| 32 | static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 33 | static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
| 33 | { | 34 | { |
| 35 | struct resource *res; | ||
| 34 | struct priv *priv; | 36 | struct priv *priv; |
| 35 | phys_addr_t mapbase; | ||
| 36 | int ret; | 37 | int ret; |
| 37 | int num_cells; | 38 | int num_cells; |
| 38 | unsigned long flags; | 39 | unsigned long flags; |
| @@ -47,19 +48,21 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 47 | return -ENODEV; | 48 | return -ENODEV; |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | mapbase = pci_resource_start(pdev, 0); | 51 | priv->mapbase = pci_resource_start(pdev, 0); |
| 51 | if (!mapbase) { | 52 | if (!priv->mapbase) { |
| 52 | dev_err(&pdev->dev, "No PCI resource\n"); | 53 | dev_err(&pdev->dev, "No PCI resource\n"); |
| 53 | goto err_start; | 54 | goto err_start; |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | ret = pci_request_region(pdev, 0, KBUILD_MODNAME); | 57 | res = request_mem_region(priv->mapbase, CHAM_HEADER_SIZE, |
| 57 | if (ret) { | 58 | KBUILD_MODNAME); |
| 58 | dev_err(&pdev->dev, "Failed to request PCI BARs\n"); | 59 | if (IS_ERR(res)) { |
| 60 | dev_err(&pdev->dev, "Failed to request PCI memory\n"); | ||
| 61 | ret = PTR_ERR(res); | ||
| 59 | goto err_start; | 62 | goto err_start; |
| 60 | } | 63 | } |
| 61 | 64 | ||
| 62 | priv->base = pci_iomap(pdev, 0, 0); | 65 | priv->base = ioremap(priv->mapbase, CHAM_HEADER_SIZE); |
| 63 | if (!priv->base) { | 66 | if (!priv->base) { |
| 64 | dev_err(&pdev->dev, "Cannot ioremap\n"); | 67 | dev_err(&pdev->dev, "Cannot ioremap\n"); |
| 65 | ret = -ENOMEM; | 68 | ret = -ENOMEM; |
| @@ -84,7 +87,7 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 84 | 87 | ||
| 85 | priv->bus->get_irq = mcb_pci_get_irq; | 88 | priv->bus->get_irq = mcb_pci_get_irq; |
| 86 | 89 | ||
| 87 | ret = chameleon_parse_cells(priv->bus, mapbase, priv->base); | 90 | ret = chameleon_parse_cells(priv->bus, priv->mapbase, priv->base); |
| 88 | if (ret < 0) | 91 | if (ret < 0) |
| 89 | goto err_drvdata; | 92 | goto err_drvdata; |
| 90 | num_cells = ret; | 93 | num_cells = ret; |
| @@ -93,8 +96,10 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 93 | 96 | ||
| 94 | mcb_bus_add_devices(priv->bus); | 97 | mcb_bus_add_devices(priv->bus); |
| 95 | 98 | ||
| 99 | return 0; | ||
| 100 | |||
| 96 | err_drvdata: | 101 | err_drvdata: |
| 97 | pci_iounmap(pdev, priv->base); | 102 | iounmap(priv->base); |
| 98 | err_ioremap: | 103 | err_ioremap: |
| 99 | pci_release_region(pdev, 0); | 104 | pci_release_region(pdev, 0); |
| 100 | err_start: | 105 | err_start: |
| @@ -107,6 +112,10 @@ static void mcb_pci_remove(struct pci_dev *pdev) | |||
| 107 | struct priv *priv = pci_get_drvdata(pdev); | 112 | struct priv *priv = pci_get_drvdata(pdev); |
| 108 | 113 | ||
| 109 | mcb_release_bus(priv->bus); | 114 | mcb_release_bus(priv->bus); |
| 115 | |||
| 116 | iounmap(priv->base); | ||
| 117 | release_region(priv->mapbase, CHAM_HEADER_SIZE); | ||
| 118 | pci_disable_device(pdev); | ||
| 110 | } | 119 | } |
| 111 | 120 | ||
| 112 | static const struct pci_device_id mcb_pci_tbl[] = { | 121 | static const struct pci_device_id mcb_pci_tbl[] = { |
diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c index 51fd6b524371..d1b55fe62817 100644 --- a/drivers/misc/cxl/context.c +++ b/drivers/misc/cxl/context.c | |||
| @@ -100,6 +100,46 @@ int cxl_context_init(struct cxl_context *ctx, struct cxl_afu *afu, bool master, | |||
| 100 | return 0; | 100 | return 0; |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | static int cxl_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | ||
| 104 | { | ||
| 105 | struct cxl_context *ctx = vma->vm_file->private_data; | ||
| 106 | unsigned long address = (unsigned long)vmf->virtual_address; | ||
| 107 | u64 area, offset; | ||
| 108 | |||
| 109 | offset = vmf->pgoff << PAGE_SHIFT; | ||
| 110 | |||
| 111 | pr_devel("%s: pe: %i address: 0x%lx offset: 0x%llx\n", | ||
| 112 | __func__, ctx->pe, address, offset); | ||
| 113 | |||
| 114 | if (ctx->afu->current_mode == CXL_MODE_DEDICATED) { | ||
| 115 | area = ctx->afu->psn_phys; | ||
| 116 | if (offset > ctx->afu->adapter->ps_size) | ||
| 117 | return VM_FAULT_SIGBUS; | ||
| 118 | } else { | ||
| 119 | area = ctx->psn_phys; | ||
| 120 | if (offset > ctx->psn_size) | ||
| 121 | return VM_FAULT_SIGBUS; | ||
| 122 | } | ||
| 123 | |||
| 124 | mutex_lock(&ctx->status_mutex); | ||
| 125 | |||
| 126 | if (ctx->status != STARTED) { | ||
| 127 | mutex_unlock(&ctx->status_mutex); | ||
| 128 | pr_devel("%s: Context not started, failing problem state access\n", __func__); | ||
| 129 | return VM_FAULT_SIGBUS; | ||
| 130 | } | ||
| 131 | |||
| 132 | vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT); | ||
| 133 | |||
| 134 | mutex_unlock(&ctx->status_mutex); | ||
| 135 | |||
| 136 | return VM_FAULT_NOPAGE; | ||
| 137 | } | ||
| 138 | |||
| 139 | static const struct vm_operations_struct cxl_mmap_vmops = { | ||
| 140 | .fault = cxl_mmap_fault, | ||
| 141 | }; | ||
| 142 | |||
| 103 | /* | 143 | /* |
| 104 | * Map a per-context mmio space into the given vma. | 144 | * Map a per-context mmio space into the given vma. |
| 105 | */ | 145 | */ |
| @@ -108,26 +148,25 @@ int cxl_context_iomap(struct cxl_context *ctx, struct vm_area_struct *vma) | |||
| 108 | u64 len = vma->vm_end - vma->vm_start; | 148 | u64 len = vma->vm_end - vma->vm_start; |
| 109 | len = min(len, ctx->psn_size); | 149 | len = min(len, ctx->psn_size); |
| 110 | 150 | ||
| 111 | if (ctx->afu->current_mode == CXL_MODE_DEDICATED) { | 151 | if (ctx->afu->current_mode != CXL_MODE_DEDICATED) { |
| 112 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 152 | /* make sure there is a valid per process space for this AFU */ |
| 113 | return vm_iomap_memory(vma, ctx->afu->psn_phys, ctx->afu->adapter->ps_size); | 153 | if ((ctx->master && !ctx->afu->psa) || (!ctx->afu->pp_psa)) { |
| 114 | } | 154 | pr_devel("AFU doesn't support mmio space\n"); |
| 155 | return -EINVAL; | ||
| 156 | } | ||
| 115 | 157 | ||
| 116 | /* make sure there is a valid per process space for this AFU */ | 158 | /* Can't mmap until the AFU is enabled */ |
| 117 | if ((ctx->master && !ctx->afu->psa) || (!ctx->afu->pp_psa)) { | 159 | if (!ctx->afu->enabled) |
| 118 | pr_devel("AFU doesn't support mmio space\n"); | 160 | return -EBUSY; |
| 119 | return -EINVAL; | ||
| 120 | } | 161 | } |
| 121 | 162 | ||
| 122 | /* Can't mmap until the AFU is enabled */ | ||
| 123 | if (!ctx->afu->enabled) | ||
| 124 | return -EBUSY; | ||
| 125 | |||
| 126 | pr_devel("%s: mmio physical: %llx pe: %i master:%i\n", __func__, | 163 | pr_devel("%s: mmio physical: %llx pe: %i master:%i\n", __func__, |
| 127 | ctx->psn_phys, ctx->pe , ctx->master); | 164 | ctx->psn_phys, ctx->pe , ctx->master); |
| 128 | 165 | ||
| 166 | vma->vm_flags |= VM_IO | VM_PFNMAP; | ||
| 129 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 167 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
| 130 | return vm_iomap_memory(vma, ctx->psn_phys, len); | 168 | vma->vm_ops = &cxl_mmap_vmops; |
| 169 | return 0; | ||
| 131 | } | 170 | } |
| 132 | 171 | ||
| 133 | /* | 172 | /* |
| @@ -150,12 +189,6 @@ static void __detach_context(struct cxl_context *ctx) | |||
| 150 | afu_release_irqs(ctx); | 189 | afu_release_irqs(ctx); |
| 151 | flush_work(&ctx->fault_work); /* Only needed for dedicated process */ | 190 | flush_work(&ctx->fault_work); /* Only needed for dedicated process */ |
| 152 | wake_up_all(&ctx->wq); | 191 | wake_up_all(&ctx->wq); |
| 153 | |||
| 154 | /* Release Problem State Area mapping */ | ||
| 155 | mutex_lock(&ctx->mapping_lock); | ||
| 156 | if (ctx->mapping) | ||
| 157 | unmap_mapping_range(ctx->mapping, 0, 0, 1); | ||
| 158 | mutex_unlock(&ctx->mapping_lock); | ||
| 159 | } | 192 | } |
| 160 | 193 | ||
| 161 | /* | 194 | /* |
| @@ -184,6 +217,17 @@ void cxl_context_detach_all(struct cxl_afu *afu) | |||
| 184 | * created and torn down after the IDR removed | 217 | * created and torn down after the IDR removed |
| 185 | */ | 218 | */ |
| 186 | __detach_context(ctx); | 219 | __detach_context(ctx); |
| 220 | |||
| 221 | /* | ||
| 222 | * We are force detaching - remove any active PSA mappings so | ||
| 223 | * userspace cannot interfere with the card if it comes back. | ||
| 224 | * Easiest way to exercise this is to unbind and rebind the | ||
| 225 | * driver via sysfs while it is in use. | ||
| 226 | */ | ||
| 227 | mutex_lock(&ctx->mapping_lock); | ||
| 228 | if (ctx->mapping) | ||
| 229 | unmap_mapping_range(ctx->mapping, 0, 0, 1); | ||
| 230 | mutex_unlock(&ctx->mapping_lock); | ||
| 187 | } | 231 | } |
| 188 | mutex_unlock(&afu->contexts_lock); | 232 | mutex_unlock(&afu->contexts_lock); |
| 189 | } | 233 | } |
diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c index e9f2f10dbb37..b15d8113877c 100644 --- a/drivers/misc/cxl/file.c +++ b/drivers/misc/cxl/file.c | |||
| @@ -140,18 +140,20 @@ static long afu_ioctl_start_work(struct cxl_context *ctx, | |||
| 140 | 140 | ||
| 141 | pr_devel("%s: pe: %i\n", __func__, ctx->pe); | 141 | pr_devel("%s: pe: %i\n", __func__, ctx->pe); |
| 142 | 142 | ||
| 143 | mutex_lock(&ctx->status_mutex); | 143 | /* Do this outside the status_mutex to avoid a circular dependency with |
| 144 | if (ctx->status != OPENED) { | 144 | * the locking in cxl_mmap_fault() */ |
| 145 | rc = -EIO; | ||
| 146 | goto out; | ||
| 147 | } | ||
| 148 | |||
| 149 | if (copy_from_user(&work, uwork, | 145 | if (copy_from_user(&work, uwork, |
| 150 | sizeof(struct cxl_ioctl_start_work))) { | 146 | sizeof(struct cxl_ioctl_start_work))) { |
| 151 | rc = -EFAULT; | 147 | rc = -EFAULT; |
| 152 | goto out; | 148 | goto out; |
| 153 | } | 149 | } |
| 154 | 150 | ||
| 151 | mutex_lock(&ctx->status_mutex); | ||
| 152 | if (ctx->status != OPENED) { | ||
| 153 | rc = -EIO; | ||
| 154 | goto out; | ||
| 155 | } | ||
| 156 | |||
| 155 | /* | 157 | /* |
| 156 | * if any of the reserved fields are set or any of the unused | 158 | * if any of the reserved fields are set or any of the unused |
| 157 | * flags are set it's invalid | 159 | * flags are set it's invalid |
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index ff2755062b44..06ff0a2ec960 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c | |||
| @@ -234,6 +234,18 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable) | |||
| 234 | struct mei_me_hw *hw = to_me_hw(dev); | 234 | struct mei_me_hw *hw = to_me_hw(dev); |
| 235 | u32 hcsr = mei_hcsr_read(hw); | 235 | u32 hcsr = mei_hcsr_read(hw); |
| 236 | 236 | ||
| 237 | /* H_RST may be found lit before reset is started, | ||
| 238 | * for example if preceding reset flow hasn't completed. | ||
| 239 | * In that case asserting H_RST will be ignored, therefore | ||
| 240 | * we need to clean H_RST bit to start a successful reset sequence. | ||
| 241 | */ | ||
| 242 | if ((hcsr & H_RST) == H_RST) { | ||
| 243 | dev_warn(dev->dev, "H_RST is set = 0x%08X", hcsr); | ||
| 244 | hcsr &= ~H_RST; | ||
| 245 | mei_me_reg_write(hw, H_CSR, hcsr); | ||
| 246 | hcsr = mei_hcsr_read(hw); | ||
| 247 | } | ||
| 248 | |||
| 237 | hcsr |= H_RST | H_IG | H_IS; | 249 | hcsr |= H_RST | H_IG | H_IS; |
| 238 | 250 | ||
| 239 | if (intr_enable) | 251 | if (intr_enable) |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1453cd127921..f1a488ee432f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
| @@ -1271,6 +1271,12 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode, | |||
| 1271 | spin_unlock_irq(&host->lock); | 1271 | spin_unlock_irq(&host->lock); |
| 1272 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); | 1272 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); |
| 1273 | spin_lock_irq(&host->lock); | 1273 | spin_lock_irq(&host->lock); |
| 1274 | |||
| 1275 | if (mode != MMC_POWER_OFF) | ||
| 1276 | sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL); | ||
| 1277 | else | ||
| 1278 | sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); | ||
| 1279 | |||
| 1274 | return; | 1280 | return; |
| 1275 | } | 1281 | } |
| 1276 | 1282 | ||
diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c index e34da13885e8..27fa62ce6136 100644 --- a/drivers/phy/phy-miphy28lp.c +++ b/drivers/phy/phy-miphy28lp.c | |||
| @@ -1050,7 +1050,8 @@ static int miphy28lp_init(struct phy *phy) | |||
| 1050 | ret = miphy28lp_init_usb3(miphy_phy); | 1050 | ret = miphy28lp_init_usb3(miphy_phy); |
| 1051 | break; | 1051 | break; |
| 1052 | default: | 1052 | default: |
| 1053 | return -EINVAL; | 1053 | ret = -EINVAL; |
| 1054 | break; | ||
| 1054 | } | 1055 | } |
| 1055 | 1056 | ||
| 1056 | mutex_unlock(&miphy_dev->miphy_mutex); | 1057 | mutex_unlock(&miphy_dev->miphy_mutex); |
diff --git a/drivers/phy/phy-omap-control.c b/drivers/phy/phy-omap-control.c index c96e8183a8ff..efe724f97e02 100644 --- a/drivers/phy/phy-omap-control.c +++ b/drivers/phy/phy-omap-control.c | |||
| @@ -29,10 +29,9 @@ | |||
| 29 | /** | 29 | /** |
| 30 | * omap_control_pcie_pcs - set the PCS delay count | 30 | * omap_control_pcie_pcs - set the PCS delay count |
| 31 | * @dev: the control module device | 31 | * @dev: the control module device |
| 32 | * @id: index of the pcie PHY (should be 1 or 2) | ||
| 33 | * @delay: 8 bit delay value | 32 | * @delay: 8 bit delay value |
| 34 | */ | 33 | */ |
| 35 | void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay) | 34 | void omap_control_pcie_pcs(struct device *dev, u8 delay) |
| 36 | { | 35 | { |
| 37 | u32 val; | 36 | u32 val; |
| 38 | struct omap_control_phy *control_phy; | 37 | struct omap_control_phy *control_phy; |
| @@ -55,8 +54,8 @@ void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay) | |||
| 55 | 54 | ||
| 56 | val = readl(control_phy->pcie_pcs); | 55 | val = readl(control_phy->pcie_pcs); |
| 57 | val &= ~(OMAP_CTRL_PCIE_PCS_MASK << | 56 | val &= ~(OMAP_CTRL_PCIE_PCS_MASK << |
| 58 | (id * OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT)); | 57 | OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT); |
| 59 | val |= delay << (id * OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT); | 58 | val |= (delay << OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT); |
| 60 | writel(val, control_phy->pcie_pcs); | 59 | writel(val, control_phy->pcie_pcs); |
| 61 | } | 60 | } |
| 62 | EXPORT_SYMBOL_GPL(omap_control_pcie_pcs); | 61 | EXPORT_SYMBOL_GPL(omap_control_pcie_pcs); |
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c index fb02a67c9181..a2b08f3ccb03 100644 --- a/drivers/phy/phy-sun4i-usb.c +++ b/drivers/phy/phy-sun4i-usb.c | |||
| @@ -244,7 +244,8 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev) | |||
| 244 | else | 244 | else |
| 245 | data->num_phys = 3; | 245 | data->num_phys = 3; |
| 246 | 246 | ||
| 247 | if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy")) | 247 | if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy") || |
| 248 | of_device_is_compatible(np, "allwinner,sun6i-a31-usb-phy")) | ||
| 248 | data->disc_thresh = 3; | 249 | data->disc_thresh = 3; |
| 249 | else | 250 | else |
| 250 | data->disc_thresh = 2; | 251 | data->disc_thresh = 2; |
diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c index 1387b4d4afe3..465de2c800f2 100644 --- a/drivers/phy/phy-ti-pipe3.c +++ b/drivers/phy/phy-ti-pipe3.c | |||
| @@ -82,7 +82,6 @@ struct ti_pipe3 { | |||
| 82 | struct clk *refclk; | 82 | struct clk *refclk; |
| 83 | struct clk *div_clk; | 83 | struct clk *div_clk; |
| 84 | struct pipe3_dpll_map *dpll_map; | 84 | struct pipe3_dpll_map *dpll_map; |
| 85 | u8 id; | ||
| 86 | }; | 85 | }; |
| 87 | 86 | ||
| 88 | static struct pipe3_dpll_map dpll_map_usb[] = { | 87 | static struct pipe3_dpll_map dpll_map_usb[] = { |
| @@ -217,8 +216,13 @@ static int ti_pipe3_init(struct phy *x) | |||
| 217 | u32 val; | 216 | u32 val; |
| 218 | int ret = 0; | 217 | int ret = 0; |
| 219 | 218 | ||
| 219 | /* | ||
| 220 | * Set pcie_pcs register to 0x96 for proper functioning of phy | ||
| 221 | * as recommended in AM572x TRM SPRUHZ6, section 18.5.2.2, table | ||
| 222 | * 18-1804. | ||
| 223 | */ | ||
| 220 | if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-pcie")) { | 224 | if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-pcie")) { |
| 221 | omap_control_pcie_pcs(phy->control_dev, phy->id, 0xF1); | 225 | omap_control_pcie_pcs(phy->control_dev, 0x96); |
| 222 | return 0; | 226 | return 0; |
| 223 | } | 227 | } |
| 224 | 228 | ||
| @@ -347,8 +351,6 @@ static int ti_pipe3_probe(struct platform_device *pdev) | |||
| 347 | } | 351 | } |
| 348 | 352 | ||
| 349 | if (of_device_is_compatible(node, "ti,phy-pipe3-pcie")) { | 353 | if (of_device_is_compatible(node, "ti,phy-pipe3-pcie")) { |
| 350 | if (of_property_read_u8(node, "id", &phy->id) < 0) | ||
| 351 | phy->id = 1; | ||
| 352 | 354 | ||
| 353 | clk = devm_clk_get(phy->dev, "dpll_ref"); | 355 | clk = devm_clk_get(phy->dev, "dpll_ref"); |
| 354 | if (IS_ERR(clk)) { | 356 | if (IS_ERR(clk)) { |
diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c index eebc52cb6984..3d95c87160b3 100644 --- a/drivers/reset/reset-sunxi.c +++ b/drivers/reset/reset-sunxi.c | |||
| @@ -102,6 +102,8 @@ static int sunxi_reset_init(struct device_node *np) | |||
| 102 | goto err_alloc; | 102 | goto err_alloc; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | spin_lock_init(&data->lock); | ||
| 106 | |||
| 105 | data->rcdev.owner = THIS_MODULE; | 107 | data->rcdev.owner = THIS_MODULE; |
| 106 | data->rcdev.nr_resets = size * 32; | 108 | data->rcdev.nr_resets = size * 32; |
| 107 | data->rcdev.ops = &sunxi_reset_ops; | 109 | data->rcdev.ops = &sunxi_reset_ops; |
| @@ -157,6 +159,8 @@ static int sunxi_reset_probe(struct platform_device *pdev) | |||
| 157 | if (IS_ERR(data->membase)) | 159 | if (IS_ERR(data->membase)) |
| 158 | return PTR_ERR(data->membase); | 160 | return PTR_ERR(data->membase); |
| 159 | 161 | ||
| 162 | spin_lock_init(&data->lock); | ||
| 163 | |||
| 160 | data->rcdev.owner = THIS_MODULE; | 164 | data->rcdev.owner = THIS_MODULE; |
| 161 | data->rcdev.nr_resets = resource_size(res) * 32; | 165 | data->rcdev.nr_resets = resource_size(res) * 32; |
| 162 | data->rcdev.ops = &sunxi_reset_ops; | 166 | data->rcdev.ops = &sunxi_reset_ops; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9ea95dd3e260..6d5c0b8cb0bb 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
| @@ -591,7 +591,6 @@ static void scsi_free_sgtable(struct scsi_data_buffer *sdb, bool mq) | |||
| 591 | static int scsi_alloc_sgtable(struct scsi_data_buffer *sdb, int nents, bool mq) | 591 | static int scsi_alloc_sgtable(struct scsi_data_buffer *sdb, int nents, bool mq) |
| 592 | { | 592 | { |
| 593 | struct scatterlist *first_chunk = NULL; | 593 | struct scatterlist *first_chunk = NULL; |
| 594 | gfp_t gfp_mask = mq ? GFP_NOIO : GFP_ATOMIC; | ||
| 595 | int ret; | 594 | int ret; |
| 596 | 595 | ||
| 597 | BUG_ON(!nents); | 596 | BUG_ON(!nents); |
| @@ -606,7 +605,7 @@ static int scsi_alloc_sgtable(struct scsi_data_buffer *sdb, int nents, bool mq) | |||
| 606 | } | 605 | } |
| 607 | 606 | ||
| 608 | ret = __sg_alloc_table(&sdb->table, nents, SCSI_MAX_SG_SEGMENTS, | 607 | ret = __sg_alloc_table(&sdb->table, nents, SCSI_MAX_SG_SEGMENTS, |
| 609 | first_chunk, gfp_mask, scsi_sg_alloc); | 608 | first_chunk, GFP_ATOMIC, scsi_sg_alloc); |
| 610 | if (unlikely(ret)) | 609 | if (unlikely(ret)) |
| 611 | scsi_free_sgtable(sdb, mq); | 610 | scsi_free_sgtable(sdb, mq); |
| 612 | return ret; | 611 | return ret; |
diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c index 86c72ba0a0cd..f8c5fc371c4c 100644 --- a/drivers/staging/vt6655/baseband.c +++ b/drivers/staging/vt6655/baseband.c | |||
| @@ -2177,7 +2177,7 @@ bool BBbVT3253Init(struct vnt_private *priv) | |||
| 2177 | /* Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) */ | 2177 | /* Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) */ |
| 2178 | /*bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);*/ | 2178 | /*bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);*/ |
| 2179 | /* Select VC1/VC2, CR215 = 0x02->0x06 */ | 2179 | /* Select VC1/VC2, CR215 = 0x02->0x06 */ |
| 2180 | bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06); | 2180 | bResult &= BBbWriteEmbedded(priv, 0xd7, 0x06); |
| 2181 | /* }} */ | 2181 | /* }} */ |
| 2182 | 2182 | ||
| 2183 | for (ii = 0; ii < CB_VT3253B0_AGC; ii++) | 2183 | for (ii = 0; ii < CB_VT3253B0_AGC; ii++) |
diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c index c8f739dd346e..70f870541f92 100644 --- a/drivers/staging/vt6655/channel.c +++ b/drivers/staging/vt6655/channel.c | |||
| @@ -182,6 +182,14 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) | |||
| 182 | if (pDevice->byCurrentCh == uConnectionChannel) | 182 | if (pDevice->byCurrentCh == uConnectionChannel) |
| 183 | return bResult; | 183 | return bResult; |
| 184 | 184 | ||
| 185 | /* Set VGA to max sensitivity */ | ||
| 186 | if (pDevice->bUpdateBBVGA && | ||
| 187 | pDevice->byBBVGACurrent != pDevice->abyBBVGA[0]) { | ||
| 188 | pDevice->byBBVGACurrent = pDevice->abyBBVGA[0]; | ||
| 189 | |||
| 190 | BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent); | ||
| 191 | } | ||
| 192 | |||
| 185 | /* clear NAV */ | 193 | /* clear NAV */ |
| 186 | MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MACCR, MACCR_CLRNAV); | 194 | MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MACCR, MACCR_CLRNAV); |
| 187 | 195 | ||
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 83e4162c0094..cd1a277d853b 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c | |||
| @@ -1232,7 +1232,7 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) | |||
| 1232 | 1232 | ||
| 1233 | head_td = priv->apCurrTD[dma_idx]; | 1233 | head_td = priv->apCurrTD[dma_idx]; |
| 1234 | 1234 | ||
| 1235 | head_td->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); | 1235 | head_td->m_td1TD1.byTCR = 0; |
| 1236 | 1236 | ||
| 1237 | head_td->pTDInfo->skb = skb; | 1237 | head_td->pTDInfo->skb = skb; |
| 1238 | 1238 | ||
| @@ -1257,6 +1257,11 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) | |||
| 1257 | 1257 | ||
| 1258 | priv->bPWBitOn = false; | 1258 | priv->bPWBitOn = false; |
| 1259 | 1259 | ||
| 1260 | /* Set TSR1 & ReqCount in TxDescHead */ | ||
| 1261 | head_td->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU); | ||
| 1262 | head_td->m_td1TD1.wReqCount = | ||
| 1263 | cpu_to_le16((u16)head_td->pTDInfo->dwReqCount); | ||
| 1264 | |||
| 1260 | head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB; | 1265 | head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB; |
| 1261 | 1266 | ||
| 1262 | if (dma_idx == TYPE_AC0DMA) | 1267 | if (dma_idx == TYPE_AC0DMA) |
| @@ -1500,9 +1505,11 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, | |||
| 1500 | if (conf->enable_beacon) { | 1505 | if (conf->enable_beacon) { |
| 1501 | vnt_beacon_enable(priv, vif, conf); | 1506 | vnt_beacon_enable(priv, vif, conf); |
| 1502 | 1507 | ||
| 1503 | MACvRegBitsOn(priv, MAC_REG_TCR, TCR_AUTOBCNTX); | 1508 | MACvRegBitsOn(priv->PortOffset, MAC_REG_TCR, |
| 1509 | TCR_AUTOBCNTX); | ||
| 1504 | } else { | 1510 | } else { |
| 1505 | MACvRegBitsOff(priv, MAC_REG_TCR, TCR_AUTOBCNTX); | 1511 | MACvRegBitsOff(priv->PortOffset, MAC_REG_TCR, |
| 1512 | TCR_AUTOBCNTX); | ||
| 1506 | } | 1513 | } |
| 1507 | } | 1514 | } |
| 1508 | 1515 | ||
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index 61c39dd7ad01..b5b0155961f2 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c | |||
| @@ -1204,13 +1204,10 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType, | |||
| 1204 | 1204 | ||
| 1205 | ptdCurr = (PSTxDesc)pHeadTD; | 1205 | ptdCurr = (PSTxDesc)pHeadTD; |
| 1206 | 1206 | ||
| 1207 | ptdCurr->pTDInfo->dwReqCount = cbReqCount - uPadding; | 1207 | ptdCurr->pTDInfo->dwReqCount = cbReqCount; |
| 1208 | ptdCurr->pTDInfo->dwHeaderLength = cbHeaderLength; | 1208 | ptdCurr->pTDInfo->dwHeaderLength = cbHeaderLength; |
| 1209 | ptdCurr->pTDInfo->skb_dma = ptdCurr->pTDInfo->buf_dma; | 1209 | ptdCurr->pTDInfo->skb_dma = ptdCurr->pTDInfo->buf_dma; |
| 1210 | ptdCurr->buff_addr = cpu_to_le32(ptdCurr->pTDInfo->skb_dma); | 1210 | ptdCurr->buff_addr = cpu_to_le32(ptdCurr->pTDInfo->skb_dma); |
| 1211 | /* Set TSR1 & ReqCount in TxDescHead */ | ||
| 1212 | ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU); | ||
| 1213 | ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((unsigned short)(cbReqCount)); | ||
| 1214 | 1211 | ||
| 1215 | return cbHeaderLength; | 1212 | return cbHeaderLength; |
| 1216 | } | 1213 | } |
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index d2b496750d59..4ddfa60c9222 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
| @@ -2399,17 +2399,12 @@ static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file, | |||
| 2399 | 2399 | ||
| 2400 | poll_wait(file, &tty->read_wait, wait); | 2400 | poll_wait(file, &tty->read_wait, wait); |
| 2401 | poll_wait(file, &tty->write_wait, wait); | 2401 | poll_wait(file, &tty->write_wait, wait); |
| 2402 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) | ||
| 2403 | mask |= POLLHUP; | ||
| 2404 | if (input_available_p(tty, 1)) | 2402 | if (input_available_p(tty, 1)) |
| 2405 | mask |= POLLIN | POLLRDNORM; | 2403 | mask |= POLLIN | POLLRDNORM; |
| 2406 | else if (mask & POLLHUP) { | ||
| 2407 | tty_flush_to_ldisc(tty); | ||
| 2408 | if (input_available_p(tty, 1)) | ||
| 2409 | mask |= POLLIN | POLLRDNORM; | ||
| 2410 | } | ||
| 2411 | if (tty->packet && tty->link->ctrl_status) | 2404 | if (tty->packet && tty->link->ctrl_status) |
| 2412 | mask |= POLLPRI | POLLIN | POLLRDNORM; | 2405 | mask |= POLLPRI | POLLIN | POLLRDNORM; |
| 2406 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) | ||
| 2407 | mask |= POLLHUP; | ||
| 2413 | if (tty_hung_up_p(file)) | 2408 | if (tty_hung_up_p(file)) |
| 2414 | mask |= POLLHUP; | 2409 | mask |= POLLHUP; |
| 2415 | if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) { | 2410 | if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) { |
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 31feeb2d0a66..d1f8dc6aabcb 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c | |||
| @@ -1815,7 +1815,7 @@ pci_wch_ch353_setup(struct serial_private *priv, | |||
| 1815 | } | 1815 | } |
| 1816 | 1816 | ||
| 1817 | static int | 1817 | static int |
| 1818 | pci_wch_ch382_setup(struct serial_private *priv, | 1818 | pci_wch_ch38x_setup(struct serial_private *priv, |
| 1819 | const struct pciserial_board *board, | 1819 | const struct pciserial_board *board, |
| 1820 | struct uart_8250_port *port, int idx) | 1820 | struct uart_8250_port *port, int idx) |
| 1821 | { | 1821 | { |
| @@ -1880,6 +1880,7 @@ pci_wch_ch382_setup(struct serial_private *priv, | |||
| 1880 | 1880 | ||
| 1881 | #define PCIE_VENDOR_ID_WCH 0x1c00 | 1881 | #define PCIE_VENDOR_ID_WCH 0x1c00 |
| 1882 | #define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250 | 1882 | #define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250 |
| 1883 | #define PCIE_DEVICE_ID_WCH_CH384_4S 0x3470 | ||
| 1883 | 1884 | ||
| 1884 | /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ | 1885 | /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ |
| 1885 | #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 | 1886 | #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 |
| @@ -2571,13 +2572,21 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { | |||
| 2571 | .subdevice = PCI_ANY_ID, | 2572 | .subdevice = PCI_ANY_ID, |
| 2572 | .setup = pci_wch_ch353_setup, | 2573 | .setup = pci_wch_ch353_setup, |
| 2573 | }, | 2574 | }, |
| 2574 | /* WCH CH382 2S1P card (16750 clone) */ | 2575 | /* WCH CH382 2S1P card (16850 clone) */ |
| 2575 | { | 2576 | { |
| 2576 | .vendor = PCIE_VENDOR_ID_WCH, | 2577 | .vendor = PCIE_VENDOR_ID_WCH, |
| 2577 | .device = PCIE_DEVICE_ID_WCH_CH382_2S1P, | 2578 | .device = PCIE_DEVICE_ID_WCH_CH382_2S1P, |
| 2578 | .subvendor = PCI_ANY_ID, | 2579 | .subvendor = PCI_ANY_ID, |
| 2579 | .subdevice = PCI_ANY_ID, | 2580 | .subdevice = PCI_ANY_ID, |
| 2580 | .setup = pci_wch_ch382_setup, | 2581 | .setup = pci_wch_ch38x_setup, |
| 2582 | }, | ||
| 2583 | /* WCH CH384 4S card (16850 clone) */ | ||
| 2584 | { | ||
| 2585 | .vendor = PCIE_VENDOR_ID_WCH, | ||
| 2586 | .device = PCIE_DEVICE_ID_WCH_CH384_4S, | ||
| 2587 | .subvendor = PCI_ANY_ID, | ||
| 2588 | .subdevice = PCI_ANY_ID, | ||
| 2589 | .setup = pci_wch_ch38x_setup, | ||
| 2581 | }, | 2590 | }, |
| 2582 | /* | 2591 | /* |
| 2583 | * ASIX devices with FIFO bug | 2592 | * ASIX devices with FIFO bug |
| @@ -2876,6 +2885,7 @@ enum pci_board_num_t { | |||
| 2876 | pbn_fintek_4, | 2885 | pbn_fintek_4, |
| 2877 | pbn_fintek_8, | 2886 | pbn_fintek_8, |
| 2878 | pbn_fintek_12, | 2887 | pbn_fintek_12, |
| 2888 | pbn_wch384_4, | ||
| 2879 | }; | 2889 | }; |
| 2880 | 2890 | ||
| 2881 | /* | 2891 | /* |
| @@ -3675,6 +3685,14 @@ static struct pciserial_board pci_boards[] = { | |||
| 3675 | .base_baud = 115200, | 3685 | .base_baud = 115200, |
| 3676 | .first_offset = 0x40, | 3686 | .first_offset = 0x40, |
| 3677 | }, | 3687 | }, |
| 3688 | |||
| 3689 | [pbn_wch384_4] = { | ||
| 3690 | .flags = FL_BASE0, | ||
| 3691 | .num_ports = 4, | ||
| 3692 | .base_baud = 115200, | ||
| 3693 | .uart_offset = 8, | ||
| 3694 | .first_offset = 0xC0, | ||
| 3695 | }, | ||
| 3678 | }; | 3696 | }; |
| 3679 | 3697 | ||
| 3680 | static const struct pci_device_id blacklist[] = { | 3698 | static const struct pci_device_id blacklist[] = { |
| @@ -3687,6 +3705,7 @@ static const struct pci_device_id blacklist[] = { | |||
| 3687 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ | 3705 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ |
| 3688 | { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ | 3706 | { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ |
| 3689 | { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */ | 3707 | { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */ |
| 3708 | { PCI_DEVICE(0x1c00, 0x3470), }, /* WCH CH384 4S */ | ||
| 3690 | }; | 3709 | }; |
| 3691 | 3710 | ||
| 3692 | /* | 3711 | /* |
| @@ -5400,6 +5419,10 @@ static struct pci_device_id serial_pci_tbl[] = { | |||
| 5400 | PCI_ANY_ID, PCI_ANY_ID, | 5419 | PCI_ANY_ID, PCI_ANY_ID, |
| 5401 | 0, 0, pbn_b0_bt_2_115200 }, | 5420 | 0, 0, pbn_b0_bt_2_115200 }, |
| 5402 | 5421 | ||
| 5422 | { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH384_4S, | ||
| 5423 | PCI_ANY_ID, PCI_ANY_ID, | ||
| 5424 | 0, 0, pbn_wch384_4 }, | ||
| 5425 | |||
| 5403 | /* | 5426 | /* |
| 5404 | * Commtech, Inc. Fastcom adapters | 5427 | * Commtech, Inc. Fastcom adapters |
| 5405 | */ | 5428 | */ |
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 19273e31d224..107e80722575 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c | |||
| @@ -1757,32 +1757,43 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { | |||
| 1757 | #endif | 1757 | #endif |
| 1758 | 1758 | ||
| 1759 | #if defined(CONFIG_ARCH_EXYNOS) | 1759 | #if defined(CONFIG_ARCH_EXYNOS) |
| 1760 | #define EXYNOS_COMMON_SERIAL_DRV_DATA \ | ||
| 1761 | .info = &(struct s3c24xx_uart_info) { \ | ||
| 1762 | .name = "Samsung Exynos UART", \ | ||
| 1763 | .type = PORT_S3C6400, \ | ||
| 1764 | .has_divslot = 1, \ | ||
| 1765 | .rx_fifomask = S5PV210_UFSTAT_RXMASK, \ | ||
| 1766 | .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ | ||
| 1767 | .rx_fifofull = S5PV210_UFSTAT_RXFULL, \ | ||
| 1768 | .tx_fifofull = S5PV210_UFSTAT_TXFULL, \ | ||
| 1769 | .tx_fifomask = S5PV210_UFSTAT_TXMASK, \ | ||
| 1770 | .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, \ | ||
| 1771 | .def_clk_sel = S3C2410_UCON_CLKSEL0, \ | ||
| 1772 | .num_clks = 1, \ | ||
| 1773 | .clksel_mask = 0, \ | ||
| 1774 | .clksel_shift = 0, \ | ||
| 1775 | }, \ | ||
| 1776 | .def_cfg = &(struct s3c2410_uartcfg) { \ | ||
| 1777 | .ucon = S5PV210_UCON_DEFAULT, \ | ||
| 1778 | .ufcon = S5PV210_UFCON_DEFAULT, \ | ||
| 1779 | .has_fracval = 1, \ | ||
| 1780 | } \ | ||
| 1781 | |||
| 1760 | static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = { | 1782 | static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = { |
| 1761 | .info = &(struct s3c24xx_uart_info) { | 1783 | EXYNOS_COMMON_SERIAL_DRV_DATA, |
| 1762 | .name = "Samsung Exynos4 UART", | ||
| 1763 | .type = PORT_S3C6400, | ||
| 1764 | .has_divslot = 1, | ||
| 1765 | .rx_fifomask = S5PV210_UFSTAT_RXMASK, | ||
| 1766 | .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, | ||
| 1767 | .rx_fifofull = S5PV210_UFSTAT_RXFULL, | ||
| 1768 | .tx_fifofull = S5PV210_UFSTAT_TXFULL, | ||
| 1769 | .tx_fifomask = S5PV210_UFSTAT_TXMASK, | ||
| 1770 | .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, | ||
| 1771 | .def_clk_sel = S3C2410_UCON_CLKSEL0, | ||
| 1772 | .num_clks = 1, | ||
| 1773 | .clksel_mask = 0, | ||
| 1774 | .clksel_shift = 0, | ||
| 1775 | }, | ||
| 1776 | .def_cfg = &(struct s3c2410_uartcfg) { | ||
| 1777 | .ucon = S5PV210_UCON_DEFAULT, | ||
| 1778 | .ufcon = S5PV210_UFCON_DEFAULT, | ||
| 1779 | .has_fracval = 1, | ||
| 1780 | }, | ||
| 1781 | .fifosize = { 256, 64, 16, 16 }, | 1784 | .fifosize = { 256, 64, 16, 16 }, |
| 1782 | }; | 1785 | }; |
| 1786 | |||
| 1787 | static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = { | ||
| 1788 | EXYNOS_COMMON_SERIAL_DRV_DATA, | ||
| 1789 | .fifosize = { 64, 256, 16, 256 }, | ||
| 1790 | }; | ||
| 1791 | |||
| 1783 | #define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data) | 1792 | #define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data) |
| 1793 | #define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos5433_serial_drv_data) | ||
| 1784 | #else | 1794 | #else |
| 1785 | #define EXYNOS4210_SERIAL_DRV_DATA (kernel_ulong_t)NULL | 1795 | #define EXYNOS4210_SERIAL_DRV_DATA (kernel_ulong_t)NULL |
| 1796 | #define EXYNOS5433_SERIAL_DRV_DATA (kernel_ulong_t)NULL | ||
| 1786 | #endif | 1797 | #endif |
| 1787 | 1798 | ||
| 1788 | static struct platform_device_id s3c24xx_serial_driver_ids[] = { | 1799 | static struct platform_device_id s3c24xx_serial_driver_ids[] = { |
| @@ -1804,6 +1815,9 @@ static struct platform_device_id s3c24xx_serial_driver_ids[] = { | |||
| 1804 | }, { | 1815 | }, { |
| 1805 | .name = "exynos4210-uart", | 1816 | .name = "exynos4210-uart", |
| 1806 | .driver_data = EXYNOS4210_SERIAL_DRV_DATA, | 1817 | .driver_data = EXYNOS4210_SERIAL_DRV_DATA, |
| 1818 | }, { | ||
| 1819 | .name = "exynos5433-uart", | ||
| 1820 | .driver_data = EXYNOS5433_SERIAL_DRV_DATA, | ||
| 1807 | }, | 1821 | }, |
| 1808 | { }, | 1822 | { }, |
| 1809 | }; | 1823 | }; |
| @@ -1823,6 +1837,8 @@ static const struct of_device_id s3c24xx_uart_dt_match[] = { | |||
| 1823 | .data = (void *)S5PV210_SERIAL_DRV_DATA }, | 1837 | .data = (void *)S5PV210_SERIAL_DRV_DATA }, |
| 1824 | { .compatible = "samsung,exynos4210-uart", | 1838 | { .compatible = "samsung,exynos4210-uart", |
| 1825 | .data = (void *)EXYNOS4210_SERIAL_DRV_DATA }, | 1839 | .data = (void *)EXYNOS4210_SERIAL_DRV_DATA }, |
| 1840 | { .compatible = "samsung,exynos5433-uart", | ||
| 1841 | .data = (void *)EXYNOS5433_SERIAL_DRV_DATA }, | ||
| 1826 | {}, | 1842 | {}, |
| 1827 | }; | 1843 | }; |
| 1828 | MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); | 1844 | MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); |
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 57ca61b14670..984605bb5bf1 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
| @@ -2164,7 +2164,9 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port) | |||
| 2164 | break; | 2164 | break; |
| 2165 | } | 2165 | } |
| 2166 | 2166 | ||
| 2167 | dev_info(port->dev, "%s%d at %s (irq = %d, base_baud = %d) is a %s\n", | 2167 | printk(KERN_INFO "%s%s%s%d at %s (irq = %d, base_baud = %d) is a %s\n", |
| 2168 | port->dev ? dev_name(port->dev) : "", | ||
| 2169 | port->dev ? ": " : "", | ||
| 2168 | drv->dev_name, | 2170 | drv->dev_name, |
| 2169 | drv->tty_driver->name_base + port->line, | 2171 | drv->tty_driver->name_base + port->line, |
| 2170 | address, port->irq, port->uartclk / 16, uart_type(port)); | 2172 | address, port->irq, port->uartclk / 16, uart_type(port)); |
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 4f35b43e2475..51f066aa375e 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
| @@ -1464,6 +1464,9 @@ static int tty_reopen(struct tty_struct *tty) | |||
| 1464 | driver->subtype == PTY_TYPE_MASTER) | 1464 | driver->subtype == PTY_TYPE_MASTER) |
| 1465 | return -EIO; | 1465 | return -EIO; |
| 1466 | 1466 | ||
| 1467 | if (test_bit(TTY_EXCLUSIVE, &tty->flags) && !capable(CAP_SYS_ADMIN)) | ||
| 1468 | return -EBUSY; | ||
| 1469 | |||
| 1467 | tty->count++; | 1470 | tty->count++; |
| 1468 | 1471 | ||
| 1469 | WARN_ON(!tty->ldisc); | 1472 | WARN_ON(!tty->ldisc); |
| @@ -2106,10 +2109,6 @@ retry_open: | |||
| 2106 | retval = -ENODEV; | 2109 | retval = -ENODEV; |
| 2107 | filp->f_flags = saved_flags; | 2110 | filp->f_flags = saved_flags; |
| 2108 | 2111 | ||
| 2109 | if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) && | ||
| 2110 | !capable(CAP_SYS_ADMIN)) | ||
| 2111 | retval = -EBUSY; | ||
| 2112 | |||
| 2113 | if (retval) { | 2112 | if (retval) { |
| 2114 | #ifdef TTY_DEBUG_HANGUP | 2113 | #ifdef TTY_DEBUG_HANGUP |
| 2115 | printk(KERN_DEBUG "%s: error %d in opening %s...\n", __func__, | 2114 | printk(KERN_DEBUG "%s: error %d in opening %s...\n", __func__, |
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 5b9825a4538a..a57dc8866fc5 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
| @@ -669,7 +669,6 @@ static int ci_hdrc_probe(struct platform_device *pdev) | |||
| 669 | if (!ci) | 669 | if (!ci) |
| 670 | return -ENOMEM; | 670 | return -ENOMEM; |
| 671 | 671 | ||
| 672 | platform_set_drvdata(pdev, ci); | ||
| 673 | ci->dev = dev; | 672 | ci->dev = dev; |
| 674 | ci->platdata = dev_get_platdata(dev); | 673 | ci->platdata = dev_get_platdata(dev); |
| 675 | ci->imx28_write_fix = !!(ci->platdata->flags & | 674 | ci->imx28_write_fix = !!(ci->platdata->flags & |
| @@ -783,6 +782,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) | |||
| 783 | } | 782 | } |
| 784 | } | 783 | } |
| 785 | 784 | ||
| 785 | platform_set_drvdata(pdev, ci); | ||
| 786 | ret = devm_request_irq(dev, ci->irq, ci_irq, IRQF_SHARED, | 786 | ret = devm_request_irq(dev, ci->irq, ci_irq, IRQF_SHARED, |
| 787 | ci->platdata->name, ci); | 787 | ci->platdata->name, ci); |
| 788 | if (ret) | 788 | if (ret) |
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index c1694cff1eaf..48731d0bab35 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c | |||
| @@ -91,6 +91,7 @@ static int host_start(struct ci_hdrc *ci) | |||
| 91 | if (!hcd) | 91 | if (!hcd) |
| 92 | return -ENOMEM; | 92 | return -ENOMEM; |
| 93 | 93 | ||
| 94 | dev_set_drvdata(ci->dev, ci); | ||
| 94 | hcd->rsrc_start = ci->hw_bank.phys; | 95 | hcd->rsrc_start = ci->hw_bank.phys; |
| 95 | hcd->rsrc_len = ci->hw_bank.size; | 96 | hcd->rsrc_len = ci->hw_bank.size; |
| 96 | hcd->regs = ci->hw_bank.abs; | 97 | hcd->regs = ci->hw_bank.abs; |
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 200168ec2d75..79242008085b 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
| @@ -2567,7 +2567,7 @@ error: | |||
| 2567 | * s3c_hsotg_ep_disable - disable given endpoint | 2567 | * s3c_hsotg_ep_disable - disable given endpoint |
| 2568 | * @ep: The endpoint to disable. | 2568 | * @ep: The endpoint to disable. |
| 2569 | */ | 2569 | */ |
| 2570 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) | 2570 | static int s3c_hsotg_ep_disable_force(struct usb_ep *ep, bool force) |
| 2571 | { | 2571 | { |
| 2572 | struct s3c_hsotg_ep *hs_ep = our_ep(ep); | 2572 | struct s3c_hsotg_ep *hs_ep = our_ep(ep); |
| 2573 | struct dwc2_hsotg *hsotg = hs_ep->parent; | 2573 | struct dwc2_hsotg *hsotg = hs_ep->parent; |
| @@ -2588,7 +2588,7 @@ static int s3c_hsotg_ep_disable(struct usb_ep *ep) | |||
| 2588 | 2588 | ||
| 2589 | spin_lock_irqsave(&hsotg->lock, flags); | 2589 | spin_lock_irqsave(&hsotg->lock, flags); |
| 2590 | /* terminate all requests with shutdown */ | 2590 | /* terminate all requests with shutdown */ |
| 2591 | kill_all_requests(hsotg, hs_ep, -ESHUTDOWN, false); | 2591 | kill_all_requests(hsotg, hs_ep, -ESHUTDOWN, force); |
| 2592 | 2592 | ||
| 2593 | hsotg->fifo_map &= ~(1<<hs_ep->fifo_index); | 2593 | hsotg->fifo_map &= ~(1<<hs_ep->fifo_index); |
| 2594 | hs_ep->fifo_index = 0; | 2594 | hs_ep->fifo_index = 0; |
| @@ -2609,6 +2609,10 @@ static int s3c_hsotg_ep_disable(struct usb_ep *ep) | |||
| 2609 | return 0; | 2609 | return 0; |
| 2610 | } | 2610 | } |
| 2611 | 2611 | ||
| 2612 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) | ||
| 2613 | { | ||
| 2614 | return s3c_hsotg_ep_disable_force(ep, false); | ||
| 2615 | } | ||
| 2612 | /** | 2616 | /** |
| 2613 | * on_list - check request is on the given endpoint | 2617 | * on_list - check request is on the given endpoint |
| 2614 | * @ep: The endpoint to check. | 2618 | * @ep: The endpoint to check. |
| @@ -2924,7 +2928,7 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget) | |||
| 2924 | 2928 | ||
| 2925 | /* all endpoints should be shutdown */ | 2929 | /* all endpoints should be shutdown */ |
| 2926 | for (ep = 1; ep < hsotg->num_of_eps; ep++) | 2930 | for (ep = 1; ep < hsotg->num_of_eps; ep++) |
| 2927 | s3c_hsotg_ep_disable(&hsotg->eps[ep].ep); | 2931 | s3c_hsotg_ep_disable_force(&hsotg->eps[ep].ep, true); |
| 2928 | 2932 | ||
| 2929 | spin_lock_irqsave(&hsotg->lock, flags); | 2933 | spin_lock_irqsave(&hsotg->lock, flags); |
| 2930 | 2934 | ||
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 7c4faf738747..b642a2f998f9 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #define PCI_DEVICE_ID_INTEL_BYT 0x0f37 | 33 | #define PCI_DEVICE_ID_INTEL_BYT 0x0f37 |
| 34 | #define PCI_DEVICE_ID_INTEL_MRFLD 0x119e | 34 | #define PCI_DEVICE_ID_INTEL_MRFLD 0x119e |
| 35 | #define PCI_DEVICE_ID_INTEL_BSW 0x22B7 | 35 | #define PCI_DEVICE_ID_INTEL_BSW 0x22B7 |
| 36 | #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 | ||
| 37 | #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 | ||
| 36 | 38 | ||
| 37 | struct dwc3_pci { | 39 | struct dwc3_pci { |
| 38 | struct device *dev; | 40 | struct device *dev; |
| @@ -219,6 +221,8 @@ static const struct pci_device_id dwc3_pci_id_table[] = { | |||
| 219 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BSW), }, | 221 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BSW), }, |
| 220 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), }, | 222 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), }, |
| 221 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRFLD), }, | 223 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRFLD), }, |
| 224 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), }, | ||
| 225 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTH), }, | ||
| 222 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, | 226 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, |
| 223 | { } /* Terminating Entry */ | 227 | { } /* Terminating Entry */ |
| 224 | }; | 228 | }; |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index f03b136ecfce..8f65ab3a3b92 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
| @@ -882,8 +882,7 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting) | |||
| 882 | 882 | ||
| 883 | if (i == (request->num_mapped_sgs - 1) || | 883 | if (i == (request->num_mapped_sgs - 1) || |
| 884 | sg_is_last(s)) { | 884 | sg_is_last(s)) { |
| 885 | if (list_is_last(&req->list, | 885 | if (list_empty(&dep->request_list)) |
| 886 | &dep->request_list)) | ||
| 887 | last_one = true; | 886 | last_one = true; |
| 888 | chain = false; | 887 | chain = false; |
| 889 | } | 888 | } |
| @@ -901,6 +900,9 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting) | |||
| 901 | if (last_one) | 900 | if (last_one) |
| 902 | break; | 901 | break; |
| 903 | } | 902 | } |
| 903 | |||
| 904 | if (last_one) | ||
| 905 | break; | ||
| 904 | } else { | 906 | } else { |
| 905 | dma = req->request.dma; | 907 | dma = req->request.dma; |
| 906 | length = req->request.length; | 908 | length = req->request.length; |
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index 6e04e302dc3a..a1bc3e3a0b09 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c | |||
| @@ -399,8 +399,9 @@ static int hidg_setup(struct usb_function *f, | |||
| 399 | value = __le16_to_cpu(ctrl->wValue); | 399 | value = __le16_to_cpu(ctrl->wValue); |
| 400 | length = __le16_to_cpu(ctrl->wLength); | 400 | length = __le16_to_cpu(ctrl->wLength); |
| 401 | 401 | ||
| 402 | VDBG(cdev, "hid_setup crtl_request : bRequestType:0x%x bRequest:0x%x " | 402 | VDBG(cdev, |
| 403 | "Value:0x%x\n", ctrl->bRequestType, ctrl->bRequest, value); | 403 | "%s crtl_request : bRequestType:0x%x bRequest:0x%x Value:0x%x\n", |
| 404 | __func__, ctrl->bRequestType, ctrl->bRequest, value); | ||
| 404 | 405 | ||
| 405 | switch ((ctrl->bRequestType << 8) | ctrl->bRequest) { | 406 | switch ((ctrl->bRequestType << 8) | ctrl->bRequest) { |
| 406 | case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8 | 407 | case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8 |
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index a90440300735..259b656c0b3e 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c | |||
| @@ -520,7 +520,7 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req) | |||
| 520 | req = midi_alloc_ep_req(ep, midi->buflen); | 520 | req = midi_alloc_ep_req(ep, midi->buflen); |
| 521 | 521 | ||
| 522 | if (!req) { | 522 | if (!req) { |
| 523 | ERROR(midi, "gmidi_transmit: alloc_ep_request failed\n"); | 523 | ERROR(midi, "%s: alloc_ep_request failed\n", __func__); |
| 524 | return; | 524 | return; |
| 525 | } | 525 | } |
| 526 | req->length = 0; | 526 | req->length = 0; |
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index f7b203293205..e9715845f82e 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c | |||
| @@ -897,7 +897,6 @@ static void f_audio_free_inst(struct usb_function_instance *f) | |||
| 897 | struct f_uac1_opts *opts; | 897 | struct f_uac1_opts *opts; |
| 898 | 898 | ||
| 899 | opts = container_of(f, struct f_uac1_opts, func_inst); | 899 | opts = container_of(f, struct f_uac1_opts, func_inst); |
| 900 | gaudio_cleanup(opts->card); | ||
| 901 | if (opts->fn_play_alloc) | 900 | if (opts->fn_play_alloc) |
| 902 | kfree(opts->fn_play); | 901 | kfree(opts->fn_play); |
| 903 | if (opts->fn_cap_alloc) | 902 | if (opts->fn_cap_alloc) |
| @@ -935,6 +934,7 @@ static void f_audio_free(struct usb_function *f) | |||
| 935 | struct f_audio *audio = func_to_audio(f); | 934 | struct f_audio *audio = func_to_audio(f); |
| 936 | struct f_uac1_opts *opts; | 935 | struct f_uac1_opts *opts; |
| 937 | 936 | ||
| 937 | gaudio_cleanup(&audio->card); | ||
| 938 | opts = container_of(f->fi, struct f_uac1_opts, func_inst); | 938 | opts = container_of(f->fi, struct f_uac1_opts, func_inst); |
| 939 | kfree(audio); | 939 | kfree(audio); |
| 940 | mutex_lock(&opts->lock); | 940 | mutex_lock(&opts->lock); |
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index c744e4975d74..db49ec4c748e 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c | |||
| @@ -441,6 +441,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
| 441 | kbuf = memdup_user(buf, len); | 441 | kbuf = memdup_user(buf, len); |
| 442 | if (IS_ERR(kbuf)) { | 442 | if (IS_ERR(kbuf)) { |
| 443 | value = PTR_ERR(kbuf); | 443 | value = PTR_ERR(kbuf); |
| 444 | kbuf = NULL; | ||
| 444 | goto free1; | 445 | goto free1; |
| 445 | } | 446 | } |
| 446 | 447 | ||
| @@ -449,6 +450,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
| 449 | data->name, len, (int) value); | 450 | data->name, len, (int) value); |
| 450 | free1: | 451 | free1: |
| 451 | mutex_unlock(&data->lock); | 452 | mutex_unlock(&data->lock); |
| 453 | kfree (kbuf); | ||
| 452 | return value; | 454 | return value; |
| 453 | } | 455 | } |
| 454 | 456 | ||
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index ce882371786b..9f93bed42052 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c | |||
| @@ -716,10 +716,10 @@ static int queue_dma(struct usba_udc *udc, struct usba_ep *ep, | |||
| 716 | req->using_dma = 1; | 716 | req->using_dma = 1; |
| 717 | req->ctrl = USBA_BF(DMA_BUF_LEN, req->req.length) | 717 | req->ctrl = USBA_BF(DMA_BUF_LEN, req->req.length) |
| 718 | | USBA_DMA_CH_EN | USBA_DMA_END_BUF_IE | 718 | | USBA_DMA_CH_EN | USBA_DMA_END_BUF_IE |
| 719 | | USBA_DMA_END_TR_EN | USBA_DMA_END_TR_IE; | 719 | | USBA_DMA_END_BUF_EN; |
| 720 | 720 | ||
| 721 | if (ep->is_in) | 721 | if (!ep->is_in) |
| 722 | req->ctrl |= USBA_DMA_END_BUF_EN; | 722 | req->ctrl |= USBA_DMA_END_TR_EN | USBA_DMA_END_TR_IE; |
| 723 | 723 | ||
| 724 | /* | 724 | /* |
| 725 | * Add this request to the queue and submit for DMA if | 725 | * Add this request to the queue and submit for DMA if |
| @@ -828,7 +828,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |||
| 828 | { | 828 | { |
| 829 | struct usba_ep *ep = to_usba_ep(_ep); | 829 | struct usba_ep *ep = to_usba_ep(_ep); |
| 830 | struct usba_udc *udc = ep->udc; | 830 | struct usba_udc *udc = ep->udc; |
| 831 | struct usba_request *req = to_usba_req(_req); | 831 | struct usba_request *req; |
| 832 | unsigned long flags; | 832 | unsigned long flags; |
| 833 | u32 status; | 833 | u32 status; |
| 834 | 834 | ||
| @@ -837,6 +837,16 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |||
| 837 | 837 | ||
| 838 | spin_lock_irqsave(&udc->lock, flags); | 838 | spin_lock_irqsave(&udc->lock, flags); |
| 839 | 839 | ||
| 840 | list_for_each_entry(req, &ep->queue, queue) { | ||
| 841 | if (&req->req == _req) | ||
| 842 | break; | ||
| 843 | } | ||
| 844 | |||
| 845 | if (&req->req != _req) { | ||
| 846 | spin_unlock_irqrestore(&udc->lock, flags); | ||
| 847 | return -EINVAL; | ||
| 848 | } | ||
| 849 | |||
| 840 | if (req->using_dma) { | 850 | if (req->using_dma) { |
| 841 | /* | 851 | /* |
| 842 | * If this request is currently being transferred, | 852 | * If this request is currently being transferred, |
| @@ -1563,7 +1573,6 @@ static void usba_ep_irq(struct usba_udc *udc, struct usba_ep *ep) | |||
| 1563 | if ((epstatus & epctrl) & USBA_RX_BK_RDY) { | 1573 | if ((epstatus & epctrl) & USBA_RX_BK_RDY) { |
| 1564 | DBG(DBG_BUS, "%s: RX data ready\n", ep->ep.name); | 1574 | DBG(DBG_BUS, "%s: RX data ready\n", ep->ep.name); |
| 1565 | receive_data(ep); | 1575 | receive_data(ep); |
| 1566 | usba_ep_writel(ep, CLR_STA, USBA_RX_BK_RDY); | ||
| 1567 | } | 1576 | } |
| 1568 | } | 1577 | } |
| 1569 | 1578 | ||
diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c index ff67ceac77c4..d4fe8d769bd6 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.c +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c | |||
| @@ -718,10 +718,11 @@ static int ep_queue(struct bdc_ep *ep, struct bdc_req *req) | |||
| 718 | struct bdc *bdc; | 718 | struct bdc *bdc; |
| 719 | int ret = 0; | 719 | int ret = 0; |
| 720 | 720 | ||
| 721 | bdc = ep->bdc; | ||
| 722 | if (!req || !ep || !ep->usb_ep.desc) | 721 | if (!req || !ep || !ep->usb_ep.desc) |
| 723 | return -EINVAL; | 722 | return -EINVAL; |
| 724 | 723 | ||
| 724 | bdc = ep->bdc; | ||
| 725 | |||
| 725 | req->usb_req.actual = 0; | 726 | req->usb_req.actual = 0; |
| 726 | req->usb_req.status = -EINPROGRESS; | 727 | req->usb_req.status = -EINPROGRESS; |
| 727 | req->epnum = ep->ep_num; | 728 | req->epnum = ep->ep_num; |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index e113fd73aeae..f9a332775c47 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
| @@ -1581,6 +1581,10 @@ iso_stream_schedule ( | |||
| 1581 | else | 1581 | else |
| 1582 | next = (now + 2 + 7) & ~0x07; /* full frame cache */ | 1582 | next = (now + 2 + 7) & ~0x07; /* full frame cache */ |
| 1583 | 1583 | ||
| 1584 | /* If needed, initialize last_iso_frame so that this URB will be seen */ | ||
| 1585 | if (ehci->isoc_count == 0) | ||
| 1586 | ehci->last_iso_frame = now >> 3; | ||
| 1587 | |||
| 1584 | /* | 1588 | /* |
| 1585 | * Use ehci->last_iso_frame as the base. There can't be any | 1589 | * Use ehci->last_iso_frame as the base. There can't be any |
| 1586 | * TDs scheduled for earlier than that. | 1590 | * TDs scheduled for earlier than that. |
| @@ -1600,11 +1604,11 @@ iso_stream_schedule ( | |||
| 1600 | */ | 1604 | */ |
| 1601 | now2 = (now - base) & (mod - 1); | 1605 | now2 = (now - base) & (mod - 1); |
| 1602 | 1606 | ||
| 1603 | /* Is the schedule already full? */ | 1607 | /* Is the schedule about to wrap around? */ |
| 1604 | if (unlikely(!empty && start < period)) { | 1608 | if (unlikely(!empty && start < period)) { |
| 1605 | ehci_dbg(ehci, "iso sched full %p (%u-%u < %u mod %u)\n", | 1609 | ehci_dbg(ehci, "request %p would overflow (%u-%u < %u mod %u)\n", |
| 1606 | urb, stream->next_uframe, base, period, mod); | 1610 | urb, stream->next_uframe, base, period, mod); |
| 1607 | status = -ENOSPC; | 1611 | status = -EFBIG; |
| 1608 | goto fail; | 1612 | goto fail; |
| 1609 | } | 1613 | } |
| 1610 | 1614 | ||
| @@ -1671,10 +1675,6 @@ iso_stream_schedule ( | |||
| 1671 | urb->start_frame = start & (mod - 1); | 1675 | urb->start_frame = start & (mod - 1); |
| 1672 | if (!stream->highspeed) | 1676 | if (!stream->highspeed) |
| 1673 | urb->start_frame >>= 3; | 1677 | urb->start_frame >>= 3; |
| 1674 | |||
| 1675 | /* Make sure scan_isoc() sees these */ | ||
| 1676 | if (ehci->isoc_count == 0) | ||
| 1677 | ehci->last_iso_frame = now >> 3; | ||
| 1678 | return status; | 1678 | return status; |
| 1679 | 1679 | ||
| 1680 | fail: | 1680 | fail: |
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 19a9af1b4d74..ff9af29b4e9f 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
| @@ -451,7 +451,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
| 451 | 451 | ||
| 452 | u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0); | 452 | u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0); |
| 453 | if (IS_ERR(u_phy)) { | 453 | if (IS_ERR(u_phy)) { |
| 454 | err = PTR_ERR(u_phy); | 454 | err = -EPROBE_DEFER; |
| 455 | goto cleanup_clk_en; | 455 | goto cleanup_clk_en; |
| 456 | } | 456 | } |
| 457 | hcd->usb_phy = u_phy; | 457 | hcd->usb_phy = u_phy; |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index dd483c13565b..ce636466edb7 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
| @@ -567,7 +567,8 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev) | |||
| 567 | { | 567 | { |
| 568 | void __iomem *base; | 568 | void __iomem *base; |
| 569 | u32 control; | 569 | u32 control; |
| 570 | u32 fminterval; | 570 | u32 fminterval = 0; |
| 571 | bool no_fminterval = false; | ||
| 571 | int cnt; | 572 | int cnt; |
| 572 | 573 | ||
| 573 | if (!mmio_resource_enabled(pdev, 0)) | 574 | if (!mmio_resource_enabled(pdev, 0)) |
| @@ -577,6 +578,13 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev) | |||
| 577 | if (base == NULL) | 578 | if (base == NULL) |
| 578 | return; | 579 | return; |
| 579 | 580 | ||
| 581 | /* | ||
| 582 | * ULi M5237 OHCI controller locks the whole system when accessing | ||
| 583 | * the OHCI_FMINTERVAL offset. | ||
| 584 | */ | ||
| 585 | if (pdev->vendor == PCI_VENDOR_ID_AL && pdev->device == 0x5237) | ||
| 586 | no_fminterval = true; | ||
| 587 | |||
| 580 | control = readl(base + OHCI_CONTROL); | 588 | control = readl(base + OHCI_CONTROL); |
| 581 | 589 | ||
| 582 | /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ | 590 | /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ |
| @@ -615,7 +623,9 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev) | |||
| 615 | } | 623 | } |
| 616 | 624 | ||
| 617 | /* software reset of the controller, preserving HcFmInterval */ | 625 | /* software reset of the controller, preserving HcFmInterval */ |
| 618 | fminterval = readl(base + OHCI_FMINTERVAL); | 626 | if (!no_fminterval) |
| 627 | fminterval = readl(base + OHCI_FMINTERVAL); | ||
| 628 | |||
| 619 | writel(OHCI_HCR, base + OHCI_CMDSTATUS); | 629 | writel(OHCI_HCR, base + OHCI_CMDSTATUS); |
| 620 | 630 | ||
| 621 | /* reset requires max 10 us delay */ | 631 | /* reset requires max 10 us delay */ |
| @@ -624,7 +634,9 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev) | |||
| 624 | break; | 634 | break; |
| 625 | udelay(1); | 635 | udelay(1); |
| 626 | } | 636 | } |
| 627 | writel(fminterval, base + OHCI_FMINTERVAL); | 637 | |
| 638 | if (!no_fminterval) | ||
| 639 | writel(fminterval, base + OHCI_FMINTERVAL); | ||
| 628 | 640 | ||
| 629 | /* Now the controller is safely in SUSPEND and nothing can wake it up */ | 641 | /* Now the controller is safely in SUSPEND and nothing can wake it up */ |
| 630 | iounmap(base); | 642 | iounmap(base); |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 142b601f9563..7f76c8a12f89 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
| @@ -82,6 +82,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
| 82 | "must be suspended extra slowly", | 82 | "must be suspended extra slowly", |
| 83 | pdev->revision); | 83 | pdev->revision); |
| 84 | } | 84 | } |
| 85 | if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) | ||
| 86 | xhci->quirks |= XHCI_BROKEN_STREAMS; | ||
| 85 | /* Fresco Logic confirms: all revisions of this chip do not | 87 | /* Fresco Logic confirms: all revisions of this chip do not |
| 86 | * support MSI, even though some of them claim to in their PCI | 88 | * support MSI, even though some of them claim to in their PCI |
| 87 | * capabilities. | 89 | * capabilities. |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 01fcbb5eb06e..c50d8d202618 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -3803,6 +3803,15 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, | |||
| 3803 | return -EINVAL; | 3803 | return -EINVAL; |
| 3804 | } | 3804 | } |
| 3805 | 3805 | ||
| 3806 | if (setup == SETUP_CONTEXT_ONLY) { | ||
| 3807 | slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); | ||
| 3808 | if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) == | ||
| 3809 | SLOT_STATE_DEFAULT) { | ||
| 3810 | xhci_dbg(xhci, "Slot already in default state\n"); | ||
| 3811 | return 0; | ||
| 3812 | } | ||
| 3813 | } | ||
| 3814 | |||
| 3806 | command = xhci_alloc_command(xhci, false, false, GFP_KERNEL); | 3815 | command = xhci_alloc_command(xhci, false, false, GFP_KERNEL); |
| 3807 | if (!command) | 3816 | if (!command) |
| 3808 | return -ENOMEM; | 3817 | return -ENOMEM; |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index 9d68372dd9aa..b005010240e5 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
| @@ -72,6 +72,8 @@ config USB_MUSB_DA8XX | |||
| 72 | 72 | ||
| 73 | config USB_MUSB_TUSB6010 | 73 | config USB_MUSB_TUSB6010 |
| 74 | tristate "TUSB6010" | 74 | tristate "TUSB6010" |
| 75 | depends on ARCH_OMAP2PLUS || COMPILE_TEST | ||
| 76 | depends on NOP_USB_XCEIV = USB_MUSB_HDRC # both built-in or both modules | ||
| 75 | 77 | ||
| 76 | config USB_MUSB_OMAP2PLUS | 78 | config USB_MUSB_OMAP2PLUS |
| 77 | tristate "OMAP2430 and onwards" | 79 | tristate "OMAP2430 and onwards" |
| @@ -85,6 +87,7 @@ config USB_MUSB_AM35X | |||
| 85 | config USB_MUSB_DSPS | 87 | config USB_MUSB_DSPS |
| 86 | tristate "TI DSPS platforms" | 88 | tristate "TI DSPS platforms" |
| 87 | select USB_MUSB_AM335X_CHILD | 89 | select USB_MUSB_AM335X_CHILD |
| 90 | depends on ARCH_OMAP2PLUS || COMPILE_TEST | ||
| 88 | depends on OF_IRQ | 91 | depends on OF_IRQ |
| 89 | 92 | ||
| 90 | config USB_MUSB_BLACKFIN | 93 | config USB_MUSB_BLACKFIN |
| @@ -93,6 +96,7 @@ config USB_MUSB_BLACKFIN | |||
| 93 | 96 | ||
| 94 | config USB_MUSB_UX500 | 97 | config USB_MUSB_UX500 |
| 95 | tristate "Ux500 platforms" | 98 | tristate "Ux500 platforms" |
| 99 | depends on ARCH_U8500 || COMPILE_TEST | ||
| 96 | 100 | ||
| 97 | config USB_MUSB_JZ4740 | 101 | config USB_MUSB_JZ4740 |
| 98 | tristate "JZ4740" | 102 | tristate "JZ4740" |
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index a441a2de8619..178250145613 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
| @@ -63,7 +63,7 @@ static void bfin_writew(void __iomem *addr, unsigned offset, u16 data) | |||
| 63 | bfin_write16(addr + offset, data); | 63 | bfin_write16(addr + offset, data); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | static void binf_writel(void __iomem *addr, unsigned offset, u32 data) | 66 | static void bfin_writel(void __iomem *addr, unsigned offset, u32 data) |
| 67 | { | 67 | { |
| 68 | bfin_write16(addr + offset, (u16)data); | 68 | bfin_write16(addr + offset, (u16)data); |
| 69 | } | 69 | } |
diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index f64fd964dc6d..c39a16ad7832 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c | |||
| @@ -628,9 +628,9 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) | |||
| 628 | ret = of_property_read_string_index(np, "dma-names", i, &str); | 628 | ret = of_property_read_string_index(np, "dma-names", i, &str); |
| 629 | if (ret) | 629 | if (ret) |
| 630 | goto err; | 630 | goto err; |
| 631 | if (!strncmp(str, "tx", 2)) | 631 | if (strstarts(str, "tx")) |
| 632 | is_tx = 1; | 632 | is_tx = 1; |
| 633 | else if (!strncmp(str, "rx", 2)) | 633 | else if (strstarts(str, "rx")) |
| 634 | is_tx = 0; | 634 | is_tx = 0; |
| 635 | else { | 635 | else { |
| 636 | dev_err(dev, "Wrong dmatype %s\n", str); | 636 | dev_err(dev, "Wrong dmatype %s\n", str); |
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c index ad3701a97389..48131aa8472c 100644 --- a/drivers/usb/musb/musb_debugfs.c +++ b/drivers/usb/musb/musb_debugfs.c | |||
| @@ -59,20 +59,12 @@ static const struct musb_register_map musb_regmap[] = { | |||
| 59 | { "RxMaxPp", MUSB_RXMAXP, 16 }, | 59 | { "RxMaxPp", MUSB_RXMAXP, 16 }, |
| 60 | { "RxCSR", MUSB_RXCSR, 16 }, | 60 | { "RxCSR", MUSB_RXCSR, 16 }, |
| 61 | { "RxCount", MUSB_RXCOUNT, 16 }, | 61 | { "RxCount", MUSB_RXCOUNT, 16 }, |
| 62 | { "ConfigData", MUSB_CONFIGDATA,8 }, | ||
| 63 | { "IntrRxE", MUSB_INTRRXE, 16 }, | 62 | { "IntrRxE", MUSB_INTRRXE, 16 }, |
| 64 | { "IntrTxE", MUSB_INTRTXE, 16 }, | 63 | { "IntrTxE", MUSB_INTRTXE, 16 }, |
| 65 | { "IntrUsbE", MUSB_INTRUSBE, 8 }, | 64 | { "IntrUsbE", MUSB_INTRUSBE, 8 }, |
| 66 | { "DevCtl", MUSB_DEVCTL, 8 }, | 65 | { "DevCtl", MUSB_DEVCTL, 8 }, |
| 67 | { "BabbleCtl", MUSB_BABBLE_CTL,8 }, | ||
| 68 | { "TxFIFOsz", MUSB_TXFIFOSZ, 8 }, | ||
| 69 | { "RxFIFOsz", MUSB_RXFIFOSZ, 8 }, | ||
| 70 | { "TxFIFOadd", MUSB_TXFIFOADD, 16 }, | ||
| 71 | { "RxFIFOadd", MUSB_RXFIFOADD, 16 }, | ||
| 72 | { "VControl", 0x68, 32 }, | 66 | { "VControl", 0x68, 32 }, |
| 73 | { "HWVers", 0x69, 16 }, | 67 | { "HWVers", 0x69, 16 }, |
| 74 | { "EPInfo", MUSB_EPINFO, 8 }, | ||
| 75 | { "RAMInfo", MUSB_RAMINFO, 8 }, | ||
| 76 | { "LinkInfo", MUSB_LINKINFO, 8 }, | 68 | { "LinkInfo", MUSB_LINKINFO, 8 }, |
| 77 | { "VPLen", MUSB_VPLEN, 8 }, | 69 | { "VPLen", MUSB_VPLEN, 8 }, |
| 78 | { "HS_EOF1", MUSB_HS_EOF1, 8 }, | 70 | { "HS_EOF1", MUSB_HS_EOF1, 8 }, |
| @@ -103,6 +95,16 @@ static const struct musb_register_map musb_regmap[] = { | |||
| 103 | { "DMA_CNTLch7", 0x274, 16 }, | 95 | { "DMA_CNTLch7", 0x274, 16 }, |
| 104 | { "DMA_ADDRch7", 0x278, 32 }, | 96 | { "DMA_ADDRch7", 0x278, 32 }, |
| 105 | { "DMA_COUNTch7", 0x27C, 32 }, | 97 | { "DMA_COUNTch7", 0x27C, 32 }, |
| 98 | #ifndef CONFIG_BLACKFIN | ||
| 99 | { "ConfigData", MUSB_CONFIGDATA,8 }, | ||
| 100 | { "BabbleCtl", MUSB_BABBLE_CTL,8 }, | ||
| 101 | { "TxFIFOsz", MUSB_TXFIFOSZ, 8 }, | ||
| 102 | { "RxFIFOsz", MUSB_RXFIFOSZ, 8 }, | ||
| 103 | { "TxFIFOadd", MUSB_TXFIFOADD, 16 }, | ||
| 104 | { "RxFIFOadd", MUSB_RXFIFOADD, 16 }, | ||
| 105 | { "EPInfo", MUSB_EPINFO, 8 }, | ||
| 106 | { "RAMInfo", MUSB_RAMINFO, 8 }, | ||
| 107 | #endif | ||
| 106 | { } /* Terminating Entry */ | 108 | { } /* Terminating Entry */ |
| 107 | }; | 109 | }; |
| 108 | 110 | ||
| @@ -197,30 +199,30 @@ static ssize_t musb_test_mode_write(struct file *file, | |||
| 197 | if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) | 199 | if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) |
| 198 | return -EFAULT; | 200 | return -EFAULT; |
| 199 | 201 | ||
| 200 | if (!strncmp(buf, "force host", 9)) | 202 | if (strstarts(buf, "force host")) |
| 201 | test = MUSB_TEST_FORCE_HOST; | 203 | test = MUSB_TEST_FORCE_HOST; |
| 202 | 204 | ||
| 203 | if (!strncmp(buf, "fifo access", 11)) | 205 | if (strstarts(buf, "fifo access")) |
| 204 | test = MUSB_TEST_FIFO_ACCESS; | 206 | test = MUSB_TEST_FIFO_ACCESS; |
| 205 | 207 | ||
| 206 | if (!strncmp(buf, "force full-speed", 15)) | 208 | if (strstarts(buf, "force full-speed")) |
| 207 | test = MUSB_TEST_FORCE_FS; | 209 | test = MUSB_TEST_FORCE_FS; |
| 208 | 210 | ||
| 209 | if (!strncmp(buf, "force high-speed", 15)) | 211 | if (strstarts(buf, "force high-speed")) |
| 210 | test = MUSB_TEST_FORCE_HS; | 212 | test = MUSB_TEST_FORCE_HS; |
| 211 | 213 | ||
| 212 | if (!strncmp(buf, "test packet", 10)) { | 214 | if (strstarts(buf, "test packet")) { |
| 213 | test = MUSB_TEST_PACKET; | 215 | test = MUSB_TEST_PACKET; |
| 214 | musb_load_testpacket(musb); | 216 | musb_load_testpacket(musb); |
| 215 | } | 217 | } |
| 216 | 218 | ||
| 217 | if (!strncmp(buf, "test K", 6)) | 219 | if (strstarts(buf, "test K")) |
| 218 | test = MUSB_TEST_K; | 220 | test = MUSB_TEST_K; |
| 219 | 221 | ||
| 220 | if (!strncmp(buf, "test J", 6)) | 222 | if (strstarts(buf, "test J")) |
| 221 | test = MUSB_TEST_J; | 223 | test = MUSB_TEST_J; |
| 222 | 224 | ||
| 223 | if (!strncmp(buf, "test SE0 NAK", 12)) | 225 | if (strstarts(buf, "test SE0 NAK")) |
| 224 | test = MUSB_TEST_SE0_NAK; | 226 | test = MUSB_TEST_SE0_NAK; |
| 225 | 227 | ||
| 226 | musb_writeb(musb->mregs, MUSB_TESTMODE, test); | 228 | musb_writeb(musb->mregs, MUSB_TESTMODE, test); |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 23d474d3d7f4..883a9adfdfff 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -2663,7 +2663,6 @@ void musb_host_cleanup(struct musb *musb) | |||
| 2663 | if (musb->port_mode == MUSB_PORT_MODE_GADGET) | 2663 | if (musb->port_mode == MUSB_PORT_MODE_GADGET) |
| 2664 | return; | 2664 | return; |
| 2665 | usb_remove_hcd(musb->hcd); | 2665 | usb_remove_hcd(musb->hcd); |
| 2666 | musb->hcd = NULL; | ||
| 2667 | } | 2666 | } |
| 2668 | 2667 | ||
| 2669 | void musb_host_free(struct musb *musb) | 2668 | void musb_host_free(struct musb *musb) |
diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c index 699e38c73d82..697a741a0cb1 100644 --- a/drivers/usb/phy/phy-mv-usb.c +++ b/drivers/usb/phy/phy-mv-usb.c | |||
| @@ -338,7 +338,6 @@ static void mv_otg_update_inputs(struct mv_otg *mvotg) | |||
| 338 | static void mv_otg_update_state(struct mv_otg *mvotg) | 338 | static void mv_otg_update_state(struct mv_otg *mvotg) |
| 339 | { | 339 | { |
| 340 | struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; | 340 | struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; |
| 341 | struct usb_phy *phy = &mvotg->phy; | ||
| 342 | int old_state = mvotg->phy.otg->state; | 341 | int old_state = mvotg->phy.otg->state; |
| 343 | 342 | ||
| 344 | switch (old_state) { | 343 | switch (old_state) { |
| @@ -858,10 +857,10 @@ static int mv_otg_suspend(struct platform_device *pdev, pm_message_t state) | |||
| 858 | { | 857 | { |
| 859 | struct mv_otg *mvotg = platform_get_drvdata(pdev); | 858 | struct mv_otg *mvotg = platform_get_drvdata(pdev); |
| 860 | 859 | ||
| 861 | if (mvotg->phy.state != OTG_STATE_B_IDLE) { | 860 | if (mvotg->phy.otg->state != OTG_STATE_B_IDLE) { |
| 862 | dev_info(&pdev->dev, | 861 | dev_info(&pdev->dev, |
| 863 | "OTG state is not B_IDLE, it is %d!\n", | 862 | "OTG state is not B_IDLE, it is %d!\n", |
| 864 | mvotg->phy.state); | 863 | mvotg->phy.otg->state); |
| 865 | return -EAGAIN; | 864 | return -EAGAIN; |
| 866 | } | 865 | } |
| 867 | 866 | ||
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index b4066a001ba0..ccfdfb24b240 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c | |||
| @@ -34,7 +34,7 @@ static struct usb_phy *__usb_find_phy(struct list_head *list, | |||
| 34 | return phy; | 34 | return phy; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | return ERR_PTR(-ENODEV); | 37 | return ERR_PTR(-EPROBE_DEFER); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | static struct usb_phy *__usb_find_phy_dev(struct device *dev, | 40 | static struct usb_phy *__usb_find_phy_dev(struct device *dev, |
| @@ -59,6 +59,9 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node) | |||
| 59 | { | 59 | { |
| 60 | struct usb_phy *phy; | 60 | struct usb_phy *phy; |
| 61 | 61 | ||
| 62 | if (!of_device_is_available(node)) | ||
| 63 | return ERR_PTR(-ENODEV); | ||
| 64 | |||
| 62 | list_for_each_entry(phy, &phy_list, head) { | 65 | list_for_each_entry(phy, &phy_list, head) { |
| 63 | if (node != phy->dev->of_node) | 66 | if (node != phy->dev->of_node) |
| 64 | continue; | 67 | continue; |
| @@ -66,7 +69,7 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node) | |||
| 66 | return phy; | 69 | return phy; |
| 67 | } | 70 | } |
| 68 | 71 | ||
| 69 | return ERR_PTR(-ENODEV); | 72 | return ERR_PTR(-EPROBE_DEFER); |
| 70 | } | 73 | } |
| 71 | 74 | ||
| 72 | static void devm_usb_phy_release(struct device *dev, void *res) | 75 | static void devm_usb_phy_release(struct device *dev, void *res) |
| @@ -190,10 +193,13 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, | |||
| 190 | spin_lock_irqsave(&phy_lock, flags); | 193 | spin_lock_irqsave(&phy_lock, flags); |
| 191 | 194 | ||
| 192 | phy = __of_usb_find_phy(node); | 195 | phy = __of_usb_find_phy(node); |
| 193 | if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { | 196 | if (IS_ERR(phy)) { |
| 194 | if (!IS_ERR(phy)) | 197 | devres_free(ptr); |
| 195 | phy = ERR_PTR(-EPROBE_DEFER); | 198 | goto err1; |
| 199 | } | ||
| 196 | 200 | ||
| 201 | if (!try_module_get(phy->dev->driver->owner)) { | ||
| 202 | phy = ERR_PTR(-ENODEV); | ||
| 197 | devres_free(ptr); | 203 | devres_free(ptr); |
| 198 | goto err1; | 204 | goto err1; |
| 199 | } | 205 | } |
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 8d7fc48b1f30..29fa1c3d0089 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
| @@ -46,6 +46,8 @@ static struct console usbcons; | |||
| 46 | * ------------------------------------------------------------ | 46 | * ------------------------------------------------------------ |
| 47 | */ | 47 | */ |
| 48 | 48 | ||
| 49 | static const struct tty_operations usb_console_fake_tty_ops = { | ||
| 50 | }; | ||
| 49 | 51 | ||
| 50 | /* | 52 | /* |
| 51 | * The parsing of the command line works exactly like the | 53 | * The parsing of the command line works exactly like the |
| @@ -137,13 +139,17 @@ static int usb_console_setup(struct console *co, char *options) | |||
| 137 | goto reset_open_count; | 139 | goto reset_open_count; |
| 138 | } | 140 | } |
| 139 | kref_init(&tty->kref); | 141 | kref_init(&tty->kref); |
| 140 | tty_port_tty_set(&port->port, tty); | ||
| 141 | tty->driver = usb_serial_tty_driver; | 142 | tty->driver = usb_serial_tty_driver; |
| 142 | tty->index = co->index; | 143 | tty->index = co->index; |
| 144 | init_ldsem(&tty->ldisc_sem); | ||
| 145 | INIT_LIST_HEAD(&tty->tty_files); | ||
| 146 | kref_get(&tty->driver->kref); | ||
| 147 | tty->ops = &usb_console_fake_tty_ops; | ||
| 143 | if (tty_init_termios(tty)) { | 148 | if (tty_init_termios(tty)) { |
| 144 | retval = -ENOMEM; | 149 | retval = -ENOMEM; |
| 145 | goto free_tty; | 150 | goto put_tty; |
| 146 | } | 151 | } |
| 152 | tty_port_tty_set(&port->port, tty); | ||
| 147 | } | 153 | } |
| 148 | 154 | ||
| 149 | /* only call the device specific open if this | 155 | /* only call the device specific open if this |
| @@ -161,7 +167,7 @@ static int usb_console_setup(struct console *co, char *options) | |||
| 161 | serial->type->set_termios(tty, port, &dummy); | 167 | serial->type->set_termios(tty, port, &dummy); |
| 162 | 168 | ||
| 163 | tty_port_tty_set(&port->port, NULL); | 169 | tty_port_tty_set(&port->port, NULL); |
| 164 | kfree(tty); | 170 | tty_kref_put(tty); |
| 165 | } | 171 | } |
| 166 | set_bit(ASYNCB_INITIALIZED, &port->port.flags); | 172 | set_bit(ASYNCB_INITIALIZED, &port->port.flags); |
| 167 | } | 173 | } |
| @@ -177,8 +183,8 @@ static int usb_console_setup(struct console *co, char *options) | |||
| 177 | 183 | ||
| 178 | fail: | 184 | fail: |
| 179 | tty_port_tty_set(&port->port, NULL); | 185 | tty_port_tty_set(&port->port, NULL); |
| 180 | free_tty: | 186 | put_tty: |
| 181 | kfree(tty); | 187 | tty_kref_put(tty); |
| 182 | reset_open_count: | 188 | reset_open_count: |
| 183 | port->port.count = 0; | 189 | port->port.count = 0; |
| 184 | usb_autopm_put_interface(serial->interface); | 190 | usb_autopm_put_interface(serial->interface); |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 6c4eb3cf5efd..f4c56fc1a9f6 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
| @@ -120,10 +120,12 @@ static const struct usb_device_id id_table[] = { | |||
| 120 | { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ | 120 | { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ |
| 121 | { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ | 121 | { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ |
| 122 | { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ | 122 | { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ |
| 123 | { USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */ | 123 | { USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */ |
| 124 | { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ | ||
| 124 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ | 125 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ |
| 125 | { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ | 126 | { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ |
| 126 | { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ | 127 | { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ |
| 128 | { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ | ||
| 127 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ | 129 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
| 128 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ | 130 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ |
| 129 | { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ | 131 | { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 1bd192290b08..ccf1df7c4b80 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
| @@ -286,7 +286,7 @@ static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, | |||
| 286 | 286 | ||
| 287 | res = usb_submit_urb(port->read_urbs[index], mem_flags); | 287 | res = usb_submit_urb(port->read_urbs[index], mem_flags); |
| 288 | if (res) { | 288 | if (res) { |
| 289 | if (res != -EPERM) { | 289 | if (res != -EPERM && res != -ENODEV) { |
| 290 | dev_err(&port->dev, | 290 | dev_err(&port->dev, |
| 291 | "%s - usb_submit_urb failed: %d\n", | 291 | "%s - usb_submit_urb failed: %d\n", |
| 292 | __func__, res); | 292 | __func__, res); |
| @@ -373,7 +373,7 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb) | |||
| 373 | __func__, urb->status); | 373 | __func__, urb->status); |
| 374 | return; | 374 | return; |
| 375 | default: | 375 | default: |
| 376 | dev_err(&port->dev, "%s - nonzero urb status: %d\n", | 376 | dev_dbg(&port->dev, "%s - nonzero urb status: %d\n", |
| 377 | __func__, urb->status); | 377 | __func__, urb->status); |
| 378 | goto resubmit; | 378 | goto resubmit; |
| 379 | } | 379 | } |
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 077c714f1285..e07b15ed5814 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
| @@ -410,6 +410,8 @@ static void usa26_instat_callback(struct urb *urb) | |||
| 410 | } | 410 | } |
| 411 | port = serial->port[msg->port]; | 411 | port = serial->port[msg->port]; |
| 412 | p_priv = usb_get_serial_port_data(port); | 412 | p_priv = usb_get_serial_port_data(port); |
| 413 | if (!p_priv) | ||
| 414 | goto resubmit; | ||
| 413 | 415 | ||
| 414 | /* Update handshaking pin state information */ | 416 | /* Update handshaking pin state information */ |
| 415 | old_dcd_state = p_priv->dcd_state; | 417 | old_dcd_state = p_priv->dcd_state; |
| @@ -420,7 +422,7 @@ static void usa26_instat_callback(struct urb *urb) | |||
| 420 | 422 | ||
| 421 | if (old_dcd_state != p_priv->dcd_state) | 423 | if (old_dcd_state != p_priv->dcd_state) |
| 422 | tty_port_tty_hangup(&port->port, true); | 424 | tty_port_tty_hangup(&port->port, true); |
| 423 | 425 | resubmit: | |
| 424 | /* Resubmit urb so we continue receiving */ | 426 | /* Resubmit urb so we continue receiving */ |
| 425 | err = usb_submit_urb(urb, GFP_ATOMIC); | 427 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 426 | if (err != 0) | 428 | if (err != 0) |
| @@ -527,6 +529,8 @@ static void usa28_instat_callback(struct urb *urb) | |||
| 527 | } | 529 | } |
| 528 | port = serial->port[msg->port]; | 530 | port = serial->port[msg->port]; |
| 529 | p_priv = usb_get_serial_port_data(port); | 531 | p_priv = usb_get_serial_port_data(port); |
| 532 | if (!p_priv) | ||
| 533 | goto resubmit; | ||
| 530 | 534 | ||
| 531 | /* Update handshaking pin state information */ | 535 | /* Update handshaking pin state information */ |
| 532 | old_dcd_state = p_priv->dcd_state; | 536 | old_dcd_state = p_priv->dcd_state; |
| @@ -537,7 +541,7 @@ static void usa28_instat_callback(struct urb *urb) | |||
| 537 | 541 | ||
| 538 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) | 542 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) |
| 539 | tty_port_tty_hangup(&port->port, true); | 543 | tty_port_tty_hangup(&port->port, true); |
| 540 | 544 | resubmit: | |
| 541 | /* Resubmit urb so we continue receiving */ | 545 | /* Resubmit urb so we continue receiving */ |
| 542 | err = usb_submit_urb(urb, GFP_ATOMIC); | 546 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 543 | if (err != 0) | 547 | if (err != 0) |
| @@ -607,6 +611,8 @@ static void usa49_instat_callback(struct urb *urb) | |||
| 607 | } | 611 | } |
| 608 | port = serial->port[msg->portNumber]; | 612 | port = serial->port[msg->portNumber]; |
| 609 | p_priv = usb_get_serial_port_data(port); | 613 | p_priv = usb_get_serial_port_data(port); |
| 614 | if (!p_priv) | ||
| 615 | goto resubmit; | ||
| 610 | 616 | ||
| 611 | /* Update handshaking pin state information */ | 617 | /* Update handshaking pin state information */ |
| 612 | old_dcd_state = p_priv->dcd_state; | 618 | old_dcd_state = p_priv->dcd_state; |
| @@ -617,7 +623,7 @@ static void usa49_instat_callback(struct urb *urb) | |||
| 617 | 623 | ||
| 618 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) | 624 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) |
| 619 | tty_port_tty_hangup(&port->port, true); | 625 | tty_port_tty_hangup(&port->port, true); |
| 620 | 626 | resubmit: | |
| 621 | /* Resubmit urb so we continue receiving */ | 627 | /* Resubmit urb so we continue receiving */ |
| 622 | err = usb_submit_urb(urb, GFP_ATOMIC); | 628 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 623 | if (err != 0) | 629 | if (err != 0) |
| @@ -855,6 +861,8 @@ static void usa90_instat_callback(struct urb *urb) | |||
| 855 | 861 | ||
| 856 | port = serial->port[0]; | 862 | port = serial->port[0]; |
| 857 | p_priv = usb_get_serial_port_data(port); | 863 | p_priv = usb_get_serial_port_data(port); |
| 864 | if (!p_priv) | ||
| 865 | goto resubmit; | ||
| 858 | 866 | ||
| 859 | /* Update handshaking pin state information */ | 867 | /* Update handshaking pin state information */ |
| 860 | old_dcd_state = p_priv->dcd_state; | 868 | old_dcd_state = p_priv->dcd_state; |
| @@ -865,7 +873,7 @@ static void usa90_instat_callback(struct urb *urb) | |||
| 865 | 873 | ||
| 866 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) | 874 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) |
| 867 | tty_port_tty_hangup(&port->port, true); | 875 | tty_port_tty_hangup(&port->port, true); |
| 868 | 876 | resubmit: | |
| 869 | /* Resubmit urb so we continue receiving */ | 877 | /* Resubmit urb so we continue receiving */ |
| 870 | err = usb_submit_urb(urb, GFP_ATOMIC); | 878 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 871 | if (err != 0) | 879 | if (err != 0) |
| @@ -926,6 +934,8 @@ static void usa67_instat_callback(struct urb *urb) | |||
| 926 | 934 | ||
| 927 | port = serial->port[msg->port]; | 935 | port = serial->port[msg->port]; |
| 928 | p_priv = usb_get_serial_port_data(port); | 936 | p_priv = usb_get_serial_port_data(port); |
| 937 | if (!p_priv) | ||
| 938 | goto resubmit; | ||
| 929 | 939 | ||
| 930 | /* Update handshaking pin state information */ | 940 | /* Update handshaking pin state information */ |
| 931 | old_dcd_state = p_priv->dcd_state; | 941 | old_dcd_state = p_priv->dcd_state; |
| @@ -934,7 +944,7 @@ static void usa67_instat_callback(struct urb *urb) | |||
| 934 | 944 | ||
| 935 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) | 945 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) |
| 936 | tty_port_tty_hangup(&port->port, true); | 946 | tty_port_tty_hangup(&port->port, true); |
| 937 | 947 | resubmit: | |
| 938 | /* Resubmit urb so we continue receiving */ | 948 | /* Resubmit urb so we continue receiving */ |
| 939 | err = usb_submit_urb(urb, GFP_ATOMIC); | 949 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 940 | if (err != 0) | 950 | if (err != 0) |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 7a4c21b4f676..efdcee15b520 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -234,6 +234,8 @@ static void option_instat_callback(struct urb *urb); | |||
| 234 | 234 | ||
| 235 | #define QUALCOMM_VENDOR_ID 0x05C6 | 235 | #define QUALCOMM_VENDOR_ID 0x05C6 |
| 236 | 236 | ||
| 237 | #define SIERRA_VENDOR_ID 0x1199 | ||
| 238 | |||
| 237 | #define CMOTECH_VENDOR_ID 0x16d8 | 239 | #define CMOTECH_VENDOR_ID 0x16d8 |
| 238 | #define CMOTECH_PRODUCT_6001 0x6001 | 240 | #define CMOTECH_PRODUCT_6001 0x6001 |
| 239 | #define CMOTECH_PRODUCT_CMU_300 0x6002 | 241 | #define CMOTECH_PRODUCT_CMU_300 0x6002 |
| @@ -512,7 +514,7 @@ enum option_blacklist_reason { | |||
| 512 | OPTION_BLACKLIST_RESERVED_IF = 2 | 514 | OPTION_BLACKLIST_RESERVED_IF = 2 |
| 513 | }; | 515 | }; |
| 514 | 516 | ||
| 515 | #define MAX_BL_NUM 8 | 517 | #define MAX_BL_NUM 11 |
| 516 | struct option_blacklist_info { | 518 | struct option_blacklist_info { |
| 517 | /* bitfield of interface numbers for OPTION_BLACKLIST_SENDSETUP */ | 519 | /* bitfield of interface numbers for OPTION_BLACKLIST_SENDSETUP */ |
| 518 | const unsigned long sendsetup; | 520 | const unsigned long sendsetup; |
| @@ -601,6 +603,11 @@ static const struct option_blacklist_info telit_le920_blacklist = { | |||
| 601 | .reserved = BIT(1) | BIT(5), | 603 | .reserved = BIT(1) | BIT(5), |
| 602 | }; | 604 | }; |
| 603 | 605 | ||
| 606 | static const struct option_blacklist_info sierra_mc73xx_blacklist = { | ||
| 607 | .sendsetup = BIT(0) | BIT(2), | ||
| 608 | .reserved = BIT(8) | BIT(10) | BIT(11), | ||
| 609 | }; | ||
| 610 | |||
| 604 | static const struct usb_device_id option_ids[] = { | 611 | static const struct usb_device_id option_ids[] = { |
| 605 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, | 612 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
| 606 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, | 613 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, |
| @@ -1098,6 +1105,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1098 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 1105 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
| 1099 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ | 1106 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ |
| 1100 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ | 1107 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ |
| 1108 | { USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x68c0, 0xff), | ||
| 1109 | .driver_info = (kernel_ulong_t)&sierra_mc73xx_blacklist }, /* MC73xx */ | ||
| 1101 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, | 1110 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, |
| 1102 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, | 1111 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, |
| 1103 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), | 1112 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index cb3e14780a7e..9c63897b3a56 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
| @@ -142,7 +142,6 @@ static const struct usb_device_id id_table[] = { | |||
| 142 | {DEVICE_SWI(0x0f3d, 0x68a2)}, /* Sierra Wireless MC7700 */ | 142 | {DEVICE_SWI(0x0f3d, 0x68a2)}, /* Sierra Wireless MC7700 */ |
| 143 | {DEVICE_SWI(0x114f, 0x68a2)}, /* Sierra Wireless MC7750 */ | 143 | {DEVICE_SWI(0x114f, 0x68a2)}, /* Sierra Wireless MC7750 */ |
| 144 | {DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */ | 144 | {DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */ |
| 145 | {DEVICE_SWI(0x1199, 0x68c0)}, /* Sierra Wireless MC73xx */ | ||
| 146 | {DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */ | 145 | {DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */ |
| 147 | {DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */ | 146 | {DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */ |
| 148 | {DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */ | 147 | {DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */ |
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h index 8a6f371ed6e7..9893d696fc97 100644 --- a/drivers/usb/storage/uas-detect.h +++ b/drivers/usb/storage/uas-detect.h | |||
| @@ -69,16 +69,39 @@ static int uas_use_uas_driver(struct usb_interface *intf, | |||
| 69 | return 0; | 69 | return 0; |
| 70 | 70 | ||
| 71 | /* | 71 | /* |
| 72 | * ASM1051 and older ASM1053 devices have the same usb-id, and UAS is | 72 | * ASMedia has a number of usb3 to sata bridge chips, at the time of |
| 73 | * broken on the ASM1051, use the number of streams to differentiate. | 73 | * this writing the following versions exist: |
| 74 | * New ASM1053-s also support 32 streams, but have a different prod-id. | 74 | * ASM1051 - no uas support version |
| 75 | * ASM1051 - with broken (*) uas support | ||
| 76 | * ASM1053 - with working uas support | ||
| 77 | * ASM1153 - with working uas support | ||
| 78 | * | ||
| 79 | * Devices with these chips re-use a number of device-ids over the | ||
| 80 | * entire line, so the device-id is useless to determine if we're | ||
| 81 | * dealing with an ASM1051 (which we want to avoid). | ||
| 82 | * | ||
| 83 | * The ASM1153 can be identified by config.MaxPower == 0, | ||
| 84 | * where as the ASM105x models have config.MaxPower == 36. | ||
| 85 | * | ||
| 86 | * Differentiating between the ASM1053 and ASM1051 is trickier, when | ||
| 87 | * connected over USB-3 we can look at the number of streams supported, | ||
| 88 | * ASM1051 supports 32 streams, where as early ASM1053 versions support | ||
| 89 | * 16 streams, newer ASM1053-s also support 32 streams, but have a | ||
| 90 | * different prod-id. | ||
| 91 | * | ||
| 92 | * (*) ASM1051 chips do work with UAS with some disks (with the | ||
| 93 | * US_FL_NO_REPORT_OPCODES quirk), but are broken with other disks | ||
| 75 | */ | 94 | */ |
| 76 | if (le16_to_cpu(udev->descriptor.idVendor) == 0x174c && | 95 | if (le16_to_cpu(udev->descriptor.idVendor) == 0x174c && |
| 77 | le16_to_cpu(udev->descriptor.idProduct) == 0x55aa) { | 96 | (le16_to_cpu(udev->descriptor.idProduct) == 0x5106 || |
| 78 | if (udev->speed < USB_SPEED_SUPER) { | 97 | le16_to_cpu(udev->descriptor.idProduct) == 0x55aa)) { |
| 98 | if (udev->actconfig->desc.bMaxPower == 0) { | ||
| 99 | /* ASM1153, do nothing */ | ||
| 100 | } else if (udev->speed < USB_SPEED_SUPER) { | ||
| 79 | /* No streams info, assume ASM1051 */ | 101 | /* No streams info, assume ASM1051 */ |
| 80 | flags |= US_FL_IGNORE_UAS; | 102 | flags |= US_FL_IGNORE_UAS; |
| 81 | } else if (usb_ss_max_streams(&eps[1]->ss_ep_comp) == 32) { | 103 | } else if (usb_ss_max_streams(&eps[1]->ss_ep_comp) == 32) { |
| 104 | /* Possibly an ASM1051, disable uas */ | ||
| 82 | flags |= US_FL_IGNORE_UAS; | 105 | flags |= US_FL_IGNORE_UAS; |
| 83 | } | 106 | } |
| 84 | } | 107 | } |
diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h index 18a283d6de1c..6df4357d9ee3 100644 --- a/drivers/usb/storage/unusual_uas.h +++ b/drivers/usb/storage/unusual_uas.h | |||
| @@ -40,6 +40,16 @@ | |||
| 40 | * and don't forget to CC: the USB development list <linux-usb@vger.kernel.org> | 40 | * and don't forget to CC: the USB development list <linux-usb@vger.kernel.org> |
| 41 | */ | 41 | */ |
| 42 | 42 | ||
| 43 | /* | ||
| 44 | * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI | ||
| 45 | * commands in UAS mode. Observed with the 1.28 firmware; are there others? | ||
| 46 | */ | ||
| 47 | UNUSUAL_DEV(0x0984, 0x0301, 0x0128, 0x0128, | ||
| 48 | "Apricorn", | ||
| 49 | "", | ||
| 50 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
| 51 | US_FL_IGNORE_UAS), | ||
| 52 | |||
| 43 | /* https://bugzilla.kernel.org/show_bug.cgi?id=79511 */ | 53 | /* https://bugzilla.kernel.org/show_bug.cgi?id=79511 */ |
| 44 | UNUSUAL_DEV(0x0bc2, 0x2312, 0x0000, 0x9999, | 54 | UNUSUAL_DEV(0x0bc2, 0x2312, 0x0000, 0x9999, |
| 45 | "Seagate", | 55 | "Seagate", |
| @@ -68,6 +78,20 @@ UNUSUAL_DEV(0x0bc2, 0xa003, 0x0000, 0x9999, | |||
| 68 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 78 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 69 | US_FL_NO_ATA_1X), | 79 | US_FL_NO_ATA_1X), |
| 70 | 80 | ||
| 81 | /* Reported-by: Marcin ZajÄ…czkowski <mszpak@wp.pl> */ | ||
| 82 | UNUSUAL_DEV(0x0bc2, 0xa013, 0x0000, 0x9999, | ||
| 83 | "Seagate", | ||
| 84 | "Backup Plus", | ||
| 85 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
| 86 | US_FL_NO_ATA_1X), | ||
| 87 | |||
| 88 | /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ | ||
| 89 | UNUSUAL_DEV(0x0bc2, 0xa0a4, 0x0000, 0x9999, | ||
| 90 | "Seagate", | ||
| 91 | "Backup Plus Desk", | ||
| 92 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
| 93 | US_FL_NO_ATA_1X), | ||
| 94 | |||
| 71 | /* https://bbs.archlinux.org/viewtopic.php?id=183190 */ | 95 | /* https://bbs.archlinux.org/viewtopic.php?id=183190 */ |
| 72 | UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999, | 96 | UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999, |
| 73 | "Seagate", | 97 | "Seagate", |
| @@ -82,6 +106,13 @@ UNUSUAL_DEV(0x0bc2, 0xab21, 0x0000, 0x9999, | |||
| 82 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 106 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 83 | US_FL_NO_ATA_1X), | 107 | US_FL_NO_ATA_1X), |
| 84 | 108 | ||
| 109 | /* Reported-by: G. Richard Bellamy <rbellamy@pteradigm.com> */ | ||
| 110 | UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999, | ||
| 111 | "Seagate", | ||
| 112 | "BUP Fast HDD", | ||
| 113 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
| 114 | US_FL_NO_ATA_1X), | ||
| 115 | |||
| 85 | /* Reported-by: Claudio Bizzarri <claudio.bizzarri@gmail.com> */ | 116 | /* Reported-by: Claudio Bizzarri <claudio.bizzarri@gmail.com> */ |
| 86 | UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, | 117 | UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, |
| 87 | "JMicron", | 118 | "JMicron", |
| @@ -89,14 +120,6 @@ UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, | |||
| 89 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 120 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 90 | US_FL_NO_REPORT_OPCODES), | 121 | US_FL_NO_REPORT_OPCODES), |
| 91 | 122 | ||
| 92 | /* Most ASM1051 based devices have issues with uas, blacklist them all */ | ||
| 93 | /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ | ||
| 94 | UNUSUAL_DEV(0x174c, 0x5106, 0x0000, 0x9999, | ||
| 95 | "ASMedia", | ||
| 96 | "ASM1051", | ||
| 97 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
| 98 | US_FL_IGNORE_UAS), | ||
| 99 | |||
| 100 | /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ | 123 | /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ |
| 101 | UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, | 124 | UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, |
| 102 | "VIA", | 125 | "VIA", |
| @@ -104,6 +127,13 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, | |||
| 104 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 127 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 105 | US_FL_NO_ATA_1X), | 128 | US_FL_NO_ATA_1X), |
| 106 | 129 | ||
| 130 | /* Reported-by: Takeo Nakayama <javhera@gmx.com> */ | ||
| 131 | UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999, | ||
| 132 | "JMicron", | ||
| 133 | "JMS566", | ||
| 134 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
| 135 | US_FL_NO_REPORT_OPCODES), | ||
| 136 | |||
| 107 | /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ | 137 | /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ |
| 108 | UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999, | 138 | UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999, |
| 109 | "Hitachi", | 139 | "Hitachi", |
diff --git a/drivers/video/fbdev/broadsheetfb.c b/drivers/video/fbdev/broadsheetfb.c index 1c29bd19e3d5..0e5fde1d3ffb 100644 --- a/drivers/video/fbdev/broadsheetfb.c +++ b/drivers/video/fbdev/broadsheetfb.c | |||
| @@ -636,7 +636,7 @@ static int broadsheet_spiflash_rewrite_sector(struct broadsheetfb_par *par, | |||
| 636 | err = broadsheet_spiflash_read_range(par, start_sector_addr, | 636 | err = broadsheet_spiflash_read_range(par, start_sector_addr, |
| 637 | data_start_addr, sector_buffer); | 637 | data_start_addr, sector_buffer); |
| 638 | if (err) | 638 | if (err) |
| 639 | return err; | 639 | goto out; |
| 640 | } | 640 | } |
| 641 | 641 | ||
| 642 | /* now we copy our data into the right place in the sector buffer */ | 642 | /* now we copy our data into the right place in the sector buffer */ |
| @@ -657,7 +657,7 @@ static int broadsheet_spiflash_rewrite_sector(struct broadsheetfb_par *par, | |||
| 657 | err = broadsheet_spiflash_read_range(par, tail_start_addr, | 657 | err = broadsheet_spiflash_read_range(par, tail_start_addr, |
| 658 | tail_len, sector_buffer + tail_start_addr); | 658 | tail_len, sector_buffer + tail_start_addr); |
| 659 | if (err) | 659 | if (err) |
| 660 | return err; | 660 | goto out; |
| 661 | } | 661 | } |
| 662 | 662 | ||
| 663 | /* if we got here we have the full sector that we want to rewrite. */ | 663 | /* if we got here we have the full sector that we want to rewrite. */ |
| @@ -665,11 +665,13 @@ static int broadsheet_spiflash_rewrite_sector(struct broadsheetfb_par *par, | |||
| 665 | /* first erase the sector */ | 665 | /* first erase the sector */ |
| 666 | err = broadsheet_spiflash_erase_sector(par, start_sector_addr); | 666 | err = broadsheet_spiflash_erase_sector(par, start_sector_addr); |
| 667 | if (err) | 667 | if (err) |
| 668 | return err; | 668 | goto out; |
| 669 | 669 | ||
| 670 | /* now write it */ | 670 | /* now write it */ |
| 671 | err = broadsheet_spiflash_write_sector(par, start_sector_addr, | 671 | err = broadsheet_spiflash_write_sector(par, start_sector_addr, |
| 672 | sector_buffer, sector_size); | 672 | sector_buffer, sector_size); |
| 673 | out: | ||
| 674 | kfree(sector_buffer); | ||
| 673 | return err; | 675 | return err; |
| 674 | } | 676 | } |
| 675 | 677 | ||
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 92cac803dee3..1085c0432158 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c | |||
| @@ -402,7 +402,7 @@ static int __init simplefb_init(void) | |||
| 402 | if (ret) | 402 | if (ret) |
| 403 | return ret; | 403 | return ret; |
| 404 | 404 | ||
| 405 | if (IS_ENABLED(CONFIG_OF) && of_chosen) { | 405 | if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) { |
| 406 | for_each_child_of_node(of_chosen, np) { | 406 | for_each_child_of_node(of_chosen, np) { |
| 407 | if (of_device_is_compatible(np, "simple-framebuffer")) | 407 | if (of_device_is_compatible(np, "simple-framebuffer")) |
| 408 | of_platform_device_create(np, NULL, NULL); | 408 | of_platform_device_create(np, NULL, NULL); |
