[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250113200749.GW5556@nvidia.com>
Date: Mon, 13 Jan 2025 16:07:49 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Tushar Dave <tdave@...dia.com>
Cc: corbet@....net, bhelgaas@...gle.com, paulmck@...nel.org,
akpm@...ux-foundation.org, thuth@...hat.com, rostedt@...dmis.org,
xiongwei.song@...driver.com, vidyas@...dia.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, vsethi@...dia.com,
sdonthineni@...dia.com
Subject: Re: [PATCH 1/1] PCI: Fix Extend ACS configurability
On Wed, Jan 08, 2025 at 07:13:34PM -0800, Tushar Dave wrote:
> > Yes, but X in config_acs should copy the FW value not the value
> > modified by disable_acs_redir_param
>
> I see your point. In that case (for the last hunk in my patch) something
> like this should work IMO.
>
> - /* If mask is 0 then we copy the bit from the firmware setting. */
> - caps->ctrl = (caps->ctrl & ~mask) | (caps->fw_ctrl & mask);
> - caps->ctrl |= flags;
> + /* For unchanged ACS bits 'x' or 'X', copy the bits from the
> firmware setting. */
> + if (!acs_mask)
> + caps->ctrl = caps->fw_ctrl;
> +
> + caps->ctrl &= ~mask;
> + caps->ctrl |= (flags & mask);
>
> Wish I can have better condition check instead of 'if (!acs_mask)' but let
> me know your thoughts.
It should be per-bit surely? I think the original logic was the right
idea, just the bit logic had the wrong operators..
Jason
Powered by blists - more mailing lists