Linux-Next discussions
 help / color / mirror / Atom feed
* linux-next: manual merge of the libata tree with the origin tree
@ 2026-06-01 16:59 Mark Brown
  2026-06-01 19:09 ` Niklas Cassel
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2026-06-01 16:59 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Bart Van Assche, Linux Kernel Mailing List,
	Linux Next Mailing List, Niklas Cassel

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

Hi all,

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

  drivers/ata/libata-scsi.c

between commits:

  759e8756da00a ("ata: libata-scsi: do not needlessly defer commands when using PMP with FBS")
  360190bd965f9 ("ata: libata-scsi: improve readability of ata_scsi_qc_issue()")

from the origin tree and commit:

  374a9cb4bd6a0 ("ata: libata: Pass ap parameter directly to functions in the issuing path")

from the libata 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/ata/libata-scsi.c
index d43207c6e4679,0fe7ffded6e24..0000000000000
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@@ -1677,11 -1676,11 +1677,11 @@@ void ata_scsi_deferred_qc_work(struct w
  	 * such case, we should not need any more deferring the qc, so warn if
  	 * qc_defer() says otherwise.
  	 */
 -	qc = ap->deferred_qc;
 +	qc = link->deferred_qc;
  	if (qc && !ata_port_eh_scheduled(ap)) {
  		WARN_ON_ONCE(ap->ops->qc_defer(qc));
 -		ap->deferred_qc = NULL;
 +		link->deferred_qc = NULL;
- 		ata_qc_issue(qc);
+ 		ata_qc_issue(ap, qc);
  	}
  
  	spin_unlock_irqrestore(ap->lock, flags);
@@@ -1769,8 -1763,8 +1769,9 @@@ static void ata_scsi_qc_complete(struc
  }
  
  static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
+ 	__must_hold(ap->lock)
  {
 +	struct ata_link *link = qc->dev->link;
  	int ret;
  
  	if (!ap->ops->qc_defer)
@@@ -1808,31 -1794,31 +1809,31 @@@
  	default:
  		WARN_ON_ONCE(1);
  		ret = SCSI_MLQUEUE_HOST_BUSY;
 -		break;
 +		goto free_qc;
  	}
  
 -	if (ret) {
 -		/*
 -		 * We must defer this qc: if this is not an NCQ command, keep
 -		 * this qc as a deferred one and report to the SCSI layer that
 -		 * we issued it so that it is not requeued. The deferred qc will
 -		 * be issued with the port deferred_qc_work once all on-going
 -		 * commands complete.
 -		 */
 -		if (!ata_is_ncq(qc->tf.protocol)) {
 -			ap->deferred_qc = qc;
 -			return 0;
 -		}
 -
 -		/* Force a requeue of the command to defer its execution. */
 -		ata_qc_free(qc);
 -		return ret;
 -	}
 -
 -issue:
 +issue_qc:
- 	ata_qc_issue(qc);
+ 	ata_qc_issue(ap, qc);
 -
  	return 0;
 +
 +defer_qc:
 +	/*
 +	 * We must defer this qc: if this is not an NCQ command, keep
 +	 * this qc as a deferred one and report to the SCSI layer that
 +	 * we issued it so that it is not requeued. The deferred qc will
 +	 * be issued with the port deferred_qc_work once all on-going
 +	 * commands complete.
 +	 */
 +	if (!ata_is_ncq(qc->tf.protocol)) {
 +		link->deferred_qc = qc;
 +		return 0;
 +	}
 +
 +free_qc:
 +	/* Force a requeue of the command to defer its execution. */
 +	ata_qc_free(qc);
 +
 +	return ret;
  }
  
  /**

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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* linux-next: manual merge of the libata tree with the origin tree
@ 2026-03-09 15:57 Mark Brown
  2026-03-09 16:56 ` Niklas Cassel
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2026-03-09 15:57 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Damien Le Moal, Linux Kernel Mailing List,
	Linux Next Mailing List, Niklas Cassel

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

Hi all,

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

  drivers/ata/libata-scsi.c

between commit:

  aac9b27f7c1f2 ("ata: libata: cancel pending work after clearing deferred_qc")

from the origin tree and commit:

  9a5eb2adb1ec9 ("ata: libata-scsi: simplify ata_scsi_requeue_deferred_qc()")

from the libata 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/ata/libata-scsi.c
index ad798e5246b49,4225c6d7ff359..0000000000000
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@@ -1694,15 -1697,10 +1697,11 @@@ void ata_scsi_requeue_deferred_qc(struc
  	 * do not try to be smart about what to do with this deferred command
  	 * and simply retry it by completing it with DID_SOFT_ERROR.
  	 */
- 	if (!qc)
- 		return;
- 
- 	scmd = qc->scsicmd;
- 	ap->deferred_qc = NULL;
- 	cancel_work(&ap->deferred_qc_work);
- 	ata_qc_free(qc);
- 	scmd->result = (DID_SOFT_ERROR << 16);
- 	scsi_done(scmd);
+ 	if (qc) {
+ 		ap->deferred_qc = NULL;
++		cancel_work(&ap->deferred_qc_work);
+ 		ata_scsi_qc_done(qc, true, DID_SOFT_ERROR << 16);
+ 	}
  }
  
  static void ata_scsi_schedule_deferred_qc(struct ata_port *ap)

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

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

end of thread, other threads:[~2026-06-01 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-01 16:59 linux-next: manual merge of the libata tree with the origin tree Mark Brown
2026-06-01 19:09 ` Niklas Cassel
  -- strict thread matches above, loose matches on Subject: below --
2026-03-09 15:57 Mark Brown
2026-03-09 16:56 ` Niklas Cassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox