Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp895349ybn; Wed, 2 Oct 2019 07:52:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzutn/5nDreUDLqHLsMIba+lMTL1q3dYuIMbHM+eFR/EZOBY5Bv83x1JCa6rTvCNb3AGBuH X-Received: by 2002:a17:906:5957:: with SMTP id g23mr3369191ejr.312.1570027943554; Wed, 02 Oct 2019 07:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570027943; cv=none; d=google.com; s=arc-20160816; b=AoZkTwE0Bw8GeKlplJ1FwmzaLEmjsSgzBXiSwn5/tezK7yOsIVPatpPDcUspRN14hr mVdd9+T+FnQq4D+c/pK955Zgjsa11WELPJavBwzfzMHNbxwACzPg9g83tmbGn2iKlZ5X d+FMsTnuACBP/rwSX+UmFEvb+V2ESdbQCdTf0Y+mY4vypg1W4QmlNDRdJOOVl+b9zQbd U7RJsnfoszg0QTxe2jkLV6LmEP+G70eZDYqiNsajsYdqtsL5zAPVdYH4EvqWo10joUVz MecBzNDH/X09YIA8ZOSMNIGSw/oErhobVT0qsmMcRXljq0zEGoFNo9OgHXoeK1Q/GJr3 E6Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=j42XyKqFcfiw1cr29A4t69KcsaFULzlrkf42oLnY4+U=; b=xKYO2di2NHWI5L8Ew4XRNg2x7GX/78zz0tYQmnHo+77mNilxwIT3m86LqtqCPADRaG WmKEDrnjF4m0HJWO31ctVv8OvRIqOes+QKNxKvvqOrBcyMzIz0jX2hiv3QSTJW6WccHE IjM0GwmngCAFrMiX++F8f6YtG5kmqA38KyWPnFQ451MlpMyJ6tZKbWVU3ELuEwlollNP bsc17z5BuHLg5RBR9gMwZbhdVYY/6sAksT2x0L7+VIM2eNgFMoAS2HtP/e9NnUDTgBjs n8J9rmuz3MMUYRK23Zgl4ihqb/UJJk6FgKqyYNfvHxZCpjim+EIxvGtvO4txPqV9/47F RzAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=Xjuz7ftx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si10681418ejw.217.2019.10.02.07.51.40; Wed, 02 Oct 2019 07:52:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=Xjuz7ftx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728022AbfJBO1e (ORCPT + 99 others); Wed, 2 Oct 2019 10:27:34 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41434 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727691AbfJBO1e (ORCPT ); Wed, 2 Oct 2019 10:27:34 -0400 Received: by mail-qk1-f196.google.com with SMTP id p10so15159450qkg.8 for ; Wed, 02 Oct 2019 07:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=j42XyKqFcfiw1cr29A4t69KcsaFULzlrkf42oLnY4+U=; b=Xjuz7ftxaEpV/qP+oM1bSUx7IMqT48FwXeOpaeJAak2QkBGKSVdNMwSG00tuhJKGy5 gmQEiW6bBSnS+cuAuSw0aV6KU+c9RElg0ZxKwCEqavwKJf/qLw6hJKXaDA8UrwuDe4p0 aQoeFWuHXDVqXXFwI7Lqwxecq1/BfYjsfTxkGzqz2CaS5AH2bt6JF36izHYeny09xTY7 wG2aUGDtL0selcwkl7TnDLMYiGK4da2cpmpcmRj1jkJgfE5BLCtpqXrj8WmeJUZ5YRGO xRb8swZ7hSYBdXwbEA/s/5akRjq0v0YYjPWEpgm7f4LHCgStMD8PwAAcYw5h/uwPyhr7 b/uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=j42XyKqFcfiw1cr29A4t69KcsaFULzlrkf42oLnY4+U=; b=OjT4eccEM6HKlQVObih/GdweuRUpPugpzVfOhTIZ/rYZDKkDSd9PJHq1xQXuAK9686 q3b4YToY+/gxXOc66+DL6aBdcf3QkwNDl8/6AVbLH6yCeaWqDwhxwAXQlOqT0OkcpbJB rMvQE/7s2Dptw2jczKl43hvih1CgA1RTBktqNTT7rn+wBE0dOl3hbiyTep4OdpJisqY+ IViVmuH/7pVUZ8Y0TghYjrGtbcZtcRzpHvV2/4xkmupbJJxvNQt4osXCW1WTdQk+df0t 0yqnpha7CAyO5ry5GE/UFo1Lc9MIAYucCrsI0UAQlIRw+KL+S2rlaeVqB6eyRJzRPl9T mzmA== X-Gm-Message-State: APjAAAVX1W8ES8/oy/FVaxNMJ1WZTCzqilwChfLnEftEfSqURyYPWGVD J//G0ygUNToo3pRYYG5I2Vji6w== X-Received: by 2002:a37:a24d:: with SMTP id l74mr3778096qke.200.1570026452312; Wed, 02 Oct 2019 07:27:32 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-180.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.180]) by smtp.gmail.com with ESMTPSA id c14sm12117764qta.80.2019.10.02.07.27.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Oct 2019 07:27:31 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iFfbH-0006sa-4a; Wed, 02 Oct 2019 11:27:31 -0300 Date: Wed, 2 Oct 2019 11:27:31 -0300 From: Jason Gunthorpe To: Alan Mikhak Cc: linux-kernel@vger.kernel.org, martin.petersen@oracle.com, alexios.zavras@intel.com, ming.lei@redhat.com, gregkh@linuxfoundation.org, tglx@linutronix.de, christophe.leroy@c-s.fr, thellstrom@vmware.com, galpress@amazon.com, palmer@sifive.com, paul.walmsley@sifive.com Subject: Re: [PATCH] scatterlist: Comment on pages for sg_set_page() Message-ID: <20191002142731.GC17152@ziepe.ca> References: <1569954770-11477-1-git-send-email-alan.mikhak@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1569954770-11477-1-git-send-email-alan.mikhak@sifive.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 01, 2019 at 11:32:50AM -0700, Alan Mikhak wrote: > From: Alan Mikhak > > Update the description of sg_set_page() to communicate current > requirements for the page pointer parameter. > > Signed-off-by: Alan Mikhak > include/linux/scatterlist.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h > index 6eec50fb36c8..6dda865893aa 100644 > +++ b/include/linux/scatterlist.h > @@ -112,6 +112,12 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page) > * of the page pointer. See sg_page() for looking up the page belonging > * to an sg entry. > * > + * Scatterlist currently expects the page parameter to be a pointer to > + * a page that is backed by a page struct. > + * > + * Page pointers derived from addresses obtained from ioremap() are > + * currently not supported since they require use of iomem safe memcpy. > + * > **/ > static inline void sg_set_page(struct scatterlist *sg, struct page *page, > unsigned int len, unsigned int offset) It seems a bit weird to have a comment explaining that 'struct page *page' must actually be a valid pointer. Of course it must. Computing a 'struct page *' to something that doesn't actually have a struct page is simply a bug in whoever did that. Code should never be interchanging ioremap results with the struct page* world. Jason