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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A087DC6FD19 for ; Thu, 16 Mar 2023 12:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VpeWNjLKGjMmE12euheF0OlpT8OZd9WKEcQtSzZyde0=; b=GSVB8mAJSYLogf wWGhQNVgddQVuIzwbJZqKac1LIPzGPFZKqKxzH/SdN5GPgBx9Ymazw1aWRCP+ICrXrwy1B4QRQ7r7 tfSiaC+SgsoH23jBbZn3LFd+Xfug4JlJ27pv21qD8q68tnQoRblhhc5AHB9JbLZotccS+2Gf8rESw UKKl3lD8PjY544BU0kF2jOQqOMeEP31RDt/qBkgm3/1Hczl7pzB4KcY7kkL9RumXKKoqn8WRR0pi3 gz8SOE143n395ggY5T0CHFC9/cjXW7QVwh4lAYT1Jahm7V4MF4Ln9X+S5kCnbZVP89OfrhnPZSrLS BP5VnZbHYJYbtDgv3DjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcmlw-00GOtt-0N; Thu, 16 Mar 2023 12:31:56 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcmls-00GOsn-33 for linux-arm-kernel@lists.infradead.org; Thu, 16 Mar 2023 12:31:54 +0000 Received: by mail-wr1-x432.google.com with SMTP id v16so1407295wrn.0 for ; Thu, 16 Mar 2023 05:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20210112.gappssmtp.com; s=20210112; t=1678969907; 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=EBgLiap3z0eOs9IEVV1ogrSUVwRj9wQ1k01+u0gMWts=; b=FgR5guvHvPt4kprXYHnCrdMuuGY87sl592+oE7AbdXaOSaBhccVRR6LSIafFSvDjDN 8mx8u7y8ohjXaY3r3PowRqodGoXPB+mmdeco3rDch3ZB9lABVAqKAhi6rxrbrlaTrLGi dGilRPr05l0o/L1nMmHRrEs3CK5eOErA95PKShDFJyozqR+4LzE4v1JpwRPJfmyFLJSw LuiX1ekhHh6b7dnGF3TIOAyNJpkMcR4F6GGi+Pfuko8GF1aw3nFwo6ooxVbrb1pFYxGi WCKPCvqe3HlKzCEv1N1L39hlx6qS97tsJy9lD0tGTX1M5fws/jpD9SDvdcOc05gb7F20 Cuew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678969907; 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=EBgLiap3z0eOs9IEVV1ogrSUVwRj9wQ1k01+u0gMWts=; b=R/RVUOwk5kXBCxOl2StUOuA7iiI18e08siGP6EyJeGsLQ7ehLTyIH61Ct05tAAMqjg C0Siut4IlkFiW3BU1RWHo+u/SVO1cKGUI0EgteaLilCsouCsCvHFHia6Wnr01ZpWoef3 H8qrQGo/zYfLctjXsl5f1nSxHRo/dRXeJa62W475131FxZm+KpnHn7AthwAx5Mt+XBag hXEzxMTiNsgYwA0V7TDgCwUkYOAf4Hb+lC5w5Efqo9A+tpAErObQo59iTs05mOZr8Oxi aQvNNVJZGokE63rmpGec0jh2j2m8JzEoBy2lCYINiVPhi+ARS6tYBlHWZ/pK0fl1y0f/ Zvbw== X-Gm-Message-State: AO0yUKWnrFUMdVT82gKYyvHT90gClvYkj1CeZb+sXm6VxuM3yr1vSeHS mSYSDqMUxEKotzVgPVJaY0v5+w== X-Google-Smtp-Source: AK7set8nrHPE+yCjyiqyl0cay4i3vqG4IwBn3w4wy8QX9KqZAxyW3zqrdr6NHGXNGcwea6nJ5f6j3g== X-Received: by 2002:a5d:428c:0:b0:2cf:e957:644b with SMTP id k12-20020a5d428c000000b002cfe957644bmr4753522wrq.27.1678969906981; Thu, 16 Mar 2023 05:31:46 -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 u1-20020adfed41000000b002c6e8cb612fsm7148717wro.92.2023.03.16.05.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 05:31:46 -0700 (PDT) Date: Thu, 16 Mar 2023 13:31:45 +0100 From: Jiri Pirko To: "Kubalewski, Arkadiusz" Cc: Vadim Fedorenko , Vadim Fedorenko , Jakub Kicinski , Jonathan Lemon , Paolo Abeni , poros , mschmidt , "netdev@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-clk@vger.kernel.org" , "Olech, Milena" , "Michalik, Michal" Subject: Re: [PATCH RFC v6 2/6] dpll: Add DPLL framework base functions Message-ID: References: <20230312022807.278528-1-vadfed@meta.com> <20230312022807.278528-3-vadfed@meta.com> <2b749045-021e-d6c8-b265-972cfa892802@linux.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230316_053153_186429_4C6D61D6 X-CRM114-Status: GOOD ( 12.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Wed, Mar 15, 2023 at 10:22:33AM CET, jiri@resnulli.us wrote: >Tue, Mar 14, 2023 at 06:50:57PM CET, arkadiusz.kubalewski@intel.com wrote: >>>From: Jiri Pirko >>>Sent: Tuesday, March 14, 2023 10:22 AM >>> >>>Mon, Mar 13, 2023 at 11:59:32PM CET, vadim.fedorenko@linux.dev wrote: >>>>On 13.03.2023 16:21, Jiri Pirko wrote: >>>>> Sun, Mar 12, 2023 at 03:28:03AM CET, vadfed@meta.com wrote: [...] >>>>> > + const struct dpll_pin_properties *prop) >>>>> > +{ >>>>> > + struct dpll_pin *pos, *ret = NULL; >>>>> > + unsigned long index; >>>>> > + >>>>> > + mutex_lock(&dpll_pin_xa_lock); >>>>> > + xa_for_each(&dpll_pin_xa, index, pos) { >>>>> > + if (pos->clock_id == clock_id && >>>>> > + pos->dev_driver_id == device_drv_id && >>>>> > + pos->module == module) { >>>>> >>>>> Compare prop as well. >>>>> >>>>> Can't the driver_id (pin index) be something const as well? I think it >>>>> should. And therefore it could be easily put inside. >>>>> >>>> >>>>I think clock_id + dev_driver_id + module should identify the pin exactly. >>>>And now I think that *prop is not needed here at all. Arkadiusz, any >>>>thoughts? >>> >>>IDK, no strong opinion on this. I just thought it may help to identify >>>the pin and avoid potential driver bugs. (Like registering 2 pins with Was thinking about this some more, I think that it would be good to store and check properties in case of pin_get() call. If the driver does call for the second time pin_get() for the same pin (clockid,pin_index) with different prop, it is buggy and WARN_ON should be triggered. WARN_ON check should compare the actual struct, not just pointer. [...] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel