Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp373956pxb; Mon, 16 Aug 2021 07:25:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtSKPMs0uqG+zz/DX/OQ7+6PHM/ZqZ1x4hTnpRuh5rkTVOEKlc8lmvYz3MGIsWs7nF1lPR X-Received: by 2002:aa7:c956:: with SMTP id h22mr20397091edt.378.1629123905100; Mon, 16 Aug 2021 07:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629123905; cv=none; d=google.com; s=arc-20160816; b=TkGTcXwlnbDRIgJdGfxSi3OvrayD/4iZt07T3Y9oWT26XTH5430ATB3d74BpnFtYxF ye6QrpGGPttZMuNAK4RiCDP9o7ftIIa94phqX5Nd21d11gFjxfKSysyoqysbKoBVm2un iB4bcpfyUg+JYh+3rEwrL4ZAf/jfhk4FIBhgHTINNjcZLvwnh1tJVIOMJpneo27EeWB1 2/kLbth5D/jjGeiNhn39ycuExzRWw+1ioJuUICvZJc/QuMQ3G6oFAvXmEeYtUvLpBDep ozFdV7drNppj7CD4HMZfYAswvDFrCl4oa/w9pmQwhhU7VyoKaMAoAR2RBHrN1GoldsmL PuAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ZdY43BmHwJ9DyNYh0fm/33Z4sEPUAt4Lp4aZlFW1GTk=; b=YLKXdcSw+rRiLtpKbQ8ptQoidQLSSzcF/tCpiq6xgQW14V20jG7Q1yzorOWfPGIpQT f62Mu79L8dzxSr8RGP0m+y4iMCcc97zlpuLioi7lTBYMEGFnyWIEhbgmTbCS6T34qT4u 1peiVD0ck4LU8tMdfoge4tPAsXLbvpfdLx7U2FukV0QcHtV1mldAmissT/KomEAGHeN9 dDtz6aRAebzLpm6I3tL5hdLtNKau+I9ZwGV7tE1StogfLVPsm6OGYrLJwT+ESF+nnIdu Arx6a0NMdmaW/NuGaNgAfKHCqFJ6geGSZy4GbELw9PGwBcWjVcarUgc0b9Zx9lJcGzrA 0bAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eclCU0gx; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ne20si11017654ejc.429.2021.08.16.07.24.40; Mon, 16 Aug 2021 07:25:05 -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=@linaro.org header.s=google header.b=eclCU0gx; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231648AbhHPOVO (ORCPT + 99 others); Mon, 16 Aug 2021 10:21:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbhHPOVO (ORCPT ); Mon, 16 Aug 2021 10:21:14 -0400 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D117EC0613C1 for ; Mon, 16 Aug 2021 07:20:42 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id f15so14726871ilk.4 for ; Mon, 16 Aug 2021 07:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZdY43BmHwJ9DyNYh0fm/33Z4sEPUAt4Lp4aZlFW1GTk=; b=eclCU0gxGJ3rxKvqWVcfExuXe7lG5b3uPcljlc9N5eaKWxp3O4DgzJa1xgfoiZp2Az EAJWZwTWrirfCayp/2mXEsJ+vswEQSV6XiC9NmuG4LrAG+FcUKXftg9fCH9yBDKJWgl1 SMCUDHb7FViztLkSYQshvDE8Aikyx324o3E1w+pS9Vyh3DINjDIcElcfKyV2I9G6G4M/ HeshVGxdytNlFQbnopKzyhc9w6+FZ9p3/hEOVCm91bMcikEfog7syCAKG2M2JiyqvNsj WaCSosue24Ry73Sa4Hu7WvirxhSOWw451pds+kbUL5EoNGeS5R+XR9OFbxBKokTUYkF/ YqLg== 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=ZdY43BmHwJ9DyNYh0fm/33Z4sEPUAt4Lp4aZlFW1GTk=; b=lWffVJZ0yTYu3rvW96mpdQS38ap30amp5zKXVwJ2apX2xVjLek0dF60qCa9DMKQExD Wd+Dfnmer/WDu6JzMl7f84X8QqvD+QmAee7xf+febCNghv+BWYk/td3NfL6O6nqB2X6B XP0Th4ebhx9yAHK3aWcOwq8NxAwzgIy2ov/LqUre6ZbmbDHcnwE9nt92wH6Ww5ZB4Kx0 OnW/pCnlcLPuQDW4W2WbfhZ4SyfP1roWY543XY1QJgmEwwDSKtwhqG1c9u0BAUPJla/2 11yZl3CrPzf9fh+ayjQ+gaGosqfdCKMAxm7L9NgAckEp2cUZd/9yGO70Z29EJi20Z2oo 2k3w== X-Gm-Message-State: AOAM532Mw8sRaIDPeIyW3TXJKY44MosoVIXHvF7lAN8sUG0eQsvzfcFW dj8+XH3fnqxqEmht13IILNWo9Tl5rGwDbYmp X-Received: by 2002:a05:6e02:2145:: with SMTP id d5mr858660ilv.23.1629123641680; Mon, 16 Aug 2021 07:20:41 -0700 (PDT) Received: from [172.22.22.4] (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.googlemail.com with ESMTPSA id m26sm3210997ioj.54.2021.08.16.07.20.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Aug 2021 07:20:41 -0700 (PDT) Subject: Re: [PATCH net-next 4/6] net: ipa: ensure hardware has power in ipa_start_xmit() To: Jakub Kicinski 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 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> <20210816071543.39a44815@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: Alex Elder Message-ID: Date: Mon, 16 Aug 2021 09:20:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210816071543.39a44815@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/16/21 9:15 AM, Jakub Kicinski wrote: > 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. Exactly what I just decided after trying to work out a clever way without using a spinlock... I'll be sending out a fix today. Thanks. -Alex