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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'spi-fix-v4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
"There's one fix for the core here, we weren't reinitialising the
actual transferred length in messages when they get reused which meant
that we'd just keep adding to the length if a message is reused. This
has limited impact since it's only used in error handling cases but
will really mess anything that tries to use it up when it triggers.

As ever there's a small collection of driver specific fixes too"

* tag 'spi-fix-v4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: bugfix: spi_message.transfer_length does not get reset
spi: pl022: handle EPROBE_DEFER for dma
spi: bcm63xx: use correct format string for printing a resource
spi: mediatek: single device does not require cs_gpios
spi: Add missing kerneldoc description for parameter

+44 -16
+2 -2
drivers/spi/spi-bcm63xx.c
··· 562 562 goto out_clk_disable; 563 563 } 564 564 565 - dev_info(dev, "at 0x%08x (irq %d, FIFOs size %d)\n", 566 - r->start, irq, bs->fifo_size); 565 + dev_info(dev, "at %pr (irq %d, FIFOs size %d)\n", 566 + r, irq, bs->fifo_size); 567 567 568 568 return 0; 569 569
+18 -8
drivers/spi/spi-mt65xx.c
··· 410 410 if (!spi->controller_data) 411 411 spi->controller_data = (void *)&mtk_default_chip_info; 412 412 413 - if (mdata->dev_comp->need_pad_sel) 413 + if (mdata->dev_comp->need_pad_sel && gpio_is_valid(spi->cs_gpio)) 414 414 gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); 415 415 416 416 return 0; ··· 632 632 goto err_put_master; 633 633 } 634 634 635 - for (i = 0; i < master->num_chipselect; i++) { 636 - ret = devm_gpio_request(&pdev->dev, master->cs_gpios[i], 637 - dev_name(&pdev->dev)); 638 - if (ret) { 639 - dev_err(&pdev->dev, 640 - "can't get CS GPIO %i\n", i); 641 - goto err_put_master; 635 + if (!master->cs_gpios && master->num_chipselect > 1) { 636 + dev_err(&pdev->dev, 637 + "cs_gpios not specified and num_chipselect > 1\n"); 638 + ret = -EINVAL; 639 + goto err_put_master; 640 + } 641 + 642 + if (master->cs_gpios) { 643 + for (i = 0; i < master->num_chipselect; i++) { 644 + ret = devm_gpio_request(&pdev->dev, 645 + master->cs_gpios[i], 646 + dev_name(&pdev->dev)); 647 + if (ret) { 648 + dev_err(&pdev->dev, 649 + "can't get CS GPIO %i\n", i); 650 + goto err_put_master; 651 + } 642 652 } 643 653 } 644 654 }
+22 -6
drivers/spi/spi-pl022.c
··· 1171 1171 static int pl022_dma_autoprobe(struct pl022 *pl022) 1172 1172 { 1173 1173 struct device *dev = &pl022->adev->dev; 1174 + struct dma_chan *chan; 1175 + int err; 1174 1176 1175 1177 /* automatically configure DMA channels from platform, normally using DT */ 1176 - pl022->dma_rx_channel = dma_request_slave_channel(dev, "rx"); 1177 - if (!pl022->dma_rx_channel) 1178 + chan = dma_request_slave_channel_reason(dev, "rx"); 1179 + if (IS_ERR(chan)) { 1180 + err = PTR_ERR(chan); 1178 1181 goto err_no_rxchan; 1182 + } 1179 1183 1180 - pl022->dma_tx_channel = dma_request_slave_channel(dev, "tx"); 1181 - if (!pl022->dma_tx_channel) 1184 + pl022->dma_rx_channel = chan; 1185 + 1186 + chan = dma_request_slave_channel_reason(dev, "tx"); 1187 + if (IS_ERR(chan)) { 1188 + err = PTR_ERR(chan); 1182 1189 goto err_no_txchan; 1190 + } 1191 + 1192 + pl022->dma_tx_channel = chan; 1183 1193 1184 1194 pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL); 1185 - if (!pl022->dummypage) 1195 + if (!pl022->dummypage) { 1196 + err = -ENOMEM; 1186 1197 goto err_no_dummypage; 1198 + } 1187 1199 1188 1200 return 0; 1189 1201 ··· 1206 1194 dma_release_channel(pl022->dma_rx_channel); 1207 1195 pl022->dma_rx_channel = NULL; 1208 1196 err_no_rxchan: 1209 - return -ENODEV; 1197 + return err; 1210 1198 } 1211 1199 1212 1200 static void terminate_dma(struct pl022 *pl022) ··· 2248 2236 2249 2237 /* Get DMA channels, try autoconfiguration first */ 2250 2238 status = pl022_dma_autoprobe(pl022); 2239 + if (status == -EPROBE_DEFER) { 2240 + dev_dbg(dev, "deferring probe to get DMA channel\n"); 2241 + goto err_no_irq; 2242 + } 2251 2243 2252 2244 /* If that failed, use channels from platform_info */ 2253 2245 if (status == 0)
+2
drivers/spi/spi.c
··· 376 376 377 377 /** 378 378 * __spi_register_driver - register a SPI driver 379 + * @owner: owner module of the driver to register 379 380 * @sdrv: the driver to register 380 381 * Context: can sleep 381 382 * ··· 2131 2130 * Set transfer tx_nbits and rx_nbits as single transfer default 2132 2131 * (SPI_NBITS_SINGLE) if it is not set for this transfer. 2133 2132 */ 2133 + message->frame_length = 0; 2134 2134 list_for_each_entry(xfer, &message->transfers, transfer_list) { 2135 2135 message->frame_length += xfer->len; 2136 2136 if (!xfer->bits_per_word)