lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141008074502.GD4999@ulmo>
Date:	Wed, 8 Oct 2014 09:45:03 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Stephen Warren <swarren@...dotorg.org>
Cc:	Vidya Sagar <vidyas@...dia.com>, bhelgaas@...gle.com,
	kthota@...dia.com, linux-tegra@...r.kernel.org,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] PCI: tegra: Enable root port specific features

On Tue, Oct 07, 2014 at 08:44:05AM -0700, Stephen Warren wrote:
> On 10/07/2014 03:27 AM, Vidya Sagar wrote:
> > Enables root port to advertise its ASPM-L1 capability
> >  resulting in possible link entry to L1 when an ASPM-L1 capable
> >  device is connected
> > Enables per-controller & per-TMS clock clamping by default
> > Enabling above features result in more power saving
> > 
> > It also avoids PM message truncation by waiting for DLLP to finish
> > before entering into L1 or L2
> > 
> > Also, it adds helper functions to access root port registers
> 
> > diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> 
> > @@ -1870,8 +1920,10 @@ static int tegra_pcie_enable(struct tegra_pcie *pcie)
> >  
> >  		tegra_pcie_port_enable(port);
> >  
> > -		if (tegra_pcie_port_check_link(port))
> > +		if (tegra_pcie_port_check_link(port)) {
> > +			tegra_pcie_enable_rp_features(port);
> >  			continue;
> > +		}
> >  
> >  		dev_info(pcie->dev, "link %u down, ignoring\n", port->index);
> 
> Wouldn't it be better to have the error case inside the if block; most
> error-handling is that way. For example:
> 
> if (!tegra_pcie_port_check_link(port)) {
> 	dev_info(pcie->dev, "link %u down, ignoring\n", port->index);
> 	tegra_pcie_port_disable(port);
> 	tegra_pcie_port_free(port);
> 	continue;
> }
> 
> tegra_pcie_enable_rp_features(port);
> ... any other "good case" code (of which there admittedly is none at
> present)

Yes, that's a little more idiomatic. I think it could be a separate
cleanup patch, though.

Thierry

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ