From patchwork Tue Aug 9 10:31:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 9270817 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 2F57E60754 for ; Tue, 9 Aug 2016 10:31:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F1C227F80 for ; Tue, 9 Aug 2016 10:31:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13C5027F9C; Tue, 9 Aug 2016 10:31:54 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 C32B127F80 for ; Tue, 9 Aug 2016 10:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932155AbcHIKbv (ORCPT ); Tue, 9 Aug 2016 06:31:51 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33937 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751596AbcHIKbu (ORCPT ); Tue, 9 Aug 2016 06:31:50 -0400 Received: by mail-pf0-f193.google.com with SMTP id g202so685371pfb.1; Tue, 09 Aug 2016 03:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Al8UPK2VWj0+dYMZx4awyP+3ivMKkBnWuoJJI3z+e2Q=; b=Fq/Q6LyJ63iVWS+zgj66Rr4/qsLpjVKsjPnsLtu5OdirxGLDr0Oz8o7tpltTKoUzXE CSTf8Qa4Zg04GNz02jRf2gdhhei7QYYtwzGGRxo/2vEkK0UFMkLpHJIkTpVbesa0kPle AKro18uIjZFrbdHXQdRDGttb3/aCN5Cty3XIbNvIvFakdI/4MqkTNA9eZk+txcgNAIb1 aqM8xGAPrp98RlSqAbmQUqgYktNQse3J+Bn6rMbcVrjDQLz5b8fSXoPu9fhTL7XJciAo 1kOVn4tIWfdJTnVPECuHAwQyGcxB59q47mY98g1vwc7x28iZIqD6gAHHyw1U+oW9EgM+ AcIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Al8UPK2VWj0+dYMZx4awyP+3ivMKkBnWuoJJI3z+e2Q=; b=maohbKEUsuA5iOiqsZ9POKWrxTttqAk9Phdng6Az+uPFm+6vd4RsTGkHO2smPs+zY2 lvln8qbPB+V3H2AvobarfsnE0xBZChULa9+M9Dm1MJTUGExH4iQ1IEhp8/v/PMm+ja/7 nR2w/AM6S1CxgNkpFMWvTtxuNz1CiSpU0jb6Jxh3x1ZMYmVYO7eNUp+Kg+s7hCslidJC JLHv6Mu8QgfdpQWckQGbfmLxdJ7czmJhGs1Iydnl3ebdQGJI0KLzvJ+4AGVDnAtt5iL2 +q1JiddJBEsSkSJYV6Hp4+FMU9DwZWrbaWGH/mvj4BN3pAZs78ieuMupYosLvsBdxaPT +tng== X-Gm-Message-State: AEkoouuB3skXguuOTV2Wh3uqG4+95vLjUosR+Qs6VoWTRROiJdIkh1pTZyTyB0RN0lKZvQ== X-Received: by 10.98.213.130 with SMTP id d124mr171191344pfg.118.1470738709411; Tue, 09 Aug 2016 03:31:49 -0700 (PDT) Received: from localhost.localdomain ([2404:c805:e00:4700:ae22:bff:fe29:e60c]) by smtp.gmail.com with ESMTPSA id uc1sm54998942pac.24.2016.08.09.03.31.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Aug 2016 03:31:48 -0700 (PDT) From: tom.ty89@gmail.com X-Google-Original-From: me To: tj@kernel.org Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, Tom Yan Subject: [PATCH 1/2] libata-scsi: do not call blk_queue_max_hw_sectors() Date: Tue, 9 Aug 2016 18:31:41 +0800 Message-Id: <1dc8fff2418744a7c4bf824f789017228ac15624.1470738284.git.tom.ty89@gmail.com> X-Mailer: git-send-email 2.9.2 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: Tom Yan We should just let the scsi driver (hosts.c) call the function. It has better heuristic anyway (i.e. use SCSI_DEFAULT_MAX_SECTORS as fallback when max_sectors is not set). diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 2bdb5da..495d916 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1204,9 +1204,6 @@ static int ata_scsi_dev_config(struct scsi_device *sdev, if (!ata_id_has_unload(dev->id)) dev->flags |= ATA_DFLAG_NO_UNLOAD; - /* configure max sectors */ - blk_queue_max_hw_sectors(q, dev->max_sectors); - if (dev->class == ATA_DEV_ATAPI) { void *buf;