From patchwork Tue Jun 2 10:39:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 6528171 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8E1A9C0020 for ; Tue, 2 Jun 2015 10:40:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 993482041A for ; Tue, 2 Jun 2015 10:40:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 889C2204AE for ; Tue, 2 Jun 2015 10:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755725AbbFBKkJ (ORCPT ); Tue, 2 Jun 2015 06:40:09 -0400 Received: from mail-bn1blp0187.outbound.protection.outlook.com ([207.46.163.187]:63408 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755048AbbFBKkD (ORCPT ); Tue, 2 Jun 2015 06:40:03 -0400 Received: from SN1PR0701CA0081.namprd07.prod.outlook.com (25.163.126.49) by CO2PR0701MB1062.namprd07.prod.outlook.com (25.160.8.141) with Microsoft SMTP Server (TLS) id 15.1.172.22; Tue, 2 Jun 2015 10:40:00 +0000 Received: from BN1BFFO11FD010.protection.gbl (2a01:111:f400:7c10::1:174) by SN1PR0701CA0081.outlook.office365.com (2a01:111:e400:52fd::49) with Microsoft SMTP Server (TLS) id 15.1.184.17 via Frontend Transport; Tue, 2 Jun 2015 10:39:59 +0000 Authentication-Results: spf=softfail (sender IP is 192.19.192.197) smtp.mailfrom=avagotech.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning avagotech.com discourages use of 192.19.192.197 as permitted sender) Received: from PALEXCH12.lsi.com (192.19.192.197) by BN1BFFO11FD010.mail.protection.outlook.com (10.58.144.73) with Microsoft SMTP Server (TLS) id 15.1.184.11 via Frontend Transport; Tue, 2 Jun 2015 10:39:59 +0000 Received: from palmhbs0.lsi.com (128.94.222.181) by PALEXCH12-EXT.lsi.com (128.94.222.103) with Microsoft SMTP Server id 14.3.158.1; Tue, 2 Jun 2015 06:39:58 -0400 Received: from localhost (dhcp-135-24-192-107.lsi.com [135.24.192.107]) by palmhbs0.lsi.com (8.13.8/8.12.11) with ESMTP id t52Ah6Cb032634; Tue, 2 Jun 2015 06:43:18 -0400 From: Message-ID: <201506021043.t52Ah6Cb032634@palmhbs0.lsi.com> Date: Tue, 2 Jun 2015 16:09:46 +0530 To: Subject: [PATCH v2] regression, megaraid - fix irq setup process CC: User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD010; 1:EqkjqOfI0ktl2eT3ppK00X/+R5V4tVqJyicO0UOLMgaoVI70Utgtp4neK2Gb7NIzG1/WANW8YyeOS10eWDbYYFuPA0MRumamIQCVQOgyiYO3vd3Qkvp6IhEstKsXolRlsLpGfBvDfispq6V+ng9/ymsTu22t0RGbjJelyABk7/yXJoE4wrkjngie2EW+YxNTUReHEfT8buhkyM3kepX3rwVFZnKR4nn2uAFas/UgNVdLCHo4dkaO2aD42G7J8OA9aMpmRnE2+NztJtMmhl6Slw== X-Forefront-Antispam-Report: CIP:192.19.192.197; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(50986999)(54356999)(16796002)(6806004)(229853001)(106466001)(2351001)(83506001)(97756001)(87936001)(26826002)(86152002)(64706001)(46102003)(47776003)(19580395003)(86362001)(62966003)(4001350100001)(77156002)(19580405001)(23726002)(50466002)(105596002)(76506005)(57986006)(4001540100001)(6550400002)(92566002)(5001860100001)(110136002)(5001830100001)(2220100001)(189998001)(46406003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR0701MB1062; H:PALEXCH12.lsi.com; FPR:; SPF:SoftFail; PTR:palexch12.lsi.com; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR0701MB1062; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520003)(3002001); SRVR:CO2PR0701MB1062; BCL:0; PCL:0; RULEID:; SRVR:CO2PR0701MB1062; X-Forefront-PRVS: 05954A7C45 X-OriginatorOrg: lsicorp.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2015 10:39:59.5255 (UTC) X-MS-Exchange-CrossTenant-Id: 33102e38-078a-4484-9fb5-731e8b59db69 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=33102e38-078a-4484-9fb5-731e8b59db69; Ip=[192.19.192.197]; Helo=[PALEXCH12.lsi.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR0701MB1062 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=ham 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 From:Tomas Henzl 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 tasklet initialisation before enable_intr, otherwise a kernel panic may occur, when an interrupt arrives before the tasklet is ready. Signed-off-by: Tomas Henzl Signed-off-by: Sumit Saxena --- -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index a022c39..da26ac4 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -4619,18 +4619,18 @@ 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,6 +4646,10 @@ 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; + + tasklet_init(&instance->isr_tasklet, instance->instancet->tasklet, + (unsigned long)instance); + instance->instancet->enable_intr(instance); printk(KERN_ERR "megasas: INIT adapter done\n"); @@ -4762,12 +4766,6 @@ static int megasas_init_fw(struct megasas_instance *instance) instance->throttlequeuedepth = MEGASAS_THROTTLE_QUEUE_DEPTH; - /* - * Setup tasklet for cmd completion - */ - - tasklet_init(&instance->isr_tasklet, instance->instancet->tasklet, - (unsigned long)instance); /* Launch SR-IOV heartbeat timer */ if (instance->requestorId) {