All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Niklas Cassel <cassel@kernel.org>
Cc: linux-ide@vger.kernel.org, Shaun Tancheff <shaun@tancheff.com>
Subject: Re: [PATCH v3 0/2] ata: DSM TRIM fix and improvements
Date: Mon, 6 Jul 2026 10:26:16 +0900	[thread overview]
Message-ID: <18c82234-c0ed-47d6-9e69-9be2d461892c@kernel.org> (raw)
In-Reply-To: <20260702105956.2058733-4-cassel@kernel.org>

On 7/2/26 7:59 PM, Niklas Cassel wrote:
> Hello all,
> 
> This fixes DSM TRIM for 4Kn devices, which has ironically been broken
> since commit ef2d7392c4ec ("libata: SCT Write Same / DSM Trim"), which
> claimed to correct the DSM TRIM handling for 4Kn devices.
> 
> 
> The first commit is a small fix that can be backported, which limits
> the DSM TRIM to what we currently report in the Block Limits VPD page.
> We currently report a single 512 byte page of entries, i.e. 64 Entries,
> where each entry has a maximum of U16_MAX logical blocks.
> 
> The second commit:
> -Improves the support by reading the MAX PAGES PER DSM COMMAND limit and
>  populates the Block Limits VPD page accordingly.
> -Modifies ata_scsi_write_same_xlat() to properly support up to this amount
>  of pages.
> -Removed the intermediate copying to ata_scsi_rbuf, writes to the scsi
>  buffer directly.
> 
> Practically, sd still caps n_block at SD_MAX_WS16_BLOCKS
> (~3 pages actually used on 4Kn), so while removing the limit on
> ATA_SCSI_RBUF_SIZE (2048) - i.e. 4 pages), we will still be limited
> by SD_MAX_WS16_BLOCKS. The main improvement is not longer taking the
> ata_scsi_rbuf_lock and doing and extra copy from ata_scsi_rbuf.

Applied to for-7.3. Thanks!

-- 
Damien Le Moal
Western Digital Research

      parent reply	other threads:[~2026-07-06  1:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02 10:59 [PATCH v3 0/2] ata: DSM TRIM fix and improvements Niklas Cassel
2026-07-02 10:59 ` [PATCH v3 1/2] ata: libata-scsi: fix DSM TRIM for sector sizes larger than 2048 bytes Niklas Cassel
2026-07-02 10:59 ` [PATCH v3 2/2] ata: libata-scsi: scale DSM TRIM payload by MAX PAGES PER DSM COMMAND Niklas Cassel
2026-07-06  1:26 ` Damien Le Moal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18c82234-c0ed-47d6-9e69-9be2d461892c@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=cassel@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=shaun@tancheff.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.