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]
Date: Thu, 1 Feb 2024 12:03:49 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Frank Li <Frank.Li@....com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>, Jingoo Han <jingoohan1@...il.com>,
	Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
	Lorenzo Pieralisi <lpieralisi@...nel.org>,
	Krzysztof WilczyƄski <kw@...ux.com>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
	Conor Dooley <conor+dt@...nel.org>, imx@...ts.linux.dev,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	devicetree@...r.kernel.org
Subject: Re: [PATCH v2 6/6] PCI: dwc: Add common send PME_Turn_Off message
 method

On Thu, Feb 01, 2024 at 11:13:30AM -0500, Frank Li wrote:
> Set outbound ATU map memory write to send PCI message. So one MMIO write
> can trigger a PCI message, such as PME_Turn_Off.
> 
> Add common dw_pcie_send_pme_turn_off_by_atu() function.
> ...

> -	if (!pci->pp.ops->pme_turn_off)
> -		return 0;
> +	if (pci->pp.ops->pme_turn_off)
> +		pci->pp.ops->pme_turn_off(&pci->pp);
> +	else
> +		ret = dw_pcie_send_pme_turn_off_by_atu(pci);

I think it's nice if function names match the function pointer names.

E.g., we currently already have:

  .pme_turn_off = ls_pcie_send_turnoff_msg,
  .pme_turn_off = ls1021a_pcie_send_turnoff_msg,
  .pme_turn_off = ls1043a_pcie_send_turnoff_msg,

which is slightly annoying because it's always useful to compare
implementations, but "git grep pme_turn_off" doesn't find the actual
functions, so I wish these were named "ls_pcie_pme_turn_off()", etc.

You don't have to fix those existing layerscape ones now, but I think
the same applies to dw_pcie_send_pme_turn_off_by_atu(): it would be
nice if it were named something like "dw_pcie_pme_turn_off()" so
grep/cscope would find it easily.

Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ