From patchwork Mon Mar 16 07:49:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 222465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5610DC0044D for ; Mon, 16 Mar 2020 07:49:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D1A720658 for ; Mon, 16 Mar 2020 07:49:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="cOeLwTWz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729999AbgCPHtQ (ORCPT ); Mon, 16 Mar 2020 03:49:16 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:39902 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729973AbgCPHtQ (ORCPT ); Mon, 16 Mar 2020 03:49:16 -0400 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 8E883891AD; Mon, 16 Mar 2020 20:49:14 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1584344954; bh=344D7td7yNvnB50ZDS+yKPulTKNSqIhTM+BaA7i6798=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cOeLwTWzpRaajwv1Rl+IKPUA5rLVOaJyIaPq1pSRtyrcC6vQzQZIa1IcrXDk8Cs53 TpchUikp5GpF+rm4QMeqG8Mje0fUfESC3PZFloDJaOHzDJNBjx8/1jkul0IrhJ5Ard 1Iqah+7xA0QSho/wdgxVzC153GVon3lOWl8wdgk+ZFeUFHzOzTT4BtBResvTY3ADi7 Jian13FqAmOnXpsulR9UHZ4Cy1rYkCZtaRyD58tPHMwk2sxcsKdFzo99G0EgTdoa8Z e2uPZcd4REd7rJKJ3U/X7skhQETMYNaVsuevRsC8DqhxEevjdN+hk+M4wVxy2iYanS xK7CSYoEQ2AQg== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 8, 10121) id ; Mon, 16 Mar 2020 20:49:14 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.20]) by smtp (Postfix) with ESMTP id 0C69513EF9B; Mon, 16 Mar 2020 20:49:09 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 60CA828006E; Mon, 16 Mar 2020 20:49:09 +1300 (NZDT) From: Chris Packham To: davem@davemloft.net, andrew@lunn.ch, josua@solid-run.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Packham Subject: [PATCH v3 1/2] Revert "net: mvmdio: avoid error message for optional IRQ" Date: Mon, 16 Mar 2020 20:49:06 +1300 Message-Id: <20200316074907.21879-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200316074907.21879-1-chris.packham@alliedtelesis.co.nz> References: <20200316074907.21879-1-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 x-atlnz-ls: pat Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This reverts commit e1f550dc44a4d535da4e25ada1b0eaf8f3417929. platform_get_irq_optional() will still return -ENXIO when no interrupt is provided so the additional error handling caused the driver prone to fail when no interrupt was specified. Revert the change so we can apply the correct minimal fix. Signed-off-by: Chris Packham --- drivers/net/ethernet/marvell/mvmdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c index d2e2dc538428..0b9e851f3da4 100644 --- a/drivers/net/ethernet/marvell/mvmdio.c +++ b/drivers/net/ethernet/marvell/mvmdio.c @@ -347,7 +347,7 @@ static int orion_mdio_probe(struct platform_device *pdev) } - dev->err_interrupt = platform_get_irq_optional(pdev, 0); + dev->err_interrupt = platform_get_irq(pdev, 0); if (dev->err_interrupt > 0 && resource_size(r) < MVMDIO_ERR_INT_MASK + 4) { dev_err(&pdev->dev, @@ -364,8 +364,8 @@ static int orion_mdio_probe(struct platform_device *pdev) writel(MVMDIO_ERR_INT_SMI_DONE, dev->regs + MVMDIO_ERR_INT_MASK); - } else if (dev->err_interrupt < 0) { - ret = dev->err_interrupt; + } else if (dev->err_interrupt == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; goto out_mdio; } From patchwork Mon Mar 16 07:49:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 222466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB55CC3F2D3 for ; Mon, 16 Mar 2020 07:49:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D3D92073D for ; Mon, 16 Mar 2020 07:49:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="HycmfWNg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730052AbgCPHtR (ORCPT ); Mon, 16 Mar 2020 03:49:17 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:39905 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729962AbgCPHtR (ORCPT ); Mon, 16 Mar 2020 03:49:17 -0400 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id AA242891AE; Mon, 16 Mar 2020 20:49:14 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1584344954; bh=lueV+3/ieVHX0j1GQCzwiOIpCw7+gr2T4FpZqjS6B2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HycmfWNg2/Q+8Ek/8KDldYNUcMAEcs8cBuxd/YQ9WlGn1QxlvkwR3cPnh+lyQxL3L c8UVa2+9Ko+TlhayaFRsmZRlGEK4JIv+TZ61+aKGM8z4KfmBHlye6Ehd95Cc29I7RX ZIvhXC04W7jbSoThi4eTR2TnvcklVTGiRsnyPmlsmSJCzitng0byif77U+N32h9GW4 U2VEzeex9xdjQWEF4sLrgwqhpW6uRRK9vTLIUhJ6cPSEpc1x/OWZ6up0oeJT8OR50I hHTm3LfNmGdd9SWc8Pf5dnDZdfZhPf8pNlLfVsdoER+s+2AYGnnv5MRmf4IyW3mAq7 IN9AOWFWmShrA== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 8, 10121) id ; Mon, 16 Mar 2020 20:49:14 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.20]) by smtp (Postfix) with ESMTP id 2D02813EF9C; Mon, 16 Mar 2020 20:49:09 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 813F428006E; Mon, 16 Mar 2020 20:49:09 +1300 (NZDT) From: Chris Packham To: davem@davemloft.net, andrew@lunn.ch, josua@solid-run.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Packham Subject: [PATCH v3 2/2] net: mvmdio: avoid error message for optional IRQ Date: Mon, 16 Mar 2020 20:49:07 +1300 Message-Id: <20200316074907.21879-3-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200316074907.21879-1-chris.packham@alliedtelesis.co.nz> References: <20200316074907.21879-1-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 x-atlnz-ls: pat Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Per the dt-binding the interrupt is optional so use platform_get_irq_optional() instead of platform_get_irq(). Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()") platform_get_irq() produces an error message orion-mdio f1072004.mdio: IRQ index 0 not found which is perfectly normal if one hasn't specified the optional property in the device tree. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn --- Notes: Changes in v3: - return to minimal fix Changes in v2: - Add review from Andrew - Clean up error handling case drivers/net/ethernet/marvell/mvmdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c index 0b9e851f3da4..d14762d93640 100644 --- a/drivers/net/ethernet/marvell/mvmdio.c +++ b/drivers/net/ethernet/marvell/mvmdio.c @@ -347,7 +347,7 @@ static int orion_mdio_probe(struct platform_device *pdev) } - dev->err_interrupt = platform_get_irq(pdev, 0); + dev->err_interrupt = platform_get_irq_optional(pdev, 0); if (dev->err_interrupt > 0 && resource_size(r) < MVMDIO_ERR_INT_MASK + 4) { dev_err(&pdev->dev,