Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7080462ybh; Thu, 8 Aug 2019 09:54:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZqEjyaidGfigbrne5bCWHB7UDEamuRfIfwbZ0aHzZZT6koB1laVsLHREJ6NDVvZ9v/t0m X-Received: by 2002:a17:902:8ec3:: with SMTP id x3mr14357179plo.313.1565283256760; Thu, 08 Aug 2019 09:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565283256; cv=none; d=google.com; s=arc-20160816; b=m3dqCH5pBaTuVOeiOlvgGuXdMtkX952Rxvx85bmDTcQSvh4dDN+cDxmYNU2SqaXLQS /xhGDsS+hCgqQRc9YiYUP7Q9lTVl89H4JYln6C4hfa28pNWkintG/N4kYhAIVizMO5PT OLhPzI2IhV67p4oUfEV8RhSayBHDgonCEJQhqA6iig57oZQtP+3yW76Ue+aXOWtTnStc PPO8yXPTsv0RgFLIGFKTbJxWGnwZsvkypUf2fijx20+VMU5yHDoDHrAq2am9kYVX3oDE c+cGwzQiAWuHM+zt4CkMasxII5LDn95L7bjk6XNLg08jQ0314oZs9/BbPxWm1+VdMfPs wCaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OiEWeL7H3W20lQN3jRYA1ldQhDggwawkb8Q2+D0yaUI=; b=aoA7PtSVDcw2YzS8k5IyEYqW7mMIqZb0a799dPGFMhQeF8BN8kAPxQ3dp6ooTGjy2d 8wcOJ73wAHUaay4TnB6UZdXpacqwz2Yzq2rBt7fmDlL3EZdNuIoiOgjX7Ey1M9I0SZMQ e+Me6QNn8AkaTHZdpO+26NeW1H9OtedEeHSbe+Hx+LWWBxbfmr56aXtQNNL0sg/yzRno l7GenLZlb7e3xuYGRFNh6rPF3ytZT6zp/Wb/nKiI5Rri3+en1x4pfV+QRwjDTvwtX5PQ x9SgF8MJ6U1zNs/guzk/Mx2sOCtG4tqI9QlnZtsJW1nTvf4ZDSmqcoWSHkFw1D8LHrXO h1bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EUWWiVf+; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b31si1079701pgb.128.2019.08.08.09.53.51; Thu, 08 Aug 2019 09:54:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EUWWiVf+; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732698AbfHHQvk (ORCPT + 99 others); Thu, 8 Aug 2019 12:51:40 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:44879 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728289AbfHHQvj (ORCPT ); Thu, 8 Aug 2019 12:51:39 -0400 Received: by mail-lj1-f195.google.com with SMTP id k18so89504651ljc.11 for ; Thu, 08 Aug 2019 09:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OiEWeL7H3W20lQN3jRYA1ldQhDggwawkb8Q2+D0yaUI=; b=EUWWiVf+MsHbZ6Hf37fv1XnXfeYn3mNoGzh8HLoysZH0qyHlba10ZDlx1QyUIv8Tcm UcDwO7QEHXzTutURw9n6274auOYkurtRradEZlT7eQ1mGxaqPDZ4XNvI5oqYmSQPGmgb vvR8SNRb3+Sm0Iz1xX5Ne0HmQ2xfH1ph+YT44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OiEWeL7H3W20lQN3jRYA1ldQhDggwawkb8Q2+D0yaUI=; b=h5p8fJ9w2Y1OJtypmpp2vjWjvyDGlQI5suuhwtk8uivYe1ASnhfuJ6E5gnNnjPcTZl VNY3RZR/XAbJe1YParzBpJtY0yaVOg/biBZXIpBb6AqmdkL3mSnhujhvyRziV42RSKbT p/ff8SjZq6WaFyKku6HksJkz89eFybo7FYY1GzcYh/wJLS0fAXviFoi9HIJM+IcrqkE0 jV5fRLuDrPRP2a8a5Jz+Hfrk8XvI6IcuPoR9z7k7i89+l2QR9yq5vxJKvMwv6wn9dVF1 aF6pO+C10errr7ESaeRupF5/mSpLD+ucjcPfe3LAQkfLNtz0j7TZnP8XIWALYG9zZWHz jdgg== X-Gm-Message-State: APjAAAVI/9jsbAQqF9IDVwLUkZWcJePI9rARAupNn4MAUliQX/9wkkI/ YtV4okubjpsWVX9w4uvwAw4m50usOVU= X-Received: by 2002:a2e:85d4:: with SMTP id h20mr8964540ljj.142.1565283097641; Thu, 08 Aug 2019 09:51:37 -0700 (PDT) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id d3sm17015229lfb.92.2019.08.08.09.51.36 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 09:51:36 -0700 (PDT) Received: by mail-lf1-f54.google.com with SMTP id x3so13592245lfn.6 for ; Thu, 08 Aug 2019 09:51:36 -0700 (PDT) X-Received: by 2002:ac2:5ec3:: with SMTP id d3mr9834070lfq.44.1565283096004; Thu, 08 Aug 2019 09:51:36 -0700 (PDT) MIME-Version: 1.0 References: <1564487414-9615-1-git-send-email-yhchuang@realtek.com> <20190730195703.GA224792@google.com> In-Reply-To: From: Brian Norris Date: Thu, 8 Aug 2019 09:51:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] rtw88: pci: enable MSI interrupt To: Tony Chuang Cc: "kvalo@codeaurora.org" , "linux-wireless@vger.kernel.org" , "jano.vesely@gmail.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Aug 1, 2019 at 2:21 AM Tony Chuang wrote: > > Subject: Re: [PATCH] rtw88: pci: enable MSI interrupt > > On Tue, Jul 30, 2019 at 07:50:14PM +0800, yhchuang@realtek.com wrote: > > > --- a/drivers/net/wireless/realtek/rtw88/pci.c > > > +++ b/drivers/net/wireless/realtek/rtw88/pci.c > > > @@ -874,6 +878,7 @@ static irqreturn_t rtw_pci_interrupt_handler(int irq, > > void *dev) > > > if (!rtwpci->irq_enabled) > > > goto out; > > > > > > + rtw_pci_disable_interrupt(rtwdev, rtwpci); > > > > Why exactly do you have to mask interrupts during the ISR? Is there a > > race in rtw_pci_irq_recognized() or something? > > > I think there is a race between SW and HW, if we do not stop the > IRQ first, write 1 clear will make the interrupt to be lost. This doesn't need to slow down this patch (I think v2 is fine), but I still don't quite understand. Before this addition, the sequence is: (a) read out your IRQ status (b) ack the un-masked IRQs you see (c) operate on those IRQs Even if a new IRQ comes in the middle of (b), shouldn't it be sufficient to move on to (c), where you're still prepared to handle that IRQ? Or if the IRQ comes after (b), you won't ACK it, and you should immediately get a new IRQ after you return? I guess that's assuming that these registers are Write 1 to Clear. But if so, that means rtw_pci_irq_recognized() is effectively atomic, no? Also, somewhat unrelated: but why do you unmask HIMR1, when you're not actually handling any of its IRQ bits? Brian > > > > > rtw_pci_irq_recognized(rtwdev, rtwpci, irq_status); > > > > > > if (irq_status[0] & IMR_MGNTDOK)