mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eyal Lebedinsky <eyal@eyal.emu.id.au>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: rmap and nvidia?
Date: Sun, 15 Dec 2002 12:23:26 +1100	[thread overview]
Message-ID: <3DFBD98E.53E9D8BB@eyal.emu.id.au> (raw)
In-Reply-To: <Pine.LNX.4.50L.0212141225320.32283-100000@imladris.surriel.com>

Rik van Riel wrote:
> 
> On Sat, 14 Dec 2002, mdew wrote:
> > On Sat, 2002-12-14 at 22:38, William Lee Irwin III wrote:
> > > On Sat, Dec 14, 2002 at 10:36:10PM +1300, mdew wrote:
> > > > nv.c: In function `nv_get_phys_address':
> > > > nv.c:2182: warning: implicit declaration of function `pte_offset'
> > > > nv.c:2182: invalid type argument of `unary *'
> > >
> > > Use pte_offset_map() with a corresponding pte_unmap().
> >
> > err pardon?
> 
> wli just gave you the information you need to create a patch
> for the nvidia driver.

The replies for people in the know (Rik, wli) give a clue but not an
answer. Use mere mortals want a proper patch in order to build and
use this kernel.

I will summarise my understanding so far; The original code says:

unsigned long
nv_get_phys_address(unsigned long address)
{
    pgd_t *pg_dir;
    pmd_t *pg_mid_dir;
    pte_t *pte__, pte;
.....
#if defined (pte_offset_atomic)
    pte__ = pte_offset_atomic(pg_mid_dir, address);
    pte = *pte__;
    pte_kunmap(pte__);
#else
    pte__ = NULL;
    pte = *pte_offset(pg_mid_dir, address);
#endif

    if (!pte_present(pte))
        goto failed;

    return ((pte_val(pte) & KERN_PAGE_MASK) | NV_MASK_OFFSET(address));
.....
}

The last line above is the problem. So far I could see two possible
changes that will compile, but I do not know which will function
correctly. The first replacement option:
    pte = *pte_offset(pg_mid_dir, address);

The second replacement option is more involved:
    pte__ = pte_offset_map(pg_mid_dir, address);
    pte = *pte__;

    if (!pte_present(pte))
        goto failed;

    pte_unmap(pte__);

Reading the patch itself I see places where the first approach is used,
while elsewhere the second is used. I do not know what pte_val(pte)
requires though. Can we do the pte_unmap(pte__) earlier or is the
mapping
necessary for pte_present(pte)? Will this work:
    pte__ = pte_offset_map(pg_mid_dir, address);
    pte = *pte__;
    pte_unmap(pte__);


In summary, you can see that for someone who is not intimately involved
the answers so far do not provide a working patch.

Thanks everybody.

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>

  reply	other threads:[~2002-12-15  1:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-14  9:36 mdew
2002-12-14  9:38 ` William Lee Irwin III
2002-12-14  9:46   ` mdew
2002-12-14 14:26     ` Rik van Riel
2002-12-15  1:23       ` Eyal Lebedinsky [this message]
2002-12-15  1:28         ` Philip Dodd
2002-12-15  1:40           ` Eyal Lebedinsky
2002-12-16 13:32             ` Ducrot Bruno
2002-12-16 18:42               ` Andrew McGregor
2002-12-16 14:25 O.Sezer
2002-12-16 15:42 ` William Lee Irwin III
2002-12-16 22:22 O.Sezer
2002-12-16 23:17 ` Eyal Lebedinsky
2002-12-17  9:58 ` Andrew McGregor
2002-12-17 19:35 ` Andrew McGregor
2002-12-17 20:14   ` O.Sezer

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=3DFBD98E.53E9D8BB@eyal.emu.id.au \
    --to=eyal@eyal.emu.id.au \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®