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: <e0ca28bd-dfd8-cf73-dfce-a11557ecd346@ozlabs.ru>
Date:   Fri, 26 Apr 2019 13:44:35 +1000
From:   Alexey Kardashevskiy <aik@...abs.ru>
To:     Heiner Kallweit <hkallweit1@...il.com>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Oded Gabbay <oded.gabbay@...il.com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "David (ChunMing) Zhou" <David1.Zhou@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Joerg Roedel <joro@...tes.org>,
        David Woodhouse <dwmw2@...radead.org>,
        Realtek linux nic maintainers <nic_swsd@...ltek.com>,
        "David S. Miller" <davem@...emloft.net>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...com>,
        Jose Abreu <joabreu@...opsys.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Benson Leung <bleung@...omium.org>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Paul Mackerras <paulus@...ba.org>
Cc:     open list <linux-kernel@...r.kernel.org>,
        "open list:AMD KFD" <dri-devel@...ts.freedesktop.org>,
        "open list:RADEON and AMDGPU DRM DRIVERS" 
        <amd-gfx@...ts.freedesktop.org>,
        "open list:AMD IOMMU (AMD-VI)" <iommu@...ts.linux-foundation.org>,
        "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" 
        <netdev@...r.kernel.org>,
        "moderated list:ARM/STM32 ARCHITECTURE" 
        <linux-stm32@...md-mailman.stormreply.com>,
        "moderated list:ARM/STM32 ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        "open list:PCI SUBSYSTEM" <linux-pci@...r.kernel.org>
Subject: Re: [PATCH v2 4/9] powerpc/powernv/npu: use helper pci_dev_id



On 25/04/2019 05:14, Heiner Kallweit wrote:
> Use new helper pci_dev_id() to simplify the code.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>



Reviewed-by: Alexey Kardashevskiy <aik@...abs.ru>


> ---
>  arch/powerpc/platforms/powernv/npu-dma.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
> index dc23d9d2a..495550432 100644
> --- a/arch/powerpc/platforms/powernv/npu-dma.c
> +++ b/arch/powerpc/platforms/powernv/npu-dma.c
> @@ -1213,9 +1213,8 @@ int pnv_npu2_map_lpar_dev(struct pci_dev *gpdev, unsigned int lparid,
>  	 * Currently we only support radix and non-zero LPCR only makes sense
>  	 * for hash tables so skiboot expects the LPCR parameter to be a zero.
>  	 */
> -	ret = opal_npu_map_lpar(nphb->opal_id,
> -			PCI_DEVID(gpdev->bus->number, gpdev->devfn), lparid,
> -			0 /* LPCR bits */);
> +	ret = opal_npu_map_lpar(nphb->opal_id, pci_dev_id(gpdev), lparid,
> +				0 /* LPCR bits */);
>  	if (ret) {
>  		dev_err(&gpdev->dev, "Error %d mapping device to LPAR\n", ret);
>  		return ret;
> @@ -1224,7 +1223,7 @@ int pnv_npu2_map_lpar_dev(struct pci_dev *gpdev, unsigned int lparid,
>  	dev_dbg(&gpdev->dev, "init context opalid=%llu msr=%lx\n",
>  			nphb->opal_id, msr);
>  	ret = opal_npu_init_context(nphb->opal_id, 0/*__unused*/, msr,
> -			PCI_DEVID(gpdev->bus->number, gpdev->devfn));
> +				    pci_dev_id(gpdev));
>  	if (ret < 0)
>  		dev_err(&gpdev->dev, "Failed to init context: %d\n", ret);
>  	else
> @@ -1258,7 +1257,7 @@ int pnv_npu2_unmap_lpar_dev(struct pci_dev *gpdev)
>  	dev_dbg(&gpdev->dev, "destroy context opalid=%llu\n",
>  			nphb->opal_id);
>  	ret = opal_npu_destroy_context(nphb->opal_id, 0/*__unused*/,
> -			PCI_DEVID(gpdev->bus->number, gpdev->devfn));
> +				       pci_dev_id(gpdev));
>  	if (ret < 0) {
>  		dev_err(&gpdev->dev, "Failed to destroy context: %d\n", ret);
>  		return ret;
> @@ -1266,9 +1265,8 @@ int pnv_npu2_unmap_lpar_dev(struct pci_dev *gpdev)
>  
>  	/* Set LPID to 0 anyway, just to be safe */
>  	dev_dbg(&gpdev->dev, "Map LPAR opalid=%llu lparid=0\n", nphb->opal_id);
> -	ret = opal_npu_map_lpar(nphb->opal_id,
> -			PCI_DEVID(gpdev->bus->number, gpdev->devfn), 0 /*LPID*/,
> -			0 /* LPCR bits */);
> +	ret = opal_npu_map_lpar(nphb->opal_id, pci_dev_id(gpdev), 0 /*LPID*/,
> +				0 /* LPCR bits */);
>  	if (ret)
>  		dev_err(&gpdev->dev, "Error %d mapping device to LPAR\n", ret);
>  
> 

-- 
Alexey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ