LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier.adi@gmail.com>
To: "Hans J. Koch" <hjk@linutronix.de>
Cc: "Greg KH" <gregkh@suse.de>, "Mike Frysinger" <vapier@gentoo.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] UIO: only call pgprot_noncached if defined
Date: Wed, 5 Nov 2008 12:43:31 -0500	[thread overview]
Message-ID: <8bd0f97a0811050943n79a4ced9u23fc5ae6540d458@mail.gmail.com> (raw)
In-Reply-To: <20081105170800.GD6382@local>

On Wed, Nov 5, 2008 at 12:08, Hans J. Koch wrote:
> On Wed, Nov 05, 2008 at 08:33:34AM -0800, Greg KH wrote:
>> On Wed, Nov 05, 2008 at 12:36:11PM +0100, Hans J. Koch wrote:
>> > There seem to be archs that cannot easily implement a sensible
>> > pgprot_noncached() function, so we should merge this patch. UIO doesn't
>> > compile on these archs right now.
>>
>> No, we should fix those arches to have that function at least NULLed
>> out.  Isn't there only one, Blackfin?  Putting #ifdefs in .c files is
>> not something we really want to do if at all possible.
>
> Yep, 5 minutes after I sent the mail I regretted it. Blackfin could
> easily implement an "empty" macro that just returns its parameter.

just because it's easy to do doesnt mean it's correct.  i'm looking
for the correct answer here, not the quick & dirty & forget about it.

perhaps uio_mmap_physical() should look like:
static int uio_mmap_physical(struct vm_area_struct *vma)
{
#ifdef pgprot_noncached
    struct uio_device *idev = vma->vm_private_data;
    int mi = uio_find_mem_index(vma);
    if (mi < 0)
        return -EINVAL;

    vma->vm_flags |= VM_IO | VM_RESERVED;

    vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);

    return remap_pfn_range(vma,
                   vma->vm_start,
                   idev->info->mem[mi].addr >> PAGE_SHIFT,
                   vma->vm_end - vma->vm_start,
                   vma->vm_page_prot);
#else
    return -EFAULT;
#endif
}

  reply	other threads:[~2008-11-05 17:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29 17:26 Mike Frysinger
2008-10-29 20:53 ` Hans J. Koch
2008-11-05  0:06   ` Mike Frysinger
2008-11-05 11:36 ` Hans J. Koch
2008-11-05 16:33   ` Greg KH
2008-11-05 17:08     ` Hans J. Koch
2008-11-05 17:43       ` Mike Frysinger [this message]
2008-11-05 17:33     ` Mike Frysinger
2008-11-05 17:42       ` Greg KH
2008-11-05 17:55         ` Mike Frysinger
2008-11-05 18:27       ` Hans J. Koch
2008-11-05 18:36         ` Mike Frysinger

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=8bd0f97a0811050943n79a4ced9u23fc5ae6540d458@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=gregkh@suse.de \
    --cc=hjk@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vapier@gentoo.org \
    --subject='Re: [PATCH] UIO: only call pgprot_noncached if defined' \
    /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

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).