Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20398183rwd; Thu, 29 Jun 2023 01:32:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7HEcqZNyfM7/dK+zvtn0yzf8m+IpHsusYg9PpTQqWrVNglAqtnLBMZQhiVGAfpx43dmVxR X-Received: by 2002:a05:6a00:24c9:b0:66d:514c:cb33 with SMTP id d9-20020a056a0024c900b0066d514ccb33mr13508937pfv.6.1688027521039; Thu, 29 Jun 2023 01:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688027521; cv=none; d=google.com; s=arc-20160816; b=FzMYslvaL/uTVr7mOLoTlF1lHyhD8NGt5I71vTwzbESbnq1JZqWJizNs8VqtzINYgf oYuUYHmxHLd3USkd8fEHiXMqw7fBizBTcJ8DBn+9yAaF+2hHh22FcgeYZVnnGBMZ3PUc QHntdsYXIIyO/411zecN1nmkWJAhErR0qgJQfwuGbLM4qj3pXdr5Ni1RXobRUaKXtdOq izcDlUZvngYP+RUpM3bbsbGZFTj2roP7SUekTVRB/woHVtb5Y1hedi87LfeQMe/4eAbV gUm2XavbsmkFaoxmp2M+VIo7EVD33VVivF6IwrN+WJfq6bMWS69D1JirbyB0XLcUPUSE SqhQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XCNcU+qQjqANE7miJnt/rRYeXCcZNW96kSXkJVN64sA=; fh=4gTn3dOQ92+ZjitoSCu4RlbJcWRAjXrYYA9giAFB0ek=; b=LrJ5OkaUGfZg3NY1SmWMEg/xuMliDbB3/zU7nV0IXVtm1ijJ6Mk2h24Zc43DzLkg9V uxM6hGm7eHRuUxpI9ofzIIvlMF21ljVuU93D1FKr4FciXnzktYBGCss7Wo3hUsowr3z9 pE3k7SCby1Q1KIeeJaxQhAt/JbzB1NCrlzY7hAuuxedab+0G1qoadXAFJv65alDCIoHm n19mr584gL4JWp2Gff/ZzDXSDkEThlVepr56XD+SXtm+kbU32juYJt0wxDmwaxxxOrY7 gNIYTWXRJ4uErQ/uiSbvDbxSRCmN18oSpqckH2EgmoHB9vTDThyQgR1J39D6jW2iMTJW 03lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20221208.gappssmtp.com header.s=20221208 header.b=t+jCRgWM; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a63574b000000b0055aeedd94c1si6112330pgm.289.2023.06.29.01.31.45; Thu, 29 Jun 2023 01:32:01 -0700 (PDT) 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=@resnulli-us.20221208.gappssmtp.com header.s=20221208 header.b=t+jCRgWM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232387AbjF2ITT (ORCPT + 99 others); Thu, 29 Jun 2023 04:19:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232546AbjF2ISI (ORCPT ); Thu, 29 Jun 2023 04:18:08 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBA0435BC for ; Thu, 29 Jun 2023 01:13:46 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fbc060a2caso1022915e9.3 for ; Thu, 29 Jun 2023 01:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20221208.gappssmtp.com; s=20221208; t=1688026425; x=1690618425; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XCNcU+qQjqANE7miJnt/rRYeXCcZNW96kSXkJVN64sA=; b=t+jCRgWMe9clsMdvABkCIyCYTsRENxOd2x1gINk9t8cwUOVP4GpHwYsveP15/BaTxa IiY4bWtoAXAchtgGBvWVBSVHajfMyXWMfg8mH09pnBnYrxbBszocjJo87KBBFuLdyr8w gDwrrJMKhMocvsJEE+7i6hMpn6aw274D3+HbNb8XDLOh+TxC3BZS79vlWTwn34U7DwIo UrNO+xXIyioiE15XYWLzIOxMxZF4seSi5sOpw+1uwvmqFJjPMEFdZ2BjQAT25raMMQuc Hd/KixDUkzG8rXkE/gv8cxwnI39xp/f05IZEtVkXU+ZL/rGRqJy4MJyAOvyOgom44ue+ K2zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688026425; x=1690618425; h=in-reply-to: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=XCNcU+qQjqANE7miJnt/rRYeXCcZNW96kSXkJVN64sA=; b=Or1o1ZP5qSaNUGQ+gq0G0ghqkdSHus7SoAOKVzr77tvPuma+N1dVOUHVraFONf8Bkb CJNBdSx6aP3ytX2Y1R4MG5LWlj5XDNsZyB1utUUFhacNi2yH9GL8+UHK+mhqOI91kG8L wMaMVGxRdgWBkoF0k4mE7/5Ae8OOKwK5TTnChOMQ5rC8a51t8H/09jyRikASCz4BbpAH IDxSF7YgGs51f9Lr+I+d12HpZCmFUMNUD6gx1TgwA7nDKSwezs9aXj2N9cbMXIZHQXwb NzX5xPj30rkCGWY+o4xQoQQmgX6CnJgIlVonzbEA0RDdm+Tqg4eH40TQYJsIZOtcBqMU Kkbg== X-Gm-Message-State: AC+VfDxPgF/IvDJ1cCzy516H0ZcG/yECEcgJB6y0MfzjJiBNYvQK80yq schVegcN/R0B+5kOKhTll7spjw== X-Received: by 2002:a1c:7417:0:b0:3f9:b87c:10db with SMTP id p23-20020a1c7417000000b003f9b87c10dbmr20901942wmc.3.1688026425228; Thu, 29 Jun 2023 01:13:45 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id g11-20020a7bc4cb000000b003fbab76165asm5145964wmk.48.2023.06.29.01.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 01:13:44 -0700 (PDT) Date: Thu, 29 Jun 2023 10:13:43 +0200 From: Jiri Pirko To: Arkadiusz Kubalewski Cc: kuba@kernel.org, vadfed@meta.com, jonathan.lemon@gmail.com, pabeni@redhat.com, corbet@lwn.net, davem@davemloft.net, edumazet@google.com, vadfed@fb.com, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, saeedm@nvidia.com, leon@kernel.org, richardcochran@gmail.com, sj@kernel.org, javierm@redhat.com, ricardo.canuelo@collabora.com, mst@redhat.com, tzimmermann@suse.de, michal.michalik@intel.com, gregkh@linuxfoundation.org, jacek.lawrynowicz@linux.intel.com, airlied@redhat.com, ogabbay@kernel.org, arnd@arndb.de, nipun.gupta@amd.com, axboe@kernel.dk, linux@zary.sk, masahiroy@kernel.org, benjamin.tissoires@redhat.com, geert+renesas@glider.be, milena.olech@intel.com, kuniyu@amazon.com, liuhangbin@gmail.com, hkallweit1@gmail.com, andy.ren@getcruise.com, razor@blackwall.org, idosch@nvidia.com, lucien.xin@gmail.com, nicolas.dichtel@6wind.com, phil@nwl.cc, claudiajkang@gmail.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, linux-arm-kernel@lists.infradead.org, poros@redhat.com, mschmidt@redhat.com, linux-clk@vger.kernel.org, vadim.fedorenko@linux.dev Subject: Re: [RFC PATCH v9 03/10] dpll: core: Add DPLL framework base functions Message-ID: References: <20230623123820.42850-1-arkadiusz.kubalewski@intel.com> <20230623123820.42850-4-arkadiusz.kubalewski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230623123820.42850-4-arkadiusz.kubalewski@intel.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, Jun 23, 2023 at 02:38:13PM CEST, arkadiusz.kubalewski@intel.com wrote: >From: Vadim Fedorenko > One thing I forgot to point out the last time: [...] >+int >+dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin, >+ const struct dpll_pin_ops *ops, void *priv) >+{ >+ int ret; >+ >+ if (WARN_ON(!ops) || >+ WARN_ON(!ops->state_on_dpll_get) || >+ WARN_ON(!ops->direction_get)) Please add check that you don't register to dpll instance which is unregistered. Similar check needs to be added to pin_on_pin register. Also, make sure you don't unregister dpll device/pin which has child pins registered under it. >+ return -EINVAL; >+ >+ mutex_lock(&dpll_lock); >+ if (WARN_ON(!(dpll->module == pin->module && >+ dpll->clock_id == pin->clock_id))) >+ ret = -EINVAL; >+ else >+ ret = __dpll_pin_register(dpll, pin, ops, priv); >+ mutex_unlock(&dpll_lock); >+ >+ return ret; >+} [...]