From patchwork Mon Jun 1 17:26:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Henzl X-Patchwork-Id: 6523861 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 76CF39F444 for ; Mon, 1 Jun 2015 17:27:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9ACCD204E7 for ; Mon, 1 Jun 2015 17:27:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D02E204EB for ; Mon, 1 Jun 2015 17:27:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674AbbFAR1F (ORCPT ); Mon, 1 Jun 2015 13:27:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44207 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752807AbbFAR0t (ORCPT ); Mon, 1 Jun 2015 13:26:49 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 5C80338DC97; Mon, 1 Jun 2015 17:26:48 +0000 (UTC) Received: from localhost.localdomain.com (vpn1-6-230.ams2.redhat.com [10.36.6.230]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t51HQk74009635; Mon, 1 Jun 2015 13:26:47 -0400 From: Tomas Henzl To: linux-scsi@vger.kernel.org Cc: kashyap.desai@avagotech.com, Sumit.Saxena@avagotech.com Subject: [PATCH] regression, megaraid - fix irq setup process Date: Mon, 1 Jun 2015 19:26:45 +0200 Message-Id: <1433179605-31821-1-git-send-email-thenzl@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes a regression caused by commit d3557fc8be11d25f316884581f487684f8e7dad3 megaraid_sas : Add separate function for setting up IRQs This makes boot end with 'root does not exist' message on certain adapters. The bug is that the driver does not setup ints for cards without msi-x support. This patch fixes it, in addition to that it moves irq-enable call after tasklet initialisation - otherwise a kernel panic may occur, when an int arrives before the tasklet is ready. Signed-off-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_base.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index a022c39153..3771d6fff5 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -4619,18 +4619,16 @@ static int megasas_init_fw(struct megasas_instance *instance) instance->msix_vectors = i; else instance->msix_vectors = 0; + } - dev_info(&instance->pdev->dev, - "firmware supports msix\t: (%d)", fw_msix_count); - dev_info(&instance->pdev->dev, - "current msix/online cpus\t: (%d/%d)\n", - instance->msix_vectors, (unsigned int)num_online_cpus()); + dev_info(&instance->pdev->dev, "firmware supports msix\t: (%d)", + fw_msix_count); + dev_info(&instance->pdev->dev, "current msix/online cpus\t: (%d/%d)\n", + instance->msix_vectors, (unsigned int)num_online_cpus()); - if (instance->msix_vectors ? - megasas_setup_irqs_msix(instance, 1) : - megasas_setup_irqs_ioapic(instance)) - goto fail_setup_irqs; - } + if (instance->msix_vectors ? megasas_setup_irqs_msix(instance, 1) : + megasas_setup_irqs_ioapic(instance)) + goto fail_setup_irqs; instance->ctrl_info = kzalloc(sizeof(struct megasas_ctrl_info), GFP_KERNEL); @@ -4646,8 +4644,6 @@ static int megasas_init_fw(struct megasas_instance *instance) /* Get operational params, sge flags, send init cmd to controller */ if (instance->instancet->init_adapter(instance)) goto fail_init_adapter; - instance->instancet->enable_intr(instance); - printk(KERN_ERR "megasas: INIT adapter done\n"); /** for passthrough @@ -4769,6 +4765,8 @@ static int megasas_init_fw(struct megasas_instance *instance) tasklet_init(&instance->isr_tasklet, instance->instancet->tasklet, (unsigned long)instance); + instance->instancet->enable_intr(instance); + /* Launch SR-IOV heartbeat timer */ if (instance->requestorId) { if (!megasas_sriov_start_heartbeat(instance, 1))