X-Received: by 2002:a17:90b:350e:b0:1b9:5875:a683 with SMTP id ls14-20020a17090b350e00b001b95875a683mr2294585pjb.51.1645505281603; Mon, 21 Feb 2022 20:48:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645505281; cv=none; d=google.com; s=arc-20160816; b=Vi2tw/thZiFNWhEmPHFUqgHHHqu1l9tCWpwEqNFpqaCLXKZ+CoTtuYg+yRe9SskBeG RWArBnhDDplTG/5h6H5lASBYF+2TNHQqETSz4bfW8cZQvzRVk2kHhaT/n/0zbwnMSZpK dZlT385e6HhqJeR0L1b3jaCGMIUDS/2B3/Am7flmu8pwpCisi5M8flZuMp/t1Bhhvy4J bW1FIkokt7ciBee/Mr81v+glldujXc0wmUTvDHzaA5ndkwuY6ecOQqpPupExqcg8QSiF 84DbXXN5Y3/NFFsAuwWHg/tk6vcV+EjvlI+Q0wuRIbxfZPOOhH6GUjFNR5WkSBNmugOa xs2g== 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=LrbmvfwNGIwgy+UB4l1bSvxrHSaZTcqFnYluIe0366g=; b=oTSHtgR9OGFL+asHn7VeayEvDm30gB7zsw9Gp/bZZAq3td72jgrF7QeQiHRhz1f5+t jteUKXnpIqwL1tBwQ7Krm7Erw4w4p3mi8lFW2LkYgbLmae0ks7srpglcQEa7as/52XSs iH3+PtEnN/i4lbFE9Ozfxc49KMhLhJgOAk3NZWyMjjG0Y/SR2KsOW6f/AG94Zs8qhs8F fLeM1UGSziF66HnRrpH+NQE1hCQ7CH7rDcHIk8Y6tGinKKGO9CnocC9QdNHEMFOhkeRO y4kfjLOsYkZnGy1dLJMkNJ5x67Av2Cj+6kr2wF54jxQHOqaAEbbFfwEWruhoWIN5mdCj TYpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=RVfbGwXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y24si998310pju.170.2022.02.21.20.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 20:48:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=RVfbGwXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 C620F140C6; Mon, 21 Feb 2022 20:29:20 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235276AbiBUWPa (ORCPT + 99 others); Mon, 21 Feb 2022 17:15:30 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbiBUWP3 (ORCPT ); Mon, 21 Feb 2022 17:15:29 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0597DA1; Mon, 21 Feb 2022 14:15:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=LrbmvfwNGIwgy+UB4l1bSvxrHSaZTcqFnYluIe0366g=; b=RVfbGwXnvpSBpOoSQVaakQfn2I tPCRfUNRuo/MvVXjbHeDCbzD1n22PwG8WGJb7dgFie39xP/W4GR2f9rQl1TfwYonkDXqwq0QGczKE sDMOGcfExDJq7+IKQm3CQzPJrlSgKmmPQVu0Mcu4CATaj5aXA8uFYOunpLQDHohnbZX4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nMGxT-007RSF-Fw; Mon, 21 Feb 2022 23:15:03 +0100 Date: Mon, 21 Feb 2022 23:15:03 +0100 From: Andrew Lunn To: Mauri Sandberg Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Hesselbarth , "David S. Miller" , Jakub Kicinski Subject: Re: [PATCH] net: mv643xx_eth: handle EPROBE_DEFER Message-ID: References: <20220221062441.2685-1-maukka@ext.kapsi.fi> <72041ee7-a618-85d0-4687-76dae2b04bbc@ext.kapsi.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72041ee7-a618-85d0-4687-76dae2b04bbc@ext.kapsi.fi> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 > > 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(). Andrew