Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp188501pxx; Wed, 28 Oct 2020 02:09:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQnE3DMLz6dtvkDCbJtGBdBWxQ4eSrJiX+KfyR9PyqSX5RBdn+PGFxzJkLlJWWQr+KD0GE X-Received: by 2002:a50:d88c:: with SMTP id p12mr6372537edj.352.1603876143008; Wed, 28 Oct 2020 02:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603876143; cv=none; d=google.com; s=arc-20160816; b=fWgk28gc51C603UcOqiPct3iGN/QZMbTJFYMC4reBZlPTzdNaw1AqAx3sVlyUGPBDy roFjQHVVsJH46azIxqrnu/BoTD5AZJPaU6ofYDAFC/dqCmY+PuVwp7o64Amo8d1WPJ2X 1/eI6AaLnRaISrPcxVeTfkgPl2Hnl8XAKeXOifHxOM4s37KXX385z559FNfZKWeE5BSM UjVhfRwo8N+s7QAaEpApywxhlQx4h+XxM9vJgk4G71DF9ic5okrKNKqC7OdK02GCBIBK TPy1oCjM1zkzNhH2rFeMedb/JSQuBm0Pl9QthqfzNGEbbQKzWdDQwY1HjYKh/J6BQS39 F84w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aicCQnc0nrKOJEZbc+w7q7od7sFTIsFg8UapCvypxHc=; b=1IFkCaCKmC6AViwTAqytapImULZS5KShkfIs3WzEcauBNE/mZL3d5hk6D1sLWoERMD f5wIaggWnUzVi8Zz6XyMlzSOnspwtonIWLqyaedViqA3/Q0/dPz/C6rqeUWFJ5uD8e9D dtJFErDh7/dD8qOn79U+bfaGXUhRt62R/mHV+6kYUZ7g+2IuUS2IXrEta0gEI9FM1Qo5 +JfpZaK+cc2ZhF3P1tNy2D4LoP9mn78XS9pqk2bM+K/E6an1GbeKS8s9zjPgqfRhImBB LEPCc1fAmaydliU89e/t7sShkOKwSjXrmDIfaXKE5Il1M6HXP63qneGJ7sUtC+sKVEz+ 0kSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MBFHp1hv; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk22si2709939edb.258.2020.10.28.02.08.40; Wed, 28 Oct 2020 02:09:02 -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=default header.b=MBFHp1hv; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754300AbgJ0OQr (ORCPT + 99 others); Tue, 27 Oct 2020 10:16:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:34360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756394AbgJ0ONC (ORCPT ); Tue, 27 Oct 2020 10:13:02 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B97302076A; Tue, 27 Oct 2020 14:13:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807981; bh=044yO2KzVY6Dp++J6DBnKQi8nbBZOUn+IFx2Q5OAxR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MBFHp1hvBRM1jVDhHaSYWqDLYsqB3FXj0gxGFdJ2Huuzb1by7Rfze/UpYpAS6uxiu 6CyTPbskA/jgZwkwOjDT0RfzRTM3x4mvw/OEiZ5g4Oa1giGo5sWyXhkDolRm99Bj33 9oN14SLX9QALVSAnFE8KwMDxdqWozpgP53oQHQ3Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Tomlinson , Lorenzo Pieralisi , Ray Jui , Sasha Levin Subject: [PATCH 4.14 113/191] PCI: iproc: Set affinity mask on MSI interrupts Date: Tue, 27 Oct 2020 14:49:28 +0100 Message-Id: <20201027134915.146089700@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Tomlinson [ Upstream commit eb7eacaa5b9e4f665bd08d416c8f88e63d2f123c ] 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. Link: https://lore.kernel.org/r/20200803035241.7737-1-mark.tomlinson@alliedtelesis.co.nz Fixes: 3bc2b2348835 ("PCI: iproc: Add iProc PCIe MSI support") Signed-off-by: Mark Tomlinson Signed-off-by: Lorenzo Pieralisi Reviewed-by: Ray Jui Signed-off-by: Sasha Levin --- drivers/pci/host/pcie-iproc-msi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/pci/host/pcie-iproc-msi.c b/drivers/pci/host/pcie-iproc-msi.c index 2d0f535a2f69a..7e6f7b8504d2f 100644 --- a/drivers/pci/host/pcie-iproc-msi.c +++ b/drivers/pci/host/pcie-iproc-msi.c @@ -217,15 +217,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, -- 2.25.1