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=-12.2 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 829ECC47082 for ; Tue, 8 Jun 2021 18:59:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 529156136D for ; Tue, 8 Jun 2021 18:59:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 529156136D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zJ+wtcOHChilhPVrESBZHZsao9bKvy/NswDywco8e84=; b=TZfXJacQOozlWQAz3drInp7EDi 0pdNT5vm7WCP4OZkxcKuXWe7UuYdMUinhQTZe4ounBgn67oKvxkdlZDXH1irWJQq5N/R8JINfs2/Z Cr1SOkin6ok/2zoKCvOklWuAWzaIzRZI2qPhmNnpxTwYojMn+DWXRuYJbBb1bNV8kKAqIXKCPP3cM jIJy7fVb9rIJTOL3+X8ML4AqoFMi4irgbYBsGAo4ahq2+m44SAen9PpQrIaGebmvrSgZUnrwgQUBu gxtzYVIhqwMANk5Ga/gb8paN4wkfnFZ5H/grjN0z85e/bQJP0l9zSRGIKwREA2vxA751p5f9GSnLY p3McaGMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqgvS-00A8tA-UE; Tue, 08 Jun 2021 18:58:11 +0000 Received: from mail-wm1-f51.google.com ([209.85.128.51]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqgvO-00A8sH-M6 for linux-arm-kernel@lists.infradead.org; Tue, 08 Jun 2021 18:58:08 +0000 Received: by mail-wm1-f51.google.com with SMTP id g204so2495632wmf.5 for ; Tue, 08 Jun 2021 11:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=zR+JC/2SzttVA6Wi+7iVGlwak4IerMBJeQ5vLiMBGTE=; b=aCAfFsjvN26ao1o5VbYA1hb4S5BPr3VSPmBYi+tPbj+6rNMp+HtfA3naWv3DEkYR8u gcoTAeKJl3oWKupFwMct7p1SNfqDPlIHjPdaMbsgh4cBZ9qQozuUoGWeBnhbiyA6+lm9 2IboWynabOYoqfxcioZtSNb/o6WuSDo2pRGgfpGXBiQBgZlb/2WINKFNdFFQrhfIvyvN SVmX8d/BtmV2n30TpS1q9Ak27Lu9/KTYFz9+HDw1wYADWLUkkIvHQ8UTpe2eM0uS+ABP AicSK+tPE0hIc5tyaE6g8uBV0vwT5dj3ML0LRh27ZHXjW6StvDCa2Tqi1Ngl2w8jkiqd 8pSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=zR+JC/2SzttVA6Wi+7iVGlwak4IerMBJeQ5vLiMBGTE=; b=c2X8umjwkmLEMT9Ovszsgr7RY34p3gYY89/ZKUn+gAjjO3p/z+PrSpV3eiuqAgITww 7dNlOkifmCoAuIvI22vgpjJzHY+StqGcsVO+zWgArzzgJiH2rr66j2rDiPHZii97Q2vM k/Tw9xXZUeEs2WyArFslhcSGfH6/LLOBS/Y1HbJx4dQOBZtAde2i8bfb1e2ZaSp/7AUv WdYgCfRattOY2wAbw/UQuo3NDjU+r3E7lFTDengohyqAU8xM5wwQ3ruKXM5GOmfjaI9r Bpv6fdvqqB4O5NFexMKI1IIXDwWlivHSlv3QhaDhA6LHJ2W+Md1VnHYRiFPYIF5EuSUR Uu9g== X-Gm-Message-State: AOAM530W4nzqfPQMCvy9UGx2x3lOaduFCnct2z3mzJEtf++DVrSsezPv f8nwiD9dp8mTVVP6fPNeJuU= X-Google-Smtp-Source: ABdhPJw4vJl+POy6CcWej23a3H9QQOC6ZezJQemdBY1dxn4yCgZHjAn5j8tYrqgir5u1r4h6c0FEAw== X-Received: by 2002:a05:600c:8a6:: with SMTP id l38mr23602133wmp.108.1623178623426; Tue, 08 Jun 2021 11:57:03 -0700 (PDT) Received: from localhost.localdomain (haganm.plus.com. [212.159.108.31]) by smtp.gmail.com with ESMTPSA id q20sm26200223wrf.45.2021.06.08.11.57.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Jun 2021 11:57:02 -0700 (PDT) Subject: Re: [PATCH v2] net: stmmac: explicitly deassert GMAC_AHB_RESET To: Philipp Zabel Cc: bjorn.andersson@linaro.org, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Coquelin , Voon Weifeng , Ong Boon Leong , Wong Vee Khee , Tan Tee Min , "Wong, Vee Khee" , Mohammad Athari Bin Ismail , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <3436f8f0-77dc-d4ff-4489-e9294c434a08@gmail.com> <20210606103019.2807397-1-mnhagan88@gmail.com> From: Matthew Hagan Message-ID: Date: Tue, 8 Jun 2021 19:57:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210608_115806_761506_2AF97983 X-CRM114-Status: GOOD ( 21.36 ) 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 07/06/2021 10:45, Philipp Zabel wrote: > On Sun, 2021-06-06 at 11:30 +0100, Matthew Hagan wrote: >> We are currently assuming that GMAC_AHB_RESET will already be deasserted >> by the bootloader. However if this has not been done, probing of the GMAC >> will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted >> prior to probing. >> >> v2 changes: >> - remove NULL condition check for stmmac_ahb_rst in stmmac_main.c >> - unwrap dev_err() message in stmmac_main.c >> - add PTR_ERR() around plat->stmmac_ahb_rst in stmmac_platform.c >> >> Signed-off-by: Matthew Hagan >> --- >> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++ >> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++ >> include/linux/stmmac.h | 1 + >> 3 files changed, 12 insertions(+) >> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> index 6d41dd6f9f7a..0d4cb423cbbd 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> @@ -6840,6 +6840,10 @@ int stmmac_dvr_probe(struct device *device, >> reset_control_reset(priv->plat->stmmac_rst); >> } >> >> + ret = reset_control_deassert(priv->plat->stmmac_ahb_rst); >> + if (ret == -ENOTSUPP) >> + dev_err(priv->device, "unable to bring out of ahb reset\n"); >> + > I would make this > > if (ret) > dev_err(priv->device, "unable to bring out of ahb reset: %pe\n", ERR_PTR(ret)); Done. > > Also consider asserting the reset again in the remove path. Or is there > a reason not to? Don't see any issue doing this. As this is a shared reset, the assert will only occur when the final GMAC is removed, due to the tracking of deassert_count. > With that addressed, > > Reviewed-by: Philipp Zabel > > regards > Philipp Thanks, Matthew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel