Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4454540pxb; Mon, 21 Feb 2022 22:07:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjkljjNjRvoOAPc502aZaYHfx6+TcwbJtAPj3z/9O8l9dficAJtPdQqhblBtFxrT4h2XCY X-Received: by 2002:a63:cf09:0:b0:372:d564:8024 with SMTP id j9-20020a63cf09000000b00372d5648024mr18783057pgg.251.1645510065036; Mon, 21 Feb 2022 22:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645510065; cv=none; d=google.com; s=arc-20160816; b=J56+YioIk5+G/BOmQ2jOCpmR779+9J90XtF0zi0nCmzh9WK+QvV7qxINzUnAkTe0bt hvqx1k9nl5nkVPsVYdPviKF02fMYPyUwfQkquGdztW/iJCfBQ/X3BIKzI47g0/zpf78v sg3bsV8FQMMIjUGnRaOapW2oduPWZ3XuB4Whkx+yIdi62mlcjbuEefa9OJr/UQYtP17O 3lIJd3osPMokDlTE0kTOrOM6BEC72xHACQHbRnZlkoBKJsEOkVPmDPm1/nOjbsstV0RI +I5bwyLir9+bTA+HXojpBbHH+QhVQ7cm4S1KhTEknB3kgernzhVFQkasGs+a/0SZoTJp a1BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:in-reply-to :from:references:cc:to:user-agent:mime-version:date:message-id :dkim-signature; bh=GmHGvFlMERYoctqrhlXNA24je+le5xDzuYUVLipVXiQ=; b=GjmxIu/ecCjCjHxXsgYNC1Ma+SNRnUk2GtptltZ7E+0dQzHHXyrxkXdLl0gzQ2yP3S NxV1ovxdatqmon5hufhvscRJVzVZPIQd3XPwr1xViKE4aQ/nUfCeFLWuR1DJ09mYz5GK Ey0vlCk1+/JQIR5mLWjAB7HpGD42tfnx3yhVzd8s19WMIl0+8rDfTSPBL6EcdDJU6A2S CfJmkeLJ08345pVG1TWqdQmusMQ6xhX25yjHpOW7b5edLg4cZtyGQfbwm3yXa3fZovUd kuAFzK2BB9inI/u/dEaqNiTQG9Y6ScnBQlMh+nw6A3EDT8ThKyvVVFYkj35TktRp4gJ0 RBiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ext.kapsi.fi header.s=20161220 header.b=HXKbeB87; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k26si19160242pgm.320.2022.02.21.22.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 22:07:45 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@ext.kapsi.fi header.s=20161220 header.b=HXKbeB87; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 20BB51031; Mon, 21 Feb 2022 21:43:06 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229883AbiBVFnT (ORCPT + 99 others); Tue, 22 Feb 2022 00:43:19 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:43182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiBVFnN (ORCPT ); Tue, 22 Feb 2022 00:43:13 -0500 Received: from mailserv1.kapsi.fi (mailserv1.kapsi.fi [IPv6:2001:67c:1be8::25:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCF4EDEAB; Mon, 21 Feb 2022 21:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ext.kapsi.fi; s=20161220; h=Subject:Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:MIME-Version:Date:Message-ID:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GmHGvFlMERYoctqrhlXNA24je+le5xDzuYUVLipVXiQ=; b=HXKbeB87PoAiP5/i0Tiq7WLqNR xhurak0NO3Du3ZAg3Xy+YxnAQyxIuV4VnW0EEkUWVdQ4nh5bkKVW9vt+TechfdA9c7aw2LRgS4xIe YlwfCssgeJ9YC+Ey2wFFVrlgz2tBOXx26+JAxgoWu9dupU8YqdNMvHtCO5XNkgjeweDIE0MEG1Mpq yg1Up+ua9gv+ZTQuK6s/YTyoar3/GBvED+x57araH6sQS6B87YmDVmKzG+i2xtwqT8I3Onr/O0AoI e6Qu+KbwyBpmJ6lBRUzd0eP9KTUPY+fo2NpMetRD3eqO7W5++2LCAtZuVvY0tcAaH0/5er5nG6s+Z sJwkzcrw==; Received: from 20e7-cd64-ca8f-bce1-aa00-87c4-07d0-2001.dyn.estpak.ee ([2001:7d0:87c4:aa00:bce1:ca8f:cd64:20e7]:62077) by mailserv1.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1nMNwW-0000BI-5o; Tue, 22 Feb 2022 07:42:32 +0200 Message-ID: <91729285-67f9-8fdb-4f97-f0e958cff8dd@ext.kapsi.fi> Date: Tue, 22 Feb 2022 07:42:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Hesselbarth , "David S. Miller" , Jakub Kicinski , maukka@ext.kapsi.fi References: <20220221062441.2685-1-maukka@ext.kapsi.fi> <72041ee7-a618-85d0-4687-76dae2b04bbc@ext.kapsi.fi> From: Mauri Sandberg In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:7d0:87c4:aa00:bce1:ca8f:cd64:20e7 X-SA-Exim-Mail-From: maukka@ext.kapsi.fi X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Subject: Re: [PATCH] net: mv643xx_eth: handle EPROBE_DEFER X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mailserv1.kapsi.fi) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.2.2022 0.15, Andrew Lunn wrote: >>> Please can you add code to remove the platform device when the probe >>> fails. >> >> I am looking at the vector 'port_platdev' that holds pointers to already >> initialised ports. There is this mv643xx_eth_shared_of_remove(), which >> probably could be utilised to remove them. Should I remove the platform >> devices only in case of probe defer or always if probe fails? > > In general, a failing probe should always undo anything it has done so > far. Sometimes you can call the release function, or its > helpers. Other times you do a goto out: and then release stuff in the > reverse order it was taken. > > It looks like platform_device_del() can take a NULL pointer, so it is > probably O.K. to call mv643xx_eth_shared_of_remove(). While I am on it, should I call of_node_put() to all port nodes as is being done to the current child node if probe fails in function mv643xx_eth_shared_of_probe() [1]? [1] https://elixir.bootlin.com/linux/v5.16/source/drivers/net/ethernet/marvell/mv643xx_eth.c#L2800 -- Mauri