All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Icenowy Zheng <uwu@icenowy.me>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] nvme-pci: skip CMB blocks incompatible with PCI P2P DMA
Date: Thu, 13 Feb 2025 06:58:25 +0100	[thread overview]
Message-ID: <20250213055825.GD19370@lst.de> (raw)
In-Reply-To: <20250212170444.16138-3-uwu@icenowy.me>

On Thu, Feb 13, 2025 at 01:04:44AM +0800, Icenowy Zheng wrote:
> +	/*
> +	 * Controllers may support a CMB size larger than their BAR,
> +	 * for example, due to being behind a bridge. Reduce the CMB to
> +	 * the reported size of the BAR
> +	 */
> +	if (size > bar_size - offset)
> +		size = bar_size - offset;

Nit: use up the full 80 characters for the comment, and maybe switch
the above expression to use the min() helper.

> +	if (!IS_ALIGNED(size, memremap_compat_align()) ||
> +	    !IS_ALIGNED(pci_resource_start(pdev, bar),
> +			memremap_compat_align()))

These compat names looked odd to me, but it looks like they are indeed
the proper interface here.  So modulo the little style things above
this looks good, thanks a lot!



  reply	other threads:[~2025-02-13  5:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 17:04 [PATCH 0/2] Misc fixes on registering PCI NVMe CMB Icenowy Zheng
2025-02-12 17:04 ` [PATCH 1/2] nvme-pci: clean up CMBMSC when registering CMB fails Icenowy Zheng
2025-02-13  5:55   ` Christoph Hellwig
2025-02-12 17:04 ` [PATCH 2/2] nvme-pci: skip CMB blocks incompatible with PCI P2P DMA Icenowy Zheng
2025-02-13  5:58   ` Christoph Hellwig [this message]
2025-02-13 14:12     ` Icenowy Zheng
2025-02-13  5:54 ` [PATCH 0/2] Misc fixes on registering PCI NVMe CMB Christoph Hellwig
2025-02-13  6:05   ` Icenowy Zheng
2025-02-25  0:17   ` Keith Busch
2025-02-25  2:07     ` Icenowy Zheng
2025-02-25  0:24 ` Keith Busch

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=20250213055825.GD19370@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=uwu@icenowy.me \
    /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.