diff options
Diffstat (limited to 'drivers')
69 files changed, 406 insertions, 208 deletions
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c index 5e9d7348c16f..62d3aa74277b 100644 --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c | |||
| @@ -81,12 +81,8 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info) | |||
| 81 | 81 | ||
| 82 | ACPI_FUNCTION_TRACE(ev_enable_gpe); | 82 | ACPI_FUNCTION_TRACE(ev_enable_gpe); |
| 83 | 83 | ||
| 84 | /* Clear the GPE status */ | ||
| 85 | status = acpi_hw_clear_gpe(gpe_event_info); | ||
| 86 | if (ACPI_FAILURE(status)) | ||
| 87 | return_ACPI_STATUS(status); | ||
| 88 | |||
| 89 | /* Enable the requested GPE */ | 84 | /* Enable the requested GPE */ |
| 85 | |||
| 90 | status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE); | 86 | status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE); |
| 91 | return_ACPI_STATUS(status); | 87 | return_ACPI_STATUS(status); |
| 92 | } | 88 | } |
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 399cad7daae7..d58a359a6622 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c | |||
| @@ -774,18 +774,18 @@ struct zram_work { | |||
| 774 | struct zram *zram; | 774 | struct zram *zram; |
| 775 | unsigned long entry; | 775 | unsigned long entry; |
| 776 | struct bio *bio; | 776 | struct bio *bio; |
| 777 | struct bio_vec bvec; | ||
| 777 | }; | 778 | }; |
| 778 | 779 | ||
| 779 | #if PAGE_SIZE != 4096 | 780 | #if PAGE_SIZE != 4096 |
| 780 | static void zram_sync_read(struct work_struct *work) | 781 | static void zram_sync_read(struct work_struct *work) |
| 781 | { | 782 | { |
| 782 | struct bio_vec bvec; | ||
| 783 | struct zram_work *zw = container_of(work, struct zram_work, work); | 783 | struct zram_work *zw = container_of(work, struct zram_work, work); |
| 784 | struct zram *zram = zw->zram; | 784 | struct zram *zram = zw->zram; |
| 785 | unsigned long entry = zw->entry; | 785 | unsigned long entry = zw->entry; |
| 786 | struct bio *bio = zw->bio; | 786 | struct bio *bio = zw->bio; |
| 787 | 787 | ||
| 788 | read_from_bdev_async(zram, &bvec, entry, bio); | 788 | read_from_bdev_async(zram, &zw->bvec, entry, bio); |
| 789 | } | 789 | } |
| 790 | 790 | ||
| 791 | /* | 791 | /* |
| @@ -798,6 +798,7 @@ static int read_from_bdev_sync(struct zram *zram, struct bio_vec *bvec, | |||
| 798 | { | 798 | { |
| 799 | struct zram_work work; | 799 | struct zram_work work; |
| 800 | 800 | ||
| 801 | work.bvec = *bvec; | ||
| 801 | work.zram = zram; | 802 | work.zram = zram; |
| 802 | work.entry = entry; | 803 | work.entry = entry; |
| 803 | work.bio = bio; | 804 | work.bio = bio; |
diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index ec8a291d62ba..54093ffd0aef 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c | |||
| @@ -671,7 +671,7 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( | |||
| 671 | d = bcm2835_dma_create_cb_chain(chan, direction, false, | 671 | d = bcm2835_dma_create_cb_chain(chan, direction, false, |
| 672 | info, extra, | 672 | info, extra, |
| 673 | frames, src, dst, 0, 0, | 673 | frames, src, dst, 0, 0, |
| 674 | GFP_KERNEL); | 674 | GFP_NOWAIT); |
| 675 | if (!d) | 675 | if (!d) |
| 676 | return NULL; | 676 | return NULL; |
| 677 | 677 | ||
diff --git a/drivers/dma/mediatek/mtk-cqdma.c b/drivers/dma/mediatek/mtk-cqdma.c index 131f3974740d..814853842e29 100644 --- a/drivers/dma/mediatek/mtk-cqdma.c +++ b/drivers/dma/mediatek/mtk-cqdma.c | |||
| @@ -253,7 +253,7 @@ static void mtk_cqdma_start(struct mtk_cqdma_pchan *pc, | |||
| 253 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT | 253 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
| 254 | mtk_dma_set(pc, MTK_CQDMA_DST2, cvd->dest >> MTK_CQDMA_ADDR2_SHFIT); | 254 | mtk_dma_set(pc, MTK_CQDMA_DST2, cvd->dest >> MTK_CQDMA_ADDR2_SHFIT); |
| 255 | #else | 255 | #else |
| 256 | mtk_dma_set(pc, MTK_CQDMA_SRC2, 0); | 256 | mtk_dma_set(pc, MTK_CQDMA_DST2, 0); |
| 257 | #endif | 257 | #endif |
| 258 | 258 | ||
| 259 | /* setup the length */ | 259 | /* setup the length */ |
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 2b4f25698169..e2a5398f89b5 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c | |||
| @@ -1282,6 +1282,9 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan, | |||
| 1282 | enum dma_status status; | 1282 | enum dma_status status; |
| 1283 | unsigned int residue = 0; | 1283 | unsigned int residue = 0; |
| 1284 | unsigned int dptr = 0; | 1284 | unsigned int dptr = 0; |
| 1285 | unsigned int chcrb; | ||
| 1286 | unsigned int tcrb; | ||
| 1287 | unsigned int i; | ||
| 1285 | 1288 | ||
| 1286 | if (!desc) | 1289 | if (!desc) |
| 1287 | return 0; | 1290 | return 0; |
| @@ -1330,14 +1333,31 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan, | |||
| 1330 | } | 1333 | } |
| 1331 | 1334 | ||
| 1332 | /* | 1335 | /* |
| 1336 | * We need to read two registers. | ||
| 1337 | * Make sure the control register does not skip to next chunk | ||
| 1338 | * while reading the counter. | ||
| 1339 | * Trying it 3 times should be enough: Initial read, retry, retry | ||
| 1340 | * for the paranoid. | ||
| 1341 | */ | ||
| 1342 | for (i = 0; i < 3; i++) { | ||
| 1343 | chcrb = rcar_dmac_chan_read(chan, RCAR_DMACHCRB) & | ||
| 1344 | RCAR_DMACHCRB_DPTR_MASK; | ||
| 1345 | tcrb = rcar_dmac_chan_read(chan, RCAR_DMATCRB); | ||
| 1346 | /* Still the same? */ | ||
| 1347 | if (chcrb == (rcar_dmac_chan_read(chan, RCAR_DMACHCRB) & | ||
| 1348 | RCAR_DMACHCRB_DPTR_MASK)) | ||
| 1349 | break; | ||
| 1350 | } | ||
| 1351 | WARN_ONCE(i >= 3, "residue might be not continuous!"); | ||
| 1352 | |||
| 1353 | /* | ||
| 1333 | * In descriptor mode the descriptor running pointer is not maintained | 1354 | * In descriptor mode the descriptor running pointer is not maintained |
| 1334 | * by the interrupt handler, find the running descriptor from the | 1355 | * by the interrupt handler, find the running descriptor from the |
| 1335 | * descriptor pointer field in the CHCRB register. In non-descriptor | 1356 | * descriptor pointer field in the CHCRB register. In non-descriptor |
| 1336 | * mode just use the running descriptor pointer. | 1357 | * mode just use the running descriptor pointer. |
| 1337 | */ | 1358 | */ |
| 1338 | if (desc->hwdescs.use) { | 1359 | if (desc->hwdescs.use) { |
| 1339 | dptr = (rcar_dmac_chan_read(chan, RCAR_DMACHCRB) & | 1360 | dptr = chcrb >> RCAR_DMACHCRB_DPTR_SHIFT; |
| 1340 | RCAR_DMACHCRB_DPTR_MASK) >> RCAR_DMACHCRB_DPTR_SHIFT; | ||
| 1341 | if (dptr == 0) | 1361 | if (dptr == 0) |
| 1342 | dptr = desc->nchunks; | 1362 | dptr = desc->nchunks; |
| 1343 | dptr--; | 1363 | dptr--; |
| @@ -1355,7 +1375,7 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan, | |||
| 1355 | } | 1375 | } |
| 1356 | 1376 | ||
| 1357 | /* Add the residue for the current chunk. */ | 1377 | /* Add the residue for the current chunk. */ |
| 1358 | residue += rcar_dmac_chan_read(chan, RCAR_DMATCRB) << desc->xfer_shift; | 1378 | residue += tcrb << desc->xfer_shift; |
| 1359 | 1379 | ||
| 1360 | return residue; | 1380 | return residue; |
| 1361 | } | 1381 | } |
| @@ -1368,6 +1388,7 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan, | |||
| 1368 | enum dma_status status; | 1388 | enum dma_status status; |
| 1369 | unsigned long flags; | 1389 | unsigned long flags; |
| 1370 | unsigned int residue; | 1390 | unsigned int residue; |
| 1391 | bool cyclic; | ||
| 1371 | 1392 | ||
| 1372 | status = dma_cookie_status(chan, cookie, txstate); | 1393 | status = dma_cookie_status(chan, cookie, txstate); |
| 1373 | if (status == DMA_COMPLETE || !txstate) | 1394 | if (status == DMA_COMPLETE || !txstate) |
| @@ -1375,10 +1396,11 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan, | |||
| 1375 | 1396 | ||
| 1376 | spin_lock_irqsave(&rchan->lock, flags); | 1397 | spin_lock_irqsave(&rchan->lock, flags); |
| 1377 | residue = rcar_dmac_chan_get_residue(rchan, cookie); | 1398 | residue = rcar_dmac_chan_get_residue(rchan, cookie); |
| 1399 | cyclic = rchan->desc.running ? rchan->desc.running->cyclic : false; | ||
| 1378 | spin_unlock_irqrestore(&rchan->lock, flags); | 1400 | spin_unlock_irqrestore(&rchan->lock, flags); |
| 1379 | 1401 | ||
| 1380 | /* if there's no residue, the cookie is complete */ | 1402 | /* if there's no residue, the cookie is complete */ |
| 1381 | if (!residue) | 1403 | if (!residue && !cyclic) |
| 1382 | return DMA_COMPLETE; | 1404 | return DMA_COMPLETE; |
| 1383 | 1405 | ||
| 1384 | dma_set_residue(txstate, residue); | 1406 | dma_set_residue(txstate, residue); |
diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index f0223cee9774..77092268ee95 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c | |||
| @@ -414,6 +414,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) | |||
| 414 | irq_set_handler_locked(data, handle_edge_irq); | 414 | irq_set_handler_locked(data, handle_edge_irq); |
| 415 | break; | 415 | break; |
| 416 | case IRQ_TYPE_EDGE_BOTH: | 416 | case IRQ_TYPE_EDGE_BOTH: |
| 417 | sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0); | ||
| 417 | sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1); | 418 | sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1); |
| 418 | irq_set_handler_locked(data, handle_edge_irq); | 419 | irq_set_handler_locked(data, handle_edge_irq); |
| 419 | break; | 420 | break; |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 0495bf1d480a..bca3e7740ef6 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
| @@ -1379,7 +1379,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | |||
| 1379 | 1379 | ||
| 1380 | status = gpiochip_add_irqchip(chip, lock_key, request_key); | 1380 | status = gpiochip_add_irqchip(chip, lock_key, request_key); |
| 1381 | if (status) | 1381 | if (status) |
| 1382 | goto err_remove_chip; | 1382 | goto err_free_gpiochip_mask; |
| 1383 | 1383 | ||
| 1384 | status = of_gpiochip_add(chip); | 1384 | status = of_gpiochip_add(chip); |
| 1385 | if (status) | 1385 | if (status) |
| @@ -1387,7 +1387,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | |||
| 1387 | 1387 | ||
| 1388 | status = gpiochip_init_valid_mask(chip); | 1388 | status = gpiochip_init_valid_mask(chip); |
| 1389 | if (status) | 1389 | if (status) |
| 1390 | goto err_remove_chip; | 1390 | goto err_remove_of_chip; |
| 1391 | 1391 | ||
| 1392 | for (i = 0; i < chip->ngpio; i++) { | 1392 | for (i = 0; i < chip->ngpio; i++) { |
| 1393 | struct gpio_desc *desc = &gdev->descs[i]; | 1393 | struct gpio_desc *desc = &gdev->descs[i]; |
| @@ -1415,14 +1415,18 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | |||
| 1415 | if (gpiolib_initialized) { | 1415 | if (gpiolib_initialized) { |
| 1416 | status = gpiochip_setup_dev(gdev); | 1416 | status = gpiochip_setup_dev(gdev); |
| 1417 | if (status) | 1417 | if (status) |
| 1418 | goto err_remove_chip; | 1418 | goto err_remove_acpi_chip; |
| 1419 | } | 1419 | } |
| 1420 | return 0; | 1420 | return 0; |
| 1421 | 1421 | ||
| 1422 | err_remove_chip: | 1422 | err_remove_acpi_chip: |
| 1423 | acpi_gpiochip_remove(chip); | 1423 | acpi_gpiochip_remove(chip); |
| 1424 | err_remove_of_chip: | ||
| 1424 | gpiochip_free_hogs(chip); | 1425 | gpiochip_free_hogs(chip); |
| 1425 | of_gpiochip_remove(chip); | 1426 | of_gpiochip_remove(chip); |
| 1427 | err_remove_chip: | ||
| 1428 | gpiochip_irqchip_remove(chip); | ||
| 1429 | err_free_gpiochip_mask: | ||
| 1426 | gpiochip_free_valid_mask(chip); | 1430 | gpiochip_free_valid_mask(chip); |
| 1427 | err_remove_irqchip_mask: | 1431 | err_remove_irqchip_mask: |
| 1428 | gpiochip_irqchip_free_valid_mask(chip); | 1432 | gpiochip_irqchip_free_valid_mask(chip); |
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index db761329a1e3..ab7968c8f6a2 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | |||
| @@ -1046,6 +1046,10 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi) | |||
| 1046 | if (hdmi->version < 0x200a) | 1046 | if (hdmi->version < 0x200a) |
| 1047 | return false; | 1047 | return false; |
| 1048 | 1048 | ||
| 1049 | /* Disable if no DDC bus */ | ||
| 1050 | if (!hdmi->ddc) | ||
| 1051 | return false; | ||
| 1052 | |||
| 1049 | /* Disable if SCDC is not supported, or if an HF-VSDB block is absent */ | 1053 | /* Disable if SCDC is not supported, or if an HF-VSDB block is absent */ |
| 1050 | if (!display->hdmi.scdc.supported || | 1054 | if (!display->hdmi.scdc.supported || |
| 1051 | !display->hdmi.scdc.scrambling.supported) | 1055 | !display->hdmi.scdc.scrambling.supported) |
| @@ -1684,13 +1688,13 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, | |||
| 1684 | * Source Devices compliant shall set the | 1688 | * Source Devices compliant shall set the |
| 1685 | * Source Version = 1. | 1689 | * Source Version = 1. |
| 1686 | */ | 1690 | */ |
| 1687 | drm_scdc_readb(&hdmi->i2c->adap, SCDC_SINK_VERSION, | 1691 | drm_scdc_readb(hdmi->ddc, SCDC_SINK_VERSION, |
| 1688 | &bytes); | 1692 | &bytes); |
| 1689 | drm_scdc_writeb(&hdmi->i2c->adap, SCDC_SOURCE_VERSION, | 1693 | drm_scdc_writeb(hdmi->ddc, SCDC_SOURCE_VERSION, |
| 1690 | min_t(u8, bytes, SCDC_MIN_SOURCE_VERSION)); | 1694 | min_t(u8, bytes, SCDC_MIN_SOURCE_VERSION)); |
| 1691 | 1695 | ||
| 1692 | /* Enabled Scrambling in the Sink */ | 1696 | /* Enabled Scrambling in the Sink */ |
| 1693 | drm_scdc_set_scrambling(&hdmi->i2c->adap, 1); | 1697 | drm_scdc_set_scrambling(hdmi->ddc, 1); |
| 1694 | 1698 | ||
| 1695 | /* | 1699 | /* |
| 1696 | * To activate the scrambler feature, you must ensure | 1700 | * To activate the scrambler feature, you must ensure |
| @@ -1706,7 +1710,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, | |||
| 1706 | hdmi_writeb(hdmi, 0, HDMI_FC_SCRAMBLER_CTRL); | 1710 | hdmi_writeb(hdmi, 0, HDMI_FC_SCRAMBLER_CTRL); |
| 1707 | hdmi_writeb(hdmi, (u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ, | 1711 | hdmi_writeb(hdmi, (u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ, |
| 1708 | HDMI_MC_SWRSTZ); | 1712 | HDMI_MC_SWRSTZ); |
| 1709 | drm_scdc_set_scrambling(&hdmi->i2c->adap, 0); | 1713 | drm_scdc_set_scrambling(hdmi->ddc, 0); |
| 1710 | } | 1714 | } |
| 1711 | } | 1715 | } |
| 1712 | 1716 | ||
| @@ -1800,6 +1804,8 @@ static void dw_hdmi_clear_overflow(struct dw_hdmi *hdmi) | |||
| 1800 | * iteration for others. | 1804 | * iteration for others. |
| 1801 | * The Amlogic Meson GX SoCs (v2.01a) have been identified as needing | 1805 | * The Amlogic Meson GX SoCs (v2.01a) have been identified as needing |
| 1802 | * the workaround with a single iteration. | 1806 | * the workaround with a single iteration. |
| 1807 | * The Rockchip RK3288 SoC (v2.00a) and RK3328/RK3399 SoCs (v2.11a) have | ||
| 1808 | * been identified as needing the workaround with a single iteration. | ||
| 1803 | */ | 1809 | */ |
| 1804 | 1810 | ||
| 1805 | switch (hdmi->version) { | 1811 | switch (hdmi->version) { |
| @@ -1808,7 +1814,9 @@ static void dw_hdmi_clear_overflow(struct dw_hdmi *hdmi) | |||
| 1808 | break; | 1814 | break; |
| 1809 | case 0x131a: | 1815 | case 0x131a: |
| 1810 | case 0x132a: | 1816 | case 0x132a: |
| 1817 | case 0x200a: | ||
| 1811 | case 0x201a: | 1818 | case 0x201a: |
| 1819 | case 0x211a: | ||
| 1812 | case 0x212a: | 1820 | case 0x212a: |
| 1813 | count = 1; | 1821 | count = 1; |
| 1814 | break; | 1822 | break; |
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index ab4e60dfd6a3..98cea1f4b3bf 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
| @@ -3862,14 +3862,16 @@ static int intel_ddi_compute_config(struct intel_encoder *encoder, | |||
| 3862 | ret = intel_hdmi_compute_config(encoder, pipe_config, conn_state); | 3862 | ret = intel_hdmi_compute_config(encoder, pipe_config, conn_state); |
| 3863 | else | 3863 | else |
| 3864 | ret = intel_dp_compute_config(encoder, pipe_config, conn_state); | 3864 | ret = intel_dp_compute_config(encoder, pipe_config, conn_state); |
| 3865 | if (ret) | ||
| 3866 | return ret; | ||
| 3865 | 3867 | ||
| 3866 | if (IS_GEN9_LP(dev_priv) && ret) | 3868 | if (IS_GEN9_LP(dev_priv)) |
| 3867 | pipe_config->lane_lat_optim_mask = | 3869 | pipe_config->lane_lat_optim_mask = |
| 3868 | bxt_ddi_phy_calc_lane_lat_optim_mask(pipe_config->lane_count); | 3870 | bxt_ddi_phy_calc_lane_lat_optim_mask(pipe_config->lane_count); |
| 3869 | 3871 | ||
| 3870 | intel_ddi_compute_min_voltage_level(dev_priv, pipe_config); | 3872 | intel_ddi_compute_min_voltage_level(dev_priv, pipe_config); |
| 3871 | 3873 | ||
| 3872 | return ret; | 3874 | return 0; |
| 3873 | 3875 | ||
| 3874 | } | 3876 | } |
| 3875 | 3877 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 8891f29a8c7f..48da4a969a0a 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -1886,6 +1886,9 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, | |||
| 1886 | int pipe_bpp; | 1886 | int pipe_bpp; |
| 1887 | int ret; | 1887 | int ret; |
| 1888 | 1888 | ||
| 1889 | pipe_config->fec_enable = !intel_dp_is_edp(intel_dp) && | ||
| 1890 | intel_dp_supports_fec(intel_dp, pipe_config); | ||
| 1891 | |||
| 1889 | if (!intel_dp_supports_dsc(intel_dp, pipe_config)) | 1892 | if (!intel_dp_supports_dsc(intel_dp, pipe_config)) |
| 1890 | return -EINVAL; | 1893 | return -EINVAL; |
| 1891 | 1894 | ||
| @@ -2116,9 +2119,6 @@ intel_dp_compute_config(struct intel_encoder *encoder, | |||
| 2116 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK) | 2119 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK) |
| 2117 | return -EINVAL; | 2120 | return -EINVAL; |
| 2118 | 2121 | ||
| 2119 | pipe_config->fec_enable = !intel_dp_is_edp(intel_dp) && | ||
| 2120 | intel_dp_supports_fec(intel_dp, pipe_config); | ||
| 2121 | |||
| 2122 | ret = intel_dp_compute_link_config(encoder, pipe_config, conn_state); | 2122 | ret = intel_dp_compute_link_config(encoder, pipe_config, conn_state); |
| 2123 | if (ret < 0) | 2123 | if (ret < 0) |
| 2124 | return ret; | 2124 | return ret; |
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index ec3602ebbc1c..54011df8c2e8 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c | |||
| @@ -71,7 +71,7 @@ static void ipu_crtc_disable_planes(struct ipu_crtc *ipu_crtc, | |||
| 71 | if (disable_partial) | 71 | if (disable_partial) |
| 72 | ipu_plane_disable(ipu_crtc->plane[1], true); | 72 | ipu_plane_disable(ipu_crtc->plane[1], true); |
| 73 | if (disable_full) | 73 | if (disable_full) |
| 74 | ipu_plane_disable(ipu_crtc->plane[0], false); | 74 | ipu_plane_disable(ipu_crtc->plane[0], true); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | static void ipu_crtc_atomic_disable(struct drm_crtc *crtc, | 77 | static void ipu_crtc_atomic_disable(struct drm_crtc *crtc, |
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 19fc601c9eeb..a1bec2779e76 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c | |||
| @@ -366,10 +366,9 @@ void drm_sched_increase_karma(struct drm_sched_job *bad) | |||
| 366 | EXPORT_SYMBOL(drm_sched_increase_karma); | 366 | EXPORT_SYMBOL(drm_sched_increase_karma); |
| 367 | 367 | ||
| 368 | /** | 368 | /** |
| 369 | * drm_sched_hw_job_reset - stop the scheduler if it contains the bad job | 369 | * drm_sched_stop - stop the scheduler |
| 370 | * | 370 | * |
| 371 | * @sched: scheduler instance | 371 | * @sched: scheduler instance |
| 372 | * @bad: bad scheduler job | ||
| 373 | * | 372 | * |
| 374 | */ | 373 | */ |
| 375 | void drm_sched_stop(struct drm_gpu_scheduler *sched) | 374 | void drm_sched_stop(struct drm_gpu_scheduler *sched) |
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 3ebd9f5e2719..29258b404e54 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/of_reserved_mem.h> | 16 | #include <linux/of_reserved_mem.h> |
| 17 | 17 | ||
| 18 | #include <drm/drmP.h> | 18 | #include <drm/drmP.h> |
| 19 | #include <drm/drm_atomic_helper.h> | ||
| 19 | #include <drm/drm_fb_cma_helper.h> | 20 | #include <drm/drm_fb_cma_helper.h> |
| 20 | #include <drm/drm_fb_helper.h> | 21 | #include <drm/drm_fb_helper.h> |
| 21 | #include <drm/drm_gem_cma_helper.h> | 22 | #include <drm/drm_gem_cma_helper.h> |
| @@ -85,6 +86,8 @@ static int sun4i_drv_bind(struct device *dev) | |||
| 85 | ret = -ENOMEM; | 86 | ret = -ENOMEM; |
| 86 | goto free_drm; | 87 | goto free_drm; |
| 87 | } | 88 | } |
| 89 | |||
| 90 | dev_set_drvdata(dev, drm); | ||
| 88 | drm->dev_private = drv; | 91 | drm->dev_private = drv; |
| 89 | INIT_LIST_HEAD(&drv->frontend_list); | 92 | INIT_LIST_HEAD(&drv->frontend_list); |
| 90 | INIT_LIST_HEAD(&drv->engine_list); | 93 | INIT_LIST_HEAD(&drv->engine_list); |
| @@ -144,8 +147,12 @@ static void sun4i_drv_unbind(struct device *dev) | |||
| 144 | 147 | ||
| 145 | drm_dev_unregister(drm); | 148 | drm_dev_unregister(drm); |
| 146 | drm_kms_helper_poll_fini(drm); | 149 | drm_kms_helper_poll_fini(drm); |
| 150 | drm_atomic_helper_shutdown(drm); | ||
| 147 | drm_mode_config_cleanup(drm); | 151 | drm_mode_config_cleanup(drm); |
| 152 | |||
| 153 | component_unbind_all(dev, NULL); | ||
| 148 | of_reserved_mem_device_release(dev); | 154 | of_reserved_mem_device_release(dev); |
| 155 | |||
| 149 | drm_dev_put(drm); | 156 | drm_dev_put(drm); |
| 150 | } | 157 | } |
| 151 | 158 | ||
| @@ -395,6 +402,8 @@ static int sun4i_drv_probe(struct platform_device *pdev) | |||
| 395 | 402 | ||
| 396 | static int sun4i_drv_remove(struct platform_device *pdev) | 403 | static int sun4i_drv_remove(struct platform_device *pdev) |
| 397 | { | 404 | { |
| 405 | component_master_del(&pdev->dev, &sun4i_drv_master_ops); | ||
| 406 | |||
| 398 | return 0; | 407 | return 0; |
| 399 | } | 408 | } |
| 400 | 409 | ||
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 0fa5034b9f9e..1a01669b159a 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
| @@ -49,9 +49,8 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj); | |||
| 49 | * ttm_global_mutex - protecting the global BO state | 49 | * ttm_global_mutex - protecting the global BO state |
| 50 | */ | 50 | */ |
| 51 | DEFINE_MUTEX(ttm_global_mutex); | 51 | DEFINE_MUTEX(ttm_global_mutex); |
| 52 | struct ttm_bo_global ttm_bo_glob = { | 52 | unsigned ttm_bo_glob_use_count; |
| 53 | .use_count = 0 | 53 | struct ttm_bo_global ttm_bo_glob; |
| 54 | }; | ||
| 55 | 54 | ||
| 56 | static struct attribute ttm_bo_count = { | 55 | static struct attribute ttm_bo_count = { |
| 57 | .name = "bo_count", | 56 | .name = "bo_count", |
| @@ -1531,12 +1530,13 @@ static void ttm_bo_global_release(void) | |||
| 1531 | struct ttm_bo_global *glob = &ttm_bo_glob; | 1530 | struct ttm_bo_global *glob = &ttm_bo_glob; |
| 1532 | 1531 | ||
| 1533 | mutex_lock(&ttm_global_mutex); | 1532 | mutex_lock(&ttm_global_mutex); |
| 1534 | if (--glob->use_count > 0) | 1533 | if (--ttm_bo_glob_use_count > 0) |
| 1535 | goto out; | 1534 | goto out; |
| 1536 | 1535 | ||
| 1537 | kobject_del(&glob->kobj); | 1536 | kobject_del(&glob->kobj); |
| 1538 | kobject_put(&glob->kobj); | 1537 | kobject_put(&glob->kobj); |
| 1539 | ttm_mem_global_release(&ttm_mem_glob); | 1538 | ttm_mem_global_release(&ttm_mem_glob); |
| 1539 | memset(glob, 0, sizeof(*glob)); | ||
| 1540 | out: | 1540 | out: |
| 1541 | mutex_unlock(&ttm_global_mutex); | 1541 | mutex_unlock(&ttm_global_mutex); |
| 1542 | } | 1542 | } |
| @@ -1548,7 +1548,7 @@ static int ttm_bo_global_init(void) | |||
| 1548 | unsigned i; | 1548 | unsigned i; |
| 1549 | 1549 | ||
| 1550 | mutex_lock(&ttm_global_mutex); | 1550 | mutex_lock(&ttm_global_mutex); |
| 1551 | if (++glob->use_count > 1) | 1551 | if (++ttm_bo_glob_use_count > 1) |
| 1552 | goto out; | 1552 | goto out; |
| 1553 | 1553 | ||
| 1554 | ret = ttm_mem_global_init(&ttm_mem_glob); | 1554 | ret = ttm_mem_global_init(&ttm_mem_glob); |
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index f1567c353b54..9a0909decb36 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c | |||
| @@ -461,8 +461,8 @@ out_no_zone: | |||
| 461 | 461 | ||
| 462 | void ttm_mem_global_release(struct ttm_mem_global *glob) | 462 | void ttm_mem_global_release(struct ttm_mem_global *glob) |
| 463 | { | 463 | { |
| 464 | unsigned int i; | ||
| 465 | struct ttm_mem_zone *zone; | 464 | struct ttm_mem_zone *zone; |
| 465 | unsigned int i; | ||
| 466 | 466 | ||
| 467 | /* let the page allocator first stop the shrink work. */ | 467 | /* let the page allocator first stop the shrink work. */ |
| 468 | ttm_page_alloc_fini(); | 468 | ttm_page_alloc_fini(); |
| @@ -475,9 +475,10 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) | |||
| 475 | zone = glob->zones[i]; | 475 | zone = glob->zones[i]; |
| 476 | kobject_del(&zone->kobj); | 476 | kobject_del(&zone->kobj); |
| 477 | kobject_put(&zone->kobj); | 477 | kobject_put(&zone->kobj); |
| 478 | } | 478 | } |
| 479 | kobject_del(&glob->kobj); | 479 | kobject_del(&glob->kobj); |
| 480 | kobject_put(&glob->kobj); | 480 | kobject_put(&glob->kobj); |
| 481 | memset(glob, 0, sizeof(*glob)); | ||
| 481 | } | 482 | } |
| 482 | 483 | ||
| 483 | static void ttm_check_swapping(struct ttm_mem_global *glob) | 484 | static void ttm_check_swapping(struct ttm_mem_global *glob) |
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 730008d3da76..1baa10e94484 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c | |||
| @@ -1042,7 +1042,7 @@ static void | |||
| 1042 | vc4_crtc_reset(struct drm_crtc *crtc) | 1042 | vc4_crtc_reset(struct drm_crtc *crtc) |
| 1043 | { | 1043 | { |
| 1044 | if (crtc->state) | 1044 | if (crtc->state) |
| 1045 | __drm_atomic_helper_crtc_destroy_state(crtc->state); | 1045 | vc4_crtc_destroy_state(crtc, crtc->state); |
| 1046 | 1046 | ||
| 1047 | crtc->state = kzalloc(sizeof(struct vc4_crtc_state), GFP_KERNEL); | 1047 | crtc->state = kzalloc(sizeof(struct vc4_crtc_state), GFP_KERNEL); |
| 1048 | if (crtc->state) | 1048 | if (crtc->state) |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 6165fe2c4504..1bfa353d995c 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |||
| @@ -546,29 +546,13 @@ static void vmw_get_initial_size(struct vmw_private *dev_priv) | |||
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | /** | 548 | /** |
| 549 | * vmw_assume_iommu - Figure out whether coherent dma-remapping might be | ||
| 550 | * taking place. | ||
| 551 | * @dev: Pointer to the struct drm_device. | ||
| 552 | * | ||
| 553 | * Return: true if iommu present, false otherwise. | ||
| 554 | */ | ||
| 555 | static bool vmw_assume_iommu(struct drm_device *dev) | ||
| 556 | { | ||
| 557 | const struct dma_map_ops *ops = get_dma_ops(dev->dev); | ||
| 558 | |||
| 559 | return !dma_is_direct(ops) && ops && | ||
| 560 | ops->map_page != dma_direct_map_page; | ||
| 561 | } | ||
| 562 | |||
| 563 | /** | ||
| 564 | * vmw_dma_select_mode - Determine how DMA mappings should be set up for this | 549 | * vmw_dma_select_mode - Determine how DMA mappings should be set up for this |
| 565 | * system. | 550 | * system. |
| 566 | * | 551 | * |
| 567 | * @dev_priv: Pointer to a struct vmw_private | 552 | * @dev_priv: Pointer to a struct vmw_private |
| 568 | * | 553 | * |
| 569 | * This functions tries to determine the IOMMU setup and what actions | 554 | * This functions tries to determine what actions need to be taken by the |
| 570 | * need to be taken by the driver to make system pages visible to the | 555 | * driver to make system pages visible to the device. |
| 571 | * device. | ||
| 572 | * If this function decides that DMA is not possible, it returns -EINVAL. | 556 | * If this function decides that DMA is not possible, it returns -EINVAL. |
| 573 | * The driver may then try to disable features of the device that require | 557 | * The driver may then try to disable features of the device that require |
| 574 | * DMA. | 558 | * DMA. |
| @@ -578,23 +562,16 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv) | |||
| 578 | static const char *names[vmw_dma_map_max] = { | 562 | static const char *names[vmw_dma_map_max] = { |
| 579 | [vmw_dma_phys] = "Using physical TTM page addresses.", | 563 | [vmw_dma_phys] = "Using physical TTM page addresses.", |
| 580 | [vmw_dma_alloc_coherent] = "Using coherent TTM pages.", | 564 | [vmw_dma_alloc_coherent] = "Using coherent TTM pages.", |
| 581 | [vmw_dma_map_populate] = "Keeping DMA mappings.", | 565 | [vmw_dma_map_populate] = "Caching DMA mappings.", |
| 582 | [vmw_dma_map_bind] = "Giving up DMA mappings early."}; | 566 | [vmw_dma_map_bind] = "Giving up DMA mappings early."}; |
| 583 | 567 | ||
| 584 | if (vmw_force_coherent) | 568 | if (vmw_force_coherent) |
| 585 | dev_priv->map_mode = vmw_dma_alloc_coherent; | 569 | dev_priv->map_mode = vmw_dma_alloc_coherent; |
| 586 | else if (vmw_assume_iommu(dev_priv->dev)) | 570 | else if (vmw_restrict_iommu) |
| 587 | dev_priv->map_mode = vmw_dma_map_populate; | 571 | dev_priv->map_mode = vmw_dma_map_bind; |
| 588 | else if (!vmw_force_iommu) | ||
| 589 | dev_priv->map_mode = vmw_dma_phys; | ||
| 590 | else if (IS_ENABLED(CONFIG_SWIOTLB) && swiotlb_nr_tbl()) | ||
| 591 | dev_priv->map_mode = vmw_dma_alloc_coherent; | ||
| 592 | else | 572 | else |
| 593 | dev_priv->map_mode = vmw_dma_map_populate; | 573 | dev_priv->map_mode = vmw_dma_map_populate; |
| 594 | 574 | ||
| 595 | if (dev_priv->map_mode == vmw_dma_map_populate && vmw_restrict_iommu) | ||
| 596 | dev_priv->map_mode = vmw_dma_map_bind; | ||
| 597 | |||
| 598 | /* No TTM coherent page pool? FIXME: Ask TTM instead! */ | 575 | /* No TTM coherent page pool? FIXME: Ask TTM instead! */ |
| 599 | if (!(IS_ENABLED(CONFIG_SWIOTLB) || IS_ENABLED(CONFIG_INTEL_IOMMU)) && | 576 | if (!(IS_ENABLED(CONFIG_SWIOTLB) || IS_ENABLED(CONFIG_INTEL_IOMMU)) && |
| 600 | (dev_priv->map_mode == vmw_dma_alloc_coherent)) | 577 | (dev_priv->map_mode == vmw_dma_alloc_coherent)) |
diff --git a/drivers/gpu/ipu-v3/ipu-dp.c b/drivers/gpu/ipu-v3/ipu-dp.c index 9b2b3fa479c4..5e44ff1f2085 100644 --- a/drivers/gpu/ipu-v3/ipu-dp.c +++ b/drivers/gpu/ipu-v3/ipu-dp.c | |||
| @@ -195,7 +195,8 @@ int ipu_dp_setup_channel(struct ipu_dp *dp, | |||
| 195 | ipu_dp_csc_init(flow, flow->foreground.in_cs, flow->out_cs, | 195 | ipu_dp_csc_init(flow, flow->foreground.in_cs, flow->out_cs, |
| 196 | DP_COM_CONF_CSC_DEF_BOTH); | 196 | DP_COM_CONF_CSC_DEF_BOTH); |
| 197 | } else { | 197 | } else { |
| 198 | if (flow->foreground.in_cs == flow->out_cs) | 198 | if (flow->foreground.in_cs == IPUV3_COLORSPACE_UNKNOWN || |
| 199 | flow->foreground.in_cs == flow->out_cs) | ||
| 199 | /* | 200 | /* |
| 200 | * foreground identical to output, apply color | 201 | * foreground identical to output, apply color |
| 201 | * conversion on background | 202 | * conversion on background |
| @@ -261,6 +262,8 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync) | |||
| 261 | struct ipu_dp_priv *priv = flow->priv; | 262 | struct ipu_dp_priv *priv = flow->priv; |
| 262 | u32 reg, csc; | 263 | u32 reg, csc; |
| 263 | 264 | ||
| 265 | dp->in_cs = IPUV3_COLORSPACE_UNKNOWN; | ||
| 266 | |||
| 264 | if (!dp->foreground) | 267 | if (!dp->foreground) |
| 265 | return; | 268 | return; |
| 266 | 269 | ||
| @@ -268,8 +271,9 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync) | |||
| 268 | 271 | ||
| 269 | reg = readl(flow->base + DP_COM_CONF); | 272 | reg = readl(flow->base + DP_COM_CONF); |
| 270 | csc = reg & DP_COM_CONF_CSC_DEF_MASK; | 273 | csc = reg & DP_COM_CONF_CSC_DEF_MASK; |
| 271 | if (csc == DP_COM_CONF_CSC_DEF_FG) | 274 | reg &= ~DP_COM_CONF_CSC_DEF_MASK; |
| 272 | reg &= ~DP_COM_CONF_CSC_DEF_MASK; | 275 | if (csc == DP_COM_CONF_CSC_DEF_BOTH || csc == DP_COM_CONF_CSC_DEF_BG) |
| 276 | reg |= DP_COM_CONF_CSC_DEF_BG; | ||
| 273 | 277 | ||
| 274 | reg &= ~DP_COM_CONF_FG_EN; | 278 | reg &= ~DP_COM_CONF_FG_EN; |
| 275 | writel(reg, flow->base + DP_COM_CONF); | 279 | writel(reg, flow->base + DP_COM_CONF); |
| @@ -347,6 +351,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base) | |||
| 347 | mutex_init(&priv->mutex); | 351 | mutex_init(&priv->mutex); |
| 348 | 352 | ||
| 349 | for (i = 0; i < IPUV3_NUM_FLOWS; i++) { | 353 | for (i = 0; i < IPUV3_NUM_FLOWS; i++) { |
| 354 | priv->flow[i].background.in_cs = IPUV3_COLORSPACE_UNKNOWN; | ||
| 355 | priv->flow[i].foreground.in_cs = IPUV3_COLORSPACE_UNKNOWN; | ||
| 350 | priv->flow[i].foreground.foreground = true; | 356 | priv->flow[i].foreground.foreground = true; |
| 351 | priv->flow[i].base = priv->base + ipu_dp_flow_base[i]; | 357 | priv->flow[i].base = priv->base + ipu_dp_flow_base[i]; |
| 352 | priv->flow[i].priv = priv; | 358 | priv->flow[i].priv = priv; |
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 38af18645133..c480ca385ffb 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c | |||
| @@ -185,7 +185,7 @@ static int i2c_generic_bus_free(struct i2c_adapter *adap) | |||
| 185 | int i2c_generic_scl_recovery(struct i2c_adapter *adap) | 185 | int i2c_generic_scl_recovery(struct i2c_adapter *adap) |
| 186 | { | 186 | { |
| 187 | struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; | 187 | struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; |
| 188 | int i = 0, scl = 1, ret; | 188 | int i = 0, scl = 1, ret = 0; |
| 189 | 189 | ||
| 190 | if (bri->prepare_recovery) | 190 | if (bri->prepare_recovery) |
| 191 | bri->prepare_recovery(adap); | 191 | bri->prepare_recovery(adap); |
diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h index ea0bc6885517..32cc8fe7902f 100644 --- a/drivers/infiniband/core/uverbs.h +++ b/drivers/infiniband/core/uverbs.h | |||
| @@ -160,6 +160,7 @@ struct ib_uverbs_file { | |||
| 160 | 160 | ||
| 161 | struct mutex umap_lock; | 161 | struct mutex umap_lock; |
| 162 | struct list_head umaps; | 162 | struct list_head umaps; |
| 163 | struct page *disassociate_page; | ||
| 163 | 164 | ||
| 164 | struct idr idr; | 165 | struct idr idr; |
| 165 | /* spinlock protects write access to idr */ | 166 | /* spinlock protects write access to idr */ |
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index f2e7ffe6fc54..c489f545baae 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
| @@ -208,6 +208,9 @@ void ib_uverbs_release_file(struct kref *ref) | |||
| 208 | kref_put(&file->async_file->ref, | 208 | kref_put(&file->async_file->ref, |
| 209 | ib_uverbs_release_async_event_file); | 209 | ib_uverbs_release_async_event_file); |
| 210 | put_device(&file->device->dev); | 210 | put_device(&file->device->dev); |
| 211 | |||
| 212 | if (file->disassociate_page) | ||
| 213 | __free_pages(file->disassociate_page, 0); | ||
| 211 | kfree(file); | 214 | kfree(file); |
| 212 | } | 215 | } |
| 213 | 216 | ||
| @@ -877,9 +880,50 @@ static void rdma_umap_close(struct vm_area_struct *vma) | |||
| 877 | kfree(priv); | 880 | kfree(priv); |
| 878 | } | 881 | } |
| 879 | 882 | ||
| 883 | /* | ||
| 884 | * Once the zap_vma_ptes has been called touches to the VMA will come here and | ||
| 885 | * we return a dummy writable zero page for all the pfns. | ||
| 886 | */ | ||
| 887 | static vm_fault_t rdma_umap_fault(struct vm_fault *vmf) | ||
| 888 | { | ||
| 889 | struct ib_uverbs_file *ufile = vmf->vma->vm_file->private_data; | ||
| 890 | struct rdma_umap_priv *priv = vmf->vma->vm_private_data; | ||
| 891 | vm_fault_t ret = 0; | ||
| 892 | |||
| 893 | if (!priv) | ||
| 894 | return VM_FAULT_SIGBUS; | ||
| 895 | |||
| 896 | /* Read only pages can just use the system zero page. */ | ||
| 897 | if (!(vmf->vma->vm_flags & (VM_WRITE | VM_MAYWRITE))) { | ||
| 898 | vmf->page = ZERO_PAGE(vmf->address); | ||
| 899 | get_page(vmf->page); | ||
| 900 | return 0; | ||
| 901 | } | ||
| 902 | |||
| 903 | mutex_lock(&ufile->umap_lock); | ||
| 904 | if (!ufile->disassociate_page) | ||
| 905 | ufile->disassociate_page = | ||
| 906 | alloc_pages(vmf->gfp_mask | __GFP_ZERO, 0); | ||
| 907 | |||
| 908 | if (ufile->disassociate_page) { | ||
| 909 | /* | ||
| 910 | * This VMA is forced to always be shared so this doesn't have | ||
| 911 | * to worry about COW. | ||
| 912 | */ | ||
| 913 | vmf->page = ufile->disassociate_page; | ||
| 914 | get_page(vmf->page); | ||
| 915 | } else { | ||
| 916 | ret = VM_FAULT_SIGBUS; | ||
| 917 | } | ||
| 918 | mutex_unlock(&ufile->umap_lock); | ||
| 919 | |||
| 920 | return ret; | ||
| 921 | } | ||
| 922 | |||
| 880 | static const struct vm_operations_struct rdma_umap_ops = { | 923 | static const struct vm_operations_struct rdma_umap_ops = { |
| 881 | .open = rdma_umap_open, | 924 | .open = rdma_umap_open, |
| 882 | .close = rdma_umap_close, | 925 | .close = rdma_umap_close, |
| 926 | .fault = rdma_umap_fault, | ||
| 883 | }; | 927 | }; |
| 884 | 928 | ||
| 885 | static struct rdma_umap_priv *rdma_user_mmap_pre(struct ib_ucontext *ucontext, | 929 | static struct rdma_umap_priv *rdma_user_mmap_pre(struct ib_ucontext *ucontext, |
| @@ -889,6 +933,9 @@ static struct rdma_umap_priv *rdma_user_mmap_pre(struct ib_ucontext *ucontext, | |||
| 889 | struct ib_uverbs_file *ufile = ucontext->ufile; | 933 | struct ib_uverbs_file *ufile = ucontext->ufile; |
| 890 | struct rdma_umap_priv *priv; | 934 | struct rdma_umap_priv *priv; |
| 891 | 935 | ||
| 936 | if (!(vma->vm_flags & VM_SHARED)) | ||
| 937 | return ERR_PTR(-EINVAL); | ||
| 938 | |||
| 892 | if (vma->vm_end - vma->vm_start != size) | 939 | if (vma->vm_end - vma->vm_start != size) |
| 893 | return ERR_PTR(-EINVAL); | 940 | return ERR_PTR(-EINVAL); |
| 894 | 941 | ||
| @@ -992,7 +1039,7 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile) | |||
| 992 | * at a time to get the lock ordering right. Typically there | 1039 | * at a time to get the lock ordering right. Typically there |
| 993 | * will only be one mm, so no big deal. | 1040 | * will only be one mm, so no big deal. |
| 994 | */ | 1041 | */ |
| 995 | down_write(&mm->mmap_sem); | 1042 | down_read(&mm->mmap_sem); |
| 996 | if (!mmget_still_valid(mm)) | 1043 | if (!mmget_still_valid(mm)) |
| 997 | goto skip_mm; | 1044 | goto skip_mm; |
| 998 | mutex_lock(&ufile->umap_lock); | 1045 | mutex_lock(&ufile->umap_lock); |
| @@ -1006,11 +1053,10 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile) | |||
| 1006 | 1053 | ||
| 1007 | zap_vma_ptes(vma, vma->vm_start, | 1054 | zap_vma_ptes(vma, vma->vm_start, |
| 1008 | vma->vm_end - vma->vm_start); | 1055 | vma->vm_end - vma->vm_start); |
| 1009 | vma->vm_flags &= ~(VM_SHARED | VM_MAYSHARE); | ||
| 1010 | } | 1056 | } |
| 1011 | mutex_unlock(&ufile->umap_lock); | 1057 | mutex_unlock(&ufile->umap_lock); |
| 1012 | skip_mm: | 1058 | skip_mm: |
| 1013 | up_write(&mm->mmap_sem); | 1059 | up_read(&mm->mmap_sem); |
| 1014 | mmput(mm); | 1060 | mmput(mm); |
| 1015 | } | 1061 | } |
| 1016 | } | 1062 | } |
diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index 66cdf625534f..60cf9f03e941 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c | |||
| @@ -533,7 +533,7 @@ static int hns_roce_set_kernel_sq_size(struct hns_roce_dev *hr_dev, | |||
| 533 | 533 | ||
| 534 | static int hns_roce_qp_has_sq(struct ib_qp_init_attr *attr) | 534 | static int hns_roce_qp_has_sq(struct ib_qp_init_attr *attr) |
| 535 | { | 535 | { |
| 536 | if (attr->qp_type == IB_QPT_XRC_TGT) | 536 | if (attr->qp_type == IB_QPT_XRC_TGT || !attr->cap.max_send_wr) |
| 537 | return 0; | 537 | return 0; |
| 538 | 538 | ||
| 539 | return 1; | 539 | return 1; |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 0845e95d2d11..347e3cac254e 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -1119,6 +1119,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, | |||
| 1119 | if (MLX5_CAP_GEN(mdev, qp_packet_based)) | 1119 | if (MLX5_CAP_GEN(mdev, qp_packet_based)) |
| 1120 | resp.flags |= | 1120 | resp.flags |= |
| 1121 | MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE; | 1121 | MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE; |
| 1122 | |||
| 1123 | resp.flags |= MLX5_IB_QUERY_DEV_RESP_FLAGS_SCAT2CQE_DCT; | ||
| 1122 | } | 1124 | } |
| 1123 | 1125 | ||
| 1124 | if (field_avail(typeof(resp), sw_parsing_caps, | 1126 | if (field_avail(typeof(resp), sw_parsing_caps, |
| @@ -2066,6 +2068,7 @@ static int mlx5_ib_mmap_clock_info_page(struct mlx5_ib_dev *dev, | |||
| 2066 | 2068 | ||
| 2067 | if (vma->vm_flags & VM_WRITE) | 2069 | if (vma->vm_flags & VM_WRITE) |
| 2068 | return -EPERM; | 2070 | return -EPERM; |
| 2071 | vma->vm_flags &= ~VM_MAYWRITE; | ||
| 2069 | 2072 | ||
| 2070 | if (!dev->mdev->clock_info_page) | 2073 | if (!dev->mdev->clock_info_page) |
| 2071 | return -EOPNOTSUPP; | 2074 | return -EOPNOTSUPP; |
| @@ -2231,19 +2234,18 @@ static int mlx5_ib_mmap(struct ib_ucontext *ibcontext, struct vm_area_struct *vm | |||
| 2231 | 2234 | ||
| 2232 | if (vma->vm_flags & VM_WRITE) | 2235 | if (vma->vm_flags & VM_WRITE) |
| 2233 | return -EPERM; | 2236 | return -EPERM; |
| 2237 | vma->vm_flags &= ~VM_MAYWRITE; | ||
| 2234 | 2238 | ||
| 2235 | /* Don't expose to user-space information it shouldn't have */ | 2239 | /* Don't expose to user-space information it shouldn't have */ |
| 2236 | if (PAGE_SIZE > 4096) | 2240 | if (PAGE_SIZE > 4096) |
| 2237 | return -EOPNOTSUPP; | 2241 | return -EOPNOTSUPP; |
| 2238 | 2242 | ||
| 2239 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
| 2240 | pfn = (dev->mdev->iseg_base + | 2243 | pfn = (dev->mdev->iseg_base + |
| 2241 | offsetof(struct mlx5_init_seg, internal_timer_h)) >> | 2244 | offsetof(struct mlx5_init_seg, internal_timer_h)) >> |
| 2242 | PAGE_SHIFT; | 2245 | PAGE_SHIFT; |
| 2243 | if (io_remap_pfn_range(vma, vma->vm_start, pfn, | 2246 | return rdma_user_mmap_io(&context->ibucontext, vma, pfn, |
| 2244 | PAGE_SIZE, vma->vm_page_prot)) | 2247 | PAGE_SIZE, |
| 2245 | return -EAGAIN; | 2248 | pgprot_noncached(vma->vm_page_prot)); |
| 2246 | break; | ||
| 2247 | case MLX5_IB_MMAP_CLOCK_INFO: | 2249 | case MLX5_IB_MMAP_CLOCK_INFO: |
| 2248 | return mlx5_ib_mmap_clock_info_page(dev, vma, context); | 2250 | return mlx5_ib_mmap_clock_info_page(dev, vma, context); |
| 2249 | 2251 | ||
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index ef7d69269a88..fc67d78ca959 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
| @@ -1818,13 +1818,16 @@ static void configure_responder_scat_cqe(struct ib_qp_init_attr *init_attr, | |||
| 1818 | 1818 | ||
| 1819 | rcqe_sz = mlx5_ib_get_cqe_size(init_attr->recv_cq); | 1819 | rcqe_sz = mlx5_ib_get_cqe_size(init_attr->recv_cq); |
| 1820 | 1820 | ||
| 1821 | if (rcqe_sz == 128) { | 1821 | if (init_attr->qp_type == MLX5_IB_QPT_DCT) { |
| 1822 | MLX5_SET(qpc, qpc, cs_res, MLX5_RES_SCAT_DATA64_CQE); | 1822 | if (rcqe_sz == 128) |
| 1823 | MLX5_SET(dctc, qpc, cs_res, MLX5_RES_SCAT_DATA64_CQE); | ||
| 1824 | |||
| 1823 | return; | 1825 | return; |
| 1824 | } | 1826 | } |
| 1825 | 1827 | ||
| 1826 | if (init_attr->qp_type != MLX5_IB_QPT_DCT) | 1828 | MLX5_SET(qpc, qpc, cs_res, |
| 1827 | MLX5_SET(qpc, qpc, cs_res, MLX5_RES_SCAT_DATA32_CQE); | 1829 | rcqe_sz == 128 ? MLX5_RES_SCAT_DATA64_CQE : |
| 1830 | MLX5_RES_SCAT_DATA32_CQE); | ||
| 1828 | } | 1831 | } |
| 1829 | 1832 | ||
| 1830 | static void configure_requester_scat_cqe(struct mlx5_ib_dev *dev, | 1833 | static void configure_requester_scat_cqe(struct mlx5_ib_dev *dev, |
diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c index 728795043496..0bb6e39dd03a 100644 --- a/drivers/infiniband/sw/rdmavt/mr.c +++ b/drivers/infiniband/sw/rdmavt/mr.c | |||
| @@ -608,11 +608,6 @@ static int rvt_set_page(struct ib_mr *ibmr, u64 addr) | |||
| 608 | if (unlikely(mapped_segs == mr->mr.max_segs)) | 608 | if (unlikely(mapped_segs == mr->mr.max_segs)) |
| 609 | return -ENOMEM; | 609 | return -ENOMEM; |
| 610 | 610 | ||
| 611 | if (mr->mr.length == 0) { | ||
| 612 | mr->mr.user_base = addr; | ||
| 613 | mr->mr.iova = addr; | ||
| 614 | } | ||
| 615 | |||
| 616 | m = mapped_segs / RVT_SEGSZ; | 611 | m = mapped_segs / RVT_SEGSZ; |
| 617 | n = mapped_segs % RVT_SEGSZ; | 612 | n = mapped_segs % RVT_SEGSZ; |
| 618 | mr->mr.map[m]->segs[n].vaddr = (void *)addr; | 613 | mr->mr.map[m]->segs[n].vaddr = (void *)addr; |
| @@ -630,17 +625,24 @@ static int rvt_set_page(struct ib_mr *ibmr, u64 addr) | |||
| 630 | * @sg_nents: number of entries in sg | 625 | * @sg_nents: number of entries in sg |
| 631 | * @sg_offset: offset in bytes into sg | 626 | * @sg_offset: offset in bytes into sg |
| 632 | * | 627 | * |
| 628 | * Overwrite rvt_mr length with mr length calculated by ib_sg_to_pages. | ||
| 629 | * | ||
| 633 | * Return: number of sg elements mapped to the memory region | 630 | * Return: number of sg elements mapped to the memory region |
| 634 | */ | 631 | */ |
| 635 | int rvt_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, | 632 | int rvt_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, |
| 636 | int sg_nents, unsigned int *sg_offset) | 633 | int sg_nents, unsigned int *sg_offset) |
| 637 | { | 634 | { |
| 638 | struct rvt_mr *mr = to_imr(ibmr); | 635 | struct rvt_mr *mr = to_imr(ibmr); |
| 636 | int ret; | ||
| 639 | 637 | ||
| 640 | mr->mr.length = 0; | 638 | mr->mr.length = 0; |
| 641 | mr->mr.page_shift = PAGE_SHIFT; | 639 | mr->mr.page_shift = PAGE_SHIFT; |
| 642 | return ib_sg_to_pages(ibmr, sg, sg_nents, sg_offset, | 640 | ret = ib_sg_to_pages(ibmr, sg, sg_nents, sg_offset, rvt_set_page); |
| 643 | rvt_set_page); | 641 | mr->mr.user_base = ibmr->iova; |
| 642 | mr->mr.iova = ibmr->iova; | ||
| 643 | mr->mr.offset = ibmr->iova - (u64)mr->mr.map[0]->segs[0].vaddr; | ||
| 644 | mr->mr.length = (size_t)ibmr->length; | ||
| 645 | return ret; | ||
| 644 | } | 646 | } |
| 645 | 647 | ||
| 646 | /** | 648 | /** |
| @@ -671,6 +673,7 @@ int rvt_fast_reg_mr(struct rvt_qp *qp, struct ib_mr *ibmr, u32 key, | |||
| 671 | ibmr->rkey = key; | 673 | ibmr->rkey = key; |
| 672 | mr->mr.lkey = key; | 674 | mr->mr.lkey = key; |
| 673 | mr->mr.access_flags = access; | 675 | mr->mr.access_flags = access; |
| 676 | mr->mr.iova = ibmr->iova; | ||
| 674 | atomic_set(&mr->mr.lkey_invalid, 0); | 677 | atomic_set(&mr->mr.lkey_invalid, 0); |
| 675 | 678 | ||
| 676 | return 0; | 679 | return 0; |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index a878351f1643..52d7f55fca32 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
| @@ -420,7 +420,7 @@ config KEYBOARD_MPR121 | |||
| 420 | 420 | ||
| 421 | config KEYBOARD_SNVS_PWRKEY | 421 | config KEYBOARD_SNVS_PWRKEY |
| 422 | tristate "IMX SNVS Power Key Driver" | 422 | tristate "IMX SNVS Power Key Driver" |
| 423 | depends on SOC_IMX6SX || SOC_IMX7D | 423 | depends on ARCH_MXC || COMPILE_TEST |
| 424 | depends on OF | 424 | depends on OF |
| 425 | help | 425 | help |
| 426 | This is the snvs powerkey driver for the Freescale i.MX application | 426 | This is the snvs powerkey driver for the Freescale i.MX application |
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index fc3ab93b7aea..7fb358f96195 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c | |||
| @@ -860,7 +860,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev, | |||
| 860 | 860 | ||
| 861 | error = rmi_register_function(fn); | 861 | error = rmi_register_function(fn); |
| 862 | if (error) | 862 | if (error) |
| 863 | goto err_put_fn; | 863 | return error; |
| 864 | 864 | ||
| 865 | if (pdt->function_number == 0x01) | 865 | if (pdt->function_number == 0x01) |
| 866 | data->f01_container = fn; | 866 | data->f01_container = fn; |
| @@ -870,10 +870,6 @@ static int rmi_create_function(struct rmi_device *rmi_dev, | |||
| 870 | list_add_tail(&fn->node, &data->function_list); | 870 | list_add_tail(&fn->node, &data->function_list); |
| 871 | 871 | ||
| 872 | return RMI_SCAN_CONTINUE; | 872 | return RMI_SCAN_CONTINUE; |
| 873 | |||
| 874 | err_put_fn: | ||
| 875 | put_device(&fn->dev); | ||
| 876 | return error; | ||
| 877 | } | 873 | } |
| 878 | 874 | ||
| 879 | void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake) | 875 | void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake) |
diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c index df64d6aed4f7..93901ebd122a 100644 --- a/drivers/input/rmi4/rmi_f11.c +++ b/drivers/input/rmi4/rmi_f11.c | |||
| @@ -1230,7 +1230,7 @@ static int rmi_f11_initialize(struct rmi_function *fn) | |||
| 1230 | } | 1230 | } |
| 1231 | 1231 | ||
| 1232 | rc = f11_write_control_regs(fn, &f11->sens_query, | 1232 | rc = f11_write_control_regs(fn, &f11->sens_query, |
| 1233 | &f11->dev_controls, fn->fd.query_base_addr); | 1233 | &f11->dev_controls, fn->fd.control_base_addr); |
| 1234 | if (rc) | 1234 | if (rc) |
| 1235 | dev_warn(&fn->dev, "Failed to write control registers\n"); | 1235 | dev_warn(&fn->dev, "Failed to write control registers\n"); |
| 1236 | 1236 | ||
diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c index f38e5c1b87e4..d984538980e2 100644 --- a/drivers/mtd/nand/raw/marvell_nand.c +++ b/drivers/mtd/nand/raw/marvell_nand.c | |||
| @@ -722,12 +722,6 @@ static void marvell_nfc_select_target(struct nand_chip *chip, | |||
| 722 | struct marvell_nfc *nfc = to_marvell_nfc(chip->controller); | 722 | struct marvell_nfc *nfc = to_marvell_nfc(chip->controller); |
| 723 | u32 ndcr_generic; | 723 | u32 ndcr_generic; |
| 724 | 724 | ||
| 725 | if (chip == nfc->selected_chip && die_nr == marvell_nand->selected_die) | ||
| 726 | return; | ||
| 727 | |||
| 728 | writel_relaxed(marvell_nand->ndtr0, nfc->regs + NDTR0); | ||
| 729 | writel_relaxed(marvell_nand->ndtr1, nfc->regs + NDTR1); | ||
| 730 | |||
| 731 | /* | 725 | /* |
| 732 | * Reset the NDCR register to a clean state for this particular chip, | 726 | * Reset the NDCR register to a clean state for this particular chip, |
| 733 | * also clear ND_RUN bit. | 727 | * also clear ND_RUN bit. |
| @@ -739,6 +733,12 @@ static void marvell_nfc_select_target(struct nand_chip *chip, | |||
| 739 | /* Also reset the interrupt status register */ | 733 | /* Also reset the interrupt status register */ |
| 740 | marvell_nfc_clear_int(nfc, NDCR_ALL_INT); | 734 | marvell_nfc_clear_int(nfc, NDCR_ALL_INT); |
| 741 | 735 | ||
| 736 | if (chip == nfc->selected_chip && die_nr == marvell_nand->selected_die) | ||
| 737 | return; | ||
| 738 | |||
| 739 | writel_relaxed(marvell_nand->ndtr0, nfc->regs + NDTR0); | ||
| 740 | writel_relaxed(marvell_nand->ndtr1, nfc->regs + NDTR1); | ||
| 741 | |||
| 742 | nfc->selected_chip = chip; | 742 | nfc->selected_chip = chip; |
| 743 | marvell_nand->selected_die = die_nr; | 743 | marvell_nand->selected_die = die_nr; |
| 744 | } | 744 | } |
diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c index e6234d209787..4212bc4a5f31 100644 --- a/drivers/net/dsa/bcm_sf2_cfp.c +++ b/drivers/net/dsa/bcm_sf2_cfp.c | |||
| @@ -886,6 +886,9 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port, | |||
| 886 | fs->m_ext.data[1])) | 886 | fs->m_ext.data[1])) |
| 887 | return -EINVAL; | 887 | return -EINVAL; |
| 888 | 888 | ||
| 889 | if (fs->location != RX_CLS_LOC_ANY && fs->location >= CFP_NUM_RULES) | ||
| 890 | return -EINVAL; | ||
| 891 | |||
| 889 | if (fs->location != RX_CLS_LOC_ANY && | 892 | if (fs->location != RX_CLS_LOC_ANY && |
| 890 | test_bit(fs->location, priv->cfp.used)) | 893 | test_bit(fs->location, priv->cfp.used)) |
| 891 | return -EBUSY; | 894 | return -EBUSY; |
| @@ -974,6 +977,9 @@ static int bcm_sf2_cfp_rule_del(struct bcm_sf2_priv *priv, int port, u32 loc) | |||
| 974 | struct cfp_rule *rule; | 977 | struct cfp_rule *rule; |
| 975 | int ret; | 978 | int ret; |
| 976 | 979 | ||
| 980 | if (loc >= CFP_NUM_RULES) | ||
| 981 | return -EINVAL; | ||
| 982 | |||
| 977 | /* Refuse deleting unused rules, and those that are not unique since | 983 | /* Refuse deleting unused rules, and those that are not unique since |
| 978 | * that could leave IPv6 rules with one of the chained rule in the | 984 | * that could leave IPv6 rules with one of the chained rule in the |
| 979 | * table. | 985 | * table. |
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 526f36dcb204..a0de3c368f4a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
| @@ -1625,7 +1625,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, | |||
| 1625 | netdev_warn(bp->dev, "RX buffer error %x\n", rx_err); | 1625 | netdev_warn(bp->dev, "RX buffer error %x\n", rx_err); |
| 1626 | bnxt_sched_reset(bp, rxr); | 1626 | bnxt_sched_reset(bp, rxr); |
| 1627 | } | 1627 | } |
| 1628 | goto next_rx; | 1628 | goto next_rx_no_len; |
| 1629 | } | 1629 | } |
| 1630 | 1630 | ||
| 1631 | len = le32_to_cpu(rxcmp->rx_cmp_len_flags_type) >> RX_CMP_LEN_SHIFT; | 1631 | len = le32_to_cpu(rxcmp->rx_cmp_len_flags_type) >> RX_CMP_LEN_SHIFT; |
| @@ -1706,12 +1706,13 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, | |||
| 1706 | rc = 1; | 1706 | rc = 1; |
| 1707 | 1707 | ||
| 1708 | next_rx: | 1708 | next_rx: |
| 1709 | rxr->rx_prod = NEXT_RX(prod); | ||
| 1710 | rxr->rx_next_cons = NEXT_RX(cons); | ||
| 1711 | |||
| 1712 | cpr->rx_packets += 1; | 1709 | cpr->rx_packets += 1; |
| 1713 | cpr->rx_bytes += len; | 1710 | cpr->rx_bytes += len; |
| 1714 | 1711 | ||
| 1712 | next_rx_no_len: | ||
| 1713 | rxr->rx_prod = NEXT_RX(prod); | ||
| 1714 | rxr->rx_next_cons = NEXT_RX(cons); | ||
| 1715 | |||
| 1715 | next_rx_no_prod_no_len: | 1716 | next_rx_no_prod_no_len: |
| 1716 | *raw_cons = tmp_raw_cons; | 1717 | *raw_cons = tmp_raw_cons; |
| 1717 | 1718 | ||
| @@ -5135,10 +5136,10 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path) | |||
| 5135 | for (i = 0; i < bp->tx_nr_rings; i++) { | 5136 | for (i = 0; i < bp->tx_nr_rings; i++) { |
| 5136 | struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; | 5137 | struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; |
| 5137 | struct bnxt_ring_struct *ring = &txr->tx_ring_struct; | 5138 | struct bnxt_ring_struct *ring = &txr->tx_ring_struct; |
| 5138 | u32 cmpl_ring_id; | ||
| 5139 | 5139 | ||
| 5140 | cmpl_ring_id = bnxt_cp_ring_for_tx(bp, txr); | ||
| 5141 | if (ring->fw_ring_id != INVALID_HW_RING_ID) { | 5140 | if (ring->fw_ring_id != INVALID_HW_RING_ID) { |
| 5141 | u32 cmpl_ring_id = bnxt_cp_ring_for_tx(bp, txr); | ||
| 5142 | |||
| 5142 | hwrm_ring_free_send_msg(bp, ring, | 5143 | hwrm_ring_free_send_msg(bp, ring, |
| 5143 | RING_FREE_REQ_RING_TYPE_TX, | 5144 | RING_FREE_REQ_RING_TYPE_TX, |
| 5144 | close_path ? cmpl_ring_id : | 5145 | close_path ? cmpl_ring_id : |
| @@ -5151,10 +5152,10 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path) | |||
| 5151 | struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i]; | 5152 | struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i]; |
| 5152 | struct bnxt_ring_struct *ring = &rxr->rx_ring_struct; | 5153 | struct bnxt_ring_struct *ring = &rxr->rx_ring_struct; |
| 5153 | u32 grp_idx = rxr->bnapi->index; | 5154 | u32 grp_idx = rxr->bnapi->index; |
| 5154 | u32 cmpl_ring_id; | ||
| 5155 | 5155 | ||
| 5156 | cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr); | ||
| 5157 | if (ring->fw_ring_id != INVALID_HW_RING_ID) { | 5156 | if (ring->fw_ring_id != INVALID_HW_RING_ID) { |
| 5157 | u32 cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr); | ||
| 5158 | |||
| 5158 | hwrm_ring_free_send_msg(bp, ring, | 5159 | hwrm_ring_free_send_msg(bp, ring, |
| 5159 | RING_FREE_REQ_RING_TYPE_RX, | 5160 | RING_FREE_REQ_RING_TYPE_RX, |
| 5160 | close_path ? cmpl_ring_id : | 5161 | close_path ? cmpl_ring_id : |
| @@ -5173,10 +5174,10 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path) | |||
| 5173 | struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i]; | 5174 | struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i]; |
| 5174 | struct bnxt_ring_struct *ring = &rxr->rx_agg_ring_struct; | 5175 | struct bnxt_ring_struct *ring = &rxr->rx_agg_ring_struct; |
| 5175 | u32 grp_idx = rxr->bnapi->index; | 5176 | u32 grp_idx = rxr->bnapi->index; |
| 5176 | u32 cmpl_ring_id; | ||
| 5177 | 5177 | ||
| 5178 | cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr); | ||
| 5179 | if (ring->fw_ring_id != INVALID_HW_RING_ID) { | 5178 | if (ring->fw_ring_id != INVALID_HW_RING_ID) { |
| 5179 | u32 cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr); | ||
| 5180 | |||
| 5180 | hwrm_ring_free_send_msg(bp, ring, type, | 5181 | hwrm_ring_free_send_msg(bp, ring, type, |
| 5181 | close_path ? cmpl_ring_id : | 5182 | close_path ? cmpl_ring_id : |
| 5182 | INVALID_HW_RING_ID); | 5183 | INVALID_HW_RING_ID); |
| @@ -5315,17 +5316,16 @@ __bnxt_hwrm_reserve_pf_rings(struct bnxt *bp, struct hwrm_func_cfg_input *req, | |||
| 5315 | req->num_tx_rings = cpu_to_le16(tx_rings); | 5316 | req->num_tx_rings = cpu_to_le16(tx_rings); |
| 5316 | if (BNXT_NEW_RM(bp)) { | 5317 | if (BNXT_NEW_RM(bp)) { |
| 5317 | enables |= rx_rings ? FUNC_CFG_REQ_ENABLES_NUM_RX_RINGS : 0; | 5318 | enables |= rx_rings ? FUNC_CFG_REQ_ENABLES_NUM_RX_RINGS : 0; |
| 5319 | enables |= stats ? FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0; | ||
| 5318 | if (bp->flags & BNXT_FLAG_CHIP_P5) { | 5320 | if (bp->flags & BNXT_FLAG_CHIP_P5) { |
| 5319 | enables |= cp_rings ? FUNC_CFG_REQ_ENABLES_NUM_MSIX : 0; | 5321 | enables |= cp_rings ? FUNC_CFG_REQ_ENABLES_NUM_MSIX : 0; |
| 5320 | enables |= tx_rings + ring_grps ? | 5322 | enables |= tx_rings + ring_grps ? |
| 5321 | FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS | | 5323 | FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS : 0; |
| 5322 | FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0; | ||
| 5323 | enables |= rx_rings ? | 5324 | enables |= rx_rings ? |
| 5324 | FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0; | 5325 | FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0; |
| 5325 | } else { | 5326 | } else { |
| 5326 | enables |= cp_rings ? | 5327 | enables |= cp_rings ? |
| 5327 | FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS | | 5328 | FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS : 0; |
| 5328 | FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0; | ||
| 5329 | enables |= ring_grps ? | 5329 | enables |= ring_grps ? |
| 5330 | FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS | | 5330 | FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS | |
| 5331 | FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0; | 5331 | FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0; |
| @@ -5365,14 +5365,13 @@ __bnxt_hwrm_reserve_vf_rings(struct bnxt *bp, | |||
| 5365 | enables |= tx_rings ? FUNC_VF_CFG_REQ_ENABLES_NUM_TX_RINGS : 0; | 5365 | enables |= tx_rings ? FUNC_VF_CFG_REQ_ENABLES_NUM_TX_RINGS : 0; |
| 5366 | enables |= rx_rings ? FUNC_VF_CFG_REQ_ENABLES_NUM_RX_RINGS | | 5366 | enables |= rx_rings ? FUNC_VF_CFG_REQ_ENABLES_NUM_RX_RINGS | |
| 5367 | FUNC_VF_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0; | 5367 | FUNC_VF_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS : 0; |
| 5368 | enables |= stats ? FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0; | ||
| 5368 | if (bp->flags & BNXT_FLAG_CHIP_P5) { | 5369 | if (bp->flags & BNXT_FLAG_CHIP_P5) { |
| 5369 | enables |= tx_rings + ring_grps ? | 5370 | enables |= tx_rings + ring_grps ? |
| 5370 | FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS | | 5371 | FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS : 0; |
| 5371 | FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0; | ||
| 5372 | } else { | 5372 | } else { |
| 5373 | enables |= cp_rings ? | 5373 | enables |= cp_rings ? |
| 5374 | FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS | | 5374 | FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS : 0; |
| 5375 | FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0; | ||
| 5376 | enables |= ring_grps ? | 5375 | enables |= ring_grps ? |
| 5377 | FUNC_VF_CFG_REQ_ENABLES_NUM_HW_RING_GRPS : 0; | 5376 | FUNC_VF_CFG_REQ_ENABLES_NUM_HW_RING_GRPS : 0; |
| 5378 | } | 5377 | } |
| @@ -6753,6 +6752,7 @@ static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp) | |||
| 6753 | struct hwrm_queue_pri2cos_qcfg_input req2 = {0}; | 6752 | struct hwrm_queue_pri2cos_qcfg_input req2 = {0}; |
| 6754 | struct hwrm_port_qstats_ext_input req = {0}; | 6753 | struct hwrm_port_qstats_ext_input req = {0}; |
| 6755 | struct bnxt_pf_info *pf = &bp->pf; | 6754 | struct bnxt_pf_info *pf = &bp->pf; |
| 6755 | u32 tx_stat_size; | ||
| 6756 | int rc; | 6756 | int rc; |
| 6757 | 6757 | ||
| 6758 | if (!(bp->flags & BNXT_FLAG_PORT_STATS_EXT)) | 6758 | if (!(bp->flags & BNXT_FLAG_PORT_STATS_EXT)) |
| @@ -6762,13 +6762,16 @@ static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp) | |||
| 6762 | req.port_id = cpu_to_le16(pf->port_id); | 6762 | req.port_id = cpu_to_le16(pf->port_id); |
| 6763 | req.rx_stat_size = cpu_to_le16(sizeof(struct rx_port_stats_ext)); | 6763 | req.rx_stat_size = cpu_to_le16(sizeof(struct rx_port_stats_ext)); |
| 6764 | req.rx_stat_host_addr = cpu_to_le64(bp->hw_rx_port_stats_ext_map); | 6764 | req.rx_stat_host_addr = cpu_to_le64(bp->hw_rx_port_stats_ext_map); |
| 6765 | req.tx_stat_size = cpu_to_le16(sizeof(struct tx_port_stats_ext)); | 6765 | tx_stat_size = bp->hw_tx_port_stats_ext ? |
| 6766 | sizeof(*bp->hw_tx_port_stats_ext) : 0; | ||
| 6767 | req.tx_stat_size = cpu_to_le16(tx_stat_size); | ||
| 6766 | req.tx_stat_host_addr = cpu_to_le64(bp->hw_tx_port_stats_ext_map); | 6768 | req.tx_stat_host_addr = cpu_to_le64(bp->hw_tx_port_stats_ext_map); |
| 6767 | mutex_lock(&bp->hwrm_cmd_lock); | 6769 | mutex_lock(&bp->hwrm_cmd_lock); |
| 6768 | rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); | 6770 | rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); |
| 6769 | if (!rc) { | 6771 | if (!rc) { |
| 6770 | bp->fw_rx_stats_ext_size = le16_to_cpu(resp->rx_stat_size) / 8; | 6772 | bp->fw_rx_stats_ext_size = le16_to_cpu(resp->rx_stat_size) / 8; |
| 6771 | bp->fw_tx_stats_ext_size = le16_to_cpu(resp->tx_stat_size) / 8; | 6773 | bp->fw_tx_stats_ext_size = tx_stat_size ? |
| 6774 | le16_to_cpu(resp->tx_stat_size) / 8 : 0; | ||
| 6772 | } else { | 6775 | } else { |
| 6773 | bp->fw_rx_stats_ext_size = 0; | 6776 | bp->fw_rx_stats_ext_size = 0; |
| 6774 | bp->fw_tx_stats_ext_size = 0; | 6777 | bp->fw_tx_stats_ext_size = 0; |
| @@ -8961,8 +8964,15 @@ static int bnxt_cfg_rx_mode(struct bnxt *bp) | |||
| 8961 | 8964 | ||
| 8962 | skip_uc: | 8965 | skip_uc: |
| 8963 | rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0); | 8966 | rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0); |
| 8967 | if (rc && vnic->mc_list_count) { | ||
| 8968 | netdev_info(bp->dev, "Failed setting MC filters rc: %d, turning on ALL_MCAST mode\n", | ||
| 8969 | rc); | ||
| 8970 | vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST; | ||
| 8971 | vnic->mc_list_count = 0; | ||
| 8972 | rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0); | ||
| 8973 | } | ||
| 8964 | if (rc) | 8974 | if (rc) |
| 8965 | netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %x\n", | 8975 | netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %d\n", |
| 8966 | rc); | 8976 | rc); |
| 8967 | 8977 | ||
| 8968 | return rc; | 8978 | return rc; |
| @@ -10699,6 +10709,7 @@ init_err_cleanup_tc: | |||
| 10699 | bnxt_clear_int_mode(bp); | 10709 | bnxt_clear_int_mode(bp); |
| 10700 | 10710 | ||
| 10701 | init_err_pci_clean: | 10711 | init_err_pci_clean: |
| 10712 | bnxt_free_hwrm_short_cmd_req(bp); | ||
| 10702 | bnxt_free_hwrm_resources(bp); | 10713 | bnxt_free_hwrm_resources(bp); |
| 10703 | bnxt_free_ctx_mem(bp); | 10714 | bnxt_free_ctx_mem(bp); |
| 10704 | kfree(bp->ctx); | 10715 | kfree(bp->ctx); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index 062a600fa5a7..21428537e231 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | |||
| @@ -333,6 +333,9 @@ static int stm32mp1_parse_data(struct stm32_dwmac *dwmac, | |||
| 333 | */ | 333 | */ |
| 334 | dwmac->irq_pwr_wakeup = platform_get_irq_byname(pdev, | 334 | dwmac->irq_pwr_wakeup = platform_get_irq_byname(pdev, |
| 335 | "stm32_pwr_wakeup"); | 335 | "stm32_pwr_wakeup"); |
| 336 | if (dwmac->irq_pwr_wakeup == -EPROBE_DEFER) | ||
| 337 | return -EPROBE_DEFER; | ||
| 338 | |||
| 336 | if (!dwmac->clk_eth_ck && dwmac->irq_pwr_wakeup >= 0) { | 339 | if (!dwmac->clk_eth_ck && dwmac->irq_pwr_wakeup >= 0) { |
| 337 | err = device_init_wakeup(&pdev->dev, true); | 340 | err = device_init_wakeup(&pdev->dev, true); |
| 338 | if (err) { | 341 | if (err) { |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index cc1e887e47b5..26db6aa002d1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | |||
| @@ -160,7 +160,7 @@ static const struct dmi_system_id quark_pci_dmi[] = { | |||
| 160 | .driver_data = (void *)&galileo_stmmac_dmi_data, | 160 | .driver_data = (void *)&galileo_stmmac_dmi_data, |
| 161 | }, | 161 | }, |
| 162 | /* | 162 | /* |
| 163 | * There are 2 types of SIMATIC IOT2000: IOT20202 and IOT2040. | 163 | * There are 2 types of SIMATIC IOT2000: IOT2020 and IOT2040. |
| 164 | * The asset tag "6ES7647-0AA00-0YA2" is only for IOT2020 which | 164 | * The asset tag "6ES7647-0AA00-0YA2" is only for IOT2020 which |
| 165 | * has only one pci network device while other asset tags are | 165 | * has only one pci network device while other asset tags are |
| 166 | * for IOT2040 which has two. | 166 | * for IOT2040 which has two. |
diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c index c589f5ae75bb..8bb53ec8d9cf 100644 --- a/drivers/net/ieee802154/mcr20a.c +++ b/drivers/net/ieee802154/mcr20a.c | |||
| @@ -533,6 +533,8 @@ mcr20a_start(struct ieee802154_hw *hw) | |||
| 533 | dev_dbg(printdev(lp), "no slotted operation\n"); | 533 | dev_dbg(printdev(lp), "no slotted operation\n"); |
| 534 | ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1, | 534 | ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1, |
| 535 | DAR_PHY_CTRL1_SLOTTED, 0x0); | 535 | DAR_PHY_CTRL1_SLOTTED, 0x0); |
| 536 | if (ret < 0) | ||
| 537 | return ret; | ||
| 536 | 538 | ||
| 537 | /* enable irq */ | 539 | /* enable irq */ |
| 538 | enable_irq(lp->spi->irq); | 540 | enable_irq(lp->spi->irq); |
| @@ -540,11 +542,15 @@ mcr20a_start(struct ieee802154_hw *hw) | |||
| 540 | /* Unmask SEQ interrupt */ | 542 | /* Unmask SEQ interrupt */ |
| 541 | ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL2, | 543 | ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL2, |
| 542 | DAR_PHY_CTRL2_SEQMSK, 0x0); | 544 | DAR_PHY_CTRL2_SEQMSK, 0x0); |
| 545 | if (ret < 0) | ||
| 546 | return ret; | ||
| 543 | 547 | ||
| 544 | /* Start the RX sequence */ | 548 | /* Start the RX sequence */ |
| 545 | dev_dbg(printdev(lp), "start the RX sequence\n"); | 549 | dev_dbg(printdev(lp), "start the RX sequence\n"); |
| 546 | ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1, | 550 | ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1, |
| 547 | DAR_PHY_CTRL1_XCVSEQ_MASK, MCR20A_XCVSEQ_RX); | 551 | DAR_PHY_CTRL1_XCVSEQ_MASK, MCR20A_XCVSEQ_RX); |
| 552 | if (ret < 0) | ||
| 553 | return ret; | ||
| 548 | 554 | ||
| 549 | return 0; | 555 | return 0; |
| 550 | } | 556 | } |
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index a7e8c8113d97..a7796134e3be 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
| @@ -1597,9 +1597,10 @@ static int marvell_get_sset_count(struct phy_device *phydev) | |||
| 1597 | 1597 | ||
| 1598 | static void marvell_get_strings(struct phy_device *phydev, u8 *data) | 1598 | static void marvell_get_strings(struct phy_device *phydev, u8 *data) |
| 1599 | { | 1599 | { |
| 1600 | int count = marvell_get_sset_count(phydev); | ||
| 1600 | int i; | 1601 | int i; |
| 1601 | 1602 | ||
| 1602 | for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++) { | 1603 | for (i = 0; i < count; i++) { |
| 1603 | strlcpy(data + i * ETH_GSTRING_LEN, | 1604 | strlcpy(data + i * ETH_GSTRING_LEN, |
| 1604 | marvell_hw_stats[i].string, ETH_GSTRING_LEN); | 1605 | marvell_hw_stats[i].string, ETH_GSTRING_LEN); |
| 1605 | } | 1606 | } |
| @@ -1627,9 +1628,10 @@ static u64 marvell_get_stat(struct phy_device *phydev, int i) | |||
| 1627 | static void marvell_get_stats(struct phy_device *phydev, | 1628 | static void marvell_get_stats(struct phy_device *phydev, |
| 1628 | struct ethtool_stats *stats, u64 *data) | 1629 | struct ethtool_stats *stats, u64 *data) |
| 1629 | { | 1630 | { |
| 1631 | int count = marvell_get_sset_count(phydev); | ||
| 1630 | int i; | 1632 | int i; |
| 1631 | 1633 | ||
| 1632 | for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++) | 1634 | for (i = 0; i < count; i++) |
| 1633 | data[i] = marvell_get_stat(phydev, i); | 1635 | data[i] = marvell_get_stat(phydev, i); |
| 1634 | } | 1636 | } |
| 1635 | 1637 | ||
diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c index f4e93f5fc204..ea90db3c7705 100644 --- a/drivers/net/slip/slhc.c +++ b/drivers/net/slip/slhc.c | |||
| @@ -153,7 +153,7 @@ out_fail: | |||
| 153 | void | 153 | void |
| 154 | slhc_free(struct slcompress *comp) | 154 | slhc_free(struct slcompress *comp) |
| 155 | { | 155 | { |
| 156 | if ( comp == NULLSLCOMPR ) | 156 | if ( IS_ERR_OR_NULL(comp) ) |
| 157 | return; | 157 | return; |
| 158 | 158 | ||
| 159 | if ( comp->tstate != NULLSLSTATE ) | 159 | if ( comp->tstate != NULLSLSTATE ) |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 18c4e5d17b05..5c3ac97519b7 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -1131,9 +1131,16 @@ static const struct usb_device_id products[] = { | |||
| 1131 | {QMI_FIXED_INTF(0x0846, 0x68d3, 8)}, /* Netgear Aircard 779S */ | 1131 | {QMI_FIXED_INTF(0x0846, 0x68d3, 8)}, /* Netgear Aircard 779S */ |
| 1132 | {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */ | 1132 | {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */ |
| 1133 | {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */ | 1133 | {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */ |
| 1134 | {QMI_FIXED_INTF(0x1435, 0x0918, 3)}, /* Wistron NeWeb D16Q1 */ | ||
| 1135 | {QMI_FIXED_INTF(0x1435, 0x0918, 4)}, /* Wistron NeWeb D16Q1 */ | ||
| 1136 | {QMI_FIXED_INTF(0x1435, 0x0918, 5)}, /* Wistron NeWeb D16Q1 */ | ||
| 1137 | {QMI_FIXED_INTF(0x1435, 0x3185, 4)}, /* Wistron NeWeb M18Q5 */ | ||
| 1138 | {QMI_FIXED_INTF(0x1435, 0xd111, 4)}, /* M9615A DM11-1 D51QC */ | ||
| 1134 | {QMI_FIXED_INTF(0x1435, 0xd181, 3)}, /* Wistron NeWeb D18Q1 */ | 1139 | {QMI_FIXED_INTF(0x1435, 0xd181, 3)}, /* Wistron NeWeb D18Q1 */ |
| 1135 | {QMI_FIXED_INTF(0x1435, 0xd181, 4)}, /* Wistron NeWeb D18Q1 */ | 1140 | {QMI_FIXED_INTF(0x1435, 0xd181, 4)}, /* Wistron NeWeb D18Q1 */ |
| 1136 | {QMI_FIXED_INTF(0x1435, 0xd181, 5)}, /* Wistron NeWeb D18Q1 */ | 1141 | {QMI_FIXED_INTF(0x1435, 0xd181, 5)}, /* Wistron NeWeb D18Q1 */ |
| 1142 | {QMI_FIXED_INTF(0x1435, 0xd182, 4)}, /* Wistron NeWeb D18 */ | ||
| 1143 | {QMI_FIXED_INTF(0x1435, 0xd182, 5)}, /* Wistron NeWeb D18 */ | ||
| 1137 | {QMI_FIXED_INTF(0x1435, 0xd191, 4)}, /* Wistron NeWeb D19Q1 */ | 1144 | {QMI_FIXED_INTF(0x1435, 0xd191, 4)}, /* Wistron NeWeb D19Q1 */ |
| 1138 | {QMI_QUIRK_SET_DTR(0x1508, 0x1001, 4)}, /* Fibocom NL668 series */ | 1145 | {QMI_QUIRK_SET_DTR(0x1508, 0x1001, 4)}, /* Fibocom NL668 series */ |
| 1139 | {QMI_FIXED_INTF(0x16d8, 0x6003, 0)}, /* CMOTech 6003 */ | 1146 | {QMI_FIXED_INTF(0x16d8, 0x6003, 0)}, /* CMOTech 6003 */ |
| @@ -1189,6 +1196,7 @@ static const struct usb_device_id products[] = { | |||
| 1189 | {QMI_FIXED_INTF(0x19d2, 0x0265, 4)}, /* ONDA MT8205 4G LTE */ | 1196 | {QMI_FIXED_INTF(0x19d2, 0x0265, 4)}, /* ONDA MT8205 4G LTE */ |
| 1190 | {QMI_FIXED_INTF(0x19d2, 0x0284, 4)}, /* ZTE MF880 */ | 1197 | {QMI_FIXED_INTF(0x19d2, 0x0284, 4)}, /* ZTE MF880 */ |
| 1191 | {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */ | 1198 | {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */ |
| 1199 | {QMI_FIXED_INTF(0x19d2, 0x0396, 3)}, /* ZTE ZM8620 */ | ||
| 1192 | {QMI_FIXED_INTF(0x19d2, 0x0412, 4)}, /* Telewell TW-LTE 4G */ | 1200 | {QMI_FIXED_INTF(0x19d2, 0x0412, 4)}, /* Telewell TW-LTE 4G */ |
| 1193 | {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */ | 1201 | {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */ |
| 1194 | {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */ | 1202 | {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */ |
| @@ -1209,7 +1217,9 @@ static const struct usb_device_id products[] = { | |||
| 1209 | {QMI_FIXED_INTF(0x19d2, 0x1425, 2)}, | 1217 | {QMI_FIXED_INTF(0x19d2, 0x1425, 2)}, |
| 1210 | {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */ | 1218 | {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */ |
| 1211 | {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ | 1219 | {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ |
| 1220 | {QMI_FIXED_INTF(0x19d2, 0x1432, 3)}, /* ZTE ME3620 */ | ||
| 1212 | {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ | 1221 | {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ |
| 1222 | {QMI_FIXED_INTF(0x2001, 0x7e16, 3)}, /* D-Link DWM-221 */ | ||
| 1213 | {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ | 1223 | {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ |
| 1214 | {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ | 1224 | {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ |
| 1215 | {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */ | 1225 | {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */ |
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 24b983edb357..eca87f7c5b6c 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c | |||
| @@ -1855,7 +1855,7 @@ void ath10k_ce_dump_registers(struct ath10k *ar, | |||
| 1855 | struct ath10k_ce_crash_data ce_data; | 1855 | struct ath10k_ce_crash_data ce_data; |
| 1856 | u32 addr, id; | 1856 | u32 addr, id; |
| 1857 | 1857 | ||
| 1858 | lockdep_assert_held(&ar->data_lock); | 1858 | lockdep_assert_held(&ar->dump_mutex); |
| 1859 | 1859 | ||
| 1860 | ath10k_err(ar, "Copy Engine register dump:\n"); | 1860 | ath10k_err(ar, "Copy Engine register dump:\n"); |
| 1861 | 1861 | ||
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 835b8de92d55..aff585658fc0 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c | |||
| @@ -3119,6 +3119,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, | |||
| 3119 | goto err_free_wq; | 3119 | goto err_free_wq; |
| 3120 | 3120 | ||
| 3121 | mutex_init(&ar->conf_mutex); | 3121 | mutex_init(&ar->conf_mutex); |
| 3122 | mutex_init(&ar->dump_mutex); | ||
| 3122 | spin_lock_init(&ar->data_lock); | 3123 | spin_lock_init(&ar->data_lock); |
| 3123 | 3124 | ||
| 3124 | INIT_LIST_HEAD(&ar->peers); | 3125 | INIT_LIST_HEAD(&ar->peers); |
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index e08a17b01e03..e35aae5146f1 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h | |||
| @@ -1063,6 +1063,9 @@ struct ath10k { | |||
| 1063 | /* prevents concurrent FW reconfiguration */ | 1063 | /* prevents concurrent FW reconfiguration */ |
| 1064 | struct mutex conf_mutex; | 1064 | struct mutex conf_mutex; |
| 1065 | 1065 | ||
| 1066 | /* protects coredump data */ | ||
| 1067 | struct mutex dump_mutex; | ||
| 1068 | |||
| 1066 | /* protects shared structure data */ | 1069 | /* protects shared structure data */ |
| 1067 | spinlock_t data_lock; | 1070 | spinlock_t data_lock; |
| 1068 | 1071 | ||
diff --git a/drivers/net/wireless/ath/ath10k/coredump.c b/drivers/net/wireless/ath/ath10k/coredump.c index 33838d9c1cb6..45a355fb62b9 100644 --- a/drivers/net/wireless/ath/ath10k/coredump.c +++ b/drivers/net/wireless/ath/ath10k/coredump.c | |||
| @@ -1102,7 +1102,7 @@ struct ath10k_fw_crash_data *ath10k_coredump_new(struct ath10k *ar) | |||
| 1102 | { | 1102 | { |
| 1103 | struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data; | 1103 | struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data; |
| 1104 | 1104 | ||
| 1105 | lockdep_assert_held(&ar->data_lock); | 1105 | lockdep_assert_held(&ar->dump_mutex); |
| 1106 | 1106 | ||
| 1107 | if (ath10k_coredump_mask == 0) | 1107 | if (ath10k_coredump_mask == 0) |
| 1108 | /* coredump disabled */ | 1108 | /* coredump disabled */ |
| @@ -1146,7 +1146,7 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar) | |||
| 1146 | if (!buf) | 1146 | if (!buf) |
| 1147 | return NULL; | 1147 | return NULL; |
| 1148 | 1148 | ||
| 1149 | spin_lock_bh(&ar->data_lock); | 1149 | mutex_lock(&ar->dump_mutex); |
| 1150 | 1150 | ||
| 1151 | dump_data = (struct ath10k_dump_file_data *)(buf); | 1151 | dump_data = (struct ath10k_dump_file_data *)(buf); |
| 1152 | strlcpy(dump_data->df_magic, "ATH10K-FW-DUMP", | 1152 | strlcpy(dump_data->df_magic, "ATH10K-FW-DUMP", |
| @@ -1213,7 +1213,7 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar) | |||
| 1213 | sofar += sizeof(*dump_tlv) + crash_data->ramdump_buf_len; | 1213 | sofar += sizeof(*dump_tlv) + crash_data->ramdump_buf_len; |
| 1214 | } | 1214 | } |
| 1215 | 1215 | ||
| 1216 | spin_unlock_bh(&ar->data_lock); | 1216 | mutex_unlock(&ar->dump_mutex); |
| 1217 | 1217 | ||
| 1218 | return dump_data; | 1218 | return dump_data; |
| 1219 | } | 1219 | } |
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 41e89db244d2..9c703d287333 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
| @@ -5774,7 +5774,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
| 5774 | } | 5774 | } |
| 5775 | 5775 | ||
| 5776 | if (changed & BSS_CHANGED_MCAST_RATE && | 5776 | if (changed & BSS_CHANGED_MCAST_RATE && |
| 5777 | !WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) { | 5777 | !ath10k_mac_vif_chan(arvif->vif, &def)) { |
| 5778 | band = def.chan->band; | 5778 | band = def.chan->band; |
| 5779 | rateidx = vif->bss_conf.mcast_rate[band] - 1; | 5779 | rateidx = vif->bss_conf.mcast_rate[band] - 1; |
| 5780 | 5780 | ||
| @@ -5812,7 +5812,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, | |||
| 5812 | } | 5812 | } |
| 5813 | 5813 | ||
| 5814 | if (changed & BSS_CHANGED_BASIC_RATES) { | 5814 | if (changed & BSS_CHANGED_BASIC_RATES) { |
| 5815 | if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) { | 5815 | if (ath10k_mac_vif_chan(vif, &def)) { |
| 5816 | mutex_unlock(&ar->conf_mutex); | 5816 | mutex_unlock(&ar->conf_mutex); |
| 5817 | return; | 5817 | return; |
| 5818 | } | 5818 | } |
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 271f92c24d44..2c27f407a851 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c | |||
| @@ -1441,7 +1441,7 @@ static void ath10k_pci_dump_registers(struct ath10k *ar, | |||
| 1441 | __le32 reg_dump_values[REG_DUMP_COUNT_QCA988X] = {}; | 1441 | __le32 reg_dump_values[REG_DUMP_COUNT_QCA988X] = {}; |
| 1442 | int i, ret; | 1442 | int i, ret; |
| 1443 | 1443 | ||
| 1444 | lockdep_assert_held(&ar->data_lock); | 1444 | lockdep_assert_held(&ar->dump_mutex); |
| 1445 | 1445 | ||
| 1446 | ret = ath10k_pci_diag_read_hi(ar, ®_dump_values[0], | 1446 | ret = ath10k_pci_diag_read_hi(ar, ®_dump_values[0], |
| 1447 | hi_failure_state, | 1447 | hi_failure_state, |
| @@ -1656,7 +1656,7 @@ static void ath10k_pci_dump_memory(struct ath10k *ar, | |||
| 1656 | int ret, i; | 1656 | int ret, i; |
| 1657 | u8 *buf; | 1657 | u8 *buf; |
| 1658 | 1658 | ||
| 1659 | lockdep_assert_held(&ar->data_lock); | 1659 | lockdep_assert_held(&ar->dump_mutex); |
| 1660 | 1660 | ||
| 1661 | if (!crash_data) | 1661 | if (!crash_data) |
| 1662 | return; | 1662 | return; |
| @@ -1734,14 +1734,19 @@ static void ath10k_pci_dump_memory(struct ath10k *ar, | |||
| 1734 | } | 1734 | } |
| 1735 | } | 1735 | } |
| 1736 | 1736 | ||
| 1737 | static void ath10k_pci_fw_crashed_dump(struct ath10k *ar) | 1737 | static void ath10k_pci_fw_dump_work(struct work_struct *work) |
| 1738 | { | 1738 | { |
| 1739 | struct ath10k_pci *ar_pci = container_of(work, struct ath10k_pci, | ||
| 1740 | dump_work); | ||
| 1739 | struct ath10k_fw_crash_data *crash_data; | 1741 | struct ath10k_fw_crash_data *crash_data; |
| 1742 | struct ath10k *ar = ar_pci->ar; | ||
| 1740 | char guid[UUID_STRING_LEN + 1]; | 1743 | char guid[UUID_STRING_LEN + 1]; |
| 1741 | 1744 | ||
| 1742 | spin_lock_bh(&ar->data_lock); | 1745 | mutex_lock(&ar->dump_mutex); |
| 1743 | 1746 | ||
| 1747 | spin_lock_bh(&ar->data_lock); | ||
| 1744 | ar->stats.fw_crash_counter++; | 1748 | ar->stats.fw_crash_counter++; |
| 1749 | spin_unlock_bh(&ar->data_lock); | ||
| 1745 | 1750 | ||
| 1746 | crash_data = ath10k_coredump_new(ar); | 1751 | crash_data = ath10k_coredump_new(ar); |
| 1747 | 1752 | ||
| @@ -1756,11 +1761,18 @@ static void ath10k_pci_fw_crashed_dump(struct ath10k *ar) | |||
| 1756 | ath10k_ce_dump_registers(ar, crash_data); | 1761 | ath10k_ce_dump_registers(ar, crash_data); |
| 1757 | ath10k_pci_dump_memory(ar, crash_data); | 1762 | ath10k_pci_dump_memory(ar, crash_data); |
| 1758 | 1763 | ||
| 1759 | spin_unlock_bh(&ar->data_lock); | 1764 | mutex_unlock(&ar->dump_mutex); |
| 1760 | 1765 | ||
| 1761 | queue_work(ar->workqueue, &ar->restart_work); | 1766 | queue_work(ar->workqueue, &ar->restart_work); |
| 1762 | } | 1767 | } |
| 1763 | 1768 | ||
| 1769 | static void ath10k_pci_fw_crashed_dump(struct ath10k *ar) | ||
| 1770 | { | ||
| 1771 | struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); | ||
| 1772 | |||
| 1773 | queue_work(ar->workqueue, &ar_pci->dump_work); | ||
| 1774 | } | ||
| 1775 | |||
| 1764 | void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe, | 1776 | void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe, |
| 1765 | int force) | 1777 | int force) |
| 1766 | { | 1778 | { |
| @@ -3442,6 +3454,8 @@ int ath10k_pci_setup_resource(struct ath10k *ar) | |||
| 3442 | spin_lock_init(&ar_pci->ps_lock); | 3454 | spin_lock_init(&ar_pci->ps_lock); |
| 3443 | mutex_init(&ar_pci->ce_diag_mutex); | 3455 | mutex_init(&ar_pci->ce_diag_mutex); |
| 3444 | 3456 | ||
| 3457 | INIT_WORK(&ar_pci->dump_work, ath10k_pci_fw_dump_work); | ||
| 3458 | |||
| 3445 | timer_setup(&ar_pci->rx_post_retry, ath10k_pci_rx_replenish_retry, 0); | 3459 | timer_setup(&ar_pci->rx_post_retry, ath10k_pci_rx_replenish_retry, 0); |
| 3446 | 3460 | ||
| 3447 | if (QCA_REV_6174(ar) || QCA_REV_9377(ar)) | 3461 | if (QCA_REV_6174(ar) || QCA_REV_9377(ar)) |
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h index 3773c79f322f..4455ed6c5275 100644 --- a/drivers/net/wireless/ath/ath10k/pci.h +++ b/drivers/net/wireless/ath/ath10k/pci.h | |||
| @@ -121,6 +121,8 @@ struct ath10k_pci { | |||
| 121 | /* For protecting ce_diag */ | 121 | /* For protecting ce_diag */ |
| 122 | struct mutex ce_diag_mutex; | 122 | struct mutex ce_diag_mutex; |
| 123 | 123 | ||
| 124 | struct work_struct dump_work; | ||
| 125 | |||
| 124 | struct ath10k_ce ce; | 126 | struct ath10k_ce ce; |
| 125 | struct timer_list rx_post_retry; | 127 | struct timer_list rx_post_retry; |
| 126 | 128 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c index fc915ecfb06e..17b34f6e4515 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c | |||
| @@ -207,7 +207,7 @@ static const struct iwl_ht_params iwl_22000_ht_params = { | |||
| 207 | #define IWL_DEVICE_AX210 \ | 207 | #define IWL_DEVICE_AX210 \ |
| 208 | IWL_DEVICE_AX200_COMMON, \ | 208 | IWL_DEVICE_AX200_COMMON, \ |
| 209 | .device_family = IWL_DEVICE_FAMILY_AX210, \ | 209 | .device_family = IWL_DEVICE_FAMILY_AX210, \ |
| 210 | .base_params = &iwl_22000_base_params, \ | 210 | .base_params = &iwl_22560_base_params, \ |
| 211 | .csr = &iwl_csr_v1, \ | 211 | .csr = &iwl_csr_v1, \ |
| 212 | .min_txq_size = 128, \ | 212 | .min_txq_size = 128, \ |
| 213 | .gp2_reg_addr = 0xd02c68, \ | 213 | .gp2_reg_addr = 0xd02c68, \ |
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/5000.c b/drivers/net/wireless/intel/iwlwifi/cfg/5000.c index 575a7022d045..3846064d51a5 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/5000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/5000.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /****************************************************************************** | 1 | /****************************************************************************** |
| 2 | * | 2 | * |
| 3 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. | 3 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. |
| 4 | * Copyright(c) 2018 Intel Corporation | 4 | * Copyright(c) 2018 - 2019 Intel Corporation |
| 5 | * | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of version 2 of the GNU General Public License as | 7 | * under the terms of version 2 of the GNU General Public License as |
| @@ -136,6 +136,7 @@ const struct iwl_cfg iwl5350_agn_cfg = { | |||
| 136 | .ht_params = &iwl5000_ht_params, | 136 | .ht_params = &iwl5000_ht_params, |
| 137 | .led_mode = IWL_LED_BLINK, | 137 | .led_mode = IWL_LED_BLINK, |
| 138 | .internal_wimax_coex = true, | 138 | .internal_wimax_coex = true, |
| 139 | .csr = &iwl_csr_v1, | ||
| 139 | }; | 140 | }; |
| 140 | 141 | ||
| 141 | #define IWL_DEVICE_5150 \ | 142 | #define IWL_DEVICE_5150 \ |
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h index abfdcabdcbf7..cd622af90077 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h | |||
| @@ -93,7 +93,7 @@ struct iwl_ucode_header { | |||
| 93 | } u; | 93 | } u; |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | #define IWL_UCODE_INI_TLV_GROUP BIT(24) | 96 | #define IWL_UCODE_INI_TLV_GROUP 0x1000000 |
| 97 | 97 | ||
| 98 | /* | 98 | /* |
| 99 | * new TLV uCode file layout | 99 | * new TLV uCode file layout |
| @@ -148,11 +148,14 @@ enum iwl_ucode_tlv_type { | |||
| 148 | IWL_UCODE_TLV_UMAC_DEBUG_ADDRS = 54, | 148 | IWL_UCODE_TLV_UMAC_DEBUG_ADDRS = 54, |
| 149 | IWL_UCODE_TLV_LMAC_DEBUG_ADDRS = 55, | 149 | IWL_UCODE_TLV_LMAC_DEBUG_ADDRS = 55, |
| 150 | IWL_UCODE_TLV_FW_RECOVERY_INFO = 57, | 150 | IWL_UCODE_TLV_FW_RECOVERY_INFO = 57, |
| 151 | IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION = IWL_UCODE_INI_TLV_GROUP | 0x1, | 151 | |
| 152 | IWL_UCODE_TLV_TYPE_HCMD = IWL_UCODE_INI_TLV_GROUP | 0x2, | 152 | IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION = IWL_UCODE_INI_TLV_GROUP + 0x1, |
| 153 | IWL_UCODE_TLV_TYPE_REGIONS = IWL_UCODE_INI_TLV_GROUP | 0x3, | 153 | IWL_UCODE_TLV_DEBUG_BASE = IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION, |
| 154 | IWL_UCODE_TLV_TYPE_TRIGGERS = IWL_UCODE_INI_TLV_GROUP | 0x4, | 154 | IWL_UCODE_TLV_TYPE_HCMD = IWL_UCODE_INI_TLV_GROUP + 0x2, |
| 155 | IWL_UCODE_TLV_TYPE_DEBUG_FLOW = IWL_UCODE_INI_TLV_GROUP | 0x5, | 155 | IWL_UCODE_TLV_TYPE_REGIONS = IWL_UCODE_INI_TLV_GROUP + 0x3, |
| 156 | IWL_UCODE_TLV_TYPE_TRIGGERS = IWL_UCODE_INI_TLV_GROUP + 0x4, | ||
| 157 | IWL_UCODE_TLV_TYPE_DEBUG_FLOW = IWL_UCODE_INI_TLV_GROUP + 0x5, | ||
| 158 | IWL_UCODE_TLV_DEBUG_MAX = IWL_UCODE_TLV_TYPE_DEBUG_FLOW, | ||
| 156 | 159 | ||
| 157 | /* TLVs 0x1000-0x2000 are for internal driver usage */ | 160 | /* TLVs 0x1000-0x2000 are for internal driver usage */ |
| 158 | IWL_UCODE_TLV_FW_DBG_DUMP_LST = 0x1000, | 161 | IWL_UCODE_TLV_FW_DBG_DUMP_LST = 0x1000, |
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c index 9107302cc444..0e8664375298 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | |||
| @@ -129,7 +129,8 @@ void iwl_alloc_dbg_tlv(struct iwl_trans *trans, size_t len, const u8 *data, | |||
| 129 | len -= ALIGN(tlv_len, 4); | 129 | len -= ALIGN(tlv_len, 4); |
| 130 | data += sizeof(*tlv) + ALIGN(tlv_len, 4); | 130 | data += sizeof(*tlv) + ALIGN(tlv_len, 4); |
| 131 | 131 | ||
| 132 | if (!(tlv_type & IWL_UCODE_INI_TLV_GROUP)) | 132 | if (tlv_type < IWL_UCODE_TLV_DEBUG_BASE || |
| 133 | tlv_type > IWL_UCODE_TLV_DEBUG_MAX) | ||
| 133 | continue; | 134 | continue; |
| 134 | 135 | ||
| 135 | hdr = (void *)&tlv->data[0]; | 136 | hdr = (void *)&tlv->data[0]; |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c index 9bf2407c9b4b..f043eefabb4e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | |||
| @@ -773,6 +773,11 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
| 773 | return; | 773 | return; |
| 774 | 774 | ||
| 775 | mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir); | 775 | mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir); |
| 776 | if (IS_ERR_OR_NULL(mvmvif->dbgfs_dir)) { | ||
| 777 | IWL_ERR(mvm, "Failed to create debugfs directory under %pd\n", | ||
| 778 | dbgfs_dir); | ||
| 779 | return; | ||
| 780 | } | ||
| 776 | 781 | ||
| 777 | if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM && | 782 | if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM && |
| 778 | ((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) || | 783 | ((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) || |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 00a47f6f1d81..ab68b5d53ec9 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c | |||
| @@ -1121,7 +1121,9 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
| 1121 | ret = iwl_mvm_load_rt_fw(mvm); | 1121 | ret = iwl_mvm_load_rt_fw(mvm); |
| 1122 | if (ret) { | 1122 | if (ret) { |
| 1123 | IWL_ERR(mvm, "Failed to start RT ucode: %d\n", ret); | 1123 | IWL_ERR(mvm, "Failed to start RT ucode: %d\n", ret); |
| 1124 | iwl_fw_dbg_error_collect(&mvm->fwrt, FW_DBG_TRIGGER_DRIVER); | 1124 | if (ret != -ERFKILL) |
| 1125 | iwl_fw_dbg_error_collect(&mvm->fwrt, | ||
| 1126 | FW_DBG_TRIGGER_DRIVER); | ||
| 1125 | goto error; | 1127 | goto error; |
| 1126 | } | 1128 | } |
| 1127 | 1129 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 55d399899d1c..8da9e5572fcf 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c | |||
| @@ -834,7 +834,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
| 834 | mutex_lock(&mvm->mutex); | 834 | mutex_lock(&mvm->mutex); |
| 835 | iwl_mvm_ref(mvm, IWL_MVM_REF_INIT_UCODE); | 835 | iwl_mvm_ref(mvm, IWL_MVM_REF_INIT_UCODE); |
| 836 | err = iwl_run_init_mvm_ucode(mvm, true); | 836 | err = iwl_run_init_mvm_ucode(mvm, true); |
| 837 | if (err) | 837 | if (err && err != -ERFKILL) |
| 838 | iwl_fw_dbg_error_collect(&mvm->fwrt, FW_DBG_TRIGGER_DRIVER); | 838 | iwl_fw_dbg_error_collect(&mvm->fwrt, FW_DBG_TRIGGER_DRIVER); |
| 839 | if (!iwlmvm_mod_params.init_dbg || !err) | 839 | if (!iwlmvm_mod_params.init_dbg || !err) |
| 840 | iwl_mvm_stop_device(mvm); | 840 | iwl_mvm_stop_device(mvm); |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index 0b1b208de767..1824566d08fc 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | |||
| @@ -169,9 +169,9 @@ static inline int iwl_mvm_check_pn(struct iwl_mvm *mvm, struct sk_buff *skb, | |||
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | /* iwl_mvm_create_skb Adds the rxb to a new skb */ | 171 | /* iwl_mvm_create_skb Adds the rxb to a new skb */ |
| 172 | static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr, | 172 | static int iwl_mvm_create_skb(struct iwl_mvm *mvm, struct sk_buff *skb, |
| 173 | u16 len, u8 crypt_len, | 173 | struct ieee80211_hdr *hdr, u16 len, u8 crypt_len, |
| 174 | struct iwl_rx_cmd_buffer *rxb) | 174 | struct iwl_rx_cmd_buffer *rxb) |
| 175 | { | 175 | { |
| 176 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 176 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
| 177 | struct iwl_rx_mpdu_desc *desc = (void *)pkt->data; | 177 | struct iwl_rx_mpdu_desc *desc = (void *)pkt->data; |
| @@ -204,6 +204,20 @@ static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr, | |||
| 204 | * present before copying packet data. | 204 | * present before copying packet data. |
| 205 | */ | 205 | */ |
| 206 | hdrlen += crypt_len; | 206 | hdrlen += crypt_len; |
| 207 | |||
| 208 | if (WARN_ONCE(headlen < hdrlen, | ||
| 209 | "invalid packet lengths (hdrlen=%d, len=%d, crypt_len=%d)\n", | ||
| 210 | hdrlen, len, crypt_len)) { | ||
| 211 | /* | ||
| 212 | * We warn and trace because we want to be able to see | ||
| 213 | * it in trace-cmd as well. | ||
| 214 | */ | ||
| 215 | IWL_DEBUG_RX(mvm, | ||
| 216 | "invalid packet lengths (hdrlen=%d, len=%d, crypt_len=%d)\n", | ||
| 217 | hdrlen, len, crypt_len); | ||
| 218 | return -EINVAL; | ||
| 219 | } | ||
| 220 | |||
| 207 | skb_put_data(skb, hdr, hdrlen); | 221 | skb_put_data(skb, hdr, hdrlen); |
| 208 | skb_put_data(skb, (u8 *)hdr + hdrlen + pad_len, headlen - hdrlen); | 222 | skb_put_data(skb, (u8 *)hdr + hdrlen + pad_len, headlen - hdrlen); |
| 209 | 223 | ||
| @@ -216,6 +230,8 @@ static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr, | |||
| 216 | skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset, | 230 | skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset, |
| 217 | fraglen, rxb->truesize); | 231 | fraglen, rxb->truesize); |
| 218 | } | 232 | } |
| 233 | |||
| 234 | return 0; | ||
| 219 | } | 235 | } |
| 220 | 236 | ||
| 221 | static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm, | 237 | static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm, |
| @@ -1671,7 +1687,11 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, | |||
| 1671 | rx_status->boottime_ns = ktime_get_boot_ns(); | 1687 | rx_status->boottime_ns = ktime_get_boot_ns(); |
| 1672 | } | 1688 | } |
| 1673 | 1689 | ||
| 1674 | iwl_mvm_create_skb(skb, hdr, len, crypt_len, rxb); | 1690 | if (iwl_mvm_create_skb(mvm, skb, hdr, len, crypt_len, rxb)) { |
| 1691 | kfree_skb(skb); | ||
| 1692 | goto out; | ||
| 1693 | } | ||
| 1694 | |||
| 1675 | if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc)) | 1695 | if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc)) |
| 1676 | iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, | 1696 | iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, |
| 1677 | sta, csi); | 1697 | sta, csi); |
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c index c5baaae8d38e..cccb8bbd7ea7 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c | |||
| @@ -3654,20 +3654,27 @@ out_no_pci: | |||
| 3654 | 3654 | ||
| 3655 | void iwl_trans_pcie_sync_nmi(struct iwl_trans *trans) | 3655 | void iwl_trans_pcie_sync_nmi(struct iwl_trans *trans) |
| 3656 | { | 3656 | { |
| 3657 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | ||
| 3657 | unsigned long timeout = jiffies + IWL_TRANS_NMI_TIMEOUT; | 3658 | unsigned long timeout = jiffies + IWL_TRANS_NMI_TIMEOUT; |
| 3659 | u32 inta_addr, sw_err_bit; | ||
| 3660 | |||
| 3661 | if (trans_pcie->msix_enabled) { | ||
| 3662 | inta_addr = CSR_MSIX_HW_INT_CAUSES_AD; | ||
| 3663 | sw_err_bit = MSIX_HW_INT_CAUSES_REG_SW_ERR; | ||
| 3664 | } else { | ||
| 3665 | inta_addr = CSR_INT; | ||
| 3666 | sw_err_bit = CSR_INT_BIT_SW_ERR; | ||
| 3667 | } | ||
| 3658 | 3668 | ||
| 3659 | iwl_disable_interrupts(trans); | 3669 | iwl_disable_interrupts(trans); |
| 3660 | iwl_force_nmi(trans); | 3670 | iwl_force_nmi(trans); |
| 3661 | while (time_after(timeout, jiffies)) { | 3671 | while (time_after(timeout, jiffies)) { |
| 3662 | u32 inta_hw = iwl_read32(trans, | 3672 | u32 inta_hw = iwl_read32(trans, inta_addr); |
| 3663 | CSR_MSIX_HW_INT_CAUSES_AD); | ||
| 3664 | 3673 | ||
| 3665 | /* Error detected by uCode */ | 3674 | /* Error detected by uCode */ |
| 3666 | if (inta_hw & MSIX_HW_INT_CAUSES_REG_SW_ERR) { | 3675 | if (inta_hw & sw_err_bit) { |
| 3667 | /* Clear causes register */ | 3676 | /* Clear causes register */ |
| 3668 | iwl_write32(trans, CSR_MSIX_HW_INT_CAUSES_AD, | 3677 | iwl_write32(trans, inta_addr, inta_hw & sw_err_bit); |
| 3669 | inta_hw & | ||
| 3670 | MSIX_HW_INT_CAUSES_REG_SW_ERR); | ||
| 3671 | break; | 3678 | break; |
| 3672 | } | 3679 | } |
| 3673 | 3680 | ||
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index a85648342d15..d5a70340a945 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c | |||
| @@ -181,7 +181,7 @@ static int mwifiex_sdio_resume(struct device *dev) | |||
| 181 | 181 | ||
| 182 | adapter = card->adapter; | 182 | adapter = card->adapter; |
| 183 | 183 | ||
| 184 | if (test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) { | 184 | if (!test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) { |
| 185 | mwifiex_dbg(adapter, WARN, | 185 | mwifiex_dbg(adapter, WARN, |
| 186 | "device already resumed\n"); | 186 | "device already resumed\n"); |
| 187 | return 0; | 187 | return 0; |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 7c1b362f599a..766f5779db92 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -6262,8 +6262,7 @@ static int __init pci_setup(char *str) | |||
| 6262 | } else if (!strncmp(str, "pcie_scan_all", 13)) { | 6262 | } else if (!strncmp(str, "pcie_scan_all", 13)) { |
| 6263 | pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS); | 6263 | pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS); |
| 6264 | } else if (!strncmp(str, "disable_acs_redir=", 18)) { | 6264 | } else if (!strncmp(str, "disable_acs_redir=", 18)) { |
| 6265 | disable_acs_redir_param = | 6265 | disable_acs_redir_param = str + 18; |
| 6266 | kstrdup(str + 18, GFP_KERNEL); | ||
| 6267 | } else { | 6266 | } else { |
| 6268 | printk(KERN_ERR "PCI: Unknown option `%s'\n", | 6267 | printk(KERN_ERR "PCI: Unknown option `%s'\n", |
| 6269 | str); | 6268 | str); |
| @@ -6274,3 +6273,19 @@ static int __init pci_setup(char *str) | |||
| 6274 | return 0; | 6273 | return 0; |
| 6275 | } | 6274 | } |
| 6276 | early_param("pci", pci_setup); | 6275 | early_param("pci", pci_setup); |
| 6276 | |||
| 6277 | /* | ||
| 6278 | * 'disable_acs_redir_param' is initialized in pci_setup(), above, to point | ||
| 6279 | * to data in the __initdata section which will be freed after the init | ||
| 6280 | * sequence is complete. We can't allocate memory in pci_setup() because some | ||
| 6281 | * architectures do not have any memory allocation service available during | ||
| 6282 | * an early_param() call. So we allocate memory and copy the variable here | ||
| 6283 | * before the init section is freed. | ||
| 6284 | */ | ||
| 6285 | static int __init pci_realloc_setup_params(void) | ||
| 6286 | { | ||
| 6287 | disable_acs_redir_param = kstrdup(disable_acs_redir_param, GFP_KERNEL); | ||
| 6288 | |||
| 6289 | return 0; | ||
| 6290 | } | ||
| 6291 | pure_initcall(pci_realloc_setup_params); | ||
diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig index 5cbdbca904ac..362eb8cfa53b 100644 --- a/drivers/pci/pcie/Kconfig +++ b/drivers/pci/pcie/Kconfig | |||
| @@ -142,3 +142,11 @@ config PCIE_PTM | |||
| 142 | 142 | ||
| 143 | This is only useful if you have devices that support PTM, but it | 143 | This is only useful if you have devices that support PTM, but it |
| 144 | is safe to enable even if you don't. | 144 | is safe to enable even if you don't. |
| 145 | |||
| 146 | config PCIE_BW | ||
| 147 | bool "PCI Express Bandwidth Change Notification" | ||
| 148 | depends on PCIEPORTBUS | ||
| 149 | help | ||
| 150 | This enables PCI Express Bandwidth Change Notification. If | ||
| 151 | you know link width or rate changes occur only to correct | ||
| 152 | unreliable links, you may answer Y. | ||
diff --git a/drivers/pci/pcie/Makefile b/drivers/pci/pcie/Makefile index f1d7bc1e5efa..efb9d2e71e9e 100644 --- a/drivers/pci/pcie/Makefile +++ b/drivers/pci/pcie/Makefile | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | # Makefile for PCI Express features and port driver | 3 | # Makefile for PCI Express features and port driver |
| 4 | 4 | ||
| 5 | pcieportdrv-y := portdrv_core.o portdrv_pci.o err.o | 5 | pcieportdrv-y := portdrv_core.o portdrv_pci.o err.o |
| 6 | pcieportdrv-y += bw_notification.o | ||
| 7 | 6 | ||
| 8 | obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o | 7 | obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o |
| 9 | 8 | ||
| @@ -13,3 +12,4 @@ obj-$(CONFIG_PCIEAER_INJECT) += aer_inject.o | |||
| 13 | obj-$(CONFIG_PCIE_PME) += pme.o | 12 | obj-$(CONFIG_PCIE_PME) += pme.o |
| 14 | obj-$(CONFIG_PCIE_DPC) += dpc.o | 13 | obj-$(CONFIG_PCIE_DPC) += dpc.o |
| 15 | obj-$(CONFIG_PCIE_PTM) += ptm.o | 14 | obj-$(CONFIG_PCIE_PTM) += ptm.o |
| 15 | obj-$(CONFIG_PCIE_BW) += bw_notification.o | ||
diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index 1d50dc58ac40..944827a8c7d3 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h | |||
| @@ -49,7 +49,11 @@ int pcie_dpc_init(void); | |||
| 49 | static inline int pcie_dpc_init(void) { return 0; } | 49 | static inline int pcie_dpc_init(void) { return 0; } |
| 50 | #endif | 50 | #endif |
| 51 | 51 | ||
| 52 | #ifdef CONFIG_PCIE_BW | ||
| 52 | int pcie_bandwidth_notification_init(void); | 53 | int pcie_bandwidth_notification_init(void); |
| 54 | #else | ||
| 55 | static inline int pcie_bandwidth_notification_init(void) { return 0; } | ||
| 56 | #endif | ||
| 53 | 57 | ||
| 54 | /* Port Type */ | 58 | /* Port Type */ |
| 55 | #define PCIE_ANY_PORT (~0) | 59 | #define PCIE_ANY_PORT (~0) |
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 7d04f9d087a6..1b330129089f 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
| @@ -55,7 +55,8 @@ static int pcie_message_numbers(struct pci_dev *dev, int mask, | |||
| 55 | * 7.8.2, 7.10.10, 7.31.2. | 55 | * 7.8.2, 7.10.10, 7.31.2. |
| 56 | */ | 56 | */ |
| 57 | 57 | ||
| 58 | if (mask & (PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP)) { | 58 | if (mask & (PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP | |
| 59 | PCIE_PORT_SERVICE_BWNOTIF)) { | ||
| 59 | pcie_capability_read_word(dev, PCI_EXP_FLAGS, ®16); | 60 | pcie_capability_read_word(dev, PCI_EXP_FLAGS, ®16); |
| 60 | *pme = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9; | 61 | *pme = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9; |
| 61 | nvec = *pme + 1; | 62 | nvec = *pme + 1; |
diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c index 08d5037fd052..6887870ba32c 100644 --- a/drivers/power/supply/cpcap-battery.c +++ b/drivers/power/supply/cpcap-battery.c | |||
| @@ -221,6 +221,9 @@ static int cpcap_battery_cc_raw_div(struct cpcap_battery_ddata *ddata, | |||
| 221 | int avg_current; | 221 | int avg_current; |
| 222 | u32 cc_lsb; | 222 | u32 cc_lsb; |
| 223 | 223 | ||
| 224 | if (!divider) | ||
| 225 | return 0; | ||
| 226 | |||
| 224 | sample &= 0xffffff; /* 24-bits, unsigned */ | 227 | sample &= 0xffffff; /* 24-bits, unsigned */ |
| 225 | offset &= 0x7ff; /* 10-bits, signed */ | 228 | offset &= 0x7ff; /* 10-bits, signed */ |
| 226 | 229 | ||
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index dce24f596160..5358a80d854f 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c | |||
| @@ -383,15 +383,11 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
| 383 | char *prop_buf; | 383 | char *prop_buf; |
| 384 | char *attrname; | 384 | char *attrname; |
| 385 | 385 | ||
| 386 | dev_dbg(dev, "uevent\n"); | ||
| 387 | |||
| 388 | if (!psy || !psy->desc) { | 386 | if (!psy || !psy->desc) { |
| 389 | dev_dbg(dev, "No power supply yet\n"); | 387 | dev_dbg(dev, "No power supply yet\n"); |
| 390 | return ret; | 388 | return ret; |
| 391 | } | 389 | } |
| 392 | 390 | ||
| 393 | dev_dbg(dev, "POWER_SUPPLY_NAME=%s\n", psy->desc->name); | ||
| 394 | |||
| 395 | ret = add_uevent_var(env, "POWER_SUPPLY_NAME=%s", psy->desc->name); | 391 | ret = add_uevent_var(env, "POWER_SUPPLY_NAME=%s", psy->desc->name); |
| 396 | if (ret) | 392 | if (ret) |
| 397 | return ret; | 393 | return ret; |
| @@ -427,8 +423,6 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
| 427 | goto out; | 423 | goto out; |
| 428 | } | 424 | } |
| 429 | 425 | ||
| 430 | dev_dbg(dev, "prop %s=%s\n", attrname, prop_buf); | ||
| 431 | |||
| 432 | ret = add_uevent_var(env, "POWER_SUPPLY_%s=%s", attrname, prop_buf); | 426 | ret = add_uevent_var(env, "POWER_SUPPLY_%s=%s", attrname, prop_buf); |
| 433 | kfree(attrname); | 427 | kfree(attrname); |
| 434 | if (ret) | 428 | if (ret) |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 8987cec9549d..ebcadaad89d1 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
| @@ -473,11 +473,6 @@ static int usb_unbind_interface(struct device *dev) | |||
| 473 | pm_runtime_disable(dev); | 473 | pm_runtime_disable(dev); |
| 474 | pm_runtime_set_suspended(dev); | 474 | pm_runtime_set_suspended(dev); |
| 475 | 475 | ||
| 476 | /* Undo any residual pm_autopm_get_interface_* calls */ | ||
| 477 | for (r = atomic_read(&intf->pm_usage_cnt); r > 0; --r) | ||
| 478 | usb_autopm_put_interface_no_suspend(intf); | ||
| 479 | atomic_set(&intf->pm_usage_cnt, 0); | ||
| 480 | |||
| 481 | if (!error) | 476 | if (!error) |
| 482 | usb_autosuspend_device(udev); | 477 | usb_autosuspend_device(udev); |
| 483 | 478 | ||
| @@ -1633,7 +1628,6 @@ void usb_autopm_put_interface(struct usb_interface *intf) | |||
| 1633 | int status; | 1628 | int status; |
| 1634 | 1629 | ||
| 1635 | usb_mark_last_busy(udev); | 1630 | usb_mark_last_busy(udev); |
| 1636 | atomic_dec(&intf->pm_usage_cnt); | ||
| 1637 | status = pm_runtime_put_sync(&intf->dev); | 1631 | status = pm_runtime_put_sync(&intf->dev); |
| 1638 | dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", | 1632 | dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", |
| 1639 | __func__, atomic_read(&intf->dev.power.usage_count), | 1633 | __func__, atomic_read(&intf->dev.power.usage_count), |
| @@ -1662,7 +1656,6 @@ void usb_autopm_put_interface_async(struct usb_interface *intf) | |||
| 1662 | int status; | 1656 | int status; |
| 1663 | 1657 | ||
| 1664 | usb_mark_last_busy(udev); | 1658 | usb_mark_last_busy(udev); |
| 1665 | atomic_dec(&intf->pm_usage_cnt); | ||
| 1666 | status = pm_runtime_put(&intf->dev); | 1659 | status = pm_runtime_put(&intf->dev); |
| 1667 | dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", | 1660 | dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", |
| 1668 | __func__, atomic_read(&intf->dev.power.usage_count), | 1661 | __func__, atomic_read(&intf->dev.power.usage_count), |
| @@ -1684,7 +1677,6 @@ void usb_autopm_put_interface_no_suspend(struct usb_interface *intf) | |||
| 1684 | struct usb_device *udev = interface_to_usbdev(intf); | 1677 | struct usb_device *udev = interface_to_usbdev(intf); |
| 1685 | 1678 | ||
| 1686 | usb_mark_last_busy(udev); | 1679 | usb_mark_last_busy(udev); |
| 1687 | atomic_dec(&intf->pm_usage_cnt); | ||
| 1688 | pm_runtime_put_noidle(&intf->dev); | 1680 | pm_runtime_put_noidle(&intf->dev); |
| 1689 | } | 1681 | } |
| 1690 | EXPORT_SYMBOL_GPL(usb_autopm_put_interface_no_suspend); | 1682 | EXPORT_SYMBOL_GPL(usb_autopm_put_interface_no_suspend); |
| @@ -1715,8 +1707,6 @@ int usb_autopm_get_interface(struct usb_interface *intf) | |||
| 1715 | status = pm_runtime_get_sync(&intf->dev); | 1707 | status = pm_runtime_get_sync(&intf->dev); |
| 1716 | if (status < 0) | 1708 | if (status < 0) |
| 1717 | pm_runtime_put_sync(&intf->dev); | 1709 | pm_runtime_put_sync(&intf->dev); |
| 1718 | else | ||
| 1719 | atomic_inc(&intf->pm_usage_cnt); | ||
| 1720 | dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", | 1710 | dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", |
| 1721 | __func__, atomic_read(&intf->dev.power.usage_count), | 1711 | __func__, atomic_read(&intf->dev.power.usage_count), |
| 1722 | status); | 1712 | status); |
| @@ -1750,8 +1740,6 @@ int usb_autopm_get_interface_async(struct usb_interface *intf) | |||
| 1750 | status = pm_runtime_get(&intf->dev); | 1740 | status = pm_runtime_get(&intf->dev); |
| 1751 | if (status < 0 && status != -EINPROGRESS) | 1741 | if (status < 0 && status != -EINPROGRESS) |
| 1752 | pm_runtime_put_noidle(&intf->dev); | 1742 | pm_runtime_put_noidle(&intf->dev); |
| 1753 | else | ||
| 1754 | atomic_inc(&intf->pm_usage_cnt); | ||
| 1755 | dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", | 1743 | dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", |
| 1756 | __func__, atomic_read(&intf->dev.power.usage_count), | 1744 | __func__, atomic_read(&intf->dev.power.usage_count), |
| 1757 | status); | 1745 | status); |
| @@ -1775,7 +1763,6 @@ void usb_autopm_get_interface_no_resume(struct usb_interface *intf) | |||
| 1775 | struct usb_device *udev = interface_to_usbdev(intf); | 1763 | struct usb_device *udev = interface_to_usbdev(intf); |
| 1776 | 1764 | ||
| 1777 | usb_mark_last_busy(udev); | 1765 | usb_mark_last_busy(udev); |
| 1778 | atomic_inc(&intf->pm_usage_cnt); | ||
| 1779 | pm_runtime_get_noresume(&intf->dev); | 1766 | pm_runtime_get_noresume(&intf->dev); |
| 1780 | } | 1767 | } |
| 1781 | EXPORT_SYMBOL_GPL(usb_autopm_get_interface_no_resume); | 1768 | EXPORT_SYMBOL_GPL(usb_autopm_get_interface_no_resume); |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 82239f27c4cc..e844bb7b5676 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
| @@ -820,9 +820,11 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size) | |||
| 820 | 820 | ||
| 821 | if (dev->state == USB_STATE_SUSPENDED) | 821 | if (dev->state == USB_STATE_SUSPENDED) |
| 822 | return -EHOSTUNREACH; | 822 | return -EHOSTUNREACH; |
| 823 | if (size <= 0 || !buf || !index) | 823 | if (size <= 0 || !buf) |
| 824 | return -EINVAL; | 824 | return -EINVAL; |
| 825 | buf[0] = 0; | 825 | buf[0] = 0; |
| 826 | if (index <= 0 || index >= 256) | ||
| 827 | return -EINVAL; | ||
| 826 | tbuf = kmalloc(256, GFP_NOIO); | 828 | tbuf = kmalloc(256, GFP_NOIO); |
| 827 | if (!tbuf) | 829 | if (!tbuf) |
| 828 | return -ENOMEM; | 830 | return -ENOMEM; |
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index baf72f95f0f1..213b52508621 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c | |||
| @@ -979,8 +979,18 @@ static int dummy_udc_start(struct usb_gadget *g, | |||
| 979 | struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g); | 979 | struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g); |
| 980 | struct dummy *dum = dum_hcd->dum; | 980 | struct dummy *dum = dum_hcd->dum; |
| 981 | 981 | ||
| 982 | if (driver->max_speed == USB_SPEED_UNKNOWN) | 982 | switch (g->speed) { |
| 983 | /* All the speeds we support */ | ||
| 984 | case USB_SPEED_LOW: | ||
| 985 | case USB_SPEED_FULL: | ||
| 986 | case USB_SPEED_HIGH: | ||
| 987 | case USB_SPEED_SUPER: | ||
| 988 | break; | ||
| 989 | default: | ||
| 990 | dev_err(dummy_dev(dum_hcd), "Unsupported driver max speed %d\n", | ||
| 991 | driver->max_speed); | ||
| 983 | return -EINVAL; | 992 | return -EINVAL; |
| 993 | } | ||
| 984 | 994 | ||
| 985 | /* | 995 | /* |
| 986 | * SLAVE side init ... the layer above hardware, which | 996 | * SLAVE side init ... the layer above hardware, which |
| @@ -1784,9 +1794,10 @@ static void dummy_timer(struct timer_list *t) | |||
| 1784 | /* Bus speed is 500000 bytes/ms, so use a little less */ | 1794 | /* Bus speed is 500000 bytes/ms, so use a little less */ |
| 1785 | total = 490000; | 1795 | total = 490000; |
| 1786 | break; | 1796 | break; |
| 1787 | default: | 1797 | default: /* Can't happen */ |
| 1788 | dev_err(dummy_dev(dum_hcd), "bogus device speed\n"); | 1798 | dev_err(dummy_dev(dum_hcd), "bogus device speed\n"); |
| 1789 | return; | 1799 | total = 0; |
| 1800 | break; | ||
| 1790 | } | 1801 | } |
| 1791 | 1802 | ||
| 1792 | /* FIXME if HZ != 1000 this will probably misbehave ... */ | 1803 | /* FIXME if HZ != 1000 this will probably misbehave ... */ |
| @@ -1828,7 +1839,7 @@ restart: | |||
| 1828 | 1839 | ||
| 1829 | /* Used up this frame's bandwidth? */ | 1840 | /* Used up this frame's bandwidth? */ |
| 1830 | if (total <= 0) | 1841 | if (total <= 0) |
| 1831 | break; | 1842 | continue; |
| 1832 | 1843 | ||
| 1833 | /* find the gadget's ep for this request (if configured) */ | 1844 | /* find the gadget's ep for this request (if configured) */ |
| 1834 | address = usb_pipeendpoint (urb->pipe); | 1845 | address = usb_pipeendpoint (urb->pipe); |
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 6d9fd5f64903..7b306aa22d25 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c | |||
| @@ -314,6 +314,7 @@ static void yurex_disconnect(struct usb_interface *interface) | |||
| 314 | usb_deregister_dev(interface, &yurex_class); | 314 | usb_deregister_dev(interface, &yurex_class); |
| 315 | 315 | ||
| 316 | /* prevent more I/O from starting */ | 316 | /* prevent more I/O from starting */ |
| 317 | usb_poison_urb(dev->urb); | ||
| 317 | mutex_lock(&dev->io_mutex); | 318 | mutex_lock(&dev->io_mutex); |
| 318 | dev->interface = NULL; | 319 | dev->interface = NULL; |
| 319 | mutex_unlock(&dev->io_mutex); | 320 | mutex_unlock(&dev->io_mutex); |
diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c index 31b024441938..cc794e25a0b6 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c | |||
| @@ -763,18 +763,16 @@ static void rts51x_suspend_timer_fn(struct timer_list *t) | |||
| 763 | break; | 763 | break; |
| 764 | case RTS51X_STAT_IDLE: | 764 | case RTS51X_STAT_IDLE: |
| 765 | case RTS51X_STAT_SS: | 765 | case RTS51X_STAT_SS: |
| 766 | usb_stor_dbg(us, "RTS51X_STAT_SS, intf->pm_usage_cnt:%d, power.usage:%d\n", | 766 | usb_stor_dbg(us, "RTS51X_STAT_SS, power.usage:%d\n", |
| 767 | atomic_read(&us->pusb_intf->pm_usage_cnt), | ||
| 768 | atomic_read(&us->pusb_intf->dev.power.usage_count)); | 767 | atomic_read(&us->pusb_intf->dev.power.usage_count)); |
| 769 | 768 | ||
| 770 | if (atomic_read(&us->pusb_intf->pm_usage_cnt) > 0) { | 769 | if (atomic_read(&us->pusb_intf->dev.power.usage_count) > 0) { |
| 771 | usb_stor_dbg(us, "Ready to enter SS state\n"); | 770 | usb_stor_dbg(us, "Ready to enter SS state\n"); |
| 772 | rts51x_set_stat(chip, RTS51X_STAT_SS); | 771 | rts51x_set_stat(chip, RTS51X_STAT_SS); |
| 773 | /* ignore mass storage interface's children */ | 772 | /* ignore mass storage interface's children */ |
| 774 | pm_suspend_ignore_children(&us->pusb_intf->dev, true); | 773 | pm_suspend_ignore_children(&us->pusb_intf->dev, true); |
| 775 | usb_autopm_put_interface_async(us->pusb_intf); | 774 | usb_autopm_put_interface_async(us->pusb_intf); |
| 776 | usb_stor_dbg(us, "RTS51X_STAT_SS 01, intf->pm_usage_cnt:%d, power.usage:%d\n", | 775 | usb_stor_dbg(us, "RTS51X_STAT_SS 01, power.usage:%d\n", |
| 777 | atomic_read(&us->pusb_intf->pm_usage_cnt), | ||
| 778 | atomic_read(&us->pusb_intf->dev.power.usage_count)); | 776 | atomic_read(&us->pusb_intf->dev.power.usage_count)); |
| 779 | } | 777 | } |
| 780 | break; | 778 | break; |
| @@ -807,11 +805,10 @@ static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) | |||
| 807 | int ret; | 805 | int ret; |
| 808 | 806 | ||
| 809 | if (working_scsi(srb)) { | 807 | if (working_scsi(srb)) { |
| 810 | usb_stor_dbg(us, "working scsi, intf->pm_usage_cnt:%d, power.usage:%d\n", | 808 | usb_stor_dbg(us, "working scsi, power.usage:%d\n", |
| 811 | atomic_read(&us->pusb_intf->pm_usage_cnt), | ||
| 812 | atomic_read(&us->pusb_intf->dev.power.usage_count)); | 809 | atomic_read(&us->pusb_intf->dev.power.usage_count)); |
| 813 | 810 | ||
| 814 | if (atomic_read(&us->pusb_intf->pm_usage_cnt) <= 0) { | 811 | if (atomic_read(&us->pusb_intf->dev.power.usage_count) <= 0) { |
| 815 | ret = usb_autopm_get_interface(us->pusb_intf); | 812 | ret = usb_autopm_get_interface(us->pusb_intf); |
| 816 | usb_stor_dbg(us, "working scsi, ret=%d\n", ret); | 813 | usb_stor_dbg(us, "working scsi, ret=%d\n", ret); |
| 817 | } | 814 | } |
diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c index 97b09a42a10c..dbfb2f24d71e 100644 --- a/drivers/usb/usbip/stub_rx.c +++ b/drivers/usb/usbip/stub_rx.c | |||
| @@ -361,16 +361,10 @@ static int get_pipe(struct stub_device *sdev, struct usbip_header *pdu) | |||
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | if (usb_endpoint_xfer_isoc(epd)) { | 363 | if (usb_endpoint_xfer_isoc(epd)) { |
| 364 | /* validate packet size and number of packets */ | 364 | /* validate number of packets */ |
| 365 | unsigned int maxp, packets, bytes; | ||
| 366 | |||
| 367 | maxp = usb_endpoint_maxp(epd); | ||
| 368 | maxp *= usb_endpoint_maxp_mult(epd); | ||
| 369 | bytes = pdu->u.cmd_submit.transfer_buffer_length; | ||
| 370 | packets = DIV_ROUND_UP(bytes, maxp); | ||
| 371 | |||
| 372 | if (pdu->u.cmd_submit.number_of_packets < 0 || | 365 | if (pdu->u.cmd_submit.number_of_packets < 0 || |
| 373 | pdu->u.cmd_submit.number_of_packets > packets) { | 366 | pdu->u.cmd_submit.number_of_packets > |
| 367 | USBIP_MAX_ISO_PACKETS) { | ||
| 374 | dev_err(&sdev->udev->dev, | 368 | dev_err(&sdev->udev->dev, |
| 375 | "CMD_SUBMIT: isoc invalid num packets %d\n", | 369 | "CMD_SUBMIT: isoc invalid num packets %d\n", |
| 376 | pdu->u.cmd_submit.number_of_packets); | 370 | pdu->u.cmd_submit.number_of_packets); |
diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip/usbip_common.h index bf8afe9b5883..8be857a4fa13 100644 --- a/drivers/usb/usbip/usbip_common.h +++ b/drivers/usb/usbip/usbip_common.h | |||
| @@ -121,6 +121,13 @@ extern struct device_attribute dev_attr_usbip_debug; | |||
| 121 | #define USBIP_DIR_OUT 0x00 | 121 | #define USBIP_DIR_OUT 0x00 |
| 122 | #define USBIP_DIR_IN 0x01 | 122 | #define USBIP_DIR_IN 0x01 |
| 123 | 123 | ||
| 124 | /* | ||
| 125 | * Arbitrary limit for the maximum number of isochronous packets in an URB, | ||
| 126 | * compare for example the uhci_submit_isochronous function in | ||
| 127 | * drivers/usb/host/uhci-q.c | ||
| 128 | */ | ||
| 129 | #define USBIP_MAX_ISO_PACKETS 1024 | ||
| 130 | |||
| 124 | /** | 131 | /** |
| 125 | * struct usbip_header_basic - data pertinent to every request | 132 | * struct usbip_header_basic - data pertinent to every request |
| 126 | * @command: the usbip request type | 133 | * @command: the usbip request type |
diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c index 0f4ecfcdb549..a9fb77585272 100644 --- a/drivers/w1/masters/ds2490.c +++ b/drivers/w1/masters/ds2490.c | |||
| @@ -1016,15 +1016,15 @@ static int ds_probe(struct usb_interface *intf, | |||
| 1016 | /* alternative 3, 1ms interrupt (greatly speeds search), 64 byte bulk */ | 1016 | /* alternative 3, 1ms interrupt (greatly speeds search), 64 byte bulk */ |
| 1017 | alt = 3; | 1017 | alt = 3; |
| 1018 | err = usb_set_interface(dev->udev, | 1018 | err = usb_set_interface(dev->udev, |
| 1019 | intf->altsetting[alt].desc.bInterfaceNumber, alt); | 1019 | intf->cur_altsetting->desc.bInterfaceNumber, alt); |
| 1020 | if (err) { | 1020 | if (err) { |
| 1021 | dev_err(&dev->udev->dev, "Failed to set alternative setting %d " | 1021 | dev_err(&dev->udev->dev, "Failed to set alternative setting %d " |
| 1022 | "for %d interface: err=%d.\n", alt, | 1022 | "for %d interface: err=%d.\n", alt, |
| 1023 | intf->altsetting[alt].desc.bInterfaceNumber, err); | 1023 | intf->cur_altsetting->desc.bInterfaceNumber, err); |
| 1024 | goto err_out_clear; | 1024 | goto err_out_clear; |
| 1025 | } | 1025 | } |
| 1026 | 1026 | ||
| 1027 | iface_desc = &intf->altsetting[alt]; | 1027 | iface_desc = intf->cur_altsetting; |
| 1028 | if (iface_desc->desc.bNumEndpoints != NUM_EP-1) { | 1028 | if (iface_desc->desc.bNumEndpoints != NUM_EP-1) { |
| 1029 | pr_info("Num endpoints=%d. It is not DS9490R.\n", | 1029 | pr_info("Num endpoints=%d. It is not DS9490R.\n", |
| 1030 | iface_desc->desc.bNumEndpoints); | 1030 | iface_desc->desc.bNumEndpoints); |
