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-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
"A couple of reference counting bugs here, one in spidev and one with
holding an extra reference in the core that we never freed if we
removed a device, plus a driver specific fix. Both of the refcounting
bugs are very old but they've only been found by observation so
hopefully their impact has been low"

* tag 'spi-fix-v4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: fix parent-device reference leak
spi: spidev: Hold spi_lock over all defererences of spi in release()
spi-fsl-dspi: Fix CTAR Register access

+8 -8
+6 -6
drivers/spi/spi-fsl-dspi.c
··· 167 167 { 168 168 unsigned int val; 169 169 170 - regmap_read(dspi->regmap, SPI_CTAR(dspi->cs), &val); 170 + regmap_read(dspi->regmap, SPI_CTAR(0), &val); 171 171 172 172 return ((val & SPI_FRAME_BITS_MASK) == SPI_FRAME_BITS(8)) ? 0 : 1; 173 173 } ··· 257 257 258 258 return SPI_PUSHR_TXDATA(d16) | 259 259 SPI_PUSHR_PCS(dspi->cs) | 260 - SPI_PUSHR_CTAS(dspi->cs) | 260 + SPI_PUSHR_CTAS(0) | 261 261 SPI_PUSHR_CONT; 262 262 } 263 263 ··· 290 290 */ 291 291 if (tx_word && (dspi->len == 1)) { 292 292 dspi->dataflags |= TRAN_STATE_WORD_ODD_NUM; 293 - regmap_update_bits(dspi->regmap, SPI_CTAR(dspi->cs), 293 + regmap_update_bits(dspi->regmap, SPI_CTAR(0), 294 294 SPI_FRAME_BITS_MASK, SPI_FRAME_BITS(8)); 295 295 tx_word = 0; 296 296 } ··· 339 339 340 340 if (tx_word && (dspi->len == 1)) { 341 341 dspi->dataflags |= TRAN_STATE_WORD_ODD_NUM; 342 - regmap_update_bits(dspi->regmap, SPI_CTAR(dspi->cs), 342 + regmap_update_bits(dspi->regmap, SPI_CTAR(0), 343 343 SPI_FRAME_BITS_MASK, SPI_FRAME_BITS(8)); 344 344 tx_word = 0; 345 345 } ··· 407 407 regmap_update_bits(dspi->regmap, SPI_MCR, 408 408 SPI_MCR_CLR_TXF | SPI_MCR_CLR_RXF, 409 409 SPI_MCR_CLR_TXF | SPI_MCR_CLR_RXF); 410 - regmap_write(dspi->regmap, SPI_CTAR(dspi->cs), 410 + regmap_write(dspi->regmap, SPI_CTAR(0), 411 411 dspi->cur_chip->ctar_val); 412 412 413 413 trans_mode = dspi->devtype_data->trans_mode; ··· 566 566 if (!dspi->len) { 567 567 if (dspi->dataflags & TRAN_STATE_WORD_ODD_NUM) { 568 568 regmap_update_bits(dspi->regmap, 569 - SPI_CTAR(dspi->cs), 569 + SPI_CTAR(0), 570 570 SPI_FRAME_BITS_MASK, 571 571 SPI_FRAME_BITS(16)); 572 572 dspi->dataflags &= ~TRAN_STATE_WORD_ODD_NUM;
+1 -1
drivers/spi/spi.c
··· 1705 1705 master->bus_num = -1; 1706 1706 master->num_chipselect = 1; 1707 1707 master->dev.class = &spi_master_class; 1708 - master->dev.parent = get_device(dev); 1708 + master->dev.parent = dev; 1709 1709 spi_master_set_devdata(master, &master[1]); 1710 1710 1711 1711 return master;
+1 -1
drivers/spi/spidev.c
··· 651 651 kfree(spidev->rx_buffer); 652 652 spidev->rx_buffer = NULL; 653 653 654 + spin_lock_irq(&spidev->spi_lock); 654 655 if (spidev->spi) 655 656 spidev->speed_hz = spidev->spi->max_speed_hz; 656 657 657 658 /* ... after we unbound from the underlying device? */ 658 - spin_lock_irq(&spidev->spi_lock); 659 659 dofree = (spidev->spi == NULL); 660 660 spin_unlock_irq(&spidev->spi_lock); 661 661