mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@mellanox.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Bernard Metzler <bmt@zurich.ibm.com>,
	Doug Ledford <dledford@redhat.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	John Hubbard <jhubbard@nvidia.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rdma/siw: fix NOMMU build
Date: Sat, 7 Sep 2019 07:34:46 +0000	[thread overview]
Message-ID: <20190907073444.GB3873@mellanox.com> (raw)
In-Reply-To: <20190906151028.1064531-1-arnd@arndb.de>

On Fri, Sep 06, 2019 at 05:10:10PM +0200, Arnd Bergmann wrote:
> On kernels without CONFIG_MMU, we get a link error for the siw
> driver:
> 
> drivers/infiniband/sw/siw/siw_mem.o: In function `siw_umem_get':
> siw_mem.c:(.text+0x4c8): undefined reference to `can_do_mlock'
> 
> I don't know whether this driver is able to work at all without
> an MMU, but it's easy to avoid the link problem by adding another
> compile-time check.
> 
> Fixes: 2251334dcac9 ("rdma/siw: application buffer management")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>  drivers/infiniband/sw/siw/siw_mem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/sw/siw/siw_mem.c b/drivers/infiniband/sw/siw/siw_mem.c
> index e99983f07663..b3b614c07fdb 100644
> +++ b/drivers/infiniband/sw/siw/siw_mem.c
> @@ -374,7 +374,7 @@ struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable)
>  	unsigned int foll_flags = FOLL_WRITE;
>  	int num_pages, num_chunks, i, rv = 0;
>  
> -	if (!can_do_mlock())
> +	if (!IS_ENABLED(CONFIG_MMU) || !can_do_mlock())
>  		return ERR_PTR(-EPERM);

I feel like !CONFIG_MMU should provide a dummy inline stub for can_do_mlock
instead?

Jason

  reply	other threads:[~2019-09-07  7:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 15:10 Arnd Bergmann
2019-09-07  7:34 ` Jason Gunthorpe [this message]
2019-09-07 12:57   ` Arnd Bergmann

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=20190907073444.GB3873@mellanox.com \
    --to=jgg@mellanox.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bmt@zurich.ibm.com \
    --cc=dledford@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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®