In the traceback you have "ata_scsi_flush_xlat", which is the function
that translates a SCSI sync-cache command into an ATA flush-cache command.
The "WARNING: at drivers/ata/libata-core.c:5752 ata_qc_issue()" also
guides us to the code comment
/* Make sure only one non-NCQ command is outstanding. The
* check is skipped for old EH because it reuses active qc to
* request ATAPI sense.
which is a check related to NCQ->off and off->NCQ edge cases.
So those are the two bits of information I found interesting.
If you are git-capable, IMO the next steps in problem elimination should be
* download latest linux-2.6.git (currently
* build and test linux-2.6.git, to establish a new baseline
* download latest libata-dev.git#nv-swncq (currently
* build and test, with sata_nv module option swncq=0
* build and test, with sata_nv module option swncq=1
That will get -mm out of the picture, use the same baseline kernel for
all three tests (nv-swncq is based off of
752097cec53eea111d087c545179b421e2bde98a) and narrow things down to the
precise changes that went upstream (or are on the 'nv-swncq' branch,
waiting to go upstream).
My gut feeling is that there is a lingering bug in sata_nv SWNCQ somewhere.