From: Ajay Agarwal <ajayagarwal@google.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>,
Vidya Sagar <vidyas@nvidia.com>,
Nikhil Devshatwar <nikhilnd@google.com>,
Manu Gautam <manugautam@google.com>,
"David E. Box" <david.e.box@linux.intel.com>,
Kai-Heng Feng <kai.heng.feng@canonical.com>,
Michael Bottini <michael.a.bottini@linux.intel.com>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH 3/3] PCI/ASPM: Remove unnecessary ASPM_STATE_L1SS check
Date: Tue, 2 May 2023 18:37:09 +0530 [thread overview]
Message-ID: <ZFEK/TVIfKDKzpm3@google.com> (raw)
In-Reply-To: <20230501175518.GA594484@bhelgaas>
On Mon, May 01, 2023 at 12:55:18PM -0500, Bjorn Helgaas wrote:
> On Tue, Apr 11, 2023 at 04:40:34PM +0530, Ajay Agarwal wrote:
> > Currently the driver checks if ASPM_STATE_L1SS is supported
> > before calling aspm_calc_l1ss_info(), only for this function to
> > return if ASPM_STATE_L1_2_MASK is not supported. Simplify the
> > logic by directly checking for L1.2 mask.
> >
> > Signed-off-by: Ajay Agarwal <ajayagarwal@google.com>
> > ---
> > drivers/pci/pcie/aspm.c | 5 +----
> > 1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> > index 7c9935f331f1..8c45835e8016 100644
> > --- a/drivers/pci/pcie/aspm.c
> > +++ b/drivers/pci/pcie/aspm.c
> > @@ -481,9 +481,6 @@ static void aspm_calc_l1ss_info(struct pcie_link_state *link,
> > u32 pctl1, pctl2, cctl1, cctl2;
> > u32 pl1_2_enables, cl1_2_enables;
> >
> > - if (!(link->aspm_support & ASPM_STATE_L1_2_MASK))
> > - return;
> > -
> > /* Choose the greater of the two Port Common_Mode_Restore_Times */
> > val1 = (parent_l1ss_cap & PCI_L1SS_CAP_CM_RESTORE_TIME) >> 8;
> > val2 = (child_l1ss_cap & PCI_L1SS_CAP_CM_RESTORE_TIME) >> 8;
> > @@ -616,7 +613,7 @@ static void aspm_l1ss_init(struct pcie_link_state *link)
> > if (parent_l1ss_ctl1 & child_l1ss_ctl1 & PCI_L1SS_CTL1_PCIPM_L1_2)
> > link->aspm_enabled |= ASPM_STATE_L1_2_PCIPM;
> >
> > - if (link->aspm_support & ASPM_STATE_L1SS)
> > + if (link->aspm_support & ASPM_STATE_L1_2_MASK)
> > aspm_calc_l1ss_info(link, parent_l1ss_cap, child_l1ss_cap);
>
> I think the reason it was this way is because several of the relevant
> names use "l1ss":
>
> ASPM_STATE_L1SS
> aspm_calc_l1ss_info
> calc_l1ss_pwron
>
> But everything in aspm_calc_l1ss_info() is L1.2-specific, so I think
> it would make sense to use your patch, and at the same time, rename
> aspm_calc_l1ss_info() and calc_l1ss_pwron() to aspm_calc_l12_info()
> and calc_l12_pwron() to match.
>
> Bjorn
Sure, will incorporate your suggestions in the next version.
prev parent reply other threads:[~2023-05-02 13:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 11:10 [PATCH 0/3] ASPM: aspm_disable/default/support state handling fixes Ajay Agarwal
2023-04-11 11:10 ` [PATCH 1/3] PCI/ASPM: Disable ASPM_STATE_L1 only when class driver disables L1 ASPM Ajay Agarwal
2023-05-01 17:21 ` Bjorn Helgaas
2023-05-02 12:38 ` Ajay Agarwal
2023-05-02 16:07 ` Bjorn Helgaas
2023-05-02 18:32 ` Ajay Agarwal
2023-04-11 11:10 ` [PATCH 2/3] PCI/ASPM: Set ASPM_STATE_L1 when class driver enables L1ss Ajay Agarwal
2023-05-01 17:44 ` Bjorn Helgaas
2023-05-02 13:02 ` Ajay Agarwal
2023-05-02 16:02 ` Bjorn Helgaas
2023-05-02 18:44 ` Ajay Agarwal
2023-04-11 11:10 ` [PATCH 3/3] PCI/ASPM: Remove unnecessary ASPM_STATE_L1SS check Ajay Agarwal
2023-05-01 17:55 ` Bjorn Helgaas
2023-05-02 13:07 ` Ajay Agarwal [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=ZFEK/TVIfKDKzpm3@google.com \
--to=ajayagarwal@google.com \
--cc=bhelgaas@google.com \
--cc=david.e.box@linux.intel.com \
--cc=helgaas@kernel.org \
--cc=kai.heng.feng@canonical.com \
--cc=linux-pci@vger.kernel.org \
--cc=manugautam@google.com \
--cc=michael.a.bottini@linux.intel.com \
--cc=nikhilnd@google.com \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=vidyas@nvidia.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.