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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37585C6FA82 for ; Tue, 13 Sep 2022 07:36:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230245AbiIMHgR (ORCPT ); Tue, 13 Sep 2022 03:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiIMHgN (ORCPT ); Tue, 13 Sep 2022 03:36:13 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 623EF57E25; Tue, 13 Sep 2022 00:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=oRpmSruXXDfHHV5+EC0Xg5Uv67nyeQ6QmShePHfU9+0=; b=IF4akWGVqP4IVED+nVq/W/GkTw m+f7J/3Z23ZFI1haNEvCDTQRepUmS7JDXVbdKrxkBsQ+IaewIYHz+VTa/Uva9J+PDaL3ZMt7v58g1 MwruXci7fOuKOOgiRU1uAFTaY6CoS4VrJU3FgQPrBEwzwtW72MJRVQkkhtuhXgApWb/+mB3//HazK ZcTDJ3+GjRN7K7rLO+/QyhpJ8qtQsPOUTxlI21UtqwGjxlQk7OofmoPVg1ZOBCDd4APbMyp6GbBc2 0NHqojWwFTK+HZ9rfPus8ecj4WLFvj+j46ExUv542VGFBEjIYCb01HaHFZUifreDl+HeBNbPoADMc 6T36UCww==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34280) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oY0Si-0002Yj-0Q; Tue, 13 Sep 2022 08:36:04 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oY0Sg-0000UY-BY; Tue, 13 Sep 2022 08:36:02 +0100 Date: Tue, 13 Sep 2022 08:36:02 +0100 From: "Russell King (Oracle)" To: Tang Bin Cc: hongxing.zhu@nxp.com, l.stach@pengutronix.de, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, shawnguo@kernel.org, bhelgaas@google.com, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: imx6: Fix wrong check in imx6_pcie_attach_pd() Message-ID: References: <20220913065910.15348-1-tangbin@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Tue, Sep 13, 2022 at 08:31:35AM +0100, Russell King (Oracle) wrote: > On Tue, Sep 13, 2022 at 02:59:10PM +0800, Tang Bin wrote: > > In the function imx6_pcie_attach_pd(), > > dev_pm_domain_attach_by_name() may return NULL in some cases, > > so IS_ERR() doesn't meet the requirements. Thus fix it. > > NAK. You are clearly doing a mechanical search and replace, and then > throwing out patches without a care in the world for other people to > then decide whether the changes are in fact appropriate or not. > > Please don't do that. Please read and understand the code before you > waste reviewers and developers time - otherwise you will educate > reviews and developers to ignore your efforts. It is also highly likely that many of these changes are just plain broken. If you read the documentation for this function and the referred to function: * Returns the created virtual device if successfully attached PM domain, NULL * when the device don't need a PM domain, else an ERR_PTR() in case of * failures. If a power-domain exists for the device, but cannot be found or * turned on, then ERR_PTR(-EPROBE_DEFER) is returned to ensure that the device * is not probed and to re-try again later. So, NULL is *not* an error condition. It means that the device does not need a power domain, which is *not* a failure. You are probably causing more harm than good by trying to do this mechanical change all over the kernel. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! 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 A22DBC6FA82 for ; Tue, 13 Sep 2022 07:37:46 +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=gqe0jXineRQykjALfiJ8hqv5bXjQlevYARpLw9eK8ig=; b=upfZDpu/V+IdO8 FhwX79jb3OFB/N87w1ssuZHxFjCluu+ebA7m5xSgvVrjSnRP5Y84WKqRdRh8W32JH31IYar+fmRoQ zltRKU7Kz8XOzUXLWLzeFb6rwDtqFBmqJioGzWWOIoHP2CmKDx+EzVumbiPZe2stmKvTuvWiAJJiq rfal4MViV+1SoLgZ2/NIlKAjYn8ULJT2GpPGLaIvn0Sg5gOhUjD6HmI6vwJJel7OwKr+siiLNIFKn y9bJpdpHmvrtZmFP7a4ONYUS2r4f5Vv4+zvadJVs6x+vj7ccFd2MadxF7fn3Oo+6MOSfWbEUcJ73g MVSZEDkSkAa5NNkvqR+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY0T4-003dbm-FG; Tue, 13 Sep 2022 07:36:36 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY0Sq-003dSl-Hg for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 07:36:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=oRpmSruXXDfHHV5+EC0Xg5Uv67nyeQ6QmShePHfU9+0=; b=IF4akWGVqP4IVED+nVq/W/GkTw m+f7J/3Z23ZFI1haNEvCDTQRepUmS7JDXVbdKrxkBsQ+IaewIYHz+VTa/Uva9J+PDaL3ZMt7v58g1 MwruXci7fOuKOOgiRU1uAFTaY6CoS4VrJU3FgQPrBEwzwtW72MJRVQkkhtuhXgApWb/+mB3//HazK ZcTDJ3+GjRN7K7rLO+/QyhpJ8qtQsPOUTxlI21UtqwGjxlQk7OofmoPVg1ZOBCDd4APbMyp6GbBc2 0NHqojWwFTK+HZ9rfPus8ecj4WLFvj+j46ExUv542VGFBEjIYCb01HaHFZUifreDl+HeBNbPoADMc 6T36UCww==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34280) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oY0Si-0002Yj-0Q; Tue, 13 Sep 2022 08:36:04 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oY0Sg-0000UY-BY; Tue, 13 Sep 2022 08:36:02 +0100 Date: Tue, 13 Sep 2022 08:36:02 +0100 From: "Russell King (Oracle)" To: Tang Bin Cc: hongxing.zhu@nxp.com, l.stach@pengutronix.de, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, shawnguo@kernel.org, bhelgaas@google.com, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: imx6: Fix wrong check in imx6_pcie_attach_pd() Message-ID: References: <20220913065910.15348-1-tangbin@cmss.chinamobile.com> 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-20220913_003612_618522_AA7F0685 X-CRM114-Status: GOOD ( 16.45 ) 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 On Tue, Sep 13, 2022 at 08:31:35AM +0100, Russell King (Oracle) wrote: > On Tue, Sep 13, 2022 at 02:59:10PM +0800, Tang Bin wrote: > > In the function imx6_pcie_attach_pd(), > > dev_pm_domain_attach_by_name() may return NULL in some cases, > > so IS_ERR() doesn't meet the requirements. Thus fix it. > > NAK. You are clearly doing a mechanical search and replace, and then > throwing out patches without a care in the world for other people to > then decide whether the changes are in fact appropriate or not. > > Please don't do that. Please read and understand the code before you > waste reviewers and developers time - otherwise you will educate > reviews and developers to ignore your efforts. It is also highly likely that many of these changes are just plain broken. If you read the documentation for this function and the referred to function: * Returns the created virtual device if successfully attached PM domain, NULL * when the device don't need a PM domain, else an ERR_PTR() in case of * failures. If a power-domain exists for the device, but cannot be found or * turned on, then ERR_PTR(-EPROBE_DEFER) is returned to ensure that the device * is not probed and to re-try again later. So, NULL is *not* an error condition. It means that the device does not need a power domain, which is *not* a failure. You are probably causing more harm than good by trying to do this mechanical change all over the kernel. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel