Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3278041pxb; Mon, 18 Oct 2021 11:45:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPUm8U6mGUAmhjWa3E/bICcMppJVsOweUGYPYzJ1i70+X4/sThP6yMXvzTWbSsENQ9W4xY X-Received: by 2002:a17:907:628f:: with SMTP id nd15mr7382819ejc.389.1634582748815; Mon, 18 Oct 2021 11:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634582748; cv=none; d=google.com; s=arc-20160816; b=BtGMorIgk07or4P3lnBM7W/6zssr4JV/NjUjuFhca2oduNYBHxp2kl3lBPeqfVg8k4 gga6mnpEyNTdO15VbZVnlThhpprxtWktGEVaCCC6Yj+ze6tFJzmwu2MzD0f/9tIucPTf KwmntH59rOobzzoYVfgivIbjkS6H+k7p7/W1GZABdmZzm1JZdLzhkLIZyBTXAFIh43w9 oz+R27uS5CyItMhM4dtsT9TRJRsVtTSLmDBIBkSS2v2rlu8gcPkv0+/hVsWNHzQ6Nc9g Sjkc9F551D1gkxE8T2MtnYyzkwZvVh5YsFw4QfDUyQ85PbLtUN2ydkgtKFLB3BrzW55b i/8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wKwdNuC/u90uy6tdfGr/fFOqFF6c6+A3o/6MvmpPI0U=; b=cEDJMDbFIlc9w1+lvPuRbzvG3WUNmowswiBcpH2y9Qy62gy9gqMV2/v9Sag2SdwFJu pSWMcomWu1WAKgKas5XsXfYrvQJ3J1WbygBRfbhQE1uMq0pWMA2lpxStZLgKs1jfLEcE NskAmTRrTZNcsYf7tjTXP13fXzUeLssrUto3kQFpvjrinAo+isDOb3ESdL0mq6wQNj7L GOvr4WaU88QM2yb5utZS35PueD5Upq7C8RKeXezk0RPHp3tfEdDKtmG96Yc2vb5eHgbU FqGFLVircPQWGoUYlxOqV1Y/t8qDDp+K5wjJ2Dn6YWYmERz1ysMVQiCRKgnoF3pncGEK MltA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=qpbsPZju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mu47si6583906ejc.609.2021.10.18.11.45.25; Mon, 18 Oct 2021 11:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=qpbsPZju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232892AbhJRSnV (ORCPT + 99 others); Mon, 18 Oct 2021 14:43:21 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:44904 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231739AbhJRSnU (ORCPT ); Mon, 18 Oct 2021 14:43:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=wKwdNuC/u90uy6tdfGr/fFOqFF6c6+A3o/6MvmpPI0U=; b=qpbsPZjuUVddf2WlJRKUc9gyOq cV0YsyWy5GMufSNviD3JS0rKYjeVVFhCSgNpwK8o6sy4K7dgFdieNF4U+bKoXj4q0Hrd7jdTy68jp GPaTrEXum4/Hx2RcgmyoWrOsq5p6Jqcv3vyKOj1wX6eLeaCF8+mjpnz39UkIEEr3va7E=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mcXZJ-00AzoE-9W; Mon, 18 Oct 2021 20:41:05 +0200 Date: Mon, 18 Oct 2021 20:41:05 +0200 From: Andrew Lunn To: Luo Jie Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sricharan@codeaurora.org Subject: Re: [PATCH v3 03/13] net: phy: at803x: improve the WOL feature Message-ID: References: <20211018033333.17677-1-luoj@codeaurora.org> <20211018033333.17677-4-luoj@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211018033333.17677-4-luoj@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -348,18 +349,29 @@ static int at803x_set_wol(struct phy_device *phydev, > phy_write_mmd(phydev, MDIO_MMD_PCS, offsets[i], > mac[(i * 2) + 1] | (mac[(i * 2)] << 8)); > > + /* Enable WOL function */ > + ret = phy_modify_mmd(phydev, MDIO_MMD_PCS, AT803X_PHY_MMD3_WOL_CTRL, > + 0, AT803X_WOL_EN); > + if (ret) > + return ret; > + /* Enable WOL interrupt */ > ret = phy_modify(phydev, AT803X_INTR_ENABLE, 0, AT803X_INTR_ENABLE_WOL); > if (ret) > return ret; > - value = phy_read(phydev, AT803X_INTR_STATUS); > } else { > + /* Disable WoL function */ > + ret = phy_modify_mmd(phydev, MDIO_MMD_PCS, AT803X_PHY_MMD3_WOL_CTRL, > + AT803X_WOL_EN, 0); > + if (ret) > + return ret; > + /* Disable WOL interrupt */ > ret = phy_modify(phydev, AT803X_INTR_ENABLE, AT803X_INTR_ENABLE_WOL, 0); > if (ret) > return ret; > - value = phy_read(phydev, AT803X_INTR_STATUS); > } > > - return ret; > + /* Clear WOL status */ > + return phy_read(phydev, AT803X_INTR_STATUS); It looks like you could be clearing other interrupt bits which have not been serviced yet. Is it possible to clear just WoL? Also, you are returning the contents of the interrupt status register? You should probably be returning 0 if the read was successful. Andrew