Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp87274lqb; Thu, 23 May 2024 11:31:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVP0bhyOtLOpBxqenqQ2dkbRGOaSR8arYSNqKRJIoIRIhhI9RXXYj8kTUgpJBcB+PDnDdEZPuuzx71nusUicE7caz4J0b6CkYp6MhcIJg== X-Google-Smtp-Source: AGHT+IFrV0fjG2SzWB3Vf4lKShJRqAx9HsDfJ+xDrmuBLAjoPAnI1Rj6n1j0hcTTUmTE3IDPAu9e X-Received: by 2002:a05:6a00:f09:b0:6ed:41f3:cd06 with SMTP id d2e1a72fcca58-6f8f2a49069mr23995b3a.7.1716489067455; Thu, 23 May 2024 11:31:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716489067; cv=pass; d=google.com; s=arc-20160816; b=v1gzhJ/vA5FgSh0HP12+G8S5wydbJF8uyMV2u+0iDRPzLjmu16W/oGEE7CrvT2UEDc u+833avUliyRIgYzmmKqJ13eYsoD/DDp4wwP+n6ExrzI5lU0W4T2/USh0gp+dz5n0pEs d+2Gb/jGb1oQLXsxerOD4tnBZcme9vLyK9jiZqEP8CXWT1teXVXDd8dtQM2uPGE/0WUd qpiQ8cRtnaX6X6BcVhloAxur2vhRKltjfzdX8bf2e1UG3JyrGflZE5MQv6bPu3rXMeLb scVJqTamrZfxVE8SKR310kEWBUFOMTlM+qhF5Vmrb9iwCpTg+MmCisr1QyQFNZAzI0vE pB9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gGj0dDZs/4dEerVvKPX6iV+5pD4rnjW0ukzaso6jX20=; fh=Bf4jl/wjFmoVj6ioa7aT4kjSqCsn0EUUtllvmmZIKgY=; b=Jbe59r16ddZHc171S6yvP5iiy/ewtB/aG37SghXYpfHFSO9OPshL+dfRn3eVkHKBwG YUp7FpxUpOKdnJosWyMFvoDFymnkCwwIWvprUGfTxZYEkcIZFnZadTUlJuHzeL9uhrk0 qh9mZhtxOl9DaxV3jVydbbflcww/pKumiXNbxUZYisPGIMYDK0HoXbxpJGLwjYoTfNsO Oz5QvjceVHpWsx8/N+mA4nWC/yVYjnD3IsGJ2jSvc07bRR75yEN5KbZK4V+oj1ZX/+wB umalDljQ/XBLAyTAUoO2IR8AyTRpqahKpFiEv+gxlKDx2pEyhvR2fS8IdujOWCKOsQYP 9j7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ZW83zNRl; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-187880-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2aeeda9si828411b3a.189.2024.05.23.11.31.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 11:31:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187880-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ZW83zNRl; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-187880-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E0D8BB22D40 for ; Thu, 23 May 2024 18:30:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2515084A31; Thu, 23 May 2024 18:28:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="ZW83zNRl" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA8AD82488; Thu, 23 May 2024 18:28:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716488916; cv=none; b=SUtV9zBZRa5yZzAUTL4mxy4EQxqrXQ7BhMlIm0GQdgdMXBQJoG1zxtG8uTOL0Yh0mX+8ucK42zE+aQc3bwsT55RiMWiQIovXDmi7ji7Y7iDEIAZYtS7IxrKLf1BqVArwuNqdrwjXxOJTRzB4CiwmZUg9mnryghSZTe/H7VKHXlU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716488916; c=relaxed/simple; bh=wMtXi1ojy/zbNh/xMLzFTjwEhDLQPXwqtWag8OKqC20=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qAZXxJWPNQcqP6LnoLjFTc9/kG3BEh0MBvZnvEWzAAHZr6liWNdlebSoRK4u9hMcfJbm6S6ZKPHGO/6hgbippODQdtfAbrUyl0ZBzjH9fbsJTNQjDXjweqVLFupji4uo34ZrDBiqFsidPBhzZpGG9duXlb4/IHylxR7MXAkTUwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=ZW83zNRl; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1716488913; x=1748024913; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=wMtXi1ojy/zbNh/xMLzFTjwEhDLQPXwqtWag8OKqC20=; b=ZW83zNRlgYWbtYZG1j0M36PHjFJ/5b7Hu5AZHZUuw0MDAUfHS34Go3XF JNoK9jvn3EIsYrx9je71QEa6RweFTkSYKNPQ97uqVjaDiywXFW7ge90EW m0SuaggyChtjimTYKjHbIUBnGiFhnraRPHxz+wt5kCx1LY+ukvFwtSh6h 5iqwkt1HNQhZuAmSG6HyHbfkR56+QZAbcuaaFIxlJKZBU+tm1H7JFi+NZ NbssH90/T9mGqhk/us44iby8wmRfGIk93xvCSHDNkaJHXzJmiZ22oIXOx AjJFGQj5LVvCM++AO9UE7qaUf6oRWVYnrMB8fr0BHB5jWsISVdDPHknbP A==; X-CSE-ConnectionGUID: NYz41ly3QeKgfFHrRsdP7Q== X-CSE-MsgGUID: l6DgFgS/QMydMfz7mQ9ggQ== X-IronPort-AV: E=Sophos;i="6.08,183,1712646000"; d="scan'208";a="193335945" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 May 2024 11:28:32 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 23 May 2024 11:28:28 -0700 Received: from localhost (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 23 May 2024 11:28:27 -0700 Date: Thu, 23 May 2024 20:28:27 +0200 From: Horatiu Vultur To: Andrew Lunn CC: , , , , , , , Subject: Re: [PATCH net] net: micrel: Fix lan8841_config_intr after getting out of sleep mode Message-ID: <20240523182827.rvavtqbsbhpcytiv@DEN-DL-M31836.microchip.com> References: <20240523074226.3540332-1-horatiu.vultur@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: The 05/23/2024 16:32, Andrew Lunn wrote: Hi Andrew, > > On Thu, May 23, 2024 at 09:42:26AM +0200, Horatiu Vultur wrote: > > When the interrupt is enabled, the function lan8841_config_intr tries to > > clear any pending interrupts by reading the interrupt status, then > > checks the return value for errors and then continue to enable the > > interrupt. It has been seen that once the system gets out of sleep mode, > > the interrupt status has the value 0x400 meaning that the PHY detected > > that the link was in low power. That is correct value but the problem is > > that the check is wrong. We try to check for errors but we return an > > error also in this case which is not an error. Therefore fix this by > > returning only when there is an error. > > Is the second case also broken in the same way? > > } else { > err = phy_write(phydev, LAN8814_INTC, 0); > if (err) > return err; > > err = phy_read(phydev, LAN8814_INTS); > } > > return err; > > e.g. there was an outstanding interrupt as interrupts are > disabled. This will cause the return value of the function to be not > 0? Yes, that is correct. In that case, it would return some positive number which is the status, which is incorrect. I will fix this in the new version. > > Andrew -- /Horatiu