Re: [PATCH v2 1/4] PCI: Add pci_power_t helper functions

From: andriy.shevchenko@xxxxxxxxx

Date: Thu Nov 19 2026 - 12:21:20 EST


On Thu, Nov 19, 2026 at 11:07:13AM -0600, Bjorn Helgaas wrote:
> On Thu, Nov 19, 2026 at 06:51:06PM +0200, andriy.shevchenko@xxxxxxxxx wrote:
> > On Thu, Nov 19, 2026 at 02:35:46PM +0000, Habil Eren Türker wrote:
> > > Add helper functions to extract, set and compare PCI power
> > > states in the Power Management Control/Status register.

...

> > > +/* Helper functions for PCI power management */
> > > +static inline pci_power_t pci_power_t_get(u32 csr)
> >
> > Why u32 as it seems the value is 16-bit?
>
> I think there's one reader of PCI_PM_CTRL that does a 32-bit read, and
> I figured a u16->u32 promotion would be better than a u32->u16
> truncation. But maybe that reader should be changed to a 16-bit read.

Is it specific read on the specific HW that is always done as 32-bit?
(Personally I do not believe there is such a requirement to even weirdest
PCI HW. This register is way too standard.)

--
With Best Regards,
Andy Shevchenko