linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nathan Chancellor <natechancellor@gmail.com>,
	Dave Airlie <airlied@gmail.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [git pull] drm for 5.7-rc1
Date: Fri, 3 Apr 2020 10:12:15 +0200	[thread overview]
Message-ID: <CAKMK7uH+vX=eh17-m9mL17QQ1uxjfDEcdj-tno-fAYA4Z1+Jag@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wjHEOHCf7kAOJOY9bOr9O0CRzxds+8YcXVVGbMZ+7kyXg@mail.gmail.com>

On Thu, Apr 2, 2020 at 10:43 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Thu, Apr 2, 2020 at 1:33 PM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > This fixes it but I am not sure if it is proper or not (could be
> > problematic if CONFIG_PHYS_ADDR_T_64BIT is set but
> > CONFIG_ARCH_DMA_ADDR_T_64BIT is not, not sure if that is possible) so I
> > figured I'd report it and let you guys deal with it.
>
> Yeah, no, that patch can't be right.
>
> From your build failure, your configuration has dma_addr_t being a
> 'long long unsigned int', and map->offset being a resource_size_t is
> for just a 'unsigned int'. Casting 'unsigned int *' to 'unsigned long
> long *' is not valid.
>
> You'd have to do something like
>
>         dma_addr_t temp;
>
> and pass the address of *that* in, and then assign that to map->offset
> (and verify that it fits), I think.
>
> That's kind of what the old code did.
>
> Or alternatively, the 'offset' field should just be of type
> 'dma_addr_t' instead (see include/drm/drm_legacy.h). But I didn't
> check if something else wants it to be a resource_size_t.

This is all exclusive in legacy code back from the days when drm
drivers where shared with *bsd. None of that code ever learned that
there's maybe a difference between dma/phys/virtual address sizes, and
that's about the least of the problems it has.

Revert seems to be clean, I'd vote for that. And maybe we instead try
to push these horrors more under the CONFIG_DRM_LEGACY. I'll try to
remember to do that, afaics the only thing outside are the
drm_pci_alloc/free multi-layered wrappers in drm_pci.c.

Linus, can you pls push the revert yourself, to avoid build bot
breakage for longer than necessary?

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2020-04-03  8:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01  5:50 [git pull] drm for 5.7-rc1 Dave Airlie
2020-04-01  9:22 ` Jani Nikula
2020-04-01 22:35 ` pr-tracker-bot
2020-04-02 20:33 ` Nathan Chancellor
2020-04-02 20:43   ` Linus Torvalds
2020-04-03  8:12     ` Daniel Vetter [this message]
2020-04-02 21:59   ` [PATCH] drm/legacy: Fix type for drm_local_map.offset Chris Wilson
2020-04-03  1:34     ` Nathan Chancellor
2020-04-03  8:28       ` Daniel Vetter
2020-04-03 17:14         ` Linus Torvalds
2020-04-03 17:16           ` Daniel Vetter
2020-04-09  7:07             ` Daniel Vetter

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='CAKMK7uH+vX=eh17-m9mL17QQ1uxjfDEcdj-tno-fAYA4Z1+Jag@mail.gmail.com' \
    --to=daniel.vetter@ffwll.ch \
    --cc=airlied@gmail.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).