From patchwork Tue Aug 13 10:17:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 11091665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5085B1398 for ; Tue, 13 Aug 2019 10:18:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B5FB285EB for ; Tue, 13 Aug 2019 10:18:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B474285F1; Tue, 13 Aug 2019 10:18:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 059D0285EB for ; Tue, 13 Aug 2019 10:18:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728410AbfHMKR7 (ORCPT ); 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 X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 */