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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 F1355C433DB for ; Fri, 22 Jan 2021 21:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1DE323A7A for ; Fri, 22 Jan 2021 21:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730106AbhAVVKB (ORCPT ); Fri, 22 Jan 2021 16:10:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729693AbhAVVIr (ORCPT ); Fri, 22 Jan 2021 16:08:47 -0500 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23900C061786 for ; Fri, 22 Jan 2021 13:08:06 -0800 (PST) Received: by mail-yb1-xb29.google.com with SMTP id y4so6803719ybn.3 for ; Fri, 22 Jan 2021 13:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qVc/JMkhbZ642gWanQRDHxa/CH0+8991b/z+xpWJCVE=; b=sv6yjs1f0h/jilFnfWEYscV2TwPHz046JX1vja4M1fRL7/hPcAimzjsx09ndnGML1+ R1dYHaoAPYi/shuH4sdW1QblpzxI+u7SkGi3MNPi+El6gPb+WhnRHFnDiaz77PyejxFE bnlC79MJ79AWbokEVsWQaIgH4NFvplailCmo3cPt7yPvl3blKaOiFXfBUpasnfE4IK9r 7wvBHXRMAI9Qdf83Jkdbgx9puJ8gL8d0sUEX1S8mMSLen7WXn9rifkY8zRhBpmsCmZJt nzUKXEqWgZeUtPVfru5jeTmT17iJVykkgsqIfG57gyHnRFVvjTp2xRRjltHv51NQUBgf HgIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qVc/JMkhbZ642gWanQRDHxa/CH0+8991b/z+xpWJCVE=; b=KVUrfcpPZJZ058JBpH0PVMw2DGyqNmgU8GMubQ/2qzifBTpg7aYTX0fJwWD//2GLDF 4RdIL/ktzUoya4Tr82J9kryDZrRHoWuImiykLYDLwa4wrP77ClcRXnnXdZPlcxPiWODT wbFEQS5jCkQMpOn3V2dy35vq5DGVcnglcCZnExSLT83RcQL4Zr/of0OnCAJJRJCNh7rF sXcMqRCL+lo+KHg576d7PXRsHzbWglGqpDy1BLYUW1L8xKdTyqkgA3mN6c1yhyZ/Hhpm 6VmFqa7vKV3PtYlXc7Qp2sJEvQ4JxfTlX40UscIhAojs+v3eJfAxjUeJlyl/XVNQdlDc 2DFQ== X-Gm-Message-State: AOAM5333abQVUsbTpTYCWWWBpIbDRu+rSmSGRnKsKi8ZU4mtumTtd/MQ 2XgliipTh4MTHubvfKVawa/t3svGjAltHiOMJvo2Gw== X-Google-Smtp-Source: ABdhPJzl3B4tmnY6/Kaav43wpplRGKE3E6UPYGKpTFTuTVbPUkkV4q2p8tfyfjSW1l1la2fC7GPmuC9hUaiU1fTvO1w= X-Received: by 2002:a25:3345:: with SMTP id z66mr9256594ybz.466.1611349685124; Fri, 22 Jan 2021 13:08:05 -0800 (PST) MIME-Version: 1.0 References: <20210112134054.342-1-calvin.johnson@oss.nxp.com> <20210112134054.342-10-calvin.johnson@oss.nxp.com> <20210112180343.GI4077@smile.fi.intel.com> In-Reply-To: From: Saravana Kannan Date: Fri, 22 Jan 2021 13:07:29 -0800 Message-ID: Subject: Re: [net-next PATCH v3 09/15] device property: Introduce fwnode_get_id() To: Andy Shevchenko Cc: "Rafael J. Wysocki" , Calvin Johnson , Grant Likely , Jeremy Linton , Andrew Lunn , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Diana Madalina Craciun , LKML , netdev , Laurentiu Tudor , ACPI Devel Maling List , "linux.cj" , linux-arm-kernel , Bartosz Golaszewski , Greg Kroah-Hartman , Laurent Pinchart , Randy Dunlap Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Fri, Jan 22, 2021 at 1:05 PM Andy Shevchenko wrote: > > On Fri, Jan 22, 2021 at 10:59 PM Saravana Kannan wrote: > > On Fri, Jan 22, 2021 at 8:34 AM Rafael J. Wysocki wrote: > > > On Wed, Jan 20, 2021 at 9:01 PM Saravana Kannan wrote: > > > > On Wed, Jan 20, 2021 at 11:15 AM Rafael J. Wysocki wrote: > > > > > > I'd rather this new function be an ops instead of a bunch of #ifdef or > > > > if (acpi) checks. Thoughts? > > > > > > Well, it looks more like a helper function than like an op and I'm not > > > even sure how many potential users of it will expect that _ADR should > > > be evaluated in the absence of the "reg" property. > > > > > > It's just that the "reg" property happens to be kind of an _ADR > > > equivalent in this particular binding AFAICS. > > > > I agree it is not clear how useful this helper function is going to be. > > > > But in general, to me, any time the wrapper/helper functions in > > drivers/base/property.c need to do something like this: > > > > if (ACPI) > > ACPI specific code > > if (OF) > > OF specific code > > > > I think the code should be pushed to the fwnode ops. That's one of the > > main point of fwnode. So that firmware specific stuff is done by > > firmware specific code. Also, when adding support for new firmware, > > it's pretty clear what support the firmware needs to implement. > > Instead of having to go fix up a bunch of code all over the place. > > Wishful thinking. > In the very case of GPIO it's related to framework using headers local > to framework. Are you suggesting to open its guts to the entire wild > world? What are you even talking about? How is whatever you are saying remotely related to getting an "id" for a fwnode? > I don't think it's a good idea. You see, here we have different > layering POD types, POD? > which are natural and quite low level that ops > suits best for them and quite different resource types like GPIO. And > the latter is closer to certain framework rather than to POD handling > cases. > -Saravana 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=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A0CABC433DB for ; Fri, 22 Jan 2021 21:10:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 5FC2323A7A for ; Fri, 22 Jan 2021 21:10:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FC2323A7A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MgyO7ChV/XzdLq8Rmfmxc/xFAqCTpai+o9Hy21UB6oI=; b=wXBjP93qlRaU+eD2pa8D2hfFY X+i/Io82jgEicaHTdzrfaPsHs2sPIGm+ytq+mzUlxIs56gH8qfl/WpKFbjdIOCc9NmWtUONj9YTzo 6pHqpM31+iMMguMo8bnHd4t9gWSsyNbDr50FYE9uIMIUX3eGulav1z/Xj6ZfTRQkgR5vVuFtVSpjx 1uNx59CNV/QPZbh2jKSJfO2lD0K+8wS8v8v6TP6JASOp0DL3odn6quMKyVZhWYHvY/wA2rH9Cr42g ttJwZZ7omG/absBs0Z4IyBQzQY4il8VzV6Px4AGOvKka2+Mzq6hTx1Qn90ut10+o5mJIi/GHUQ6sL wLcI1luCw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l33fC-0000k9-Nb; Fri, 22 Jan 2021 21:08:14 +0000 Received: from mail-yb1-xb30.google.com ([2607:f8b0:4864:20::b30]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l33f7-0000jF-K9 for linux-arm-kernel@lists.infradead.org; Fri, 22 Jan 2021 21:08:10 +0000 Received: by mail-yb1-xb30.google.com with SMTP id z1so6773959ybr.4 for ; Fri, 22 Jan 2021 13:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qVc/JMkhbZ642gWanQRDHxa/CH0+8991b/z+xpWJCVE=; b=sv6yjs1f0h/jilFnfWEYscV2TwPHz046JX1vja4M1fRL7/hPcAimzjsx09ndnGML1+ R1dYHaoAPYi/shuH4sdW1QblpzxI+u7SkGi3MNPi+El6gPb+WhnRHFnDiaz77PyejxFE bnlC79MJ79AWbokEVsWQaIgH4NFvplailCmo3cPt7yPvl3blKaOiFXfBUpasnfE4IK9r 7wvBHXRMAI9Qdf83Jkdbgx9puJ8gL8d0sUEX1S8mMSLen7WXn9rifkY8zRhBpmsCmZJt nzUKXEqWgZeUtPVfru5jeTmT17iJVykkgsqIfG57gyHnRFVvjTp2xRRjltHv51NQUBgf HgIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qVc/JMkhbZ642gWanQRDHxa/CH0+8991b/z+xpWJCVE=; b=SLOerF5rwTJyO8Hr0W8hVteivFjjwC7BgyACQcA7NIyWdG49f2cxTA+atRygvfLLnm phT5YKOIlo4wWttlSZ+8oyHfewi7j9tILDk9E6LM2caWy1EsnTRGomMYFVgD2Gs1qQEL djYyurDLxAEZ77QrC44TvbTMj8JibF1Nyn3Jt/g65JCeNt3EbIMg1QIBYAY41iB0Q82a N0SuqT9XhWJmJBODe/XUOL5Zhnf5xbueqfb/4RYqeJpBGP7lShVak5jBfRoeMGvavw+6 GFaxMVwedTpMvwyV0CNfwBWpREU8V9iec8fE9f7IeHzx1Y3j8SUI3uGGZnogngj8Ozi0 V+ng== X-Gm-Message-State: AOAM532s5gQylwxxgber8aEkQetBWEwubiCfSGzHF3R9RHIYXlWCNp61 Zmi/qieCF5Nrc12ZxbFDq36R3zPEmX/EX/G0EU/6nQ== X-Google-Smtp-Source: ABdhPJzl3B4tmnY6/Kaav43wpplRGKE3E6UPYGKpTFTuTVbPUkkV4q2p8tfyfjSW1l1la2fC7GPmuC9hUaiU1fTvO1w= X-Received: by 2002:a25:3345:: with SMTP id z66mr9256594ybz.466.1611349685124; Fri, 22 Jan 2021 13:08:05 -0800 (PST) MIME-Version: 1.0 References: <20210112134054.342-1-calvin.johnson@oss.nxp.com> <20210112134054.342-10-calvin.johnson@oss.nxp.com> <20210112180343.GI4077@smile.fi.intel.com> In-Reply-To: From: Saravana Kannan Date: Fri, 22 Jan 2021 13:07:29 -0800 Message-ID: Subject: Re: [net-next PATCH v3 09/15] device property: Introduce fwnode_get_id() To: Andy Shevchenko X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210122_160809_678499_40239737 X-CRM114-Status: GOOD ( 27.13 ) 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: Andrew Lunn , Heikki Krogerus , "Rafael J. Wysocki" , Grant Likely , Calvin Johnson , Ioana Ciornei , Florian Fainelli , Bartosz Golaszewski , Jon , Russell King - ARM Linux admin , Diana Madalina Craciun , ACPI Devel Maling List , Florin Laurentiu Chiculita , Madalin Bucur , Pieter Jansen Van Vuuren , Laurent Pinchart , Marcin Wojtas , linux-arm-kernel , Laurentiu Tudor , netdev , Randy Dunlap , LKML , Jeremy Linton , Cristi Sovaiala , "linux.cj" , Greg Kroah-Hartman Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jan 22, 2021 at 1:05 PM Andy Shevchenko wrote: > > On Fri, Jan 22, 2021 at 10:59 PM Saravana Kannan wrote: > > On Fri, Jan 22, 2021 at 8:34 AM Rafael J. Wysocki wrote: > > > On Wed, Jan 20, 2021 at 9:01 PM Saravana Kannan wrote: > > > > On Wed, Jan 20, 2021 at 11:15 AM Rafael J. Wysocki wrote: > > > > > > I'd rather this new function be an ops instead of a bunch of #ifdef or > > > > if (acpi) checks. Thoughts? > > > > > > Well, it looks more like a helper function than like an op and I'm not > > > even sure how many potential users of it will expect that _ADR should > > > be evaluated in the absence of the "reg" property. > > > > > > It's just that the "reg" property happens to be kind of an _ADR > > > equivalent in this particular binding AFAICS. > > > > I agree it is not clear how useful this helper function is going to be. > > > > But in general, to me, any time the wrapper/helper functions in > > drivers/base/property.c need to do something like this: > > > > if (ACPI) > > ACPI specific code > > if (OF) > > OF specific code > > > > I think the code should be pushed to the fwnode ops. That's one of the > > main point of fwnode. So that firmware specific stuff is done by > > firmware specific code. Also, when adding support for new firmware, > > it's pretty clear what support the firmware needs to implement. > > Instead of having to go fix up a bunch of code all over the place. > > Wishful thinking. > In the very case of GPIO it's related to framework using headers local > to framework. Are you suggesting to open its guts to the entire wild > world? What are you even talking about? How is whatever you are saying remotely related to getting an "id" for a fwnode? > I don't think it's a good idea. You see, here we have different > layering POD types, POD? > which are natural and quite low level that ops > suits best for them and quite different resource types like GPIO. And > the latter is closer to certain framework rather than to POD handling > cases. > -Saravana _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel