All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the dmaengine tree with the dmaengine-fixes tree
@ 2021-12-14 17:24 broonie
  2021-12-28  9:09 ` Geert Uytterhoeven
  0 siblings, 1 reply; 17+ messages in thread
From: broonie @ 2021-12-14 17:24 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Dave Jiang, Linux Kernel Mailing List, Linux Next Mailing List

Hi all,

Today's linux-next merge of the dmaengine tree got a conflict in:

  drivers/dma/idxd/submit.c

between commit:

  8affd8a4b5ce3 ("dmaengine: idxd: fix missed completion on abort path")

from the dmaengine-fixes tree and commit:

  5d78abb6fbc97 ("dmaengine: idxd: rework descriptor free path on failure")

from the dmaengine tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc drivers/dma/idxd/submit.c
index 83452fbbb168b,569815a84e95b..0000000000000
--- a/drivers/dma/idxd/submit.c
+++ b/drivers/dma/idxd/submit.c
@@@ -134,20 -120,32 +125,43 @@@ static void llist_abort_desc(struct idx
  	spin_unlock(&ie->list_lock);
  
  	if (found)
- 		complete_desc(found, IDXD_COMPLETE_ABORT);
+ 		idxd_dma_complete_txd(found, IDXD_COMPLETE_ABORT, false);
 +
 +	/*
- 	 * complete_desc() will return desc to allocator and the desc can be
- 	 * acquired by a different process and the desc->list can be modified.
- 	 * Delete desc from list so the list trasversing does not get corrupted
- 	 * by the other process.
++	 * completing the descriptor will return desc to allocator and
++	 * the desc can be acquired by a different process and the
++	 * desc->list can be modified.  Delete desc from list so the
++	 * list trasversing does not get corrupted by the other process.
 +	 */
 +	list_for_each_entry_safe(d, t, &flist, list) {
 +		list_del_init(&d->list);
- 		complete_desc(d, IDXD_COMPLETE_NORMAL);
++		idxd_dma_complete_txd(d, IDXD_COMPLETE_NORMAL, false);
 +	}
  }
  
+ /*
+  * ENQCMDS typically fail when the WQ is inactive or busy. On host submission, the driver
+  * has better control of number of descriptors being submitted to a shared wq by limiting
+  * the number of driver allocated descriptors to the wq size. However, when the swq is
+  * exported to a guest kernel, it may be shared with multiple guest kernels. This means
+  * the likelihood of getting busy returned on the swq when submitting goes significantly up.
+  * Having a tunable retry mechanism allows the driver to keep trying for a bit before giving
+  * up. The sysfs knob can be tuned by the system administrator.
+  */
+ int idxd_enqcmds(struct idxd_wq *wq, void __iomem *portal, const void *desc)
+ {
+ 	int rc, retries = 0;
+ 
+ 	do {
+ 		rc = enqcmds(portal, desc);
+ 		if (rc == 0)
+ 			break;
+ 		cpu_relax();
+ 	} while (retries++ < wq->enqcmds_retries);
+ 
+ 	return rc;
+ }
+ 
  int idxd_submit_desc(struct idxd_wq *wq, struct idxd_desc *desc)
  {
  	struct idxd_device *idxd = wq->idxd;

^ permalink raw reply	[flat|nested] 17+ messages in thread
* linux-next: manual merge of the dmaengine tree with the dmaengine-fixes tree
@ 2022-04-12  2:42 Stephen Rothwell
  2022-04-12 11:16 ` Vinod Koul
  0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2022-04-12  2:42 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Lad Prabhakar, Linux Kernel Mailing List,
	Linux Next Mailing List, Minghao Chi

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

Hi all,

Today's linux-next merge of the dmaengine tree got a conflict in:

  drivers/dma/mediatek/mtk-hsdma.c

between commit:

  5cfde5b82f05 ("dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt")

from the dmaengine-fixes tree and commit:

  bb40bb695ec8 ("dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt")

from the dmaengine tree.

I fixed it up (I arbitrarily used the former) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread
* linux-next: manual merge of the dmaengine tree with the dmaengine-fixes tree
@ 2021-07-15  1:40 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2021-07-15  1:40 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Dave Jiang, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 805 bytes --]

Hi all,

Today's linux-next merge of the dmaengine tree got a conflict in:

  drivers/dma/idxd/submit.c

between commit:

  da435aedb00a ("dmaengine: idxd: fix array index when int_handles are being used")

from the dmaengine-fixes tree and commit:

  6cfd9e62e329 ("dmaengine: idxd: assign MSIX vectors to each WQ rather than roundrobin")

from the dmaengine tree.

I fixed it up (I just used the latter) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread
* linux-next: manual merge of the dmaengine tree with the dmaengine-fixes tree
@ 2020-11-19  3:29 Stephen Rothwell
  2020-12-14 19:58 ` Stephen Rothwell
  0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2020-11-19  3:29 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Dave Jiang, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2091 bytes --]

Hi all,

Today's linux-next merge of the dmaengine tree got a conflict in:

  drivers/dma/idxd/submit.c

between commit:

  8326be9f1c0b ("dmaengine: idxd: fix mapping of portal size")

from the dmaengine-fixes tree and commit:

  8e50d392652f ("dmaengine: idxd: Add shared workqueue support")

from the dmaengine tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/dma/idxd/submit.c
index 417048e3c42a,efca5d8468a6..000000000000
--- a/drivers/dma/idxd/submit.c
+++ b/drivers/dma/idxd/submit.c
@@@ -74,14 -86,27 +86,27 @@@ int idxd_submit_desc(struct idxd_wq *wq
  	if (idxd->state != IDXD_DEV_ENABLED)
  		return -EIO;
  
- 	portal = wq->dportal;
 -	portal = wq->portal + idxd_get_wq_portal_offset(IDXD_PORTAL_LIMITED);
++	portal = wq->portal;
+ 
  	/*
- 	 * The wmb() flushes writes to coherent DMA data before possibly
- 	 * triggering a DMA read. The wmb() is necessary even on UP because
- 	 * the recipient is a device.
+ 	 * The wmb() flushes writes to coherent DMA data before
+ 	 * possibly triggering a DMA read. The wmb() is necessary
+ 	 * even on UP because the recipient is a device.
  	 */
  	wmb();
- 	iosubmit_cmds512(portal, desc->hw, 1);
+ 	if (wq_dedicated(wq)) {
+ 		iosubmit_cmds512(portal, desc->hw, 1);
+ 	} else {
+ 		/*
+ 		 * It's not likely that we would receive queue full rejection
+ 		 * since the descriptor allocation gates at wq size. If we
+ 		 * receive a -EAGAIN, that means something went wrong such as the
+ 		 * device is not accepting descriptor at all.
+ 		 */
+ 		rc = enqcmds(portal, desc->hw);
+ 		if (rc < 0)
+ 			return rc;
+ 	}
  
  	/*
  	 * Pending the descriptor to the lockless list for the irq_entry

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread
* linux-next: manual merge of the dmaengine tree with the dmaengine-fixes tree
@ 2020-07-06  3:56 Stephen Rothwell
  2020-07-06  4:23 ` Dave Jiang
  0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2020-07-06  3:56 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Linux Next Mailing List, Linux Kernel Mailing List, Dave Jiang

[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]

Hi all,

Today's linux-next merge of the dmaengine tree got a conflict in:

  drivers/dma/idxd/sysfs.c

between commit:

  da32b28c95a7 ("dmaengine: idxd: cleanup workqueue config after disabling")

from the dmaengine-fixes tree and commit:

  f50b150e315e ("dmaengine: idxd: add work queue drain support")

from the dmaengine tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/dma/idxd/sysfs.c
index 2e2c5082f322,6f0711a822a1..000000000000
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@@ -313,14 -303,7 +303,12 @@@ static int idxd_config_bus_remove(struc
  		}
  
  		idxd_unregister_dma_device(idxd);
- 		spin_lock_irqsave(&idxd->dev_lock, flags);
  		rc = idxd_device_disable(idxd);
 +		for (i = 0; i < idxd->max_wqs; i++) {
 +			struct idxd_wq *wq = &idxd->wqs[i];
 +
 +			idxd_wq_disable_cleanup(wq);
 +		}
- 		spin_unlock_irqrestore(&idxd->dev_lock, flags);
  		module_put(THIS_MODULE);
  		if (rc < 0)
  			dev_warn(dev, "Device disable failed\n");

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-04-12 12:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 17:24 linux-next: manual merge of the dmaengine tree with the dmaengine-fixes tree broonie
2021-12-28  9:09 ` Geert Uytterhoeven
2021-12-28 14:54   ` Jiang, Dave
2022-01-04 21:41   ` Dave Jiang
2022-01-04 23:04     ` Stephen Rothwell
2022-01-05  7:19       ` Vinod Koul
2022-01-06 23:18         ` Dave Jiang
  -- strict thread matches above, loose matches on Subject: below --
2022-04-12  2:42 Stephen Rothwell
2022-04-12 11:16 ` Vinod Koul
2021-07-15  1:40 Stephen Rothwell
2020-11-19  3:29 Stephen Rothwell
2020-12-14 19:58 ` Stephen Rothwell
2020-12-15  4:33   ` Vinod Koul
2020-07-06  3:56 Stephen Rothwell
2020-07-06  4:23 ` Dave Jiang
2020-07-06  4:41   ` Vinod Koul
2020-07-06  6:03     ` Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.