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:   Tue, 15 Jun 2021 11:03:34 +0800
From:   Dongdong Liu <liudongdong3@...wei.com>
To:     Christoph Hellwig <hch@...radead.org>
CC:     <helgaas@...nel.org>, <kw@...ux.com>, <linux-pci@...r.kernel.org>,
        <rajur@...lsio.com>, <hverkuil-cisco@...all.nl>,
        <linux-media@...r.kernel.org>, <netdev@...r.kernel.org>
Subject: Re: [RESEND PATCH V3 1/6] PCI: Use cached Device Capabilities
 Register


On 2021/6/14 13:42, Christoph Hellwig wrote:
> On Sun, Jun 13, 2021 at 05:29:10PM +0800, Dongdong Liu wrote:
>> It will make sense to store the pcie_devcap value in the pci_dev
>> structure instead of reading Device Capabilities Register multiple
>> times. The fisrt place to use pcie_devcap is in set_pcie_port_type(),
>> get the pcie_devcap value here, then use cached pcie_devcap in the
>> needed place.
>>
>> Acked-by: Hans Verkuil <hverkuil-cisco@...all.nl>
>> Signed-off-by: Dongdong Liu <liudongdong3@...wei.com>
>> ---
>>  drivers/media/pci/cobalt/cobalt-driver.c |  4 ++--
>>  drivers/pci/pci.c                        |  5 +----
>>  drivers/pci/pcie/aspm.c                  | 11 ++++-------
>>  drivers/pci/probe.c                      | 11 +++--------
>>  drivers/pci/quirks.c                     |  3 +--
>>  include/linux/pci.h                      |  1 +
>>  6 files changed, 12 insertions(+), 23 deletions(-)
>>
>> diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c
>> index 839503e..04e735f 100644
>> --- a/drivers/media/pci/cobalt/cobalt-driver.c
>> +++ b/drivers/media/pci/cobalt/cobalt-driver.c
>> @@ -193,11 +193,11 @@ void cobalt_pcie_status_show(struct cobalt *cobalt)
>>  		return;
>>
>>  	/* Device */
>> -	pcie_capability_read_dword(pci_dev, PCI_EXP_DEVCAP, &capa);
>>  	pcie_capability_read_word(pci_dev, PCI_EXP_DEVCTL, &ctrl);
>>  	pcie_capability_read_word(pci_dev, PCI_EXP_DEVSTA, &stat);
>>  	cobalt_info("PCIe device capability 0x%08x: Max payload %d\n",
>> -		    capa, get_payload_size(capa & PCI_EXP_DEVCAP_PAYLOAD));
>> +		    capa,
>> +		    get_payload_size(pci_dev->pcie_devcap & PCI_EXP_DEVCAP_PAYLOAD));
>
> Overly long line.
Will fix
>
>> +		if (!(child->pcie_devcap & PCI_EXP_DEVCAP_RBER) && !aspm_force) {
>
> Another one.
Will fix.

Thanks,
Dongdong
>
> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@....de>
> .
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ