From patchwork Wed Jul 31 12:15:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 11067637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F20A2174A for ; Wed, 31 Jul 2019 12:16:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E02402885F for ; Wed, 31 Jul 2019 12:16:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D461D288EE; Wed, 31 Jul 2019 12:16:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7FD6D288CB for ; Wed, 31 Jul 2019 12:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UaDydHxzJlioXoHfPwi0NU1rcZGKF203A9aIkxahQBE=; b=bOWghQJr2iQqBD hy0AeyNSFpUe+8cGAY9D8FuE2h+o/O9apI0v+5LlWSDe8Mm4FHfRJvB21gBnA/V/1pD64jYA6TFWi PFh+0O/iswvzfC85cbXXOJUzsSnDp8oDI5HLUy29qFBKdW53pzi03QjFrfioQeWLpQWDFUPEU+jFD yf5/pEJMDguWqWDc2OuH4CtA48iuOcqe8ar/vF/EHbSIY1xsJrbRvgRM0MsnAGECqMoH3GYBSn6S3 LQvl4gfyMpGDlDI5mPvmZ483UzMgc9a0Qz+9ui+Kbjclt67WGRbpv8qIeal+aEiqVQM1fT/wus0aA k3KGLsMZ6ChXOvA5gsUw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hsnWX-0000Mn-09; Wed, 31 Jul 2019 12:16:05 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hsnWW-0000Le-0d for linux-arm-kernel@bombadil.infradead.org; Wed, 31 Jul 2019 12:16:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=bOj6/DfFImfkret2/p2N546djxopb65m94ZiKrbECUw=; b=JQ7tyFbpNJ9HWGAoD7bXubs0zW E2E8zJaP7VpMvnYBSvLTkV1YMROKoAOuRoM7HSWpQZHSz5IAjPLRug23dH7X4CY1bKUcMUe3bBcqp ljP8mVsX53PW6IX9qoybyLB1Mtgyoqd1aVQJM2x+UmhVSp1LeIRFnLpfeyAt+P75TR+brUWA4rST2 OyuphLXBoDE3G2cp8pkL/hVYSfmOD8Mcwl4+vF5kw6kko6Va0lKTGVSrgWL62t2uIL8vMouwrI+Cq dhUMlMdT+Tf5NdbhDbah9f3cUEojfoYW7eDf2222qsxWDhQlsg/F9jpX47H2qGfPmQAEqiVUeGePk L75EW/KQ==; Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by merlin.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hsnWS-0001ps-5S for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2019 12:16:02 +0000 X-Originating-IP: 86.250.200.211 Received: from localhost.localdomain (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: miquel.raynal@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 7C467E0007; Wed, 31 Jul 2019 12:15:15 +0000 (UTC) From: Miquel Raynal To: Kishon Vijay Abraham I Subject: [RESEND PATCH] phy: mvebu-a3700-comphy: Inform users if their firmware is too old Date: Wed, 31 Jul 2019 14:15:13 +0200 Message-Id: <20190731121513.2495-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antoine Tenart , Gregory Clement , Maxime Chevallier , Nadav Haklai , Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP PHY configuration has been implemented in the firmware and accessed through SMC calls. In the past, it worked magically if the bootloader was correctly doing the initializations. With up-to-date bindings, the kernel will need a recent firmware in order to do the initializations himself (we assume people must update their firmware along with their kernel). People might not understand why IPs that were working correctly before stopped to be probed suddendly. In this case, let's advise the users to update their firmware with a visual warning. Signed-off-by: Miquel Raynal --- Hello, I think this patch got lost, just resending it after -rc1. Cheers, Miquèl drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c index 8812a104c233..b09bf64d53b7 100644 --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c @@ -26,6 +26,7 @@ #define COMPHY_SIP_POWER_ON 0x82000001 #define COMPHY_SIP_POWER_OFF 0x82000002 #define COMPHY_SIP_PLL_LOCK 0x82000003 +#define COMPHY_FW_NOT_SUPPORTED (-1) #define COMPHY_FW_MODE_SATA 0x1 #define COMPHY_FW_MODE_SGMII 0x2 @@ -169,6 +170,7 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy) struct mvebu_a3700_comphy_lane *lane = phy_get_drvdata(phy); u32 fw_param; int fw_mode; + int ret; fw_mode = mvebu_a3700_comphy_get_fw_mode(lane->id, lane->port, lane->mode, lane->submode); @@ -217,7 +219,12 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy) return -ENOTSUPP; } - return mvebu_a3700_comphy_smc(COMPHY_SIP_POWER_ON, lane->id, fw_param); + ret = mvebu_a3700_comphy_smc(COMPHY_SIP_POWER_ON, lane->id, fw_param); + if (ret == COMPHY_FW_NOT_SUPPORTED) + dev_err(lane->dev, + "unsupported SMC call, try updating your firmware\n"); + + return ret; } static int mvebu_a3700_comphy_power_off(struct phy *phy)