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 621D3C04A6A for ; Wed, 2 Aug 2023 06:58:03 +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=FNJl67X/0pcOp1G43dtJlVwSSb6taxxRDRIynyMWYIc=; b=gWBTZeHVN9WFTJ of2nWkLv0jMcPA6NZSF/iQJuazE3D/1j+ND29pi5BP1GqLL6Lrmaxv+zfMPtZ/vwDq0js0Dor+wxO qB+GLgUTny3buzULsD+TnS4u4HNIeAUnLcbHe6IweLVVNqsf12xh3K7aSgBD0sCCmI1F711RV42vX G1cSyHLOYqkymi/ZG4NC9ohepjF2qG/I8xSZ9LFuHde5WIuZmb6JZzVQKy2D2udvhhju/0sQnJ7B2 rdf3L8kpbdf7T+FwlvAA2QDWkn6vyFUmitzGkY2qS1GuyruqUsbJUi6JLa4IcwyRA3RwCsJt8oZop 8cVx/45ABO3+dV8bJ7Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR5nX-004BWc-10; Wed, 02 Aug 2023 06:57:31 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qR5nU-004BVX-09 for linux-arm-kernel@lists.infradead.org; Wed, 02 Aug 2023 06:57:29 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5222bc91838so9479188a12.0 for ; Tue, 01 Aug 2023 23:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20221208.gappssmtp.com; s=20221208; t=1690959444; x=1691564244; 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=HB8Dw00DZJ09mEmQijXfQQXA6sfh5AwCygh3j6F8AMc=; b=lSzUBF6FWUxiw1oYdULIQmYbEwENFVJmgp4JHBGx1zI7B5KvQ4m1+HYCR3R505SGO+ Slnm+NLgpdt03o6b0L5LjdOksh6iuX/NfrVTmTR1r3wSyzLm1ZvZhs8JTUP/R0HGnXbt +dId+PmCsdS9AeXUfXfuzB7uBR58pYzFlr4jLqg6SD6WkBW0X7fzWbq6Ap51X5SrY7f8 26Rfid8Vp4WklhfLbP86W/a8mULDm3JgxVAUpRVulNg8v5IMCFqe9SbxU29Q2s2n5LbS BJ3qf3Q9gDvbLHRTwsNp/N0vzDrst27eU4f2XDPFe7aEPvC8jqnd3eLXFIifyDzPf3/W 8l9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690959444; x=1691564244; 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=HB8Dw00DZJ09mEmQijXfQQXA6sfh5AwCygh3j6F8AMc=; b=OXZTpfjMh9/dKIsSiPvQoulb5v/660xzZoihNS5ubCkH9ZSW9MyW+7H2QnA/+5cOB9 FK7WYdNmDG+5KTO4iaXLenKB+f8YVBbjOXyRDHRI2y4qkLg+D0h2Ji6qaG2Nr4j6dhSd 0UobnkuNt/MNmhTysBYnwA2HbKSS6FRxfe/Y9lUNviWtTY59IcBJqzUJrvL1b+9YLNnr aDHJo51u7pKj7BBIdrtdMYtbFMVdUfnen2wrHUAbJfwm6zGlUxOmeHGqyCFaqK/jc3d6 PMxXDHEOXkcZYXanymrP7bWTVXHoDhTVPWbIWa9GXivGGQZgkQF8ccO1bIvX5L4puTXg mC/w== X-Gm-Message-State: ABy/qLaysb1HYOEzYZrn/PzRxGrUxU8JXnKBfCwI2bSz9MoIk24ssa4I 4Irdlts3wR7mvTB/mA03AQPQsQ== X-Google-Smtp-Source: APBJJlGatQfPGX1zCA4O2oVLRP7VUG8QpcwUx9/zHINaPrjjZYEd6cJWoVD2Oc2hkHgdGZY7lcZQvQ== X-Received: by 2002:a17:906:3198:b0:98e:1156:1a35 with SMTP id 24-20020a170906319800b0098e11561a35mr3703590ejy.74.1690959444201; Tue, 01 Aug 2023 23:57:24 -0700 (PDT) Received: from localhost ([212.23.236.67]) by smtp.gmail.com with ESMTPSA id mb5-20020a170906eb0500b00997cce73cc7sm8598409ejb.29.2023.08.01.23.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 23:57:23 -0700 (PDT) Date: Wed, 2 Aug 2023 08:57:22 +0200 From: Jiri Pirko To: "Kubalewski, Arkadiusz" Cc: Vadim Fedorenko , Jakub Kicinski , Jonathan Lemon , Paolo Abeni , "Olech, Milena" , "Michalik, Michal" , "linux-arm-kernel@lists.infradead.org" , poros , mschmidt , "netdev@vger.kernel.org" , "linux-clk@vger.kernel.org" , Bart Van Assche Subject: Re: [PATCH 09/11] ice: implement dpll interface to control cgu Message-ID: References: <20230720091903.297066-1-vadim.fedorenko@linux.dev> <20230720091903.297066-10-vadim.fedorenko@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-20230801_235728_088705_910CCF43 X-CRM114-Status: GOOD ( 19.59 ) 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 Tue, Aug 01, 2023 at 04:50:44PM CEST, arkadiusz.kubalewski@intel.com wrote: >>From: Jiri Pirko >>Sent: Monday, July 31, 2023 2:20 PM >> >>Sat, Jul 29, 2023 at 01:03:59AM CEST, arkadiusz.kubalewski@intel.com wrote: >>>>From: Jiri Pirko >>>>Sent: Friday, July 21, 2023 1:39 PM >>>> >>>>Thu, Jul 20, 2023 at 11:19:01AM CEST, vadim.fedorenko@linux.dev wrote: >>>>>From: Arkadiusz Kubalewski >>> >> >>[...] >> >> >>>>>+static int ice_dpll_cb_lock(struct ice_pf *pf, struct netlink_ext_ack >>>>>*extack) >>>>>+{ >>>>>+ int i; >>>>>+ >>>>>+ for (i = 0; i < ICE_DPLL_LOCK_TRIES; i++) { >>>>>+ if (!test_bit(ICE_FLAG_DPLL, pf->flags)) { >>>> >>>>And again, as I already told you, this flag checking is totally >>>>pointless. See below my comment to ice_dpll_init()/ice_dpll_deinit(). >>>> >>> >>>This is not pointless, will explain below. >>> >>>> >>>> >>> >>>[...] >>> >> >>[...] >> >> >>>>>+void ice_dpll_deinit(struct ice_pf *pf) >>>>>+{ >>>>>+ bool cgu = ice_is_feature_supported(pf, ICE_F_CGU); >>>>>+ >>>>>+ if (!test_bit(ICE_FLAG_DPLL, pf->flags)) >>>>>+ return; >>>>>+ clear_bit(ICE_FLAG_DPLL, pf->flags); >>>>>+ >>>>>+ ice_dpll_deinit_pins(pf, cgu); >>>>>+ ice_dpll_deinit_dpll(pf, &pf->dplls.pps, cgu); >>>>>+ ice_dpll_deinit_dpll(pf, &pf->dplls.eec, cgu); >>>>>+ ice_dpll_deinit_info(pf); >>>>>+ if (cgu) >>>>>+ ice_dpll_deinit_worker(pf); >>>> >>>>Could you please order the ice_dpll_deinit() to be symmetrical to >>>>ice_dpll_init()? Then, you can drop ICE_FLAG_DPLL flag entirely, as the >>>>ice_dpll_periodic_work() function is the only reason why you need it >>>>currently. >>>> >>> >>>Not true. >>>The feature flag is common approach in ice. If the feature was successfully >> >>The fact that something is common does not necessarily mean it is >>correct. 0 value argument. >> > >Like using functions that unwrap netlink attributes as unsigned when >they are in fact enums with possibility of being signed? Looks this is bothering you, sorry about that. > >This is about consistent approach in ice driver. > >> >>>initialized the flag is set. It allows to determine if deinit of the feature >>>is required on driver unload. >>> >>>Right now the check for the flag is not only in kworker but also in each >>>callback, if the flag were cleared the data shall be not accessed by >>>callbacks. >> >>Could you please draw me a scenario when this could actually happen? >>It is just a matter of ordering. Unregister dpll device/pins before you >>cleanup the related resources and you don't need this ridiculous flag. >> > >Flag allows to determine if dpll was successfully initialized and do proper >deinit on rmmod only if it was initialized. That's all. You are not answering my question. I asked about how the flag helps is you do unregister dpll devices/pins and you free related resources in the correct order. Because that is why you claim you need this flag. I'm tired of this. Keep your driver tangled for all I care, I'm trying to help you, obviously you are not interested. > >> >>>I know this is not required, but it helps on loading and unloading the >>>driver, >>>thanks to that, spam of pin-get dump is not slowing the driver >>>load/unload. >> >>? Could you plese draw me a scenario how such thing may actually happen? > >First of all I said it is not required. > >I already draw you this with above sentence. >You need spam pin-get asynchronously and unload driver, what is not clear? >Basically mutex in dpll is a bottleneck, with multiple requests waiting for >mutex there is low change of driver getting mutex when doing unregisters. How exactly your flag helps you in this scenario? It does not. > >We actually need to redesign the mutex in dpll core/netlink, but I guess after >initial submission. Why? > >Thank you! >Arkadiusz > >> >>Thanks! >> >> >>> >>>> >>>>>+ mutex_destroy(&pf->dplls.lock); >>>>>+} >> >> >>[...] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel