[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4d5224c6-bc0b-4ca9-9f1a-71d701554b3d@nvidia.com>
Date: Thu, 16 Jan 2025 17:21:29 -0800
From: Tushar Dave <tdave@...dia.com>
To: Jason Gunthorpe <jgg@...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 1/16/25 11:01, Jason Gunthorpe wrote:
> On Wed, Jan 15, 2025 at 07:11:25PM -0800, Tushar Dave wrote:
>> @@ -1028,10 +1032,15 @@ static void __pci_config_acs(struct pci_dev *dev,
>> struct pci_acs *caps,
>>
>> pci_dbg(dev, "ACS mask = %#06x\n", mask);
>> pci_dbg(dev, "ACS flags = %#06x\n", flags);
>> + pci_dbg(dev, "ACS control = %#06x\n", caps->ctrl);
>> + pci_dbg(dev, "ACS fw_ctrl = %#06x\n", caps->fw_ctrl);
>>
>> /* 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;
>> + caps->ctrl = (caps->ctrl & mask) | (caps->fw_ctrl & ~mask);
>> +
>> + /* Apply the flags */
>> + caps->ctrl &= ~mask;
>> + caps->ctrl |= (flags & mask);
>
> caps->ctrl = (caps->ctrl & mask) & ~mask == 0 - so this is kind of confusing.
>
> What we want is to take the fw_ctl for all bits where mask is 0 and
> take flags for all bits where it is 1?
>
> caps->ctrl = (caps->fw_ctrl & ~mask) | (flags & mask);
>
> ?
Yes :)
- /* 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 mask bits that are 0 copy them from the firmware setting
+ * and apply flags for all the mask bits that are 1.
+ */
+ caps->ctrl = (caps->fw_ctrl & ~mask) | (flags & mask);
I ran some sanity tests and looks good. Can I send V2 now?
-Tushar
>
> Jason
Powered by blists - more mailing lists