mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Stanner <pstanner@redhat.com>
To: Dave Airlie <airlied@redhat.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Jocelyn Falempe <jfalempe@redhat.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm/ast: use managed devres functions
Date: Fri, 10 Nov 2023 20:12:12 +0100	[thread overview]
Message-ID: <a6f35e9bf5a2857e12b2d7ee38f82b6d4468a9c5.camel@redhat.com> (raw)
In-Reply-To: <20231103182542.97589-2-pstanner@redhat.com>

On Fri, 2023-11-03 at 19:25 +0100, Philipp Stanner wrote:
> Currently, tha ast-driver just maps the PCI-dev's regions with
> pcim_iomap(). It does not actually reserve the regions exclusively
> with, e.g., pci_request_regions().
> 
> Replace the calls to pcim_iomap() with ones to pcim_iomap_regions()
> to
> reserve and map the regions simultaneously.
> 
> Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>

Thinking about this once more, I guess we could postpone merging it.

I'm a bit unhappy with the pcim_* functions as they're currently
implemented and might soon start working on a replacement.

Depending on that work, this Patch here might soon be obsolete /
outdated anyways.

But merging wouldn't hurt on the other hand, as I have to send a new
one in any case. I leave that up to the maintainer.

See also here [1] if interested.

P.

[1] https://lore.kernel.org/all/84be1049e41283cf8a110267646320af9ffe59fe.camel@redhat.com/


> ---
> Changes in v2:
> - Remove unnecessary return code checks for pcim_iomap_regions()
>   (Jocelyn)
> 
> Thx Jocelyn for the kind review
> ---
>  drivers/gpu/drm/ast/ast_main.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_main.c
> b/drivers/gpu/drm/ast/ast_main.c
> index dae365ed3969..8b714b99f9d6 100644
> --- a/drivers/gpu/drm/ast/ast_main.c
> +++ b/drivers/gpu/drm/ast/ast_main.c
> @@ -444,9 +444,11 @@ struct ast_device *ast_device_create(const
> struct drm_driver *drv,
>         if (ret)
>                 return ERR_PTR(ret);
>  
> -       ast->regs = pcim_iomap(pdev, 1, 0);
> -       if (!ast->regs)
> -               return ERR_PTR(-EIO);
> +       ret = pcim_iomap_regions(pdev, BIT(1), 0);
> +       if (ret)
> +               return ERR_PTR(ret);
> +
> +       ast->regs = pcim_iomap_table(pdev)[1];
>  
>         /*
>          * After AST2500, MMIO is enabled by default, and it should
> be adopted
> @@ -461,9 +463,10 @@ struct ast_device *ast_device_create(const
> struct drm_driver *drv,
>  
>         /* "map" IO regs if the above hasn't done so already */
>         if (!ast->ioregs) {
> -               ast->ioregs = pcim_iomap(pdev, 2, 0);
> -               if (!ast->ioregs)
> -                       return ERR_PTR(-EIO);
> +               ret = pcim_iomap_regions(pdev, BIT(2), 0);
> +               if (ret)
> +                       return ERR_PTR(ret);
> +               ast->ioregs = pcim_iomap_table(pdev)[2];
>         }
>  
>         if (!ast_is_vga_enabled(dev)) {


  reply	other threads:[~2023-11-10 19:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 18:25 Philipp Stanner
2023-11-10 19:12 ` Philipp Stanner [this message]
2023-11-16 13:45 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6f35e9bf5a2857e12b2d7ee38f82b6d4468a9c5.camel@redhat.com \
    --to=pstanner@redhat.com \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jfalempe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®