Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp896942pxa; Wed, 5 Aug 2020 15:51:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzitetbWz5YFKWfAygzRE6mes+eSSnoKm/B+GfEs007hd44lxt6pGY+PHAhTrMQ/Ok5INg3 X-Received: by 2002:a17:906:d9db:: with SMTP id qk27mr1498875ejb.37.1596667902979; Wed, 05 Aug 2020 15:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596667902; cv=none; d=google.com; s=arc-20160816; b=AKIQ92vJSTIolxYYS6xH74gar7eAoUGosjfhPNT0j5On88qj3PXJFhLKtLH79B0vyb SgiJh9KaV5DzRR1ZJ+wI2eCpELwVKH/4Xypg8br8dC0RUyZVtM1opVfout/mgrwytycg RwTRVJo/DreDO/X/4TTZpc/ag9SbKGCEMKinuD37srSS+RryHzIj7omrhVCjxFULQv9X ZjHcS7JyfoGpjLgUUVCQ94oZngtu+Ez3Jw827axBOrxcssxFH2PVbyOD8eN6GE8/o9zq eQXVbxCIzJ+FFeEgUE9cEuTEMqayu1EZIfiqYRhuKjG7NDO/TkTmoS4c79epyhHcjPMv wMrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2f0chzsU8plamndGAVa0L+UE4xurrF8AKN1ix/elzeo=; b=m29cWJhIQtcrH4FmNqpg5gYVwZqMBTKgWLGh7/nSRzzSJcRGJlUvzSylgnLUZ3kmQD xtp9mtTomKv9BghHuQEjruNVwhtmkgqUbiMCeP/zoa+J1CzBTty8atMWvAp3eH4lllu4 hlJ15uV7eC56bcrlTfBaIVtysnMQnTp1IM9SUrpWFSE7Fr1u2bnaK/tdXMfFxmAnHGc9 zWBxWmVAPt6M7UDozqA5ROca2D3Kf2Ps1BMI/hfx/6WJdJDlwlJQjjCnS9ID223WgS8m 0mDXu1VFiMPD1S3o3LN45Mz/WezehwxkCExoJgHpnCegn7WImwjTIDVm4KFKSqcAolyy z7gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=LOq++iuh; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si2102150edg.519.2020.08.05.15.51.20; Wed, 05 Aug 2020 15:51:42 -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=@broadcom.com header.s=google header.b=LOq++iuh; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbgHEWsn (ORCPT + 99 others); Wed, 5 Aug 2020 18:48:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbgHEWsl (ORCPT ); Wed, 5 Aug 2020 18:48:41 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56A9DC061575 for ; Wed, 5 Aug 2020 15:48:41 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id t6so25611403pgq.1 for ; Wed, 05 Aug 2020 15:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2f0chzsU8plamndGAVa0L+UE4xurrF8AKN1ix/elzeo=; b=LOq++iuhI8DCPBmvAeXeK/R4Egf9sXfsO+JT+/SfxSso00VNm7Owtu/33R1IS0Wdeg 5cgE+2K4leqV8LFpAL8zTtFMcgIOH1TEuj2VQguyDAXEa0Fn1TvGiD5vMj9rq10q3ukx xTNbJJ62lXn8Aog2ut6XDKkljIOiYrE58r4Ps= 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=2f0chzsU8plamndGAVa0L+UE4xurrF8AKN1ix/elzeo=; b=EPFNAkFa7MIDjV+3nLENrqsblTz+zBp8f3eWfiThEIl9raeQzumkoIVMqizlh3WXr8 6pS1bN2Aa4lVYjaTGWQ+dABxpsA0/2vJz0+3EvL/83ED8nbW6GVOFOFg41vALF9Wbz+Q qxZYDg6VnMGpv2ikUzT0Czs3tWCBSZ8sh88dz0PZ3Ksc9dqVi3MTJ+jqQphNbe8yvlHq O6ZdjdZcEVx9+BV2m3o/fBUgeX8sxiCa/i83vrvIOiusgIo8KrCLzSn5t8Ue+Mts7M86 N9YwSwdUOxtTDSHIUb1IyBn02Fx/s0gD/JGgtIM4UqEwlSN6iEsZjwr452E8C6o1j2DT z80A== X-Gm-Message-State: AOAM531c9bhKKOL5SA3UAB72Tl05XLBlT488CU5MPS0KrjSts46fpO+P U6VjrPhPRK+8p4GXQW96QdYVEyPcS3aMxy2EQNnuw8ZFnyYnpmD3lQ/0Lfw/PY7buBg2IOgL/Jk vdd1SFU5zTML+UKvVNIrzAkyyYOhJnxTCmFfdkGqk6/IQkeARgX53+zdZA4WVXYheagmfhu1inO 4cIGU= X-Received: by 2002:a63:5349:: with SMTP id t9mr5210648pgl.204.1596667718770; Wed, 05 Aug 2020 15:48:38 -0700 (PDT) Received: from [10.230.182.181] ([192.19.224.250]) by smtp.gmail.com with ESMTPSA id f3sm5378263pfj.206.2020.08.05.15.48.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Aug 2020 15:48:37 -0700 (PDT) Subject: Re: [PATCH v3 1/2] PCI: iproc: Set affinity mask on MSI interrupts To: Mark Tomlinson , helgaas@kernel.org, sbranden@broadcom.com, f.fainelli@gmail.com, lorenzo.pieralisi@arm.com, robh@kernel.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200803035241.7737-1-mark.tomlinson@alliedtelesis.co.nz> From: Ray Jui Message-ID: <00166b29-f284-984c-81c2-54d5c1e3343a@broadcom.com> Date: Wed, 5 Aug 2020 15:48:36 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200803035241.7737-1-mark.tomlinson@alliedtelesis.co.nz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/2020 8:52 PM, Mark Tomlinson wrote: > The core interrupt code expects the irq_set_affinity call to update the > effective affinity for the interrupt. This was not being done, so update > iproc_msi_irq_set_affinity() to do so. > > Fixes: 3bc2b2348835 ("PCI: iproc: Add iProc PCIe MSI support") > Signed-off-by: Mark Tomlinson > --- > changes in v2: > - Patch 1/2 Added Fixes tag > - Patch 2/2 Replace original change with change suggested by Bjorn > Helgaas. > > changes in v3: > - Use bitfield rather than bool to save memory. > > drivers/pci/controller/pcie-iproc-msi.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/controller/pcie-iproc-msi.c b/drivers/pci/controller/pcie-iproc-msi.c > index 3176ad3ab0e5..908475d27e0e 100644 > --- a/drivers/pci/controller/pcie-iproc-msi.c > +++ b/drivers/pci/controller/pcie-iproc-msi.c > @@ -209,15 +209,20 @@ static int iproc_msi_irq_set_affinity(struct irq_data *data, > struct iproc_msi *msi = irq_data_get_irq_chip_data(data); > int target_cpu = cpumask_first(mask); > int curr_cpu; > + int ret; > > curr_cpu = hwirq_to_cpu(msi, data->hwirq); > if (curr_cpu == target_cpu) > - return IRQ_SET_MASK_OK_DONE; > + ret = IRQ_SET_MASK_OK_DONE; > + else { > + /* steer MSI to the target CPU */ > + data->hwirq = hwirq_to_canonical_hwirq(msi, data->hwirq) + target_cpu; > + ret = IRQ_SET_MASK_OK; > + } > > - /* steer MSI to the target CPU */ > - data->hwirq = hwirq_to_canonical_hwirq(msi, data->hwirq) + target_cpu; > + irq_data_update_effective_affinity(data, cpumask_of(target_cpu)); > > - return IRQ_SET_MASK_OK; > + return ret; > } > > static void iproc_msi_irq_compose_msi_msg(struct irq_data *data, > Looks good with the Fixes tag added. Thanks. Reviewed-by: Ray Jui