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=-4.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS 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 18DC2C43387 for ; Thu, 17 Jan 2019 06:10:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D727220851 for ; Thu, 17 Jan 2019 06:10:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j741/pEt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729982AbfAQGKr (ORCPT ); Thu, 17 Jan 2019 01:10:47 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40662 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbfAQGKr (ORCPT ); Thu, 17 Jan 2019 01:10:47 -0500 Received: by mail-wr1-f66.google.com with SMTP id p4so9577683wrt.7 for ; Wed, 16 Jan 2019 22:10:46 -0800 (PST) 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-language:content-transfer-encoding; bh=pt7LCx6883BfwDhc9Wc01k7EQVl6KFc9hmIb+lg0ECQ=; b=j741/pEte0COSkODHCYj5mrbpmeMThFMl4PqDRziWZHdwkgSfuwOPZfbFINQXy3+pq pPHFzY79cN1ec6U7sM6IjMDXCufpLsg7fz0ognWMjVDfdcbuDewFi+Y+QX1yHqIk4DD5 RunHf08EiP+Tpqv7fTAINrT0O8Q/mr7cC2N3Lm24WAwL5bApHF6i6EBOXkATLhf7XYAy ZZjZM2WcQ8MbJMDH3RV1cvm4QJzf+OmevN1EgiZjDl0+TV7Eralqw5DudoIJ/7dpgvP+ KdCSPtzdb1j8F0gXvaYNKYen/JnEBxbyv902+b1GLpW4qEUcQqOfddS1ytFRJ/Szd9vI Sbeg== 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-language :content-transfer-encoding; bh=pt7LCx6883BfwDhc9Wc01k7EQVl6KFc9hmIb+lg0ECQ=; b=YjDsFw3e04N+w8idMmQ6GwZqvFOhtFJO3OtXmnrINyahJ2r5mqwLB/gnFbgouKeGDi Qp2xZ8bqa4pgxZTtrtJMDgxOvunT8tBIPHuOCAbZRQyQenJ3t2FrvTcl6SfpRGzxoKWm KC8XhxD13jfSkchkwdA3s1kCyrcwMDq9RsfLfJ37B+cEVpjiO7BZVBvUhdPfXgQbeUeo J6wYyWaqjxEhnBszn5luyJ4jyKtaW/nXLa/KhgwaPVrhCAQpNILP2Pv4YRBEHj6KUgAn LXog8JoCKUdRs23Xnxosy4UoHuNgbGlF8UhZw2bhZbF+N06qIwYgYM6KhBlCoTUqMSpU m63A== X-Gm-Message-State: AJcUukcWmJ1SdPP/YKK7hjMFMe4jjoLuMd8z7L6BUB5jPgTjU3nMgFdC rRO5hbJHGuHLjrVsvXGClyjTvMq5 X-Google-Smtp-Source: ALg8bN7FV279xMm8jw25rI+RqeRgQ5InQNnEod03vVf2rV033PIR2pDpXEH6seWdwSttSseR15pcIw== X-Received: by 2002:a5d:454f:: with SMTP id p15mr10978401wrr.39.1547705445365; Wed, 16 Jan 2019 22:10:45 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:f186:f86:d850:f99e? (p200300EA8BF1E200F1860F86D850F99E.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:f186:f86:d850:f99e]) by smtp.googlemail.com with ESMTPSA id w12sm70612876wrr.23.2019.01.16.22.10.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 22:10:44 -0800 (PST) Subject: Re: [PATCH v2 net-next 2/3] net: phy: ensure phylib state machine is stopped after calling phy_stop To: Andrew Lunn Cc: Florian Fainelli , David Miller , "netdev@vger.kernel.org" References: <36e18752-488a-8fa7-ce0a-376446455345@gmail.com> <91377107-d931-55a4-b231-0c530aa9359b@gmail.com> <20190116215945.GL29244@lunn.ch> From: Heiner Kallweit Message-ID: <76ba0e6e-ead4-31f8-1235-d7bc59e95e16@gmail.com> Date: Thu, 17 Jan 2019 07:10:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190116215945.GL29244@lunn.ch> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 16.01.2019 22:59, Andrew Lunn wrote: > On Wed, Jan 16, 2019 at 09:25:54PM +0100, Heiner Kallweit wrote: >> The call to the phylib state machine in phy_stop() just ensures that >> the state machine isn't re-triggered, but a state machine call may >> be scheduled already. So lets's call phy_stop_machine(). >> This also allows to get rid of the call to phy_stop_machine() in >> phy_disconnect(). >> >> Signed-off-by: Heiner Kallweit > > Reviewed-by: Andrew Lunn > > At some point it would be good to audit the code and see if anything > is still used in interrupt context. PHY interrupt handling is now done > in a threaded interrupt handler. So i think it is just callers to > phy_mac_interrupt() that need to be checked. It could be the work > queue can be removed and everything done synchronous. > Yes, I think few calls to phy_trigger_machine() could be changed to be synchronous. But I think the workqueue will still be needed: - for phy_mac_interrupt() which is typically called from hard irq context - for polling link status (delayed work) > Andrew > Heiner