Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp368877pxb; Mon, 16 Aug 2021 07:18:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXYe/U4DfuZtbf4vcEt7kvPa0h50/+rZclRIk4w9HVK55rNMgLyvW4DSvMI4brDQXRZ6wA X-Received: by 2002:a02:a409:: with SMTP id c9mr15583475jal.138.1629123483914; Mon, 16 Aug 2021 07:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629123483; cv=none; d=google.com; s=arc-20160816; b=M8pj1vB+erDdQWBM+jMZuNR+IVtmT9HBMqAmWnJUkXFDe6hfEaYBV5BqsiZ/CcKvRL GK2V4aBGjzlw3yo+/QzhPwkUQ/JGCQv+DYHNZqk4tclEzXvNbQxe+Ri4Kbe2ufPspLbq +FeIGWavG8Jsmg13+Kwe5vTXenPHUNcAD6kZ0Ttl1Cfln6RpJcjJ0iVGxzD7SEPONqb9 mnElOcW6OAqc12xvA47sAHekqivoRkEc0xsEsi2Me3kOykWeVd8Y7v09pCeq1NX2o6jb m2dwEO4VnhVEjPEDzv0mO6YF6Xg7AGdi1TG97moMXocsWNRrwfoTX1E4kN7asf33EsUh SF0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=o8jUGvBo6ydjJDGHuNxPUmz0YyW7pzou4TxDnfBtvys=; b=EthF6QdH0l/Oa98HDF6iRor7Kw1u0AUwP8v0IRmkzsn4/zg87UUspc9tFLEN3ssXVF sWExQCufpxKiTYiD3+9DpEKRNXA5wOxfmNT8x502W+KloCYWeAnTYe2kC5Yo+oEcC4l/ b+vAcAJI5X7TASP9iiTUDoOAt7a666Gnveu4x2UvNkwK+0RzQ3Ibqwgs1inOgiEX6liA rFAqwGQwDuo1i5kzB2YLD+iURdToFeycZX5JA0oKYKPew6RRUvd55WAQ4COqJUYUM5Yd AonAQPaMlnTSOXE6dWLIARqJ2W3BYhqrKCPM9/yvUnCYtn2/+tmK9C6gALq2SZij6w1e PoKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vz163sbJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s2si2972935ilv.0.2021.08.16.07.17.51; Mon, 16 Aug 2021 07:18:03 -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=@kernel.org header.s=k20201202 header.b=Vz163sbJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231777AbhHPOQT (ORCPT + 99 others); Mon, 16 Aug 2021 10:16:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:43518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbhHPOQQ (ORCPT ); Mon, 16 Aug 2021 10:16:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 457E160FD8; Mon, 16 Aug 2021 14:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629123344; bh=1jYaq3pulCTBiY2onrHD7yAdtdvZB2Co4B3PYaUe4Z8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Vz163sbJzGINyAv8crNo12ZC1JvSgZDTboa7dMgRdXXZ9v8jqlVYYdDWsO7+6sLAj q4i7xcCZTbCQhrW5qy+BhbvSRxwPwhamyz/FpWBTXHysqYwUVna9rpt8301ju9dtdO 3zyE/+o5TMOUBCjclMt2Tk7UpwBecbveTEcfENeWPxMczDRz9ewbnxnl6YL0t/rbXq uHHtycpxLMGDBofRSjMxLYUN0df4mPHeu9letMfSDf5nV8TSI7Nn2bvVp1s8hVwiWn ClqESbqNkMLjlhBU8n6IR1PHNhitKcJdej/efcAtiFn2NRWJx+PIDv5RvJZEgQDRkk ziWhtd5kudWdg== Date: Mon, 16 Aug 2021 07:15:43 -0700 From: Jakub Kicinski To: Alex Elder Cc: davem@davemloft.net, bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 4/6] net: ipa: ensure hardware has power in ipa_start_xmit() Message-ID: <20210816071543.39a44815@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <3a9e82cc-c09e-62e8-4671-8f16d4f6a35b@linaro.org> References: <20210812195035.2816276-1-elder@linaro.org> <20210812195035.2816276-5-elder@linaro.org> <20210813174655.1d13b524@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <3a9e82cc-c09e-62e8-4671-8f16d4f6a35b@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Aug 2021 21:25:23 -0500 Alex Elder wrote: > > This is racy, what if the pm work gets scheduled on another CPU and > > calls wake right here (i.e. before you call netif_stop_queue())? > > The queue may never get woken up? > > I haven't been seeing this happen but I think you may be right. > > I did think about this race, but I think I was relying on the > PM work queue to somehow avoid the problem. I need to think > about this again after a good night's sleep. I might need > to add an atomic flag or something. Maybe add a spin lock? Seems like the whole wake up path will be expensive enough for a spin lock to be in the noise. You can always add complexity later.