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=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 473EAC11F6B for ; Fri, 2 Jul 2021 13:49:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30257613D2 for ; Fri, 2 Jul 2021 13:49:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232779AbhGBNvd (ORCPT ); Fri, 2 Jul 2021 09:51:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232672AbhGBNvd (ORCPT ); Fri, 2 Jul 2021 09:51:33 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30C0DC061762; Fri, 2 Jul 2021 06:49:01 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id o17-20020a9d76510000b02903eabfc221a9so10158636otl.0; Fri, 02 Jul 2021 06:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=UEjOTwG3dEw4BMs9zskTAlB/qyEqwJyHyp2F3uc3IEyjANLR6uP1/H9KR/MbGUoN+q uXXp5fn/iI8ZGaLxshXE1VQxeK5/3UWORkO2pNxSV6JX6TB55C98dgtqR+ifQCzwR/+E tWXw5g4HJNLzPOLmN5ZESxRdKK1SlSI9vIjSxu/oxrzoNqDVDJAp6devlE/I9vjje1jl UriRs+KKNlto9yhu5Cc6j3zBlDtCEQbiH6DoyRIcLxwtvRuZjbkzbi0yal/mv3qJLt2a 3fiDvGnsl5Hudqdx9BEktUwL9MS3wAY6jCzLNb0Q5Ly1c+F45rGX3brSqu3cPed6aviv JOqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=rnp0loDKExb81NYcW1AVOHl744/ODWsZUzxHbAbWJc0miKokU545NYq3Rz7QPAPK72 GwULTgjZUxBqiqYTF70JCIHnOeo3/Z4EOOvx07wBr4bsuXoFeAqQ0BujCV6RCjF8MDfP gHRGREagbqIRnlAGxqrFCJLMZJqNOh+wLDIBSAnkaq4HLhNRS4P/zd6mMHaJrTWMEiyk 8fVNiX5LKysRYdgxIJyYKGdrO+9/xqYR8eheEaA2ieIVKMjwyf75yp7o1ok7qKwyatem hiemxfZwp94wMU1zBsaW6BuYK4+5BODilwjvEOORoSpDQRzoADkB2jv9DtbnAfBz6YKW Dp2g== X-Gm-Message-State: AOAM530uHP2fDw7tqNwZQknCUqcTMqZBNawru59BLhD0+ikifK75dzqv QtGOvzY6ZPCeZwa8S7OykTE= X-Google-Smtp-Source: ABdhPJzlnGPxxKYZSXkVHHmfsdkLH9E7ecEfVsvBHCQZR82klKUBGGO/PYD4fEoEphoBmS1gKABKng== X-Received: by 2002:a05:6830:823:: with SMTP id t3mr4518459ots.334.1625233740480; Fri, 02 Jul 2021 06:49:00 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n26sm599488oos.14.2021.07.02.06.48.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 06:48:59 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH v15 12/12] of: Add plumbing for restricted DMA pool To: Will Deacon , Robin Murphy Cc: Claire Chang , Rob Herring , mpe@ellerman.id.au, Joerg Roedel , Frank Rowand , Konrad Rzeszutek Wilk , boris.ostrovsky@oracle.com, jgross@suse.com, Christoph Hellwig , Marek Szyprowski , heikki.krogerus@linux.intel.com, thomas.hellstrom@linux.intel.com, peterz@infradead.org, dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk, grant.likely@arm.com, paulus@samba.org, mingo@kernel.org, jxgao@google.com, sstabellini@kernel.org, Saravana Kannan , xypron.glpk@gmx.de, "Rafael J . Wysocki" , Bartosz Golaszewski , bskeggs@redhat.com, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, Thierry Reding , intel-gfx@lists.freedesktop.org, matthew.auld@intel.com, linux-devicetree , airlied@linux.ie, Nicolas Boichat , rodrigo.vivi@intel.com, bhelgaas@google.com, Dan Williams , Andy Shevchenko , Greg KH , Randy Dunlap , quic_qiancai@quicinc.com, lkml , tfiga@chromium.org, "list@263.net:IOMMU DRIVERS" , Jim Quinlan , thomas.lendacky@amd.com, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com References: <20210624155526.2775863-1-tientzu@chromium.org> <20210624155526.2775863-13-tientzu@chromium.org> <20210702030807.GA2685166@roeck-us.net> <87ca3ada-22ed-f40c-0089-ca6fffc04f24@arm.com> <20210702131829.GA11132@willie-the-truck> From: Guenter Roeck Message-ID: <2f2d6633-2457-f7eb-81c1-355f56dc34ce@roeck-us.net> Date: Fri, 2 Jul 2021 06:48:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210702131829.GA11132@willie-the-truck> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/2/21 6:18 AM, Will Deacon wrote: > On Fri, Jul 02, 2021 at 12:39:41PM +0100, Robin Murphy wrote: >> On 2021-07-02 04:08, Guenter Roeck wrote: >>> On Thu, Jun 24, 2021 at 11:55:26PM +0800, Claire Chang wrote: >>>> If a device is not behind an IOMMU, we look up the device node and set >>>> up the restricted DMA when the restricted-dma-pool is presented. >>>> >>>> Signed-off-by: Claire Chang >>>> Tested-by: Stefano Stabellini >>>> Tested-by: Will Deacon >>> >>> With this patch in place, all sparc and sparc64 qemu emulations >>> fail to boot. Symptom is that the root file system is not found. >>> Reverting this patch fixes the problem. Bisect log is attached. >> >> Ah, OF_ADDRESS depends on !SPARC, so of_dma_configure_id() is presumably >> returning an unexpected -ENODEV from the of_dma_set_restricted_buffer() >> stub. That should probably be returning 0 instead, since either way it's not >> an error condition for it to simply do nothing. > > Something like below? > Yes, that does the trick. > Will > > --->8 > >>>From 4d9dcb9210c1f37435b6088284e04b6b36ee8c4d Mon Sep 17 00:00:00 2001 > From: Will Deacon > Date: Fri, 2 Jul 2021 14:13:28 +0100 > Subject: [PATCH] of: Return success from of_dma_set_restricted_buffer() when > !OF_ADDRESS > > When CONFIG_OF_ADDRESS=n, of_dma_set_restricted_buffer() returns -ENODEV > and breaks the boot for sparc[64] machines. Return 0 instead, since the > function is essentially a glorified NOP in this configuration. > > Cc: Claire Chang > Cc: Konrad Rzeszutek Wilk > Reported-by: Guenter Roeck > Suggested-by: Robin Murphy > Link: https://lore.kernel.org/r/20210702030807.GA2685166@roeck-us.net > Signed-off-by: Will Deacon Tested-by: Guenter Roeck > --- > drivers/of/of_private.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h > index 8fde97565d11..34dd548c5eac 100644 > --- a/drivers/of/of_private.h > +++ b/drivers/of/of_private.h > @@ -173,7 +173,8 @@ static inline int of_dma_get_range(struct device_node *np, > static inline int of_dma_set_restricted_buffer(struct device *dev, > struct device_node *np) > { > - return -ENODEV; > + /* Do nothing, successfully. */ > + return 0; > } > #endif > > 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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 8BC7EC11F68 for ; Fri, 2 Jul 2021 13:49:35 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 D2535613F4 for ; Fri, 2 Jul 2021 13:49:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2535613F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GGbzd18jfz3bXX for ; Fri, 2 Jul 2021 23:49:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=UEjOTwG3; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::336; helo=mail-ot1-x336.google.com; envelope-from=groeck7@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=UEjOTwG3; dkim-atps=neutral Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GGbz56BDCz301N for ; Fri, 2 Jul 2021 23:49:05 +1000 (AEST) Received: by mail-ot1-x336.google.com with SMTP id n99-20020a9d206c0000b029045d4f996e62so10106370ota.4 for ; Fri, 02 Jul 2021 06:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=UEjOTwG3dEw4BMs9zskTAlB/qyEqwJyHyp2F3uc3IEyjANLR6uP1/H9KR/MbGUoN+q uXXp5fn/iI8ZGaLxshXE1VQxeK5/3UWORkO2pNxSV6JX6TB55C98dgtqR+ifQCzwR/+E tWXw5g4HJNLzPOLmN5ZESxRdKK1SlSI9vIjSxu/oxrzoNqDVDJAp6devlE/I9vjje1jl UriRs+KKNlto9yhu5Cc6j3zBlDtCEQbiH6DoyRIcLxwtvRuZjbkzbi0yal/mv3qJLt2a 3fiDvGnsl5Hudqdx9BEktUwL9MS3wAY6jCzLNb0Q5Ly1c+F45rGX3brSqu3cPed6aviv JOqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=kDmt/r+f4LYwfGxrwhfQNAwBP1aKT+OjuOyMdHk5tGGev2x25uFos9EwHVxlXCmfgK wtrgGIrFeidwzkRNU4WpSBgljGDwV6ERw9HRsedq1kc8dqvhSF00k7xPP9Y82IF/IZ4z QGAYWZ962flO1vetZSqQF82erMQnr3eBkbhfJi/pCBcRtH4v8Gglt/HizBSKDrnOr/k/ zopLXU6vEn+wvmgxjePhH0fp3mnGfqFRp+TKPL/XTApD/8AGptidcYxlf8Lr4tJp0IYB DoLS/xRfkb3VWlWV7CcdtMyNXgFc+BXJbmJttmYJJsRGSUq52XKynGCXNoGgfY5iuMaT 729A== X-Gm-Message-State: AOAM531ehAriV21+b6it4Yo95ZHhhWkc5X7QX8VYluvbrR+FRlmZ44Fh N27VeIhZY8elN/OS6BjbHnY= X-Google-Smtp-Source: ABdhPJzlnGPxxKYZSXkVHHmfsdkLH9E7ecEfVsvBHCQZR82klKUBGGO/PYD4fEoEphoBmS1gKABKng== X-Received: by 2002:a05:6830:823:: with SMTP id t3mr4518459ots.334.1625233740480; Fri, 02 Jul 2021 06:49:00 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n26sm599488oos.14.2021.07.02.06.48.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 06:48:59 -0700 (PDT) Subject: Re: [PATCH v15 12/12] of: Add plumbing for restricted DMA pool To: Will Deacon , Robin Murphy References: <20210624155526.2775863-1-tientzu@chromium.org> <20210624155526.2775863-13-tientzu@chromium.org> <20210702030807.GA2685166@roeck-us.net> <87ca3ada-22ed-f40c-0089-ca6fffc04f24@arm.com> <20210702131829.GA11132@willie-the-truck> From: Guenter Roeck Message-ID: <2f2d6633-2457-f7eb-81c1-355f56dc34ce@roeck-us.net> Date: Fri, 2 Jul 2021 06:48:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210702131829.GA11132@willie-the-truck> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heikki.krogerus@linux.intel.com, linux-devicetree , peterz@infradead.org, linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk, grant.likely@arm.com, paulus@samba.org, Frank Rowand , mingo@kernel.org, jxgao@google.com, sstabellini@kernel.org, Saravana Kannan , Joerg Roedel , "Rafael J . Wysocki" , Christoph Hellwig , Bartosz Golaszewski , bskeggs@redhat.com, xen-devel@lists.xenproject.org, Marek Szyprowski , matthew.auld@intel.com, Nicolas Boichat , thomas.hellstrom@linux.intel.com, Konrad Rzeszutek Wilk , intel-gfx@lists.freedesktop.org, Dan Williams , Rob Herring , rodrigo.vivi@intel.com, bhelgaas@google.com, Claire Chang , boris.ostrovsky@oracle.com, Andy Shevchenko , jgross@suse.com, airlied@linux.ie, Thierry Reding , Greg KH , Randy Dunlap , quic_qiancai@quicinc.com, lkml , tfiga@chromium.org, "list@263.net:IOMMU DRIVERS" , Jim Quinlan , xypron.glpk@gmx.de, thomas.lendacky@amd.com, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 7/2/21 6:18 AM, Will Deacon wrote: > On Fri, Jul 02, 2021 at 12:39:41PM +0100, Robin Murphy wrote: >> On 2021-07-02 04:08, Guenter Roeck wrote: >>> On Thu, Jun 24, 2021 at 11:55:26PM +0800, Claire Chang wrote: >>>> If a device is not behind an IOMMU, we look up the device node and set >>>> up the restricted DMA when the restricted-dma-pool is presented. >>>> >>>> Signed-off-by: Claire Chang >>>> Tested-by: Stefano Stabellini >>>> Tested-by: Will Deacon >>> >>> With this patch in place, all sparc and sparc64 qemu emulations >>> fail to boot. Symptom is that the root file system is not found. >>> Reverting this patch fixes the problem. Bisect log is attached. >> >> Ah, OF_ADDRESS depends on !SPARC, so of_dma_configure_id() is presumably >> returning an unexpected -ENODEV from the of_dma_set_restricted_buffer() >> stub. That should probably be returning 0 instead, since either way it's not >> an error condition for it to simply do nothing. > > Something like below? > Yes, that does the trick. > Will > > --->8 > >>>From 4d9dcb9210c1f37435b6088284e04b6b36ee8c4d Mon Sep 17 00:00:00 2001 > From: Will Deacon > Date: Fri, 2 Jul 2021 14:13:28 +0100 > Subject: [PATCH] of: Return success from of_dma_set_restricted_buffer() when > !OF_ADDRESS > > When CONFIG_OF_ADDRESS=n, of_dma_set_restricted_buffer() returns -ENODEV > and breaks the boot for sparc[64] machines. Return 0 instead, since the > function is essentially a glorified NOP in this configuration. > > Cc: Claire Chang > Cc: Konrad Rzeszutek Wilk > Reported-by: Guenter Roeck > Suggested-by: Robin Murphy > Link: https://lore.kernel.org/r/20210702030807.GA2685166@roeck-us.net > Signed-off-by: Will Deacon Tested-by: Guenter Roeck > --- > drivers/of/of_private.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h > index 8fde97565d11..34dd548c5eac 100644 > --- a/drivers/of/of_private.h > +++ b/drivers/of/of_private.h > @@ -173,7 +173,8 @@ static inline int of_dma_get_range(struct device_node *np, > static inline int of_dma_set_restricted_buffer(struct device *dev, > struct device_node *np) > { > - return -ENODEV; > + /* Do nothing, successfully. */ > + return 0; > } > #endif > > 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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 A8DD7C11F68 for ; Fri, 2 Jul 2021 13:49:08 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 50CCA6142C for ; Fri, 2 Jul 2021 13:49:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50CCA6142C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 18E0383D77; Fri, 2 Jul 2021 13:49:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QQg5hnmR64Tt; Fri, 2 Jul 2021 13:49:04 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 85B2B83D12; Fri, 2 Jul 2021 13:49:04 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 412FEC001A; Fri, 2 Jul 2021 13:49:04 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id CA323C000E for ; Fri, 2 Jul 2021 13:49:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id AE172606A0 for ; Fri, 2 Jul 2021 13:49:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RCUU06TQeazi for ; Fri, 2 Jul 2021 13:49:01 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by smtp3.osuosl.org (Postfix) with ESMTPS id 857316069D for ; Fri, 2 Jul 2021 13:49:01 +0000 (UTC) Received: by mail-ot1-x329.google.com with SMTP id o13-20020a9d404d0000b0290466630039caso10095733oti.6 for ; Fri, 02 Jul 2021 06:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=UEjOTwG3dEw4BMs9zskTAlB/qyEqwJyHyp2F3uc3IEyjANLR6uP1/H9KR/MbGUoN+q uXXp5fn/iI8ZGaLxshXE1VQxeK5/3UWORkO2pNxSV6JX6TB55C98dgtqR+ifQCzwR/+E tWXw5g4HJNLzPOLmN5ZESxRdKK1SlSI9vIjSxu/oxrzoNqDVDJAp6devlE/I9vjje1jl UriRs+KKNlto9yhu5Cc6j3zBlDtCEQbiH6DoyRIcLxwtvRuZjbkzbi0yal/mv3qJLt2a 3fiDvGnsl5Hudqdx9BEktUwL9MS3wAY6jCzLNb0Q5Ly1c+F45rGX3brSqu3cPed6aviv JOqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=R5ANop4qfyGKyMQQfos7tpyyC0Gd3odqjBbyUp0sM81h8BsGcmtlDs9n9m3tQbBxii 1IXwu4RN5yMOXziB94170sAARJRP8aUdx4Hhn70Nub9dmw/pcQYIKwh6bg0IpWJ7nljp 9KCn3mSLo2WNjxDZnm37LtABe/cmp8sx9G20ncfIZshwD8b+zGS1W8gzeD/H1l9OArqE A5Q4bJn/+nDt9v20Nw5nob7Q8gPZ+jO+rQ5J7IbKJbfGH08mhVjamelK1qRd5BAWAnT3 GESQREJTZ2JPnQMsCzWSZReUcmej7qrbK6pxLdideu3RJPvlJlxrIR7g60VKCbYPSm67 C9hQ== X-Gm-Message-State: AOAM533/tA8b2WKcDMlZpPB87rFU0RxcLebYykfCS0rjrIXJhlaE+Ex0 i9C8P8tCotx5YvAE7y9H7IQ= X-Google-Smtp-Source: ABdhPJzlnGPxxKYZSXkVHHmfsdkLH9E7ecEfVsvBHCQZR82klKUBGGO/PYD4fEoEphoBmS1gKABKng== X-Received: by 2002:a05:6830:823:: with SMTP id t3mr4518459ots.334.1625233740480; Fri, 02 Jul 2021 06:49:00 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n26sm599488oos.14.2021.07.02.06.48.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 06:48:59 -0700 (PDT) Subject: Re: [PATCH v15 12/12] of: Add plumbing for restricted DMA pool To: Will Deacon , Robin Murphy References: <20210624155526.2775863-1-tientzu@chromium.org> <20210624155526.2775863-13-tientzu@chromium.org> <20210702030807.GA2685166@roeck-us.net> <87ca3ada-22ed-f40c-0089-ca6fffc04f24@arm.com> <20210702131829.GA11132@willie-the-truck> From: Guenter Roeck Message-ID: <2f2d6633-2457-f7eb-81c1-355f56dc34ce@roeck-us.net> Date: Fri, 2 Jul 2021 06:48:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210702131829.GA11132@willie-the-truck> Content-Language: en-US Cc: heikki.krogerus@linux.intel.com, linux-devicetree , peterz@infradead.org, linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk, grant.likely@arm.com, paulus@samba.org, Frank Rowand , mingo@kernel.org, jxgao@google.com, sstabellini@kernel.org, Saravana Kannan , mpe@ellerman.id.au, "Rafael J . Wysocki" , Christoph Hellwig , Bartosz Golaszewski , bskeggs@redhat.com, xen-devel@lists.xenproject.org, matthew.auld@intel.com, Nicolas Boichat , thomas.hellstrom@linux.intel.com, Konrad Rzeszutek Wilk , intel-gfx@lists.freedesktop.org, Dan Williams , Rob Herring , rodrigo.vivi@intel.com, bhelgaas@google.com, Claire Chang , boris.ostrovsky@oracle.com, Andy Shevchenko , jgross@suse.com, airlied@linux.ie, Thierry Reding , Greg KH , Randy Dunlap , quic_qiancai@quicinc.com, lkml , "list@263.net:IOMMU DRIVERS" , Jim Quinlan , xypron.glpk@gmx.de, thomas.lendacky@amd.com, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 7/2/21 6:18 AM, Will Deacon wrote: > On Fri, Jul 02, 2021 at 12:39:41PM +0100, Robin Murphy wrote: >> On 2021-07-02 04:08, Guenter Roeck wrote: >>> On Thu, Jun 24, 2021 at 11:55:26PM +0800, Claire Chang wrote: >>>> If a device is not behind an IOMMU, we look up the device node and set >>>> up the restricted DMA when the restricted-dma-pool is presented. >>>> >>>> Signed-off-by: Claire Chang >>>> Tested-by: Stefano Stabellini >>>> Tested-by: Will Deacon >>> >>> With this patch in place, all sparc and sparc64 qemu emulations >>> fail to boot. Symptom is that the root file system is not found. >>> Reverting this patch fixes the problem. Bisect log is attached. >> >> Ah, OF_ADDRESS depends on !SPARC, so of_dma_configure_id() is presumably >> returning an unexpected -ENODEV from the of_dma_set_restricted_buffer() >> stub. That should probably be returning 0 instead, since either way it's not >> an error condition for it to simply do nothing. > > Something like below? > Yes, that does the trick. > Will > > --->8 > >>>From 4d9dcb9210c1f37435b6088284e04b6b36ee8c4d Mon Sep 17 00:00:00 2001 > From: Will Deacon > Date: Fri, 2 Jul 2021 14:13:28 +0100 > Subject: [PATCH] of: Return success from of_dma_set_restricted_buffer() when > !OF_ADDRESS > > When CONFIG_OF_ADDRESS=n, of_dma_set_restricted_buffer() returns -ENODEV > and breaks the boot for sparc[64] machines. Return 0 instead, since the > function is essentially a glorified NOP in this configuration. > > Cc: Claire Chang > Cc: Konrad Rzeszutek Wilk > Reported-by: Guenter Roeck > Suggested-by: Robin Murphy > Link: https://lore.kernel.org/r/20210702030807.GA2685166@roeck-us.net > Signed-off-by: Will Deacon Tested-by: Guenter Roeck > --- > drivers/of/of_private.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h > index 8fde97565d11..34dd548c5eac 100644 > --- a/drivers/of/of_private.h > +++ b/drivers/of/of_private.h > @@ -173,7 +173,8 @@ static inline int of_dma_get_range(struct device_node *np, > static inline int of_dma_set_restricted_buffer(struct device *dev, > struct device_node *np) > { > - return -ENODEV; > + /* Do nothing, successfully. */ > + return 0; > } > #endif > > _______________________________________________ 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 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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 4921DC11F6C for ; Fri, 2 Jul 2021 13:49:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 DD3866142B for ; Fri, 2 Jul 2021 13:49:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD3866142B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42C3B6E174; Fri, 2 Jul 2021 13:49:02 +0000 (UTC) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3FCFC6E174; Fri, 2 Jul 2021 13:49:01 +0000 (UTC) Received: by mail-ot1-x330.google.com with SMTP id m6-20020a9d1d060000b029044e2d8e855eso10066569otm.8; Fri, 02 Jul 2021 06:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=UEjOTwG3dEw4BMs9zskTAlB/qyEqwJyHyp2F3uc3IEyjANLR6uP1/H9KR/MbGUoN+q uXXp5fn/iI8ZGaLxshXE1VQxeK5/3UWORkO2pNxSV6JX6TB55C98dgtqR+ifQCzwR/+E tWXw5g4HJNLzPOLmN5ZESxRdKK1SlSI9vIjSxu/oxrzoNqDVDJAp6devlE/I9vjje1jl UriRs+KKNlto9yhu5Cc6j3zBlDtCEQbiH6DoyRIcLxwtvRuZjbkzbi0yal/mv3qJLt2a 3fiDvGnsl5Hudqdx9BEktUwL9MS3wAY6jCzLNb0Q5Ly1c+F45rGX3brSqu3cPed6aviv JOqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=J4OdMN89ZwmeGqjtxKt6FGLbxJNl6yxZys3JfRksUe30jnpZcz2+NiuGKpnNohNCg4 HiSg7PRwAbKMCpXnmivamzAP3AJcoGKEpQMAonH12rg9KzKa4e3YtClTbI7BPO/8KAZ/ 7LVMth1YyHAl4OyhOYGE7U1S4M+mVydxLdRqiyZOm1+4WHJKGUx+kbAyvbX3Zv4S9tq7 dhIcev4q2/xnDpcorvFy05o4KxLMJ9QtsmQr8l8FFiPKUSwSlwfnxy3A4u+cVLfTiTuT AEYDj3L00/JtSdkM47L8zwUKmqSsy3zw5bES6RQha35DEMkyWgZA5P23XjjQKUZOPrCf YisA== X-Gm-Message-State: AOAM5302AIrBlGD0pNH48keeqS2/SvSR6TqMMitei2LtTZF6Xz3XYAPs P6R0dcWu3ubISqybenaxGUE= X-Google-Smtp-Source: ABdhPJzlnGPxxKYZSXkVHHmfsdkLH9E7ecEfVsvBHCQZR82klKUBGGO/PYD4fEoEphoBmS1gKABKng== X-Received: by 2002:a05:6830:823:: with SMTP id t3mr4518459ots.334.1625233740480; Fri, 02 Jul 2021 06:49:00 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n26sm599488oos.14.2021.07.02.06.48.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 06:48:59 -0700 (PDT) Subject: Re: [PATCH v15 12/12] of: Add plumbing for restricted DMA pool To: Will Deacon , Robin Murphy References: <20210624155526.2775863-1-tientzu@chromium.org> <20210624155526.2775863-13-tientzu@chromium.org> <20210702030807.GA2685166@roeck-us.net> <87ca3ada-22ed-f40c-0089-ca6fffc04f24@arm.com> <20210702131829.GA11132@willie-the-truck> From: Guenter Roeck Message-ID: <2f2d6633-2457-f7eb-81c1-355f56dc34ce@roeck-us.net> Date: Fri, 2 Jul 2021 06:48:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210702131829.GA11132@willie-the-truck> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heikki.krogerus@linux.intel.com, linux-devicetree , peterz@infradead.org, linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk, grant.likely@arm.com, paulus@samba.org, Frank Rowand , mingo@kernel.org, jxgao@google.com, sstabellini@kernel.org, Saravana Kannan , mpe@ellerman.id.au, Joerg Roedel , "Rafael J . Wysocki" , Christoph Hellwig , Bartosz Golaszewski , bskeggs@redhat.com, xen-devel@lists.xenproject.org, Marek Szyprowski , matthew.auld@intel.com, Nicolas Boichat , thomas.hellstrom@linux.intel.com, Konrad Rzeszutek Wilk , intel-gfx@lists.freedesktop.org, Dan Williams , Rob Herring , rodrigo.vivi@intel.com, bhelgaas@google.com, Claire Chang , boris.ostrovsky@oracle.com, Andy Shevchenko , jgross@suse.com, airlied@linux.ie, Thierry Reding , Greg KH , Randy Dunlap , quic_qiancai@quicinc.com, lkml , tfiga@chromium.org, "list@263.net:IOMMU DRIVERS" , Jim Quinlan , xypron.glpk@gmx.de, thomas.lendacky@amd.com, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 7/2/21 6:18 AM, Will Deacon wrote: > On Fri, Jul 02, 2021 at 12:39:41PM +0100, Robin Murphy wrote: >> On 2021-07-02 04:08, Guenter Roeck wrote: >>> On Thu, Jun 24, 2021 at 11:55:26PM +0800, Claire Chang wrote: >>>> If a device is not behind an IOMMU, we look up the device node and set >>>> up the restricted DMA when the restricted-dma-pool is presented. >>>> >>>> Signed-off-by: Claire Chang >>>> Tested-by: Stefano Stabellini >>>> Tested-by: Will Deacon >>> >>> With this patch in place, all sparc and sparc64 qemu emulations >>> fail to boot. Symptom is that the root file system is not found. >>> Reverting this patch fixes the problem. Bisect log is attached. >> >> Ah, OF_ADDRESS depends on !SPARC, so of_dma_configure_id() is presumably >> returning an unexpected -ENODEV from the of_dma_set_restricted_buffer() >> stub. That should probably be returning 0 instead, since either way it's not >> an error condition for it to simply do nothing. > > Something like below? > Yes, that does the trick. > Will > > --->8 > >>>From 4d9dcb9210c1f37435b6088284e04b6b36ee8c4d Mon Sep 17 00:00:00 2001 > From: Will Deacon > Date: Fri, 2 Jul 2021 14:13:28 +0100 > Subject: [PATCH] of: Return success from of_dma_set_restricted_buffer() when > !OF_ADDRESS > > When CONFIG_OF_ADDRESS=n, of_dma_set_restricted_buffer() returns -ENODEV > and breaks the boot for sparc[64] machines. Return 0 instead, since the > function is essentially a glorified NOP in this configuration. > > Cc: Claire Chang > Cc: Konrad Rzeszutek Wilk > Reported-by: Guenter Roeck > Suggested-by: Robin Murphy > Link: https://lore.kernel.org/r/20210702030807.GA2685166@roeck-us.net > Signed-off-by: Will Deacon Tested-by: Guenter Roeck > --- > drivers/of/of_private.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h > index 8fde97565d11..34dd548c5eac 100644 > --- a/drivers/of/of_private.h > +++ b/drivers/of/of_private.h > @@ -173,7 +173,8 @@ static inline int of_dma_get_range(struct device_node *np, > static inline int of_dma_set_restricted_buffer(struct device *dev, > struct device_node *np) > { > - return -ENODEV; > + /* Do nothing, successfully. */ > + return 0; > } > #endif > > 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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 2C893C11F68 for ; Fri, 2 Jul 2021 13:49:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 EF01A6142B for ; Fri, 2 Jul 2021 13:49:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF01A6142B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 198DC6E187; Fri, 2 Jul 2021 13:49:03 +0000 (UTC) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3FCFC6E174; Fri, 2 Jul 2021 13:49:01 +0000 (UTC) Received: by mail-ot1-x330.google.com with SMTP id m6-20020a9d1d060000b029044e2d8e855eso10066569otm.8; Fri, 02 Jul 2021 06:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=UEjOTwG3dEw4BMs9zskTAlB/qyEqwJyHyp2F3uc3IEyjANLR6uP1/H9KR/MbGUoN+q uXXp5fn/iI8ZGaLxshXE1VQxeK5/3UWORkO2pNxSV6JX6TB55C98dgtqR+ifQCzwR/+E tWXw5g4HJNLzPOLmN5ZESxRdKK1SlSI9vIjSxu/oxrzoNqDVDJAp6devlE/I9vjje1jl UriRs+KKNlto9yhu5Cc6j3zBlDtCEQbiH6DoyRIcLxwtvRuZjbkzbi0yal/mv3qJLt2a 3fiDvGnsl5Hudqdx9BEktUwL9MS3wAY6jCzLNb0Q5Ly1c+F45rGX3brSqu3cPed6aviv JOqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9x+juvDeOlaCtKmozneQfrCt9yo0Whbh1MNkOy7JJZU=; b=J4OdMN89ZwmeGqjtxKt6FGLbxJNl6yxZys3JfRksUe30jnpZcz2+NiuGKpnNohNCg4 HiSg7PRwAbKMCpXnmivamzAP3AJcoGKEpQMAonH12rg9KzKa4e3YtClTbI7BPO/8KAZ/ 7LVMth1YyHAl4OyhOYGE7U1S4M+mVydxLdRqiyZOm1+4WHJKGUx+kbAyvbX3Zv4S9tq7 dhIcev4q2/xnDpcorvFy05o4KxLMJ9QtsmQr8l8FFiPKUSwSlwfnxy3A4u+cVLfTiTuT AEYDj3L00/JtSdkM47L8zwUKmqSsy3zw5bES6RQha35DEMkyWgZA5P23XjjQKUZOPrCf YisA== X-Gm-Message-State: AOAM5302AIrBlGD0pNH48keeqS2/SvSR6TqMMitei2LtTZF6Xz3XYAPs P6R0dcWu3ubISqybenaxGUE= X-Google-Smtp-Source: ABdhPJzlnGPxxKYZSXkVHHmfsdkLH9E7ecEfVsvBHCQZR82klKUBGGO/PYD4fEoEphoBmS1gKABKng== X-Received: by 2002:a05:6830:823:: with SMTP id t3mr4518459ots.334.1625233740480; Fri, 02 Jul 2021 06:49:00 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n26sm599488oos.14.2021.07.02.06.48.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 06:48:59 -0700 (PDT) To: Will Deacon , Robin Murphy References: <20210624155526.2775863-1-tientzu@chromium.org> <20210624155526.2775863-13-tientzu@chromium.org> <20210702030807.GA2685166@roeck-us.net> <87ca3ada-22ed-f40c-0089-ca6fffc04f24@arm.com> <20210702131829.GA11132@willie-the-truck> From: Guenter Roeck Message-ID: <2f2d6633-2457-f7eb-81c1-355f56dc34ce@roeck-us.net> Date: Fri, 2 Jul 2021 06:48:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210702131829.GA11132@willie-the-truck> Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH v15 12/12] of: Add plumbing for restricted DMA pool X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heikki.krogerus@linux.intel.com, linux-devicetree , peterz@infradead.org, linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk, grant.likely@arm.com, paulus@samba.org, Frank Rowand , mingo@kernel.org, jxgao@google.com, sstabellini@kernel.org, Saravana Kannan , mpe@ellerman.id.au, Joerg Roedel , "Rafael J . Wysocki" , Christoph Hellwig , Bartosz Golaszewski , bskeggs@redhat.com, xen-devel@lists.xenproject.org, Marek Szyprowski , matthew.auld@intel.com, Nicolas Boichat , thomas.hellstrom@linux.intel.com, Konrad Rzeszutek Wilk , intel-gfx@lists.freedesktop.org, Dan Williams , Rob Herring , bhelgaas@google.com, Claire Chang , boris.ostrovsky@oracle.com, Andy Shevchenko , jgross@suse.com, airlied@linux.ie, Thierry Reding , Greg KH , Randy Dunlap , quic_qiancai@quicinc.com, lkml , tfiga@chromium.org, "list@263.net:IOMMU DRIVERS" , Jim Quinlan , xypron.glpk@gmx.de, thomas.lendacky@amd.com, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 7/2/21 6:18 AM, Will Deacon wrote: > On Fri, Jul 02, 2021 at 12:39:41PM +0100, Robin Murphy wrote: >> On 2021-07-02 04:08, Guenter Roeck wrote: >>> On Thu, Jun 24, 2021 at 11:55:26PM +0800, Claire Chang wrote: >>>> If a device is not behind an IOMMU, we look up the device node and set >>>> up the restricted DMA when the restricted-dma-pool is presented. >>>> >>>> Signed-off-by: Claire Chang >>>> Tested-by: Stefano Stabellini >>>> Tested-by: Will Deacon >>> >>> With this patch in place, all sparc and sparc64 qemu emulations >>> fail to boot. Symptom is that the root file system is not found. >>> Reverting this patch fixes the problem. Bisect log is attached. >> >> Ah, OF_ADDRESS depends on !SPARC, so of_dma_configure_id() is presumably >> returning an unexpected -ENODEV from the of_dma_set_restricted_buffer() >> stub. That should probably be returning 0 instead, since either way it's not >> an error condition for it to simply do nothing. > > Something like below? > Yes, that does the trick. > Will > > --->8 > >>>From 4d9dcb9210c1f37435b6088284e04b6b36ee8c4d Mon Sep 17 00:00:00 2001 > From: Will Deacon > Date: Fri, 2 Jul 2021 14:13:28 +0100 > Subject: [PATCH] of: Return success from of_dma_set_restricted_buffer() when > !OF_ADDRESS > > When CONFIG_OF_ADDRESS=n, of_dma_set_restricted_buffer() returns -ENODEV > and breaks the boot for sparc[64] machines. Return 0 instead, since the > function is essentially a glorified NOP in this configuration. > > Cc: Claire Chang > Cc: Konrad Rzeszutek Wilk > Reported-by: Guenter Roeck > Suggested-by: Robin Murphy > Link: https://lore.kernel.org/r/20210702030807.GA2685166@roeck-us.net > Signed-off-by: Will Deacon Tested-by: Guenter Roeck > --- > drivers/of/of_private.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h > index 8fde97565d11..34dd548c5eac 100644 > --- a/drivers/of/of_private.h > +++ b/drivers/of/of_private.h > @@ -173,7 +173,8 @@ static inline int of_dma_get_range(struct device_node *np, > static inline int of_dma_set_restricted_buffer(struct device *dev, > struct device_node *np) > { > - return -ENODEV; > + /* Do nothing, successfully. */ > + return 0; > } > #endif > > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx