Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp1043951lqp; Thu, 23 May 2024 07:32:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhFifXb2CSmrjeOS48y0EdOt8jsrk6st27reRnMkCGPEHpNtOILASxZoFhneQPnhfks0o6II0X+vOqZFXQSYK1/LcjDROH1i7RQnOqCw== X-Google-Smtp-Source: AGHT+IHjzC5cq+TJ3ORjHdkzNHk5u9FV90Lk6e8Vu1v3xkDs46VfVnGWq9ksyD4m353eXQN0SPQF X-Received: by 2002:a05:620a:136e:b0:792:bc3f:401 with SMTP id af79cd13be357-7949941811fmr536075185a.3.1716474767125; Thu, 23 May 2024 07:32:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716474767; cv=pass; d=google.com; s=arc-20160816; b=uzfYMAB8wGsLDTZbdquviZyG0pOjWhDuKJfbfBR00W5Rf+PLkcTqIZCKguaXXMMw8N im6jO4LvDnWlCu5KPBjgWILACjziXDHlaU78ysv65XlDTD+f+kq0HK+vkFWwDCFmNHlX kK9i6XDvYBJUszoXNLq8GGzlJjasIgJwonnoV04pd2/Z4FR7werq7eYE5DcbHxTokzKO Bj+WVbpEEGp9PhlR7knfyVNT+JZQ/ui7YASezpKJObP84byz2vICCs6BwJz/0iFfu8x7 XoFN1EwLJ6mpEAqXAug2PTWsYuTqzvS1FsoQfMYBMVvtOpVLPD/sWN2lWirkVFCn88kh 0Xsg== 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=OyLpAbqIcm49EN50aC4QtDsFYC5RZ7HoWFou/ezE01w=; fh=/qJXLSMZFRdFDpZI8o1HFwSjRdryXLsZft6TpDGYdLs=; b=IE3Y0Twe6yh1j6LXLbLh4GEBVeHPmX1RLg5mzZ8HeOLV6cHbXfshs6e6PzMwbIa/G7 edidplY+enjFQm60RPk1Swxj3nzL92uCWzI9he6GVyeaZ0IG2nhRHFJ+QT5MmMQ0GUO9 jJLpTEZfKZsXfu6+5Jx/qcDYgmRCDSLq2Iar7LOOs/ajjkA1OnOsxjY4EXaEUlbtLZvx ndMBwyenCICHxb8FHb973QWfpGyDI0HhylN9zd2XAOGfVAmEBVy3aUiKH7g+WtvSxNXh 9xdGjOQwze/of6Qn1b4Ly1CZo2h0vb8LnWOlkZiLWRsqnWH8k300g/RbFfszQZHtLnWR 6AdQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=NdMTbwhM; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-187649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792e91b63a1si86895385a.146.2024.05.23.07.32.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 07:32:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=NdMTbwhM; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-187649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CFA7F1C21334 for ; Thu, 23 May 2024 14:32:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 157AB13DBA0; Thu, 23 May 2024 14:32:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="NdMTbwhM" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 EB07514BF8F; Thu, 23 May 2024 14:32:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716474757; cv=none; b=JqMg1y02CPmXz05s7Y/EQZodgH8HLJzEx3Fn1x6/AXmsx8DKw5YbZtUkAfTAFeyVnFzzePgGgOJHUlrBZ/2ecByhP6Kze7qBMIzrJHZ+Rt2YOuJT+QxY11WIXBLIWd2+bL6RgzxhsOsCIHh5ZwwMUVkWcQJBYCUOtVyQl515jEQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716474757; c=relaxed/simple; bh=nOBwnAUrG3XTArYtlV00zl2oa7x6KdWXnkghya/eAH8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ug0LmgICpZR2AkObBjxBbx14N/13zeQUVD7NgOBvpj9/E1nGkDKxBhkneJy5DUjxHySERYqDKPl9vE3XZqKiCL+mvi+r0iUCt2UpboFuhb0ZqTc7tNVOy4kgUMB3QUYvzt8H2esYDX/peATvmfm+MhgPZ1gww6i/03pkalTOScg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=NdMTbwhM; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch 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=OyLpAbqIcm49EN50aC4QtDsFYC5RZ7HoWFou/ezE01w=; b=NdMTbwhMtQM5CICpSwky5B6+xe Q6oL9/6VkX2WUudrsBMz1qzwMyI8G0btA9E6QpTOvf20Y/xhGRVOO6hJl9E1BU4Ey9nQZEel4e3lM l/d3Ov2KO/AWTORCqiWLeSmGqjvbuQLgTkQLtVXKIgNnuAVNJViOms12LLjNQO/uw4yY=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1sA9UY-00Ftog-T6; Thu, 23 May 2024 16:32:26 +0200 Date: Thu, 23 May 2024 16:32:26 +0200 From: Andrew Lunn To: Horatiu Vultur Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: micrel: Fix lan8841_config_intr after getting out of sleep mode Message-ID: 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=us-ascii Content-Disposition: inline In-Reply-To: <20240523074226.3540332-1-horatiu.vultur@microchip.com> 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? Andrew