Re: [PATCH] drm/legacy: Fix type for drm_local_map.offset

2020-04-09 Thread Daniel Vetter
On Fri, Apr 03, 2020 at 07:16:28PM +0200, Daniel Vetter wrote:
> On Fri, Apr 3, 2020 at 7:14 PM Linus Torvalds
>  wrote:
> >
> > On Fri, Apr 3, 2020 at 1:29 AM Daniel Vetter  wrote:
> > >
> > > > Tested-by: Nathan Chancellor  # build
> > >
> > > This works too, missed it when replying to Linus
> > >
> > > Reviewed-by: Daniel Vetter 
> > >
> > > Linus I guess this one is better, but like I explained it really
> > > doesn't matter what we do with drm legacy code, it's a horror show
> > > that should be disabled on all modern distros anyway. We just keep it
> > > because of "never break old uapi".
> >
> > Ok, That patch from Chris looks fine to me too.
> >
> > dma_addr_t and resource_size_t aren't the same, but at least
> > dma_addr_t should always be the bigger one.
> >
> > And it does look like nothing else ever takes the address of this
> > field, so the ones that might want just the resource_size_t part will
> > at least have enough bits.
> >
> > So I think Chris' patch is the way to go. I'm assuming I'll get it
> > through the normal drm tree channels, this doesn't sound _so_ urgent
> > that I'd need to expedite that patch into my tree and apply it
> > directly.
> 
> Ok, sounds good.
> 
> Chris can you pls push this to drm-misc-next-fixes? That should be
> enough for the pull request train next week.

Ok I applied this now, seems to have fallen through a few cracks. Might
only make it after easter :-/
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/legacy: Fix type for drm_local_map.offset

2020-04-03 Thread Daniel Vetter
On Fri, Apr 3, 2020 at 7:14 PM Linus Torvalds
 wrote:
>
> On Fri, Apr 3, 2020 at 1:29 AM Daniel Vetter  wrote:
> >
> > > Tested-by: Nathan Chancellor  # build
> >
> > This works too, missed it when replying to Linus
> >
> > Reviewed-by: Daniel Vetter 
> >
> > Linus I guess this one is better, but like I explained it really
> > doesn't matter what we do with drm legacy code, it's a horror show
> > that should be disabled on all modern distros anyway. We just keep it
> > because of "never break old uapi".
>
> Ok, That patch from Chris looks fine to me too.
>
> dma_addr_t and resource_size_t aren't the same, but at least
> dma_addr_t should always be the bigger one.
>
> And it does look like nothing else ever takes the address of this
> field, so the ones that might want just the resource_size_t part will
> at least have enough bits.
>
> So I think Chris' patch is the way to go. I'm assuming I'll get it
> through the normal drm tree channels, this doesn't sound _so_ urgent
> that I'd need to expedite that patch into my tree and apply it
> directly.

Ok, sounds good.

Chris can you pls push this to drm-misc-next-fixes? That should be
enough for the pull request train next week.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/legacy: Fix type for drm_local_map.offset

2020-04-03 Thread Linus Torvalds
On Fri, Apr 3, 2020 at 1:29 AM Daniel Vetter  wrote:
>
> > Tested-by: Nathan Chancellor  # build
>
> This works too, missed it when replying to Linus
>
> Reviewed-by: Daniel Vetter 
>
> Linus I guess this one is better, but like I explained it really
> doesn't matter what we do with drm legacy code, it's a horror show
> that should be disabled on all modern distros anyway. We just keep it
> because of "never break old uapi".

Ok, That patch from Chris looks fine to me too.

dma_addr_t and resource_size_t aren't the same, but at least
dma_addr_t should always be the bigger one.

And it does look like nothing else ever takes the address of this
field, so the ones that might want just the resource_size_t part will
at least have enough bits.

So I think Chris' patch is the way to go. I'm assuming I'll get it
through the normal drm tree channels, this doesn't sound _so_ urgent
that I'd need to expedite that patch into my tree and apply it
directly.

Thanks,

   Linus
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/legacy: Fix type for drm_local_map.offset

2020-04-03 Thread Daniel Vetter
On Fri, Apr 3, 2020 at 8:54 AM Nathan Chancellor
 wrote:
>
> On Thu, Apr 02, 2020 at 10:59:26PM +0100, Chris Wilson wrote:
> > drm_local_map.offset is not only used for resource_size_t but also
> > dma_addr_t which may be of different sizes.
> >
> > Reported-by: Nathan Chancellor 
> > Fixes: 8e4ff9b56957 ("drm: Remove the dma_alloc_coherent wrapper for 
> > internal usage")
> > Signed-off-by: Chris Wilson 
> > Cc: Dave Airlie 
> > Cc: Nathan Chancellor 
> > Cc: Linus Torvalds 
> > ---
> >  include/drm/drm_legacy.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
> > index dcef3598f49e..aed382c17b26 100644
> > --- a/include/drm/drm_legacy.h
> > +++ b/include/drm/drm_legacy.h
> > @@ -136,7 +136,7 @@ struct drm_sg_mem {
> >   * Kernel side of a mapping
> >   */
> >  struct drm_local_map {
> > - resource_size_t offset;  /**< Requested physical address (0 for 
> > SAREA)*/
> > + dma_addr_t offset;   /**< Requested physical address (0 for 
> > SAREA)*/
> >   unsigned long size;  /**< Requested physical size (bytes) */
> >   enum drm_map_type type;  /**< Type of memory to map */
> >   enum drm_map_flags flags;/**< Flags */
> > --
> > 2.20.1
> >
>
> Thanks for the quick fix!
>
> I ran it through my set of build tests and nothing else seems to have
> broken (at least not any more than it already is...).
>
> Tested-by: Nathan Chancellor  # build

This works too, missed it when replying to Linus

Reviewed-by: Daniel Vetter 

Linux I guess this one is better, but like I explained it really
doesn't matter what we do with drm legacy code, it's a horror show
that should be disabled on all modern distros anyway. We just keep it
because of "never break old uapi". Maybe in a few years more ...
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/legacy: Fix type for drm_local_map.offset

2020-04-03 Thread Nathan Chancellor
On Thu, Apr 02, 2020 at 10:59:26PM +0100, Chris Wilson wrote:
> drm_local_map.offset is not only used for resource_size_t but also
> dma_addr_t which may be of different sizes.
> 
> Reported-by: Nathan Chancellor 
> Fixes: 8e4ff9b56957 ("drm: Remove the dma_alloc_coherent wrapper for internal 
> usage")
> Signed-off-by: Chris Wilson 
> Cc: Dave Airlie 
> Cc: Nathan Chancellor 
> Cc: Linus Torvalds 
> ---
>  include/drm/drm_legacy.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
> index dcef3598f49e..aed382c17b26 100644
> --- a/include/drm/drm_legacy.h
> +++ b/include/drm/drm_legacy.h
> @@ -136,7 +136,7 @@ struct drm_sg_mem {
>   * Kernel side of a mapping
>   */
>  struct drm_local_map {
> - resource_size_t offset;  /**< Requested physical address (0 for SAREA)*/
> + dma_addr_t offset;   /**< Requested physical address (0 for SAREA)*/
>   unsigned long size;  /**< Requested physical size (bytes) */
>   enum drm_map_type type;  /**< Type of memory to map */
>   enum drm_map_flags flags;/**< Flags */
> -- 
> 2.20.1
> 

Thanks for the quick fix!

I ran it through my set of build tests and nothing else seems to have
broken (at least not any more than it already is...).

Tested-by: Nathan Chancellor  # build
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel