From patchwork Mon May 7 06:57:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10383305 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 7185A60159 for ; Mon, 7 May 2018 06:57:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 669AA28B36 for ; Mon, 7 May 2018 06:57:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AE5028B3D; Mon, 7 May 2018 06:57:39 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, 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 134EF28B36 for ; Mon, 7 May 2018 06:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751042AbeEGG50 (ORCPT ); Mon, 7 May 2018 02:57:26 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43010 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbeEGG5Z (ORCPT ); Mon, 7 May 2018 02:57:25 -0400 Received: by mail-pf0-f193.google.com with SMTP id j20so7784122pff.10 for ; Sun, 06 May 2018 23:57:24 -0700 (PDT) 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=0PTcSPbWhO3SFIZCWLzmAdNO89neWxdurkpilxIj89o=; b=FHyxZ1bOL7td5iVH8fWOOYQwbeKUz7jiwcI53DwIMjqhr76kT+BPJ9hfaJxo3YfYbh QdcgO9vpRqm3XfdgjjlPagDFt1DTYbzEmVXKOsysWqmV3RghFueI0GVVlRamsSisxDgp e41JsoPRz/UYtiVDNJcirct6tavWtyrc4nF1+0RW/A3Pm/Ha1HaeELK6U9o7e/cL+5im 4jPgkd3EzfPJ/6txUdZgzN5FapByBS4Ga43+0Ukeaqy7rjfn4giLruwvbb9KMy4VRBzS Di9GlljfC5e+EEt92Xs3usHEmx9NkhPixHWjSE78hjnESzrdBgRrJd4WKF8MBU6NpVkQ cFNg== 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=0PTcSPbWhO3SFIZCWLzmAdNO89neWxdurkpilxIj89o=; b=XihLdrx8694UQg8NtJqlnTUHU4mzK7XMm2KBIZqcQ8moGlKi6ha6mKcXmZyoG2HAxL bt7VUB+hD2DXql58RewFPpSsEFgDRzTaK72Befo0af8uzb6uFitEu6DJiMtXyVapHorR wWrvIxL3oR2eU6YzaHzuLtkJomNMmZO3KC997PRak5mCxPNRiKYHSousmqZQ25q3HoWd MEHtIFfHfM7PSarNCTWOdF+urogd163hs6hdRppqgDZ5ZakjVOV0dwzyInW6xWrYQPQv /w9l8B5YWl4D7Jt8Pq00+G5FK74voGCS2c7RjMGtvaalVstQVSSwcvHgXgTK05GW4XfV YAhA== X-Gm-Message-State: ALQs6tB5nFKZYDtUWJOqsHmk/hvfKwcX4gnUyu7cZbFM5T8reK0cVVUo iDYv/0pQgWkY63X/FkEzOaWAzg== X-Google-Smtp-Source: AB8JxZoKW6qh9L+SJV0D8wOuc1FUNIDvFaaukH5wKDuG4eKh6+dP59hstEmPdYwqWqjgC599hmjn6A== X-Received: by 2002:a65:48c9:: with SMTP id o9-v6mr28396180pgs.390.1525676244643; Sun, 06 May 2018 23:57:24 -0700 (PDT) Received: from [192.168.0.101] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id c7sm53700567pfg.81.2018.05.06.23.57.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 May 2018 23:57:23 -0700 (PDT) Subject: [PATCH 2/3] scsi: arcmsr: Add slave_configure callback function to set device command timeout value From: Ching Huang To: martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dan.carpenter@oracle.com, hch@infradead.org, colin.king@canonical.com Date: Mon, 07 May 2018 14:57:16 +0800 Message-ID: <1525676236.8876.18.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 slave_configure callback function to set device command timeout value Signed-off-by: Ching Huang diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index f6ddaec..79a4487 100755 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -139,6 +139,7 @@ static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb); static void arcmsr_free_irq(struct pci_dev *, struct AdapterControlBlock *); static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb); static void arcmsr_set_iop_datetime(struct timer_list *); +static int arcmsr_slave_config(struct scsi_device *sdev); static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev, int queue_depth) { if (queue_depth > ARCMSR_MAX_CMD_PERLUN) @@ -154,6 +155,7 @@ static struct scsi_host_template arcmsr_scsi_host_template = { .eh_abort_handler = arcmsr_abort, .eh_bus_reset_handler = arcmsr_bus_reset, .bios_param = arcmsr_bios_param, + .slave_configure = arcmsr_slave_config, .change_queue_depth = arcmsr_adjust_disk_queue_depth, .can_queue = ARCMSR_DEFAULT_OUTSTANDING_CMD, .this_id = ARCMSR_SCSI_INITIATOR_ID, @@ -3033,6 +3035,17 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, static DEF_SCSI_QCMD(arcmsr_queue_command) +static int arcmsr_slave_config(struct scsi_device *sdev) +{ + unsigned int dev_timeout; + + dev_timeout = sdev->request_queue->rq_timeout; + if ((cmd_timeout > 0) && ((cmd_timeout * HZ) > dev_timeout)) + blk_queue_rq_timeout(sdev->request_queue, cmd_timeout * HZ); + arcmsr_adjust_disk_queue_depth(sdev, cmd_per_lun); + return 0; +} + static void arcmsr_get_adapter_config(struct AdapterControlBlock *pACB, uint32_t *rwbuffer) { int count;