Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7152795rwb; Tue, 6 Dec 2022 01:46:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4l+9P0S+EKp3UnKZksa5M2u0z7onjisPmQHj5Fmwv3tULhpoEMWtKA6Lo9lxoAQtGue/nn X-Received: by 2002:a63:5920:0:b0:43f:88cc:473 with SMTP id n32-20020a635920000000b0043f88cc0473mr63520065pgb.491.1670319968044; Tue, 06 Dec 2022 01:46:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670319968; cv=none; d=google.com; s=arc-20160816; b=WK+VUhH+IHDDipvJf0hNVd4pvzqnzV0+gy8BGu/L8mcZR5yTNVkWJ2M+5mH+UsfThW 4STVCJydgoDgAP1FXH/XVkjgHQxf2gcJAY2RJWuDcgNx7xozKEZ6sDqLk1nkBnbyyAaV vdqyy6VRhdpZtWguqBuOsiMI9TsHAv3NiXfLCZsmbqYTcIyH9e5V6NrsATXJDeRrkMdt V/Iyl0byXkK64X3Gg72fOOT2ePFo2wp190syrVRn1bouXuaHZyWLAfigH3KEthSy6q0m lEwo+lP/qzvxZtk2HJ/Dt3NZr2xPKU8ermjEsi4NWk9KZIRmPlNJzvS4SFf8hoWdaNQ+ MQNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ePWQHlJZ1ifQfk6Te5xFRB+dPeDDvHuJ9FBMyduq99Y=; b=jhDmNx/8v0m6/37HY9AbvMhoiheghASs2jVSigNNQRrwonPhJI0GdWqxplKR2i4xlZ AocB/WlphhFe4jKxXe6RuWqV20zFnmA1rve38JHr4mMyViNKK8SwKgZKVR4WPuz8V1qG YKD2knsijAx+Htief+MxOHThCV2GXlS5Je7zVHQkCn6Ha+qxlE0pqJirgzQPbDtExATD I9EOO+mFgfzoFgQ7HGEagnRPRZiaFYeQHmlYQX+pKSYfcTRHj9E3CqkqycMVDxN9P1UJ NoMVdtk5NdUxD/6dqTp9vTtm9gWk2Zvp7tqn+jAAqMuy45Gguv2K+cF35Pv0HUt6SJeI vOOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bCtcy40T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a1709027e8a00b00189bae9d928si11155563pla.162.2022.12.06.01.45.57; Tue, 06 Dec 2022 01:46:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bCtcy40T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234809AbiLFJUI (ORCPT + 79 others); Tue, 6 Dec 2022 04:20:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234774AbiLFJTi (ORCPT ); Tue, 6 Dec 2022 04:19:38 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBB8E20983 for ; Tue, 6 Dec 2022 01:17:56 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id f3so12852703pgc.2 for ; Tue, 06 Dec 2022 01:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ePWQHlJZ1ifQfk6Te5xFRB+dPeDDvHuJ9FBMyduq99Y=; b=bCtcy40TBkMMs+Bx7uvp/8ffgWsN8SmTCqqiq0rSu0lzo3hObF4h5AzqBWU1RUxsqe d9MjQKefgoEX5/ePs9f3/OyR8DC51smp0jwcbADoc9qCq4inshfq5p5V7sgXUDG4uLai KLXihMWFtwtTsuuVwt23cYGHe47HidgigeuHK5cyOTYqesLPqPXhHvcNC7desZNJ45zS PW7yLVv9J/DfOZtUAtCLPuIhRUfjduXXxZfp+MLVw8Yk0bQgjlUR1OBYeVxyrZMW+uoU 0r/VfW72EUgKAG/Ppl1J9m5QfsSehrdRa/Muf1Fo7fgEn7PBewdOnKcrGMX/MeHJAhGG Zvrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ePWQHlJZ1ifQfk6Te5xFRB+dPeDDvHuJ9FBMyduq99Y=; b=zfai/vVdE3bCxvO2y7/kJrQeUok0GPnijJsYSf/yRGfyLzjWZgLbtSmPjY13UHA4+c C+8p6RywXp/CRxlt+RSHEAx8+zgNoFNCfvaTn1GufqJIgjIq0GItydyX67N75X+3MfX4 VgwcnlEV5ZLUiiF3GUkKwT1V9KIvbeMhnDZ35Ah5qiohyiQnKl4YrlkSlDEwFsBbJPmj liggXsPNRoexSMGXI3aU9hjdJ67DcWxLlGN46tnNeQB+WD61wi5ALFkL/KyqcePa9Jrw EldnzPpp08T8A/wcJ44Q2KzOaZFmySvauhA1KN4qZCZRAOyrIFFdFJaBRX+zjACPJSCm Ww3g== X-Gm-Message-State: ANoB5plDCT4dzGtYDjMI9AAAcdFbT0QgdQyQ+ynv0QA4YeMVAakhyfe+ mxz4gGivnjK7WoXf1oMX5rAf X-Received: by 2002:a65:58ca:0:b0:470:2c91:9579 with SMTP id e10-20020a6558ca000000b004702c919579mr58584377pgu.22.1670318276006; Tue, 06 Dec 2022 01:17:56 -0800 (PST) Received: from thinkpad ([59.92.103.18]) by smtp.gmail.com with ESMTPSA id u10-20020a170902e5ca00b00189371b5971sm12147194plf.220.2022.12.06.01.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 01:17:54 -0800 (PST) Date: Tue, 6 Dec 2022 14:47:37 +0530 From: Manivannan Sadhasivam To: Krzysztof Kozlowski Cc: Johan Hovold , Johan Hovold , Bjorn Andersson , Alim Akhtar , Avri Altman , Andy Gross , Konrad Dybcio , Bart Van Assche , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] dt-bindings: ufs: qcom: allow 'dma-coherent' property Message-ID: <20221206091737.GC15486@thinkpad> References: <20221205100837.29212-1-johan+linaro@kernel.org> <20221205100837.29212-2-johan+linaro@kernel.org> <20221205115906.GA20192@thinkpad> <20221205122018.GC20192@thinkpad> <20221205130048.GD20192@thinkpad> <20221205133712.GE20192@thinkpad> <2699840b-9746-473b-fa17-900258db555d@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2699840b-9746-473b-fa17-900258db555d@linaro.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 06, 2022 at 09:14:30AM +0100, Krzysztof Kozlowski wrote: > On 05/12/2022 14:37, Manivannan Sadhasivam wrote: > > On Mon, Dec 05, 2022 at 02:12:48PM +0100, Johan Hovold wrote: > >> On Mon, Dec 05, 2022 at 06:30:48PM +0530, Manivannan Sadhasivam wrote: > >>> On Mon, Dec 05, 2022 at 01:27:34PM +0100, Johan Hovold wrote: > >>>> On Mon, Dec 05, 2022 at 05:50:18PM +0530, Manivannan Sadhasivam wrote: > >>>>> On Mon, Dec 05, 2022 at 01:07:16PM +0100, Johan Hovold wrote: > >>>>>> On Mon, Dec 05, 2022 at 05:29:06PM +0530, Manivannan Sadhasivam wrote: > >>>>>>> On Mon, Dec 05, 2022 at 11:08:36AM +0100, Johan Hovold wrote: > >>>>>>>> UFS controllers may be cache coherent and must be marked as such in the > >>>>>>>> devicetree to avoid data corruption. > >>>>>>>> > >>>>>>>> This is specifically needed on recent Qualcomm platforms like SC8280XP. > >>>>>>>> > >>>>>>>> Signed-off-by: Johan Hovold > >> > >>>>>> Yes, it would be a valid, but it will only be added to the DTs of SoCs > >>>>>> that actually require it. No need to re-encode the dtsi in the binding. > >>>>>> > >>>>> > >>>>> But if you make a property valid in the binding then it implies that anyone > >>>>> could add it to DTS which is wrong. You should make this property valid for > >>>>> SoCs that actually support it. > >>>> > >>>> No, it's not wrong. > >>>> > >>>> Note that the binding only requires 'compatible' and 'regs', all other > >>>> properties are optional, and you could, for example, add a > >>>> 'reset' property to a node for a device which does not have a reset > >>>> without the DT validation failing. > > Optional properties are optional primarily looking at one variant. It > means that on different boards with the same SoC, things can be routed a > bit differently and some property can be skipped. E.g. sometimes > regulators come from PMIC and sometimes are wired to some VBATT, so we > do not have regulator in DTS for them. Or some interrupt/pin is not > connected. > > Now between variants of devices - different SoCs: I don't think that > "optional" should be used in such context, except special cases or lack > of knowledge about hardware. For given SoC/variant, the property is either: > 1. valid and possible (can be required or optional), > 2. not valid, not possible. > And this we should express in constraints, if doable with reasonable > complexity. > > Therefore the question is: is dma-coherent not valid for other SoCs? > Yes, it is not valid on older SoCs because they don't support I/O coherency. So setting this property on those un-supported SoCs may lead to wierd behavior. This was the concern I had for setting this property valid for all SoCs. So far we only know that SC8280XP and newer SoCs support I/O coherency. Thanks, Mani > If it is "not needed" for other SoCs, then I would leave it like this. > Consider also what Rob said, that otherwise we would create DTS from the > bindings. > > Also, too many allOf:if:then: constraints in the bindings make them > trickier to read. > > >>>> > >>> > >>> Then what is the point of devicetree validation using bindings? > >> > >> You're still making sure that no properties are added that are not > >> documented, number of clocks, names of clocks, etc. > >> > >>> There is also a comment from Krzysztof: https://lkml.org/lkml/2022/11/24/390 > >> > >> Speaking of Krzysztof: > >> > >> https://lore.kernel.org/lkml/20221204094717.74016-5-krzysztof.kozlowski@linaro.org/ > > That's not the best example, because I just do not know where > dma-coherent is applicable and where it is not, thus I added it as valid > for all variants. Also, I think that all variants are capable of using > IOMMU - it isn't restricted per variant. If they are capable of IOMMU, > then dma-coherent is a possible choice. > > > Best regards, > Krzysztof > -- மணிவண்ணன் சதாசிவம்