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 9DCA0C001DC for ; Mon, 31 Jul 2023 12:20:24 +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=DaudC/3aZ+tkzuyE/bNOIYOZWqYEbfZS8VTHZsov7PE=; b=MCSzmByRaAWi4i w8+UZVIHZiIzOEAIMwCehosH0X2ppCwIg+yHVSVZQnObiSuL8DqzsLYqdC6oM1XRHLq5U2XJQU4kW 4WUeKbQTGfJn2+BXJ65y6l/mz8d2VlXcI9n9CNAjSZla/JLeynLRqs8u44CPX0wSfi10SkZ4F9jtb RG8YLbPu72+VbG5tppwFhenPZUL+6O1ECAzOUzZnljrGn1gke/7wLmxh5oZaC6xx32+LF2yKvSJjr WkMxZlHTxbml6DdAF/lyYCCy4ybAEIvOx39YQ9O9h8GTWbh3IEd1KVs1vhQSx3nEvWHyE+YFDdwhg soz9jfXIyONwLm4TW7aA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQRsV-00FY4H-0A; Mon, 31 Jul 2023 12:19:59 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQRsK-00FY1p-2T for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 12:19:50 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fc0aecf15bso49742095e9.1 for ; Mon, 31 Jul 2023 05:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20221208.gappssmtp.com; s=20221208; t=1690805985; x=1691410785; 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=XM+dBkL9BOQB5M0QkPLLYoaZfMRgmlrJZ/IVtD0ioO0=; b=K/ixDBtHAoED1QTZkzrM0HP35wmxU5en+ia0zc1sDJnLq2BhUN1mjgwFGR3x0mhUTm H3OGTNuakXfxocEdqK1GhB3S8ynucvmwby3nWGTgvzmW49oBhpMPPdFAcSMbboxIRnU4 qKduZksCoD63Qc6ufiHOWoJc41ELb6Vq9XiC1ggxpI9Ch37s/vd9s1KhlnqneJ39yKbE xvoRMFv7kumu57kjrYbkZp1tjuXo2Te+/Kf/dZlJ8g7PjBW+cB0Rj0SCLXWinfJmVqSV OQMt2XyprtX9qNGZQKMuoaR7LapJai9uasZrHpbx8KCHwCsJpCf1oB9++nilbbY57J6n FIlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690805985; x=1691410785; 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=XM+dBkL9BOQB5M0QkPLLYoaZfMRgmlrJZ/IVtD0ioO0=; b=eVPIT19Vn2kLlurkdU2shJ1IQfQd/L5+OvsqZHH02pTY5i7n/fDwEsgbDswjrj2e6G Lx1kYVSMAfKUETAdomS/mT4/PEY/jZyuusFfe86TNvsSLPy3zzAnmUs6Y6vq7nxhbaZJ YqQquvtnd89VZTLKTrF35zw2Tz8NmRDk3yss8cw5R452Gh3broYzMtQWbdyUu+TZwASj FQVyIi5gQh127do43XSKpK0uyMvh7jw9D3NjXYzvvoWJVftB05PKSlM9Ac+azsygXQrH iUB+F33M45bs0rxgQHRJgRm9MKuijfIfcpg5f4e754W7H35iC87/re757f2JzRmVvzKw LmPg== X-Gm-Message-State: ABy/qLbmV/rsX3bh3inyQZFuUyn274pfbVgwBqtO8l4pme+nnxzkHyPo Keu1MQHwjlg+J8P/LM/2ZTyJwQ== X-Google-Smtp-Source: APBJJlEctlAU59sp6IeHDQnotTpHuuRt9EWdIcJSmwMi77Aq/AtVjK71uRjSDGZv/d1bBLLm+M5qIw== X-Received: by 2002:a7b:ca53:0:b0:3fb:415a:d07 with SMTP id m19-20020a7bca53000000b003fb415a0d07mr7933564wml.36.1690805984930; Mon, 31 Jul 2023 05:19:44 -0700 (PDT) Received: from localhost ([212.23.236.67]) by smtp.gmail.com with ESMTPSA id x13-20020a05600c21cd00b003fe21c7386esm2247355wmj.45.2023.07.31.05.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 05:19:44 -0700 (PDT) Date: Mon, 31 Jul 2023 14:19:43 +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-20230731_051948_806284_65655163 X-CRM114-Status: GOOD ( 14.42 ) 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 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. >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. >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? 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