Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6434283ybh; Thu, 8 Aug 2019 00:00:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAGja7Kq+9R6IksF4ZBfzDno44IxQF8ScDAwYAfIYhujqX7EfAe6t2I8jN0bZbP9fi4c8Z X-Received: by 2002:a17:902:6b81:: with SMTP id p1mr12014681plk.91.1565247631063; Thu, 08 Aug 2019 00:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565247631; cv=none; d=google.com; s=arc-20160816; b=y04n/3ki6gR0fA3QJQkqSI+qR5j5kSmt6L02iL/BuDZJ8Vl+msMChOgO3nwlRuT2Aq VveCEv45NDcGElQR2q3NxiFsoEvBAcRDewXturuq6qG1cLs7flzV+XA61NvyPcnOohcZ sOBbE86DibBPQ982UEiUnSTnkqjQjfFKFvg92UxjcM4x26TUPQe0pMmImbo1iVv9X8Gg LZJsr8+tRJGaob4p7eLJ+pdDPgRcUUNl2jb1rwIwhiL630L1luv9XN5ZKtK8UkDBWP5w 2wLraldkGdXV2dCsqARtkJFzCqnD+hy7Is9Hteg+FT1r9m7JJ9Ln7kDYca16E5MfhlqW snkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=X8IaFASAX4PNtkoNcQqu1RVvB8EK57wuV23coB9N5gQ=; b=omPyJiSoCz65gEmup2duhqdrgwY4DmpMF2yUbxMPLvY4KziVDQh1NjoS+PzGAfLgZG +/tLMFTMpKTinD0SAPC0D4k5GYeGCNEM2MGf6SmazWMRUKJ0asA9fZNOAYUA8DZU0Elv nRyoDeteUqZ2oQ1SLHtDsaTLc78qMMHa7bda9XKxG8he5eANtifVwq3mQATrliVzoaTI aZhRk85Q4v+/M4jSdeUQr4hiDwGxPeTWp6u0PdujpJIE1yzJAPreA7gKOsc47+yhX6Cf KDMCv/5gE2Ls+LHVOB3F0c0MoiKm9BmKAx2FFgDQIXmI/zoMVSKm2d6kDVk109APTRaE 4SjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=LULD5ZqN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l70si51326223pge.446.2019.08.08.00.00.15; Thu, 08 Aug 2019 00:00:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@zytor.com header.s=2019071901 header.b=LULD5ZqN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731201AbfHHGwT (ORCPT + 99 others); Thu, 8 Aug 2019 02:52:19 -0400 Received: from terminus.zytor.com ([198.137.202.136]:55957 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730943AbfHHGwS (ORCPT ); Thu, 8 Aug 2019 02:52:18 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x786q6Y73020017 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 7 Aug 2019 23:52:06 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x786q6Y73020017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1565247126; bh=X8IaFASAX4PNtkoNcQqu1RVvB8EK57wuV23coB9N5gQ=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=LULD5ZqNV0LGTUqip1L9v+3rkGqmFTU063EteFgruRHLHxMovb+LO54AM6qLOGyzE 5afMO1J+CogCvYCpug/3TxOLup+8DDrVjnczHRscTGVDRxLZDhOAsf7pg0j3cnNF0U HddeVwOwONhG61ntvGx3hkI7qBh6/w0xMkhsZuFZM+MhdBaxxFH7dtl93Sru3uBh7d dUCoCg+mKQvR5e+OhNAnbv2au79rDMb6LNajLd0wudspzCr+l+JMtQHL8AC7L8fNz2 hqhjurN4R0aViABSwaflIzVMbxYU00W7qvO54gwgqiWzWByIB0ED0fMO+tbnyqfpe+ FNWntxMMcVydw== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x786q5SC3020014; Wed, 7 Aug 2019 23:52:05 -0700 Date: Wed, 7 Aug 2019 23:52:05 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Ming Lei Message-ID: Cc: linux-kernel@vger.kernel.org, ming.lei@redhat.com, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org Reply-To: ming.lei@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org In-Reply-To: <20190805011906.5020-1-ming.lei@redhat.com> References: <20190805011906.5020-1-ming.lei@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/urgent] genirq/affinity: Create affinity mask for single vector Git-Commit-ID: 491beed3b102b6e6c0e7734200661242226e3933 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 491beed3b102b6e6c0e7734200661242226e3933 Gitweb: https://git.kernel.org/tip/491beed3b102b6e6c0e7734200661242226e3933 Author: Ming Lei AuthorDate: Mon, 5 Aug 2019 09:19:06 +0800 Committer: Thomas Gleixner CommitDate: Thu, 8 Aug 2019 08:47:55 +0200 genirq/affinity: Create affinity mask for single vector Since commit c66d4bd110a1f8 ("genirq/affinity: Add new callback for (re)calculating interrupt sets"), irq_create_affinity_masks() returns NULL in case of single vector. This change has caused regression on some drivers, such as lpfc. The problem is that single vector requests can happen in some generic cases: 1) kdump kernel 2) irq vectors resource is close to exhaustion. If in that situation the affinity mask for a single vector is not created, every caller has to handle the special case. There is no reason why the mask cannot be created, so remove the check for a single vector and create the mask. Fixes: c66d4bd110a1f8 ("genirq/affinity: Add new callback for (re)calculating interrupt sets") Signed-off-by: Ming Lei Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20190805011906.5020-1-ming.lei@redhat.com --- kernel/irq/affinity.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index 4352b08ae48d..6fef48033f96 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -251,11 +251,9 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) * Determine the number of vectors which need interrupt affinities * assigned. If the pre/post request exhausts the available vectors * then nothing to do here except for invoking the calc_sets() - * callback so the device driver can adjust to the situation. If there - * is only a single vector, then managing the queue is pointless as - * well. + * callback so the device driver can adjust to the situation. */ - if (nvecs > 1 && nvecs > affd->pre_vectors + affd->post_vectors) + if (nvecs > affd->pre_vectors + affd->post_vectors) affvecs = nvecs - affd->pre_vectors - affd->post_vectors; else affvecs = 0;