+static void blk_stack_atomic_writes_limits(struct queue_limits *t, struct queue_limits *b)Avoid the overly long line here.
+ if (t->atomic_write_hw_max) {Maybe split this branch and the code for when it is not set into
separate helpers to keep the function to a size where it can be
easily understood?
+ /* Check first bottom device limits */No need for the else here.
+ if (!b->atomic_write_hw_boundary)
+ goto check_unit;
+ /*
+ * Ensure atomic write boundary is aligned with chunk sectors. Stacked
+ * devices store chunk sectors in t->io_min.
+ */
+ if (b->atomic_write_hw_boundary > t->io_min &&
+ b->atomic_write_hw_boundary % t->io_min)
+ goto unsupported;
+ else if (t->io_min > b->atomic_write_hw_boundary &&
+ t->io_min % b->atomic_write_hw_boundary)Maybe instead of the check_unit goto just move the checks between the
+ goto unsupported;
+
+ t->atomic_write_hw_boundary = b->atomic_write_hw_boundary;
+
+check_unit:
goto above and this into a branch?
Otherwise this looks conceptually fine to me.