Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6282121rwn; Tue, 13 Sep 2022 01:37:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR79IQxqTUe5CM+C9Z7nxWKGXB+gQk0+qZV4fFcSp6iTtL7h6f8SwxgpVdhRIr/zZdrhefGN X-Received: by 2002:a17:906:ef90:b0:77c:7227:705 with SMTP id ze16-20020a170906ef9000b0077c72270705mr7589458ejb.565.1663058222959; Tue, 13 Sep 2022 01:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663058222; cv=none; d=google.com; s=arc-20160816; b=BapGJTzFDZWetvOFnyFa+a5NmKA2HEN1K4f9n4VHRiovV297weCSZEnC+R1dsYbd5O Rw+PVb/rKFDkbWSqGXB8DaSIDTsKwq6r4TRKitHv7nUGB8fYilUaof7+d7BAzQwvC5tn 4ccaAQ24yfHraUIzFPHudwr1D55tgtjjKAlWzN4ha8Fb7a7qMXrZ2USDa9l8vum5b/u+ Or5n3jaoP1SERIqnhtVUvpWcsnV581al+ka6BH1wrCpRlNbMAA6B6sfVvbC6cRyEuv82 +puMr6M1Bulv1+uOT2HJGh4hPwFvDAc/mHxq7MJUJRK0v2Neiu749LKh+5MrKcRri0qZ wp1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7R46dL5v/qAAceuZ423ZSM42+lTG5q+jzS8a0ZHd/yA=; b=ymKvba7YOD49bHvFgFvv3XKcS2yMxSxRFGNevotLiNrb1YjbaDIZdF3vVOaGDwzow0 kZ20Go56dPyntrEvhzlQKN5NUIXO5LGOQ9MLWoXOTHQUWMUFSCKPAAHPBAHwxha7khpY ycsM5sA9aqhP2uVU4Zz/SjVn2tOFLt2Y/SvnVJgzJjym4b8o2QwFzsuSzLOxYJZg01Zl OJVE9DwztBC6LDGHQl32eKRiRkktaKj7W9JvyHnSLLDsIjmnG5tCdt6JMGXzwm7N/Qaj nTPmv0eRheyZi3DRsO0YVeGci0c1YfLktZRoVnsTs8Yz/R/V2I2JgD5J90oNBWGVRr4T yqEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=G4HJswNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xf1-20020a17090731c100b00741a17b9d20si9532772ejb.536.2022.09.13.01.36.36; Tue, 13 Sep 2022 01:37:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=G4HJswNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231161AbiIMHqU (ORCPT + 99 others); Tue, 13 Sep 2022 03:46:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230342AbiIMHqR (ORCPT ); Tue, 13 Sep 2022 03:46:17 -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 ECAD82B279; Tue, 13 Sep 2022 00:46:16 -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=7R46dL5v/qAAceuZ423ZSM42+lTG5q+jzS8a0ZHd/yA=; b=G4HJswNfkvqvbqgOKeKi5WXj8O JuEpK1sh7BVrm90ZMiDMwiCB3P2tVsIpxr0G2uo2fEOIkWmF+gBR61FBIk9kMY/nhTgANroSLAZsK vwmMWfq1z1Wvd3Q//G3gSYr0U6Cm7ri+g/6VvKjJZCK8fI9g4+KSMZaet8hsr9/e7omVcehR5HIIk OmUBpkhdCurtJjVThQDsEWjdLMnU9GZGEq7OyHdvC/8epR6czzdq5OAvYuMjD0TCJ81jIjEEOGMz+ YR4zt9V9DqxzeNwaIRLgIM/Iz6PObghcRWAxaXUqPYFBjGdNgZKgmQnLpuK8NexrTkw4AjL8whuZu HnN+b4mw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34286) 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 1oY0cS-0002aM-4j; Tue, 13 Sep 2022 08:46:08 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oY0cQ-0000Vo-RI; Tue, 13 Sep 2022 08:46:06 +0100 Date: Tue, 13 Sep 2022 08:46:06 +0100 From: "Russell King (Oracle)" To: Lucas Stach Cc: Tang Bin , hongxing.zhu@nxp.com, 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> <0660fff6d29c5f8251ac4f28d4badcfea91e6833.camel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0660fff6d29c5f8251ac4f28d4badcfea91e6833.camel@pengutronix.de> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Tue, Sep 13, 2022 at 09:39:03AM +0200, Lucas Stach wrote: > Am Dienstag, dem 13.09.2022 um 14:59 +0800 schrieb Tang Bin: > > 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. > > > I don't like this added complexity in the driver. IHMO if there is a > real issue, dev_pm_domain_attach_by_name() should just return a error > code, instead of NULL. You've fallen into the trap that Tang Bin laid. It returns an error code for all cases where an error has happened. It returns NULL only when the device does not require a power domain. So, a NULL return is *not* an error condition, but merely an indication that "this device does not require this power domain". Mechanical changes like this are really quite harmful to the kernel. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!