From patchwork Tue Dec 5 01:57:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10092587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0B11F60348 for ; Tue, 5 Dec 2017 09:57:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4E8129482 for ; Tue, 5 Dec 2017 09:57:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D939829487; Tue, 5 Dec 2017 09:57:36 +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=-5.4 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,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 5FCB129482 for ; Tue, 5 Dec 2017 09:57:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753242AbdLEJ5e (ORCPT ); Tue, 5 Dec 2017 04:57:34 -0500 Received: from mail-it0-f51.google.com ([209.85.214.51]:39442 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752900AbdLEJ5c (ORCPT ); Tue, 5 Dec 2017 04:57:32 -0500 Received: by mail-it0-f51.google.com with SMTP id 68so135524ite.4 for ; Tue, 05 Dec 2017 01:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=areca-com-tw.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:date:message-id:mime-version :content-transfer-encoding; bh=gZRw87OG6XLGYhYJ4ZVJUevYZqgeR1awnWFbLZdaM1g=; b=Pg4AbmHJFE17swSchIuTHGe2VOhEJ46ZZaA4TAvZLKvzW45iYpDr3WbquatGq6cBCM qEri0LxcTuNnCMkDRC/d5HVr6QVQVRTEcIm24RgtO2CW2wRBsFpSbaxSxPCR9xV5EK1J WliEvM/vCyuYuSXbCFtrttuIqFwWNrj15u3MX19yO1hNgejNGZL2BHq2JlOtKYGUEpw/ 9y1jQPu/N21incw35HM/P9JURBCdwwb4tDO2JPLdjUiqWpY65KBX5ZSw3O1HaZ7lO3db III98rNSkUWCunU0WlNbYndkHNTJ//6Beew/y9oqDT95ecymuRWMuQCgfzKEcpe7Ox5P mnAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:mime-version :content-transfer-encoding; bh=gZRw87OG6XLGYhYJ4ZVJUevYZqgeR1awnWFbLZdaM1g=; b=pb51OV/gwuHzMsjgZSImapN2q3hZyKBR9KvLTaT/r05yqDT/Oq9+OmlFRLhVwsI9dV /96w7JYu/fIJSOaHynH+h2VqVUEIarnu/oeMq3w/dH3fj+s+h2BDQhYYJlun2xIvkXlv 5V6SYilDYs+CwpU8sc+4JvvhM59+CvI9Zf3v7qmAxT/vziRoCd5pqdiaui0sxjktnayf gy67BsgDznIlj7WFPxHKgpVj6Dq2vxdIECGy3lUwMVV8SLM+KRTHzcxdV2lN4KWl68qw Kwgd0r72RFl706fN/myxplCcAzN6xpZqapt89/aeSwUiizZsLnOyEOSd9BMaVH/upaNA M9pg== X-Gm-Message-State: AJaThX5xouIxfAagf8a+MpVNEpztSHJH2xLE5HcpDvcd0Cc31YPNSJQ9 a7u52T1rqtY+jT/7EQsxJ2U/7Q== X-Google-Smtp-Source: AGs4zMZbF2q438R2Dtwd2FDpJmsVYkh8N+rO2jcfVPw7331BZTPohB9iiCkbhur3ucvootrasr7cPQ== X-Received: by 10.36.83.20 with SMTP id n20mr16477479itb.76.1512467851391; Tue, 05 Dec 2017 01:57:31 -0800 (PST) Received: from [192.168.0.105] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id 137sm13739itb.42.2017.12.05.01.57.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 01:57:30 -0800 (PST) Subject: [PATCH 9/17] scsi: arcmsr: add ACB_F_MSG_GET_CONFIG to acb->acb_flags for for message interrupt checking before schedule work for get device map From: Ching Huang To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: James.Bottomley@HansenPartnership.com, sfr@canb.auug.org.au Date: Tue, 05 Dec 2017 09:57:23 +0800 Message-ID: <1512439043.4577.57.camel@Centos6.3-64> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-37.el6) 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 From: Ching Huang add ACB_F_MSG_GET_CONFIG to acb->acb_flags for for message interrupt checking before schedule work for get device map Signed-off-by: Ching Huang diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2017-12-05 15:26:32.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr.h 2017-12-05 15:27:04.000000000 +0800 @@ -782,6 +782,7 @@ struct AdapterControlBlock /* iop init */ #define ACB_F_ABORT 0x0200 #define ACB_F_FIRMWARE_TRAP 0x0400 + #define ACB_F_MSG_GET_CONFIG 0x1000 struct CommandControlBlock * pccb_pool[ARCMSR_MAX_FREECCB_NUM]; /* used for memory free */ struct list_head ccb_free_list; diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2017-12-05 11:46:18.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2017-12-05 11:46:06.000000000 +0800 @@ -743,6 +743,7 @@ static void arcmsr_message_isr_bh_fn(str struct scsi_device *psdev; char diff, temp; + acb->acb_flags &= ~ACB_F_MSG_GET_CONFIG; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { struct MessageUnit_A __iomem *reg = acb->pmuA; @@ -2328,7 +2329,8 @@ static void arcmsr_hbaA_message_isr(stru struct MessageUnit_A __iomem *reg = acb->pmuA; /*clear interrupt and message state*/ writel(ARCMSR_MU_OUTBOUND_MESSAGE0_INT, ®->outbound_intstatus); - schedule_work(&acb->arcmsr_do_message_isr_bh); + if (acb->acb_flags & ACB_F_MSG_GET_CONFIG) + schedule_work(&acb->arcmsr_do_message_isr_bh); } static void arcmsr_hbaB_message_isr(struct AdapterControlBlock *acb) { @@ -2336,7 +2338,8 @@ static void arcmsr_hbaB_message_isr(stru /*clear interrupt and message state*/ writel(ARCMSR_MESSAGE_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); - schedule_work(&acb->arcmsr_do_message_isr_bh); + if (acb->acb_flags & ACB_F_MSG_GET_CONFIG) + schedule_work(&acb->arcmsr_do_message_isr_bh); } /* ********************************************************************************** @@ -2352,7 +2355,8 @@ static void arcmsr_hbaC_message_isr(stru struct MessageUnit_C __iomem *reg = acb->pmuC; /*clear interrupt and message state*/ writel(ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR, ®->outbound_doorbell_clear); - schedule_work(&acb->arcmsr_do_message_isr_bh); + if (acb->acb_flags & ACB_F_MSG_GET_CONFIG) + schedule_work(&acb->arcmsr_do_message_isr_bh); } static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb) @@ -2361,7 +2365,8 @@ static void arcmsr_hbaD_message_isr(stru writel(ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE, reg->outbound_doorbell); readl(reg->outbound_doorbell); - schedule_work(&acb->arcmsr_do_message_isr_bh); + if (acb->acb_flags & ACB_F_MSG_GET_CONFIG) + schedule_work(&acb->arcmsr_do_message_isr_bh); } static void arcmsr_hbaE_message_isr(struct AdapterControlBlock *acb) @@ -2369,7 +2374,8 @@ static void arcmsr_hbaE_message_isr(stru struct MessageUnit_E __iomem *reg = acb->pmuE; writel(0, ®->host_int_status); - schedule_work(&acb->arcmsr_do_message_isr_bh); + if (acb->acb_flags & ACB_F_MSG_GET_CONFIG) + schedule_work(&acb->arcmsr_do_message_isr_bh); } static int arcmsr_hbaA_handle_isr(struct AdapterControlBlock *acb) @@ -3826,6 +3832,7 @@ static void arcmsr_hbaA_request_device_m return; } writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); + acb->acb_flags |= ACB_F_MSG_GET_CONFIG; mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); } return; @@ -3848,6 +3855,7 @@ static void arcmsr_hbaB_request_device_m return; } writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell); + acb->acb_flags |= ACB_F_MSG_GET_CONFIG; mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); } return; @@ -3871,6 +3879,7 @@ static void arcmsr_hbaC_request_device_m } writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); + acb->acb_flags |= ACB_F_MSG_GET_CONFIG; mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); } return; @@ -3900,6 +3909,7 @@ static void arcmsr_hbaD_request_device_m } writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, reg->inbound_msgaddr0); + acb->acb_flags |= ACB_F_MSG_GET_CONFIG; mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); } @@ -3930,6 +3940,7 @@ static void arcmsr_hbaE_request_device_m writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; writel(acb->out_doorbell, ®->iobound_doorbell); + acb->acb_flags |= ACB_F_MSG_GET_CONFIG; mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); }