Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp112250rdh; Tue, 13 Feb 2024 10:55:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWa3RGa83aEZH3aaQg1fixzNrwR0jfWFa+3RO2XnktXZJhqUj2CloW2G6+LGY+QvQKzorKAEfT9SIPTCgCLWpWlUkDHRJ0rhwyXlTdYhw== X-Google-Smtp-Source: AGHT+IFDCybsLNPwkmcvZ8pz6Xy3LTYcyhZtwhI6Vhi3KilxsoxwhkEGnuFKaUM1IMlrZR+rpyoi X-Received: by 2002:a05:6214:250f:b0:68c:7c38:6cd with SMTP id gf15-20020a056214250f00b0068c7c3806cdmr377496qvb.36.1707850557015; Tue, 13 Feb 2024 10:55:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707850557; cv=pass; d=google.com; s=arc-20160816; b=Gn8b3Cohf6UGd0l1v3WfqWyXbbBMpFwb6msEjoUjYxtp8flsmSECksHeYQwMYtRQIL b3Ed9Isvqb9RCGHVGckiGUIf0/k9icltRdOIIWoR3XLj/mZrFTiK6ZwmGutvqWkDe39V zT/0ltJsGljPPF/FO5NWoeeIhSkKZ5G919HivywuBtsqrwCSY8tCS+O9SJ0Dx4WmFePe s1Zhab855fuicJpEb2dcwg/2/mF8J36jjYoHLX3/72kYMbGjEr/kH+917T+HbETSzPWU bnOPRi9FvNGMUyh3zgVOOZ0U0CHEZTuZTFOpNmz1kQyc6G7q1xvUOrM+R/ru2jgUy1q4 Jnew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=pMhzu1S70tXsjq/n2IaXdigXH/qhRAWmzHR2uq8cwRE=; fh=M701q1vrUQywOP+Vu72YB+1+CEPDUz4Ygj2c6zgywDo=; b=R9zxhNzq+JfeTfYk1e8dIkDzHUhR9N5ZW3eEyrZWeAxRuIPB8L7fBytigT7N6tPDpb iShXPAoqag8qNvrs7gKS6uwaVMcWhjZd7EiutXRMxyyKS3IcMBqZj/XogwOlQqp+yBWg g2ypvYoVZ48es+HzlbW314AwVkjP+hek0SsLU78ec4WaQ+r6rQeAhGsHMRDrA+BvHqgA 3kWRCh28Fu32X/yShid8hYc842sjzXjO4R2H+S0aWFkWzN0Iuw296npltE/gSJTi//WE kqm+zmOP3wxBHGJBZlxHrG7MzwpeOcgY80saXJrfdfTVE3j/lCywArRA61VtssOEGfGJ +pRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=P+V0Ex2r; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-64124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64124-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCW7/hDBvlg1iyGpWb3bOZGbs4kpCCtBwNHLzrAhQr2uSbqeWMA3mSdAeOjoIJgPRu0r49UiGBPxwWQ1TjiLvx2DG6oVyZ3EevPPJF2CYA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u12-20020ad45aac000000b0068cb77e77d2si3464227qvg.533.2024.02.13.10.55.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64124-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=@tuxon.dev header.s=google header.b=P+V0Ex2r; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-64124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64124-linux.lists.archive=gmail.com@vger.kernel.org" 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 141D21C262DD for ; Tue, 13 Feb 2024 18:55:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B82B1CA93; Tue, 13 Feb 2024 18:55:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="P+V0Ex2r" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D8BF1F618 for ; Tue, 13 Feb 2024 18:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707850531; cv=none; b=j5rZ/2iQrZyIJ8qHLh8llxt8+6+QuT+b23+lim8Fs6QFdDXfDGM9IzHH4eOpo6w/rKobrCJi28iHhn1n0lfrQS4MJfPbqEnsP5Q89hYj1f/H9V2BYredIu6a2S0NxSaHZT/yFEfjGOkZW0mi6IwGMXRrT47G3kUiNU8vXcWAruI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707850531; c=relaxed/simple; bh=81ioBMQoFUAXfD3calqbogWeHqxzR5ypL2hOiBSpVRI=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=YcV3weRyeKeYhe7YtkH5ekWlunuDpmrmpVXMaeuJ+Qr51yFyeOoSSzuv2eM+G/cABHNqvwdJDUAShgJxDa8BspTDM7PIblmNdLIJ5CfdkTrToGowoVT9IfO/LuVsJNj17n3RWTNZieXIqPXcB4n5O2LVNyDEXiYxlhB+UNXnROA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=P+V0Ex2r; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4114e0a2978so14561965e9.3 for ; Tue, 13 Feb 2024 10:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1707850527; x=1708455327; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pMhzu1S70tXsjq/n2IaXdigXH/qhRAWmzHR2uq8cwRE=; b=P+V0Ex2r63IyKVy83Q1cz5G+SPepQWJ1IBN3Iyk5aKvkm9vKkCo/YkzGewVKOu8AB5 7Y2v0GOiFTRAWDOHbp0fzgiVTYPhAE37KkuO3pnQDsj+gcp7Km05nkbEAZ1WPk4Dwiyk eXQ1yTHfuD3Y5GnwRayJTmCU9HxmbZWf/R672gScGpIdFgIyyrfccEVVG59vp/e5W1df ky3qzpc7pze57l/lmuatJAOpTyw0CWkPEd+RyOIHfJfT0rifftLlh0btSJ50LCW+d4JA Ade5FUh9AL/Og2N8zzI7/7CmKSCreHE9TwDA4PnUBQu5B0DzPkZMpANphUBnfylU+8tp YAsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707850527; x=1708455327; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pMhzu1S70tXsjq/n2IaXdigXH/qhRAWmzHR2uq8cwRE=; b=Ev2kWKy6gvZZJ4CoXvRuT0TMhl44k25HOgo5NPSZ+AUlHuE7BL3lZOr/kly268HFOe SkE3hkwdbZB/RqFqDghwf9yYFp08K1BYp+wE1/hdDGGU9iQ9sqsyZ57fgscWX7DWwc6L kxujveE3uoDawg1ESKv1ZpqL1MLeXvw52rODo5P6Rdq3U/ppzmGkZB5u+XqdRvdg6BD/ JDxBSo2DBkmwIG9KP2+aWJl8Q0vrO/eaFfhYX6Skz2MGykEpPZLEanJVo1B533q0RZ3k t5yRheQED5pQzIqbURtCe0JmyyFRFoyhyKo4VCgtQMlaC/6DTuFY6+b3ntzCGjvXU1wP s0lA== X-Forwarded-Encrypted: i=1; AJvYcCX8NLva+DM1+hTM2h+Mfmfo3eWEQ0PVpXtwCN6uYELfoyZCwlMmRXPZvuTVPC5gYh7KQSs6UCrRIcVfJm5hi2aSCEl4g8TROV553tob X-Gm-Message-State: AOJu0YzMzDoggzpUsi8Nv277a+gfYguykn9UmcKTuy4uC8jCSSwTRYrX QgRIBJ81n7tN0NmRjZpk8xnvsz4WF6NOAg+mzHpEufBCA4GOYnUZk9T1beHRH6M= X-Received: by 2002:a5d:4eca:0:b0:33c:e30e:cdbf with SMTP id s10-20020a5d4eca000000b0033ce30ecdbfmr156391wrv.32.1707850526649; Tue, 13 Feb 2024 10:55:26 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVbZFjo6U0l4qHSR2B3l08IWRcDmD7J0fP1JWVlRiF7e4jEIcgogqfuF8OLdiYCme/QnUASSv/ScThqp8Bwxe4eY8uWu1931lUCgvMXPTAqHESBRBS3kLnWsV6B/fmdzPBmH0TdsgnLs3e/WvENTd8U06dUB1xdI2CYDyCTO3GjDUmdJ+8RkRehQCORmuPZ0LHX0E6xq7rwkyVk1qaO19z5P7RQfnqQkF7UFp7aKT7JCDXGQCrkp8A7ayRy4ceSxhjsygicQ7iH4euN7cLleXpi6wOluKgG1CUoLhNR5gc+bgLdJnDwZm4DIn6Pdc6cDsXWwI800FYFSHHl4MZTaUK9ejBq2k601Enu0fP+ Received: from [192.168.50.4] ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id p31-20020a05600c1d9f00b00411a595d56bsm4292075wms.14.2024.02.13.10.55.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Feb 2024 10:55:26 -0800 (PST) Message-ID: <81ca7397-3f00-431d-aea4-c30c363a90e6@tuxon.dev> Date: Tue, 13 Feb 2024 20:55:24 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v3 5/6] net: ravb: Do not apply features to hardware if the interface is down Content-Language: en-US From: claudiu beznea To: Biju Das , "s.shtylyov@omp.ru" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" Cc: "netdev@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Claudiu Beznea References: <20240213094110.853155-1-claudiu.beznea.uj@bp.renesas.com> <20240213094110.853155-6-claudiu.beznea.uj@bp.renesas.com> <368ca0a8-a005-4371-a959-297fd4f58cb1@tuxon.dev> In-Reply-To: <368ca0a8-a005-4371-a959-297fd4f58cb1@tuxon.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 13.02.2024 13:07, claudiu beznea wrote: >>> @@ -2566,15 +2566,23 @@ static int ravb_set_features(struct net_device >>> *ndev, { >>> struct ravb_private *priv = netdev_priv(ndev); >>> const struct ravb_hw_info *info = priv->info; >>> - int ret; >>> + struct device *dev = &priv->pdev->dev; >>> + int ret = 0; >>> + >>> + pm_runtime_get_noresume(dev); >>> + >>> + if (!pm_runtime_active(dev)) >>> + goto out_set_features; >> This can be simplified, which avoids 1 goto statement and >> Unnecessary ret initialization. I am leaving to you and Sergey. >> >> if (!pm_runtime_active(dev)) >> ret = 0; >> else >> ret = info->set_feature(ndev, features); >> >> pm_runtime_put_noidle(dev); >> if (ret) >> goto err; >> >> ndev->features = features; >> >> err: >> return ret; >> > I find it a bit difficult to follow this way. Looking again at it, your version seems better.