Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fixes' into next

+91 -4
+8
drivers/dma/imx-sdma.c
··· 1707 1707 if (!sdma->script_number) 1708 1708 sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; 1709 1709 1710 + if (sdma->script_number > sizeof(struct sdma_script_start_addrs) 1711 + / sizeof(s32)) { 1712 + dev_err(sdma->dev, 1713 + "SDMA script number %d not match with firmware.\n", 1714 + sdma->script_number); 1715 + return; 1716 + } 1717 + 1710 1718 for (i = 0; i < sdma->script_number; i++) 1711 1719 if (addr_arr[i] > 0) 1712 1720 saddr_arr[i] = addr_arr[i];
+19
drivers/dma/qcom/bam_dma.c
··· 694 694 695 695 /* remove all transactions, including active transaction */ 696 696 spin_lock_irqsave(&bchan->vc.lock, flag); 697 + /* 698 + * If we have transactions queued, then some might be committed to the 699 + * hardware in the desc fifo. The only way to reset the desc fifo is 700 + * to do a hardware reset (either by pipe or the entire block). 701 + * bam_chan_init_hw() will trigger a pipe reset, and also reinit the 702 + * pipe. If the pipe is left disabled (default state after pipe reset) 703 + * and is accessed by a connected hardware engine, a fatal error in 704 + * the BAM will occur. There is a small window where this could happen 705 + * with bam_chan_init_hw(), but it is assumed that the caller has 706 + * stopped activity on any attached hardware engine. Make sure to do 707 + * this first so that the BAM hardware doesn't cause memory corruption 708 + * by accessing freed resources. 709 + */ 710 + if (!list_empty(&bchan->desc_list)) { 711 + async_desc = list_first_entry(&bchan->desc_list, 712 + struct bam_async_desc, desc_node); 713 + bam_chan_init_hw(bchan, async_desc->dir); 714 + } 715 + 697 716 list_for_each_entry_safe(async_desc, tmp, 698 717 &bchan->desc_list, desc_node) { 699 718 list_add(&async_desc->vd.node, &bchan->vc.desc_issued);
+25 -2
drivers/dma/sprd-dma.c
··· 134 134 #define SPRD_DMA_SRC_TRSF_STEP_OFFSET 0 135 135 #define SPRD_DMA_TRSF_STEP_MASK GENMASK(15, 0) 136 136 137 + /* SPRD DMA_SRC_BLK_STEP register definition */ 138 + #define SPRD_DMA_LLIST_HIGH_MASK GENMASK(31, 28) 139 + #define SPRD_DMA_LLIST_HIGH_SHIFT 28 140 + 137 141 /* define DMA channel mode & trigger mode mask */ 138 142 #define SPRD_DMA_CHN_MODE_MASK GENMASK(7, 0) 139 143 #define SPRD_DMA_TRG_MODE_MASK GENMASK(7, 0) ··· 212 208 struct sprd_dma_chn channels[0]; 213 209 }; 214 210 211 + static void sprd_dma_free_desc(struct virt_dma_desc *vd); 215 212 static bool sprd_dma_filter_fn(struct dma_chan *chan, void *param); 216 213 static struct of_dma_filter_info sprd_dma_info = { 217 214 .filter_fn = sprd_dma_filter_fn, ··· 614 609 static void sprd_dma_free_chan_resources(struct dma_chan *chan) 615 610 { 616 611 struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); 612 + struct virt_dma_desc *cur_vd = NULL; 617 613 unsigned long flags; 618 614 619 615 spin_lock_irqsave(&schan->vc.lock, flags); 616 + if (schan->cur_desc) 617 + cur_vd = &schan->cur_desc->vd; 618 + 620 619 sprd_dma_stop(schan); 621 620 spin_unlock_irqrestore(&schan->vc.lock, flags); 621 + 622 + if (cur_vd) 623 + sprd_dma_free_desc(cur_vd); 622 624 623 625 vchan_free_chan_resources(&schan->vc); 624 626 pm_runtime_put(chan->device->dev); ··· 729 717 u32 int_mode = flags & SPRD_DMA_INT_MASK; 730 718 int src_datawidth, dst_datawidth, src_step, dst_step; 731 719 u32 temp, fix_mode = 0, fix_en = 0; 720 + phys_addr_t llist_ptr; 732 721 733 722 if (dir == DMA_MEM_TO_DEV) { 734 723 src_step = sprd_dma_get_step(slave_cfg->src_addr_width); ··· 827 814 * Set the link-list pointer point to next link-list 828 815 * configuration's physical address. 829 816 */ 830 - hw->llist_ptr = schan->linklist.phy_addr + temp; 817 + llist_ptr = schan->linklist.phy_addr + temp; 818 + hw->llist_ptr = lower_32_bits(llist_ptr); 819 + hw->src_blk_step = (upper_32_bits(llist_ptr) << SPRD_DMA_LLIST_HIGH_SHIFT) & 820 + SPRD_DMA_LLIST_HIGH_MASK; 831 821 } else { 832 822 hw->llist_ptr = 0; 823 + hw->src_blk_step = 0; 833 824 } 834 825 835 826 hw->frg_step = 0; 836 - hw->src_blk_step = 0; 837 827 hw->des_blk_step = 0; 838 828 return 0; 839 829 } ··· 1039 1023 static int sprd_dma_terminate_all(struct dma_chan *chan) 1040 1024 { 1041 1025 struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); 1026 + struct virt_dma_desc *cur_vd = NULL; 1042 1027 unsigned long flags; 1043 1028 LIST_HEAD(head); 1044 1029 1045 1030 spin_lock_irqsave(&schan->vc.lock, flags); 1031 + if (schan->cur_desc) 1032 + cur_vd = &schan->cur_desc->vd; 1033 + 1046 1034 sprd_dma_stop(schan); 1047 1035 1048 1036 vchan_get_all_descriptors(&schan->vc, &head); 1049 1037 spin_unlock_irqrestore(&schan->vc.lock, flags); 1038 + 1039 + if (cur_vd) 1040 + sprd_dma_free_desc(cur_vd); 1050 1041 1051 1042 vchan_dma_desc_free_list(&schan->vc, &head); 1052 1043 return 0;
+7
drivers/dma/tegra210-adma.c
··· 40 40 #define ADMA_CH_CONFIG_MAX_BURST_SIZE 16 41 41 #define ADMA_CH_CONFIG_WEIGHT_FOR_WRR(val) ((val) & 0xf) 42 42 #define ADMA_CH_CONFIG_MAX_BUFS 8 43 + #define TEGRA186_ADMA_CH_CONFIG_OUTSTANDING_REQS(reqs) (reqs << 4) 43 44 44 45 #define ADMA_CH_FIFO_CTRL 0x2c 45 46 #define TEGRA210_ADMA_CH_FIFO_CTRL_TXSIZE(val) (((val) & 0xf) << 8) ··· 78 77 * @ch_req_tx_shift: Register offset for AHUB transmit channel select. 79 78 * @ch_req_rx_shift: Register offset for AHUB receive channel select. 80 79 * @ch_base_offset: Register offset of DMA channel registers. 80 + * @has_outstanding_reqs: If DMA channel can have outstanding requests. 81 81 * @ch_fifo_ctrl: Default value for channel FIFO CTRL register. 82 82 * @ch_req_mask: Mask for Tx or Rx channel select. 83 83 * @ch_req_max: Maximum number of Tx or Rx channels available. ··· 97 95 unsigned int ch_req_max; 98 96 unsigned int ch_reg_size; 99 97 unsigned int nr_channels; 98 + bool has_outstanding_reqs; 100 99 }; 101 100 102 101 /* ··· 597 594 ADMA_CH_CTRL_FLOWCTRL_EN; 598 595 ch_regs->config |= cdata->adma_get_burst_config(burst_size); 599 596 ch_regs->config |= ADMA_CH_CONFIG_WEIGHT_FOR_WRR(1); 597 + if (cdata->has_outstanding_reqs) 598 + ch_regs->config |= TEGRA186_ADMA_CH_CONFIG_OUTSTANDING_REQS(8); 600 599 ch_regs->fifo_ctrl = cdata->ch_fifo_ctrl; 601 600 ch_regs->tc = desc->period_len & ADMA_CH_TC_COUNT_MASK; 602 601 ··· 783 778 .ch_req_tx_shift = 28, 784 779 .ch_req_rx_shift = 24, 785 780 .ch_base_offset = 0, 781 + .has_outstanding_reqs = false, 786 782 .ch_fifo_ctrl = TEGRA210_FIFO_CTRL_DEFAULT, 787 783 .ch_req_mask = 0xf, 788 784 .ch_req_max = 10, ··· 798 792 .ch_req_tx_shift = 27, 799 793 .ch_req_rx_shift = 22, 800 794 .ch_base_offset = 0x10000, 795 + .has_outstanding_reqs = true, 801 796 .ch_fifo_ctrl = TEGRA186_FIFO_CTRL_DEFAULT, 802 797 .ch_req_mask = 0x1f, 803 798 .ch_req_max = 20,
+20 -1
drivers/dma/ti/cppi41.c
··· 586 586 enum dma_transfer_direction dir, unsigned long tx_flags, void *context) 587 587 { 588 588 struct cppi41_channel *c = to_cpp41_chan(chan); 589 + struct dma_async_tx_descriptor *txd = NULL; 590 + struct cppi41_dd *cdd = c->cdd; 589 591 struct cppi41_desc *d; 590 592 struct scatterlist *sg; 591 593 unsigned int i; 594 + int error; 595 + 596 + error = pm_runtime_get(cdd->ddev.dev); 597 + if (error < 0) { 598 + pm_runtime_put_noidle(cdd->ddev.dev); 599 + 600 + return NULL; 601 + } 602 + 603 + if (cdd->is_suspended) 604 + goto err_out_not_ready; 592 605 593 606 d = c->desc; 594 607 for_each_sg(sgl, sg, sg_len, i) { ··· 624 611 d++; 625 612 } 626 613 627 - return &c->txd; 614 + txd = &c->txd; 615 + 616 + err_out_not_ready: 617 + pm_runtime_mark_last_busy(cdd->ddev.dev); 618 + pm_runtime_put_autosuspend(cdd->ddev.dev); 619 + 620 + return txd; 628 621 } 629 622 630 623 static void cppi41_compute_td_desc(struct cppi41_desc *d)
+9 -1
drivers/dma/xilinx/xilinx_dma.c
··· 74 74 #define XILINX_DMA_DMACR_CIRC_EN BIT(1) 75 75 #define XILINX_DMA_DMACR_RUNSTOP BIT(0) 76 76 #define XILINX_DMA_DMACR_FSYNCSRC_MASK GENMASK(6, 5) 77 + #define XILINX_DMA_DMACR_DELAY_MASK GENMASK(31, 24) 78 + #define XILINX_DMA_DMACR_FRAME_COUNT_MASK GENMASK(23, 16) 79 + #define XILINX_DMA_DMACR_MASTER_MASK GENMASK(11, 8) 77 80 78 81 #define XILINX_DMA_REG_DMASR 0x0004 79 82 #define XILINX_DMA_DMASR_EOL_LATE_ERR BIT(15) ··· 1539 1536 node); 1540 1537 hw = &segment->hw; 1541 1538 1542 - xilinx_write(chan, XILINX_DMA_REG_SRCDSTADDR, hw->buf_addr); 1539 + xilinx_write(chan, XILINX_DMA_REG_SRCDSTADDR, 1540 + xilinx_prep_dma_addr_t(hw->buf_addr)); 1543 1541 1544 1542 /* Start the transfer */ 1545 1543 dma_ctrl_write(chan, XILINX_DMA_REG_BTT, ··· 2463 2459 chan->config.gen_lock = cfg->gen_lock; 2464 2460 chan->config.master = cfg->master; 2465 2461 2462 + dmacr &= ~XILINX_DMA_DMACR_GENLOCK_EN; 2466 2463 if (cfg->gen_lock && chan->genlock) { 2467 2464 dmacr |= XILINX_DMA_DMACR_GENLOCK_EN; 2465 + dmacr &= ~XILINX_DMA_DMACR_MASTER_MASK; 2468 2466 dmacr |= cfg->master << XILINX_DMA_DMACR_MASTER_SHIFT; 2469 2467 } 2470 2468 ··· 2482 2476 chan->config.delay = cfg->delay; 2483 2477 2484 2478 if (cfg->coalesc <= XILINX_DMA_DMACR_FRAME_COUNT_MAX) { 2479 + dmacr &= ~XILINX_DMA_DMACR_FRAME_COUNT_MASK; 2485 2480 dmacr |= cfg->coalesc << XILINX_DMA_DMACR_FRAME_COUNT_SHIFT; 2486 2481 chan->config.coalesc = cfg->coalesc; 2487 2482 } 2488 2483 2489 2484 if (cfg->delay <= XILINX_DMA_DMACR_DELAY_MAX) { 2485 + dmacr &= ~XILINX_DMA_DMACR_DELAY_MASK; 2490 2486 dmacr |= cfg->delay << XILINX_DMA_DMACR_DELAY_SHIFT; 2491 2487 chan->config.delay = cfg->delay; 2492 2488 }
+3
include/linux/platform_data/dma-imx-sdma.h
··· 51 51 /* End of v2 array */ 52 52 s32 zcanfd_2_mcu_addr; 53 53 s32 zqspi_2_mcu_addr; 54 + s32 mcu_2_ecspi_addr; 54 55 /* End of v3 array */ 56 + s32 mcu_2_zqspi_addr; 57 + /* End of v4 array */ 55 58 }; 56 59 57 60 /**