From patchwork Tue Dec 5 01:51:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10092579 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 2054560348 for ; Tue, 5 Dec 2017 09:52:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03E9F29482 for ; Tue, 5 Dec 2017 09:52:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECE6429487; Tue, 5 Dec 2017 09:51:59 +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=unavailable 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 7DC3D29482 for ; Tue, 5 Dec 2017 09:51:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753068AbdLEJvj (ORCPT ); Tue, 5 Dec 2017 04:51:39 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:43655 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752971AbdLEJvg (ORCPT ); Tue, 5 Dec 2017 04:51:36 -0500 Received: by mail-it0-f67.google.com with SMTP id u62so130177ita.2 for ; Tue, 05 Dec 2017 01:51:36 -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=iaE4dzT9Xj7Ihcs2JZYe6uxIqdEyT0TuYhdm0AVLHF8=; b=tjQK9c5fZP0QkMTE7m8Re2OhSXYzrEJpz04exDjW38ly1rqswDFpoEwqQWTYQFqCBf DfgEoSn8B4kI7JII1LZrokPKBrv3cv1ggq6M6IUXaHS4dGmzqMKZ0SjzRBM9HBvyjjkh 6wW7HUY3W90RWlYMEI6wYPP+qEnQOVcpB51UfHe4k7/6dsSY8SCe//ew1r+wbMEHPMfh FC2/ImMcQWiOgNyppBB4fVW+NkqDB1+/XY2+r6/yqWhORX6suU4TMaSQ3DFR80YNKBM3 AaTR9QtAe8pZjaZT8Cx7lrkOnHusw5A+2jK44StpGKqPehB7R6q12Jn7vUEOExW5VU3c jUTA== 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=iaE4dzT9Xj7Ihcs2JZYe6uxIqdEyT0TuYhdm0AVLHF8=; b=jwE/sVVbQZi1wzCHpqk3k+YUQ9k5/5bkHvonpEOR7ZbawUQb9HmdGWLcDPM1by/X6A lpzF+3By2jEz3+maLUxL2LTV+UMV3md9LdCPV30aBc2muXB2xU/a8YCiKg8bbP6X12ed lCt72Rqv9MF6Ga/vr2b1b3c0pzWP+54lOegFuufa+wUfwzwqcyOGRcAcTanms7MtxDRb lwe4kitImtClg2B4aWxZ2fFNfNtcs3sHj/oM1FesWuRuPSOfFQ1x35gLoL3s9XQFiQgp 1At/vQ/TBVoRzX5hwpM+FxISCHiSsyDRHIm9KbAEdgB18xLqkP4hk4NWk1NpsXyrEyKK 34Vg== X-Gm-Message-State: AJaThX7IiyEBFVA+ijZ/hQmOeslFhr2TrFbKoeW+s5JMndHUojDszeXo xqYv4HBtMPseZqWJA+dVxIJ1sg== X-Google-Smtp-Source: AGs4zMbK461/gVzlnjdyn0J9O+j9djqnmjLDwpRol+Oe01S2hdwdWPSlCJL+EhU8O2us2eUIVRYEfg== X-Received: by 10.107.129.35 with SMTP id c35mr27961520iod.258.1512467496107; Tue, 05 Dec 2017 01:51:36 -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 o73sm4908446ito.4.2017.12.05.01.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 01:51:35 -0800 (PST) Subject: [PATCH 7/17] scsi: arcmsr: replace constant ARCMSR_MAX_OUTSTANDING_CMD by variable acb->maxOutstanding that was determined by user 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:51:27 +0800 Message-ID: <1512438687.4577.52.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 replace constant ARCMSR_MAX_OUTSTANDING_CMD by variable acb->maxOutstanding that was determined by user Signed-off-by: Ching Huang 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:50.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2017-12-05 11:46:30.000000000 +0800 @@ -1315,7 +1315,7 @@ static void arcmsr_done4abort_postqueue( /*clear and abort all outbound posted Q*/ writel(outbound_intstatus, ®->outbound_intstatus);/*clear interrupt*/ while(((flag_ccb = readl(®->outbound_queueport)) != 0xFFFFFFFF) - && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { + && (i++ < acb->maxOutstanding)) { pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));/*frame must be 32 bytes aligned*/ pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb); error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false; @@ -1345,7 +1345,7 @@ static void arcmsr_done4abort_postqueue( break; case ACB_ADAPTER_TYPE_C: { struct MessageUnit_C __iomem *reg = acb->pmuC; - while ((readl(®->host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { + while ((readl(®->host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < acb->maxOutstanding)) { /*need to do*/ flag_ccb = readl(®->outbound_queueport_low); ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); @@ -1421,7 +1421,7 @@ static void arcmsr_remove(struct pci_dev acb->acb_flags |= ACB_F_SCSISTOPADAPTER; acb->acb_flags &= ~ACB_F_IOP_INITED; - for (poll_count = 0; poll_count < ARCMSR_MAX_OUTSTANDING_CMD; poll_count++){ + for (poll_count = 0; poll_count < acb->maxOutstanding; poll_count++){ if (!atomic_read(&acb->ccboutstandingcount)) break; arcmsr_interrupt(acb);/* FIXME: need spinlock */