Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp532320pxb; Mon, 16 Aug 2021 10:59:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCLdKZgbXsOwOkeixvVjo6n4dShUQ12VaRY/dsds1Icmx/HcG6A8JaYoSSbwW1yryGmVLZ X-Received: by 2002:a05:6402:31ad:: with SMTP id dj13mr21768617edb.296.1629136795582; Mon, 16 Aug 2021 10:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629136795; cv=none; d=google.com; s=arc-20160816; b=mdEDlH+LElt7hOAU2nNMk8KnMG+Nt0Mc7MLaiPsBVuwvqc7KJMOsIeHWJhlTxvXcnH KjsrxjxYSsVN8jhs/qja7i6GP6C34jiS2zQW8pRWAOc4q3Ul70wVsmKK/EzMNmrU6CCi h5WdJlL3AuCWsW+SYo++LmivDnFbhnbVH+IfEtIpSHrug4ygP57SsFm5zu4tFOucpoH/ kPg3OugTa6XBU3I8GTdDTbkbpumI/Uz04g53hQ2+pc4jtjwjrPhqXsRD6qGLUTVB0Y5N 7KlyimrEYKLRqezk0DK7yp4H9SIVsQV2XKjWTy973nyiYcg6Q0Ow8oZdV5RnsEG6ShJ3 Z5cg== 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:references:cc :to:from:subject:dkim-signature; bh=UHeEL37pku4HOreD+wBckxjETJz5QqCAx8V1P9VHsAo=; b=zcsxBdMaXkYy8jnaQEJGwJnX3ST8rrAWi11/00c0gbD4fa3I1zOp00tI1fdal2nc2g Q32WKbIkrQBSXOqFEHyQj337IEpGHvbpNFex65W+S1vLJgGBnBzRdWwZTIP2eXojBs45 Hab1ZWkbR5dx3t313qrblD6LDVzGapJxCoOUL4Hfi4vsBhDAQm74Q5z25XTNFDt5IxjL kVFRmvW5pyyd2cCYuJP6l3m+SX4+n4IU/2PLtDel/ln1kmRVwVzfDvbMJDwqtc9m5GQM xlSr8JclkeA8ghXNhphm8UdwWvLvvTHTiuWJLUV89+QTSp0dS38VANLxXgTb/KzAdjO4 TosQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y67JzR4P; 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 z12si3807489edd.320.2021.08.16.10.59.32; Mon, 16 Aug 2021 10:59:55 -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=y67JzR4P; 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 S229481AbhHPR5P (ORCPT + 99 others); Mon, 16 Aug 2021 13:57:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbhHPR5O (ORCPT ); Mon, 16 Aug 2021 13:57:14 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B1CC0613C1 for ; Mon, 16 Aug 2021 10:56:42 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id r6so18379620ilt.13 for ; Mon, 16 Aug 2021 10:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UHeEL37pku4HOreD+wBckxjETJz5QqCAx8V1P9VHsAo=; b=y67JzR4PNZVPGNmW5CuQAyLtq6CodFO0mG0t6TIL/LGVMBenQ8NR3ZQ0XQvqkljkAa ZmTHD3bU3MsZ0Nnhoa4Vqbc36cotlNbRxWWSPbTnpS2TV5O3OKeEt1dx2O5p2FEwjHeB aytyZ2NfnrnATOAMB2BhHvvJrxGrhdtSJDulNFSOLWBO4yiSFhfN8cktU3kY8k8mpTmJ AdbGCVXMFczBCzRmZ/vgt46FIQb90jVwQBnuk8cThYJDDO+NrioXA1YXPvItQ27UJPzQ UHLf447t9SSg+rE9nCgFNNQn+2FKmxMdDqlvQK9Tmzzd4bQRarpYBPWtq8acmwWONW1C 41xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UHeEL37pku4HOreD+wBckxjETJz5QqCAx8V1P9VHsAo=; b=YqHskuvoIQsNqN9fc29S3toyr00nsBogL+e/5LZWvIP5QmHGjV/z14ODUBnoW+wC79 M0mUSy0SY17j8HKf/DmBRELtJZjk2sWVK5VTfvdwMvUh8xzqQnjT735hnLjsYOlAFDYO cyIJNnGRBpAx/BelI8V1htQREJmP3/WCWSAHgB4U06I5griDS/pZSgG0pBkovvQr9krs F2ffkFUTEoNGJus07rehaYojjr8FUskWlRJXmg2JmoCVSjD1TB1FuPRyYvGSjOkD3Au8 Fhe4B2fz07sJngrOOlWwg+noK1kymYziRZM3X82Xm/wC1zDdiakSqp9IeVIo3VLdvtIa zfSw== X-Gm-Message-State: AOAM530YL9Vxc6NKDbrqIgarTqX7IkcR1VdsOgdgaudUl+GlUdBsg/bD IjWIWhaPKjXhQNhe5S1ioi/gcxSHT4RNkXAm X-Received: by 2002:a92:b711:: with SMTP id k17mr3119ili.247.1629136602006; Mon, 16 Aug 2021 10:56:42 -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 z26sm1603739iol.6.2021.08.16.10.56.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Aug 2021 10:56:41 -0700 (PDT) Subject: Re: [PATCH net-next 4/6] net: ipa: ensure hardware has power in ipa_start_xmit() From: Alex Elder 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> Message-ID: Date: Mon, 16 Aug 2021 12:56: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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/16/21 9:20 AM, Alex Elder wrote: > 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. I'm finding this isn't an easy problem to solve (or even think about). While I ponder the best course of action I'm going to send out another series (i.e., *before* I send a fix for this issue) because I'd like to get everything I have out for review this week. I *will* address this potential race one way or another, possibly later today. -Alex > >                     -Alex >