From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50C7EC06510 for ; Tue, 2 Jul 2019 15:13:46 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 213142146F for ; Tue, 2 Jul 2019 15:13:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="PZuM9EJb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 213142146F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lists.linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 8F15A1C69; Tue, 2 Jul 2019 15:13:45 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E6D3D17E8 for ; Tue, 2 Jul 2019 09:48:50 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8B971836 for ; Tue, 2 Jul 2019 09:48:49 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id p13so16983230wru.10 for ; Tue, 02 Jul 2019 02:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UdYCIZGQ7tAt7A88vWqWA422Qpx5IuQReKn9P3m3xX8=; b=PZuM9EJbQb3YhMp+qaw+VF6BwkhSSyYMquhljCcVZSO+tjIcy06ofVIGPbwYNmREXi pRcuGFWqgU+nSlEobDVIi97m26fD20LGHZVCL/m/+eGewb0yAO7NlvlF/9gBYN5Rgy0B UVcUnIeulg2Ui8pzjNF76wVB55J/p/3pN/YrI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UdYCIZGQ7tAt7A88vWqWA422Qpx5IuQReKn9P3m3xX8=; b=hOBxWrs6dVeLLs+SqDzxEYBKzz2b1mjjbSW8y8BM2Nkbst9xPFsM0N+p8g3YM2ouND OzlMFq4jMOVNM+Ak23MtxiPPgoI5dL9cJ9n0DGcsUXcBGYb6SweOIqrDBIgAaZkSxWlH nUXxI6BOwUcLUSYH3WvhxHj6TCiCguXMKtEnc16OiFDi4tRdYAH1LQO6xOjnmBm2jKey Rn0ELdEk2MC+lJxfZ0v5zvIfKF2VUwKVzXA714ImFqCmij7gtQtJR6hXWmotNWQ2QeSM q37HPr5FeBdVWiwJ5zHnZFk3lXgtvN0qqXz7A2SBkXxtrPSqUVmOKOWkmQ7vuR+zjWKN qPuA== X-Gm-Message-State: APjAAAWEMc6WeuWDE5xmOFRFCONKF1A8ZOrWBGs7YH9crV/gU8cQhO2W 1YcVEk1FmjaZYnda8+vVcRzNXA== X-Google-Smtp-Source: APXvYqw+cs3wphtlInYiqa/iYYLL5YBkbuaWsrCFwdpkqDK8kfUrPvl8YI8TNOvUo+26MvPNs1E1Ng== X-Received: by 2002:adf:9487:: with SMTP id 7mr9588274wrr.114.1562060928176; Tue, 02 Jul 2019 02:48:48 -0700 (PDT) Received: from [10.176.68.244] ([192.19.248.250]) by smtp.gmail.com with ESMTPSA id l124sm2421987wmf.36.2019.07.02.02.48.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2019 02:48:47 -0700 (PDT) Subject: Re: use exact allocation for dma coherent memory To: Christoph Hellwig , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Ian Abbott , H Hartley Sweeten References: <20190614134726.3827-1-hch@lst.de> <20190701084833.GA22927@lst.de> Message-ID: <74eb9d99-6aa6-d1ad-e66d-6cc9c496b2f3@broadcom.com> Date: Tue, 2 Jul 2019 11:48:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190701084833.GA22927@lst.de> Content-Language: en-US X-Mailman-Approved-At: Tue, 02 Jul 2019 15:11:13 +0000 Cc: devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, Intel Linux Wireless , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, "moderated list:ARM PORT" , linux-media@vger.kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Arend Van Spriel via iommu Reply-To: Arend Van Spriel Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org On 7/1/2019 10:48 AM, Christoph Hellwig wrote: > On Fri, Jun 14, 2019 at 03:47:10PM +0200, Christoph Hellwig wrote: >> Switching to a slightly cleaned up alloc_pages_exact is pretty easy, >> but it turns out that because we didn't filter valid gfp_t flags >> on the DMA allocator, a bunch of drivers were passing __GFP_COMP >> to it, which is rather bogus in too many ways to explain. Arm has >> been filtering it for a while, but this series instead tries to fix >> the drivers and warn when __GFP_COMP is passed, which makes it much >> larger than just adding the functionality. > > Dear driver maintainers, > > can you look over the patches touching your drivers, please? I'd > like to get as much as possible of the driver patches into this > merge window, so that it can you through your maintainer trees. You made me look ;-) Actually not touching my drivers so I'm off the hook. However, I was wondering if drivers could know so I decided to look into the DMA-API.txt documentation which currently states: """ The flag parameter (dma_alloc_coherent() only) allows the caller to specify the ``GFP_`` flags (see kmalloc()) for the allocation (the implementation may choose to ignore flags that affect the location of the returned memory, like GFP_DMA). """ I do expect you are going to change that description as well now that you are going to issue a warning on __GFP_COMP. Maybe include that in patch 15/16 where you introduce that warning. Regards, Arend _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arend Van Spriel Subject: Re: use exact allocation for dma coherent memory Date: Tue, 2 Jul 2019 11:48:44 +0200 Message-ID: <74eb9d99-6aa6-d1ad-e66d-6cc9c496b2f3@broadcom.com> References: <20190614134726.3827-1-hch@lst.de> <20190701084833.GA22927@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190701084833.GA22927@lst.de> Content-Language: en-US Sender: netdev-owner@vger.kernel.org To: Christoph Hellwig , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Ian Abbott , H Hartley Sweeten Cc: devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, Intel Linux Wireless , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, "moderated list:ARM PORT" , linux-media@vger.kernel.org List-Id: linux-rdma@vger.kernel.org On 7/1/2019 10:48 AM, Christoph Hellwig wrote: > On Fri, Jun 14, 2019 at 03:47:10PM +0200, Christoph Hellwig wrote: >> Switching to a slightly cleaned up alloc_pages_exact is pretty easy, >> but it turns out that because we didn't filter valid gfp_t flags >> on the DMA allocator, a bunch of drivers were passing __GFP_COMP >> to it, which is rather bogus in too many ways to explain. Arm has >> been filtering it for a while, but this series instead tries to fix >> the drivers and warn when __GFP_COMP is passed, which makes it much >> larger than just adding the functionality. > > Dear driver maintainers, > > can you look over the patches touching your drivers, please? I'd > like to get as much as possible of the driver patches into this > merge window, so that it can you through your maintainer trees. You made me look ;-) Actually not touching my drivers so I'm off the hook. However, I was wondering if drivers could know so I decided to look into the DMA-API.txt documentation which currently states: """ The flag parameter (dma_alloc_coherent() only) allows the caller to specify the ``GFP_`` flags (see kmalloc()) for the allocation (the implementation may choose to ignore flags that affect the location of the returned memory, like GFP_DMA). """ I do expect you are going to change that description as well now that you are going to issue a warning on __GFP_COMP. Maybe include that in patch 15/16 where you introduce that warning. Regards, Arend From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8262C06510 for ; Tue, 2 Jul 2019 09:48:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 895C7206A2 for ; Tue, 2 Jul 2019 09:48:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iAAmrPKi"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="PZuM9EJb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 895C7206A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lQgYK0+LOuLrawa/irgcEvAnSasw2DEkUa1Ve/2mIqY=; b=iAAmrPKiodFnKjMOm83Nuxbgs bqVsw2gHjmX/7+TlXx7i/ePuASnWDwNIq1iIAObay4a+yHHvWhkoy8KLwkLg5YTovvVPcckjrgR0x L5rb3oJ6GQmWzzmBTloVBmVQvgPkYDu8wVz8OoPHcmCMLgu06L7zyUO1SmQU+lv3Y59Jy70B/8GXu LvCKVp2RBH1kTeMrSPVbBxJOH/fJ4WZp/z3QWYbDduLLLvonLFGIFo3Kfy+W6bvf4mslKjuuCdUS7 gZnMDeHW/E16YtbbmoWTpKX8UMW6/hK/2JaGMyzs3YwAbMbd7FwYeKuYTLvyWli08dzwGjXeOePO7 ghNkT1z2w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hiFPB-0003N2-Ps; Tue, 02 Jul 2019 09:48:53 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hiFP8-0003Md-Bp for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2019 09:48:51 +0000 Received: by mail-wr1-x441.google.com with SMTP id c27so9311927wrb.2 for ; Tue, 02 Jul 2019 02:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UdYCIZGQ7tAt7A88vWqWA422Qpx5IuQReKn9P3m3xX8=; b=PZuM9EJbQb3YhMp+qaw+VF6BwkhSSyYMquhljCcVZSO+tjIcy06ofVIGPbwYNmREXi pRcuGFWqgU+nSlEobDVIi97m26fD20LGHZVCL/m/+eGewb0yAO7NlvlF/9gBYN5Rgy0B UVcUnIeulg2Ui8pzjNF76wVB55J/p/3pN/YrI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UdYCIZGQ7tAt7A88vWqWA422Qpx5IuQReKn9P3m3xX8=; b=U+9mEJs095sJv9BAn19AI1+1/fsNGS+Y3gqm1I5+neCKrDC9cAFvNrpTVAEPF1qje1 CrSBZPgHecq26t9YqXgQvpn/Tu8FwpQXVIBzMoVOFcqmXDBxxAYjrke1l4zl4V+1O7jd 4PrhdQ75CzH9Z05HW91VpzxwDX0S2ox0DREQyG6AZGbsUl+SFMJDm7karxOyiOz+ScOv aemceHznAdydO316XLf9qx1+9ljzimv0LWilUTP+27xgVjCdF4ue+3lDIAhWE3egNDjN FA9ruPBzUJ0KqkIlJFz1yVqnpN/egbQCeJiShlcg6/sY98NloPHxzeS4mnChfmXE/V5/ Nutw== X-Gm-Message-State: APjAAAWCh5fCMkQQBDsUCNfQkaq17rg789CIU7ZqAmbx/7gzoGz2fVpm uuOlxXcdSSqO+x5C4qbZ+NmjLg== X-Google-Smtp-Source: APXvYqw+cs3wphtlInYiqa/iYYLL5YBkbuaWsrCFwdpkqDK8kfUrPvl8YI8TNOvUo+26MvPNs1E1Ng== X-Received: by 2002:adf:9487:: with SMTP id 7mr9588274wrr.114.1562060928176; Tue, 02 Jul 2019 02:48:48 -0700 (PDT) Received: from [10.176.68.244] ([192.19.248.250]) by smtp.gmail.com with ESMTPSA id l124sm2421987wmf.36.2019.07.02.02.48.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2019 02:48:47 -0700 (PDT) Subject: Re: use exact allocation for dma coherent memory To: Christoph Hellwig , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Ian Abbott , H Hartley Sweeten References: <20190614134726.3827-1-hch@lst.de> <20190701084833.GA22927@lst.de> From: Arend Van Spriel Message-ID: <74eb9d99-6aa6-d1ad-e66d-6cc9c496b2f3@broadcom.com> Date: Tue, 2 Jul 2019 11:48:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190701084833.GA22927@lst.de> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190702_024850_418979_79A7C4B0 X-CRM114-Status: GOOD ( 15.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, Intel Linux Wireless , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, "moderated list:ARM PORT" , linux-media@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/1/2019 10:48 AM, Christoph Hellwig wrote: > On Fri, Jun 14, 2019 at 03:47:10PM +0200, Christoph Hellwig wrote: >> Switching to a slightly cleaned up alloc_pages_exact is pretty easy, >> but it turns out that because we didn't filter valid gfp_t flags >> on the DMA allocator, a bunch of drivers were passing __GFP_COMP >> to it, which is rather bogus in too many ways to explain. Arm has >> been filtering it for a while, but this series instead tries to fix >> the drivers and warn when __GFP_COMP is passed, which makes it much >> larger than just adding the functionality. > > Dear driver maintainers, > > can you look over the patches touching your drivers, please? I'd > like to get as much as possible of the driver patches into this > merge window, so that it can you through your maintainer trees. You made me look ;-) Actually not touching my drivers so I'm off the hook. However, I was wondering if drivers could know so I decided to look into the DMA-API.txt documentation which currently states: """ The flag parameter (dma_alloc_coherent() only) allows the caller to specify the ``GFP_`` flags (see kmalloc()) for the allocation (the implementation may choose to ignore flags that affect the location of the returned memory, like GFP_DMA). """ I do expect you are going to change that description as well now that you are going to issue a warning on __GFP_COMP. Maybe include that in patch 15/16 where you introduce that warning. Regards, Arend _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel