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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 204F8C4338F for ; Tue, 17 Aug 2021 06:13:26 +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 B1DCD60E78 for ; Tue, 17 Aug 2021 06:13:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B1DCD60E78 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Gpgh41KN9z306d for ; Tue, 17 Aug 2021 16:13:24 +1000 (AEST) 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=BBCXvOXw; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::82e; helo=mail-qt1-x82e.google.com; envelope-from=leobras.c@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=BBCXvOXw; dkim-atps=neutral Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 4GpggH0Ntqz2yR8 for ; Tue, 17 Aug 2021 16:12:42 +1000 (AEST) Received: by mail-qt1-x82e.google.com with SMTP id t16so16266256qta.9 for ; Mon, 16 Aug 2021 23:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=G5q2kw4t+Ye13oI9DBMvvqvug6wc8CKiiXAR6p+W89I=; b=BBCXvOXw4li2gIL9kkbvJ5ZcdZ+itbeWzg1qIECAHIFLOfIX2XSQzcKwfXQTU/IqWt 0btORgGye8PrIQUXPygvdchbdYCaQyo1Q4GcGhYSSzziVV8bTFIgxygtUDIcpe2aDVp4 Ov2YFEmfPew8Zm21hM8gN6zOq6CR4/7HL5YLQuJcHgHM4TBgJSCHH3D6NtnqekbbjINL 6TCJgs9NbqCw9HqgEa8hR4bHgGT7MSpU8rwwB+Gwu8dsD7lWtUre0X0uyZyzW4gI7gR0 M6mjWK2nRH6HVtCKI9chJv5JQUDsjo2GIvvXVjANDGjxbPFQyV+cUAD/Eg6sWgk7wfkM 8W0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=G5q2kw4t+Ye13oI9DBMvvqvug6wc8CKiiXAR6p+W89I=; b=Zoy5m3RmOFT9L3/xLjF1RMpHFy8dKvaLrLSz2Igymw2BYEqwswUQqQZAhchEl5ZGRd QJLhB6xoWkwPKPW0loI2S5jVBf5QVseqXyXENyj9VZ3B92BPnghsRpe1t8QY+XQMJhnY WSC1KRIWrfMNVavQuGy6ak64ClfHEQ06v/MbabkZfmXObJIsmjQIYHG8P90swgldA/Yl vcJJpJ02KomLpK8Isn2GYP+pHeI8Wmf+3U1v06NCLVYHOEs8bcP9XqPxluIxnHvmuV09 jQJ1YEZyH2b98gfTqzESMVC3/KE774L4DkkwQq4gdXa4ysQw/6FLnJoCEGe0L53PtPDe M/XQ== X-Gm-Message-State: AOAM532c3xyM7GnV8r4K3WsPevZ88FXdRguww2RjCbqT5OdSzDTDDi/Q 7RQxp/T22o1rGq5bm8nNHaQ= X-Google-Smtp-Source: ABdhPJyol1AUFCOLYakvjk8k/FnQSFqpYVx52TWd46ga3LUw/FtBCvvKbLt20uNE3CMvS+SRsEfk+Q== X-Received: by 2002:a05:622a:612:: with SMTP id z18mr1635720qta.330.1629180756978; Mon, 16 Aug 2021 23:12:36 -0700 (PDT) Received: from ?IPv6:2804:431:c7f0:30b2:5c9e:50:88f3:269a? ([2804:431:c7f0:30b2:5c9e:50:88f3:269a]) by smtp.gmail.com with ESMTPSA id w6sm750513qkf.95.2021.08.16.23.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 23:12:36 -0700 (PDT) Message-ID: Subject: Re: [PATCH v5 08/11] powerpc/pseries/iommu: Update remove_dma_window() to accept property name From: Leonardo =?ISO-8859-1?Q?Br=E1s?= To: Frederic Barrat , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Alexey Kardashevskiy , David Gibson , kernel test robot , Nicolin Chen Date: Tue, 17 Aug 2021 03:12:38 -0300 In-Reply-To: <2653ee3e582ba181651e4842821e64d3323fa566.camel@gmail.com> References: <20210716082755.428187-1-leobras.c@gmail.com> <20210716082755.428187-9-leobras.c@gmail.com> <8dbd08fb-375c-9f21-f8ab-bec163b157bf@linux.ibm.com> <2653ee3e582ba181651e4842821e64d3323fa566.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, 2021-08-17 at 02:59 -0300, Leonardo Brás wrote: > Hello Fred, thanks for the feedback! > > On Tue, 2021-07-20 at 19:51 +0200, Frederic Barrat wrote: > > > > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > > Update remove_dma_window() so it can be used to remove DDW with a > > > given > > > property name. > > > > > > This enables the creation of new property names for DDW, so we > > > can > > > have different usage for it, like indirect mapping. > > > > > > Signed-off-by: Leonardo Bras > > > Reviewed-by: Alexey Kardashevskiy > > > --- > > >   arch/powerpc/platforms/pseries/iommu.c | 21 +++++++++++-------- > > > -- > > >   1 file changed, 11 insertions(+), 10 deletions(-) > > > > > > diff --git a/arch/powerpc/platforms/pseries/iommu.c > > > b/arch/powerpc/platforms/pseries/iommu.c > > > index 108c3dcca686..17c6f4706e76 100644 > > > --- a/arch/powerpc/platforms/pseries/iommu.c > > > +++ b/arch/powerpc/platforms/pseries/iommu.c > > > @@ -830,31 +830,32 @@ static void remove_dma_window(struct > > > device_node *np, u32 *ddw_avail, > > >                         np, ret, > > > ddw_avail[DDW_REMOVE_PE_DMA_WIN], > > > liobn); > > >   } > > >   > > > -static void remove_ddw(struct device_node *np, bool remove_prop) > > > +static int remove_ddw(struct device_node *np, bool remove_prop, > > > const char *win_name) > > >   { > > > > > > Why switch to returning an int? None of the callers check it. > > IIRC, in a previous version it did make sense, which is not the case > anymore. I will revert this. > > Thanks! Oh, sorry about that, it is in fact still needed: It will make sense in patch v5 10/11: On iommu_reconfig_notifier(), if (action == OF_RECONFIG_DETACH_NODE), we need to remove a DDW if it exists. As there may be different window names, it tests for DIRECT64_PROPNAME, and if it's not found, it tests for DMA64_PROPNAME. This approach will skip scanning for DMA64_PROPNAME if DIRECT64_PROPNAME was found, as both may not exist in the same node. But for this approach to work we need remove_ddw() to return error if the property is not found. Does it make sense? or should I just test for both? Best regards, Leonardo Bras