Commit 9a48d4a1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull i3c fixes from Alexandre Belloni:
 "This introduces the I3C_OR_I2C symbol which is not a fix per se but is
  affecting multiple subsystems so it is included to ease
  synchronization.

  Apart from that, Adrian is mostly fixing the mipi-i3c-hci driver DMA
  handling, and I took the opportunity to add two fixes for the dw-i3c
  driver.

  Subsystem:
   - simplify combined i3c/i2c dependencies

  Drivers:
   - dw: handle 2C properly, fix possible race condition
   - mipi-i3c-hci: many DMA related fixes"

* tag 'i3c/fixes-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux:
  i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach
  i3c: master: dw-i3c: Fix missing of_node for virtual I2C adapter
  i3c: mipi-i3c-hci: Fallback to software reset when bus disable fails
  i3c: mipi-i3c-hci: Fix handling of shared IRQs during early initialization
  i3c: mipi-i3c-hci: Fix race in DMA error handling in interrupt context
  i3c: mipi-i3c-hci: Consolidate common xfer processing logic
  i3c: mipi-i3c-hci: Restart DMA ring correctly after dequeue abort
  i3c: mipi-i3c-hci: Add missing TID field to no-op command descriptor
  i3c: mipi-i3c-hci: Correct RING_CTRL_ABORT handling in DMA dequeue
  i3c: mipi-i3c-hci: Fix race between DMA ring dequeue and interrupt handler
  i3c: mipi-i3c-hci: Fix race in DMA ring dequeue
  i3c: mipi-i3c-hci: Fix race in DMA ring enqueue for parallel xfers
  i3c: mipi-i3c-hci: Consolidate spinlocks
  i3c: mipi-i3c-hci: Factor out DMA mapping from queuing path
  i3c: mipi-i3c-hci: Fix Hot-Join NACK
  i3c: mipi-i3c-hci: Use ETIMEDOUT instead of ETIME for timeout errors
  i3c: simplify combined i3c/i2c dependencies
parents f26de90c f311a057
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1493,8 +1493,7 @@ config SENSORS_LM73

config SENSORS_LM75
	tristate "National Semiconductor LM75 and compatibles"
	depends on I2C
	depends on I3C || !I3C
	depends on I3C_OR_I2C
	select REGMAP_I2C
	select REGMAP_I3C if I3C
	help
@@ -2382,8 +2381,7 @@ config SENSORS_TMP103

config SENSORS_TMP108
	tristate "Texas Instruments TMP108"
	depends on I2C
	depends on I3C || !I3C
	depends on I3C_OR_I2C
	select REGMAP_I2C
	select REGMAP_I3C if I3C
	help
+12 −0
Original line number Diff line number Diff line
@@ -22,3 +22,15 @@ menuconfig I3C
if I3C
source "drivers/i3c/master/Kconfig"
endif # I3C

config I3C_OR_I2C
	tristate
	default m if I3C=m
	default I2C
	help
	  Device drivers using module_i3c_i2c_driver() can use either
	  i2c or i3c hosts, but cannot be built-in for the kernel when
	  CONFIG_I3C=m.

	  Add 'depends on I2C_OR_I3C' in Kconfig for those drivers to
	  get the correct dependencies.
+4 −2
Original line number Diff line number Diff line
@@ -1024,7 +1024,7 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev,
		master->free_pos &= ~BIT(pos);
	}

	writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr),
	writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr) | DEV_ADDR_TABLE_SIR_REJECT,
	       master->regs +
	       DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));

@@ -1053,7 +1053,7 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev)
	master->free_pos &= ~BIT(pos);
	i3c_dev_set_master_data(dev, data);

	writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr),
	writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr) | DEV_ADDR_TABLE_SIR_REJECT,
	       master->regs +
	       DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));

@@ -1659,6 +1659,8 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
		pm_runtime_get_noresume(&pdev->dev);

	INIT_WORK(&master->hj_work, dw_i3c_hj_work);

	device_set_of_node_from_dev(&master->base.i2c.dev, &pdev->dev);
	ret = i3c_master_register(&master->base, &pdev->dev,
				  &dw_mipi_i3c_ops, false);
	if (ret)
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#define CMD_0_TOC			W0_BIT_(31)
#define CMD_0_ROC			W0_BIT_(30)
#define CMD_0_ATTR			W0_MASK(2, 0)
#define CMD_0_TID			W0_MASK(6, 3)

/*
 * Response Descriptor Structure
+3 −5
Original line number Diff line number Diff line
@@ -331,12 +331,10 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
			CMD_A0_ROC | CMD_A0_TOC;
		xfer->cmd_desc[1] = 0;
		xfer->completion = &done;
		hci->io->queue_xfer(hci, xfer, 1);
		if (!wait_for_completion_timeout(&done, HZ) &&
		    hci->io->dequeue_xfer(hci, xfer, 1)) {
			ret = -ETIME;
		xfer->timeout = HZ;
		ret = i3c_hci_process_xfer(hci, xfer, 1);
		if (ret)
			break;
		}
		if ((RESP_STATUS(xfer->response) == RESP_ERR_ADDR_HEADER ||
		     RESP_STATUS(xfer->response) == RESP_ERR_NACK) &&
		    RESP_DATA_LENGTH(xfer->response) == 1) {
Loading