This seems to be the same thing for NVMe devices (eg Samsung, SK Hynix, Micron, Kingston, ADATA, Intel, (etc) NVMe drives):
https://github.com/torvalds/linux/blob/69f2c9346313ba3d3dfa4...
Not quite as easy to read and understand as the ata driver code though.
With the occasional further device specific workarounds in other parts of the code.
eg for specific Toshiba, LiteON, and Kioxia devices:
https://github.com/torvalds/linux/blob/69f2c9346313ba3d3dfa4...
While this seems to be special handling for Samsung X5 SSD external drives, and also Samsung 970 Evo Plus drives:
https://github.com/torvalds/linux/blob/69f2c9346313ba3d3dfa4...