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: <edb8cf4f-a82c-41be-8316-dd316050d975@suse.de>
Date: Wed, 7 Aug 2024 10:59:26 +0200
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Philipp Stanner <pstanner@...hat.com>, Dave Airlie <airlied@...hat.com>,
 Jocelyn Falempe <jfalempe@...hat.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>, David Airlie <airlied@...il.com>,
 Daniel Vetter <daniel@...ll.ch>, Bjorn Helgaas <bhelgaas@...gle.com>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
 linux-pci@...r.kernel.org
Subject: Re: [PATCH 2/2] drm/ast: Request PCI BAR with devres



Am 07.08.24 um 10:30 schrieb Philipp Stanner:
> ast currently ioremaps two PCI BARs using pcim_iomap(). It does not
> perform a request on the regions, however, which would make the driver a
> bit more robust.
>
> PCI now offers pcim_iomap_region(), a managed function which both
> requests and ioremaps a BAR.
>
> Replace pcim_iomap() with pcim_iomap_region().
>
> Suggested-by: Thomas Zimmermann <tzimmermann@...e.de>
> Signed-off-by: Philipp Stanner <pstanner@...hat.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@...e.de>

> ---
>   drivers/gpu/drm/ast/ast_drv.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
> index aae019e79bda..1fadaadfbe39 100644
> --- a/drivers/gpu/drm/ast/ast_drv.c
> +++ b/drivers/gpu/drm/ast/ast_drv.c
> @@ -287,9 +287,9 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>   	if (ret)
>   		return ret;
>   
> -	regs = pcim_iomap(pdev, 1, 0);
> -	if (!regs)
> -		return -EIO;
> +	regs = pcim_iomap_region(pdev, 1, "ast");
> +	if (IS_ERR(regs))
> +		return PTR_ERR(regs);
>   
>   	if (pdev->revision >= 0x40) {
>   		/*
> @@ -311,9 +311,9 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>   
>   		if (len < AST_IO_MM_LENGTH)
>   			return -EIO;
> -		ioregs = pcim_iomap(pdev, 2, 0);
> -		if (!ioregs)
> -			return -EIO;
> +		ioregs = pcim_iomap_region(pdev, 2, "ast");
> +		if (IS_ERR(ioregs))
> +			return PTR_ERR(ioregs);
>   	} else {
>   		/*
>   		 * Anything else is best effort.

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ