Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1063561ybl; Wed, 14 Aug 2019 10:07:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTR3w85BUdOZrfpTnv1cgIxm2PxGc9ApxGOOBnCrd7fZ6StWq7dRVRiXLCX7jOJP7kMw6E X-Received: by 2002:a17:90b:f13:: with SMTP id br19mr709652pjb.124.1565802451770; Wed, 14 Aug 2019 10:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802451; cv=none; d=google.com; s=arc-20160816; b=qHl+0iZhVazzCel8Pnt3sHQ067XyVr4WtQpZPQJj+FZHREZWke8dR3tcBB5D5gbyXB U3sMvrv3w+H+tI7WWc44efELEFdsM3WdpPvgUGRAQznvqwZ9zQcA0ELILa9mgKPO77to jDzBfVDHzleveVc2LKe8iM2j8Q7sS9QVtLfjWTG/DL+FgdKrtGgQDZkhvfeQ2blKojUs VVveiaR4Se+026k+HWxDtJ9rbFixb/Zk6xYX57j5RgghVS1QAqkHPYL3UcXPyBoHbDXG Ni7nvNaNsjbrD85B4l37mLhVBGrxApuIgs/AiswVsupZWZ2lJoM18Gy1XCX/O+W6NY5T 9v/g== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ROahbhgsKE+Fcus5bwR/GRlM9vHSiZi88+N/ciS+78g=; b=fHpJyamUwqe1rduwZUMs2FUmJnHv0KRX8kYZhtgw+MHkf0pnMQiVdE+RrQyAp25nV/ E4QnU7veOwn23eUssIFww241opOAUbltj4ly26IaiKv5Go8fBUNNRTpRjr+XyN5UCVwk Fumg2XAbx0uztjcjKcel0DKNZ1qljhaIkn5IUDfn1C1jdie17evckEJfcv563RUVctpP Jar+NP+UT6nyGgsCho+lotsTeRRukJLDIJuWqHtZYzRe2FXFSrDZc4fpjtjEltCYt/LY QMWpDY82qfehRTuv+OHF/FfvSQziPSzCDX/fckOyqR74H/pS9I1iqtnPWD2E3dCxqBDh pKBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KpvMPPlv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9si206651pjv.37.2019.08.14.10.07.15; Wed, 14 Aug 2019 10:07: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=@kernel.org header.s=default header.b=KpvMPPlv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729283AbfHNREj (ORCPT + 99 others); Wed, 14 Aug 2019 13:04:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:53434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729253AbfHNREe (ORCPT ); Wed, 14 Aug 2019 13:04:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 765B1214DA; Wed, 14 Aug 2019 17:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802273; bh=LPfPacdqzNLUM0fy/JrApmF/4SQTkvNzeA5k+KvbKKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KpvMPPlvGZoxiMDaPCZoJQinVJvrWYDuIUyVDTzxzL3LntyikZbEq1kHYIWqmxcEp u6xcMJKQTXGI6ssq6EXubBYpJSrg13u7pSVz50wZzCnQw3KCP4p+mKYPalaQWyHIR+ OJDAj4mILNLfKWjaxsOfK32/g+TSu8VRYtUaagqM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ming Lei , Thomas Gleixner Subject: [PATCH 5.2 036/144] genirq/affinity: Create affinity mask for single vector Date: Wed, 14 Aug 2019 18:59:52 +0200 Message-Id: <20190814165801.335390862@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ming Lei commit 491beed3b102b6e6c0e7734200661242226e3933 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- kernel/irq/affinity.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -253,11 +253,9 @@ irq_create_affinity_masks(unsigned int n * 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;