Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp828392ybl; Tue, 13 Aug 2019 03:19:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMcIFKaUOSsbBTzsOpMrcg7A/ndVS5mnFYdYIeSJvj02xsYLA7V5XqeqA6IYx68Lu8FXLx X-Received: by 2002:a17:90a:7d09:: with SMTP id g9mr1509257pjl.38.1565691566763; Tue, 13 Aug 2019 03:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565691566; cv=none; d=google.com; s=arc-20160816; b=TssHF5icY10W1LxglxUrtOg+VpmdVyVmoXeyuI1ri6/AukWt1eSdZiPJAONkuMYq8J DTyaYm1MAjp6e37FPuad7dXYN15sE62oEWC7FlNef2l8ELjMLVIWR5Vy42YIJIX/2AKB 27tseG/YF2jv2QZucZCqzSrRjq0CA2p1R7jmtXgLVS7onsWrmHcrLwNlddtLFdu0cdnY KFiMFNrB7RSLJ6VeLEO370ASk6kxQpb0dz+ccGgq7cHWenZuUcTyOo6uiRgUZ29ZB8Qc 99PnLg+FI4Qy3bgKx37qC0jo2COLSIfqTqyHbED8/ASo38Bwro2kiUbCZdMkwOdq1nKz HPEQ== 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 :date:cc:to:from:subject:message-id:dkim-signature:dkim-signature; bh=uPJ/tvJ9Cs3flZiURZzPJq2HOgiKJqrdbySl8hZApQw=; b=AyGLGEa3jpzh/xYENaGkIpSR6gHs/7++4Vf0AD9XdPtSsvzQ3KgfNP9WwZot9geNWM feq90c7AnUMYIjBNYvivFk6RYpFhUJKXq+FaSBfh56XdqiMDvxLcKBpfGBlCVUIIAcPP oxQv4Om6VvajvAT6GR6oiWWEpj2+dgIAzupK+rCWb0udl8twTqm2++KCm6zMgaNkvuJR Pg8Ya9YbyMP6fImELq0M5jVoNnZaQYZOe/gt5RgmhcrCfbCvy/wTL+zj/J+u5yzLPcZB xIWIhlllS26VDPzQRZO2ppQu7k2nei3IGAfIdZ/wX3rDo40wTi29GAVXBOni+Yvc0vpb /wpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=tMv7PD0d; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=Ot30WIQF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y16si67736394pgj.169.2019.08.13.03.19.10; Tue, 13 Aug 2019 03:19:26 -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=fail header.i=@hansenpartnership.com header.s=20151216 header.b=tMv7PD0d; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=Ot30WIQF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728576AbfHMKR7 (ORCPT + 99 others); Tue, 13 Aug 2019 06:17:59 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:54800 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727097AbfHMKR7 (ORCPT ); Tue, 13 Aug 2019 06:17:59 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id E95008EE1F3; Tue, 13 Aug 2019 03:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1565691479; bh=0x61KgL+epPE4UqSL9XfER8aosdyl0oQssYuIO7NwOM=; h=Subject:From:To:Cc:Date:From; b=tMv7PD0d08pVBYycgoiVxTDJXXZZnbT/J5PD+KTk/NQtBnAags1//nSBTPcaYl2Wg 5ayjB0eQOr6JI6+KO7ywa01bUft8UQVyS7cMkGIfvktjCxOgmKoqe+ZRYdrxRbIMgh 41evSBSdqZu4+X329lcUP6z/G0g6Vh2Ca637GaWo= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5hD8y0w54OvB; Tue, 13 Aug 2019 03:17:58 -0700 (PDT) Received: from [172.16.180.52] (unknown [217.16.13.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 8A88C8EE1B4; Tue, 13 Aug 2019 03:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1565691478; bh=0x61KgL+epPE4UqSL9XfER8aosdyl0oQssYuIO7NwOM=; h=Subject:From:To:Cc:Date:From; b=Ot30WIQFr11SxLsve0CAtv12Vzo/HJFqLRAM7pOS2JfI+GTxkar3XJdSWRVx3nSfx RDcLh6m6+SMBWrtj7yPzYSQjPF0NaHd3mB/EDVBG26xTQw01xK8MSsDfA9BZDFkGha 7xkKlwc6snPNWUBqc00XK1eY+CicuZPQ+06wT0Hk= Message-ID: <1565691473.3371.4.camel@HansenPartnership.com> Subject: [GIT PULL] SCSI fixes for 5.3-rc4 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Tue, 13 Aug 2019 12:17:53 +0200 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org single lpfc fix, for a single cpu corner case. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: James Smart (1): scsi: lpfc: Fix crash when cpu count is 1 and null irq affinity mask And the diffstat drivers/scsi/lpfc/lpfc_init.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) With full diff below. James --- diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index faf43b1d3dbe..a7549ae32542 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -10776,12 +10776,31 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors) /* This loop sets up all CPUs that are affinitized with a * irq vector assigned to the driver. All affinitized CPUs * will get a link to that vectors IRQ and EQ. + * + * NULL affinity mask handling: + * If irq count is greater than one, log an error message. + * If the null mask is received for the first irq, find the + * first present cpu, and assign the eq index to ensure at + * least one EQ is assigned. */ for (idx = 0; idx < phba->cfg_irq_chann; idx++) { /* Get a CPU mask for all CPUs affinitized to this vector */ maskp = pci_irq_get_affinity(phba->pcidev, idx); - if (!maskp) - continue; + if (!maskp) { + if (phba->cfg_irq_chann > 1) + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "3329 No affinity mask found " + "for vector %d (%d)\n", + idx, phba->cfg_irq_chann); + if (!idx) { + cpu = cpumask_first(cpu_present_mask); + cpup = &phba->sli4_hba.cpu_map[cpu]; + cpup->eq = idx; + cpup->irq = pci_irq_vector(phba->pcidev, idx); + cpup->flag |= LPFC_CPU_FIRST_IRQ; + } + break; + } i = 0; /* Loop through all CPUs associated with vector idx */