From patchwork Fri Mar 18 08:24:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 8616991 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 039B49F44D for ; Fri, 18 Mar 2016 08:24:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65ADF2026F for ; Fri, 18 Mar 2016 08:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92AC72014A for ; Fri, 18 Mar 2016 08:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751680AbcCRIYX (ORCPT ); Fri, 18 Mar 2016 04:24:23 -0400 Received: from sjc00mx1.hgst.com ([199.255.44.36]:21486 "EHLO sjc00mx1.hgst.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbcCRIYU (ORCPT ); Fri, 18 Mar 2016 04:24:20 -0400 X-IronPort-AV: E=Sophos;i="5.24,354,1455004800"; d="scan'208";a="189105147" Received: from mail-bl2lp0204.outbound.protection.outlook.com (HELO na01-bl2-obe.outbound.protection.outlook.com) ([207.46.163.204]) by sjc00mx1.hgst.com with ESMTP/TLS/AES256-SHA; 18 Mar 2016 01:24:19 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-hgst-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BRQm5+Vp2FSes+rlVa4kLpPIJ9SRu8nXpwtPAOjk0nA=; b=SyH2vvyRoJ4RbVqska9y08j35M6LqNLQPXFCFbH3aN1ftrMx3hx6b4ziqvAPbTcbJG47T0yY6ua5T6cehZVd764xvK+her+tm/+KHYUQGJhNF/lKj0ljy2a4tIycMqW4TtpF2l7ZqspnrDTDrA5kN79Xd0b+xpEUIcsyB4rPiis= Received: from BL2PR04MB1969.namprd04.prod.outlook.com (10.167.97.141) by BL2PR04MB1969.namprd04.prod.outlook.com (10.167.97.141) with Microsoft SMTP Server (TLS) id 15.1.434.16; Fri, 18 Mar 2016 08:24:15 +0000 Received: from BL2PR04MB1969.namprd04.prod.outlook.com ([10.167.97.141]) by BL2PR04MB1969.namprd04.prod.outlook.com ([10.167.97.141]) with mapi id 15.01.0434.020; Fri, 18 Mar 2016 08:24:15 +0000 From: Damien Le Moal To: Hannes Reinecke , "linux-scsi@vger.kernel.org" Subject: Re: [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP Thread-Topic: [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP Thread-Index: AQHRgNGB1oJ5izP8rEuFcr71O3Mk059exdCAgACuh4A= Date: Fri, 18 Mar 2016 08:24:14 +0000 Message-ID: <7B4ED661-DFD7-4347-B652-574E3B180957@hgst.com> References: <0810B2A7-DEA9-417D-8CCF-6A62BEFD9783@hgst.com> <56EBA755.3080603@suse.de> In-Reply-To: <56EBA755.3080603@suse.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/0.0.0.160212 authentication-results: suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=none action=none header.from=hgst.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.47.8] x-ms-office365-filtering-correlation-id: 8bf3244f-b401-4e22-cecf-08d34f06b148 x-microsoft-exchange-diagnostics: 1; BL2PR04MB1969; 5:zD2McBqUpjzdrGtjLKSjj77z997xMPi3oaWZiZgIGMuWraOqtOJqyyS+rdggnojOVm59OzkpNQLo7TWiBmSUdDKv+q3CvyoEI4nzwZYyVe/02Vw9kdip4FCD9kdZqx3CNg2nzi+eTc/pwRiJ12bnoQ==; 24:y35891UpFzFlpeS7vlpwM0j+7TSlSEj8ouIdstHJhKGQ58Ti0JyiFnadMWUHaDNamdWrq+Lm66/ZkFOyECbFOWpDscV0omSXcrAKtq52PYE=; 20:n/dE3jonttXs39bPb9Jnjo4P+MJ1a/u9/PRBBmhc9M2yNPh7efaursH73EgSoTVLSe4LtSSxkE4tGCbC0ijU4hx5bcRc8M5ITjGvfRLqDd5v5kIW6k9+D2gdIhwtS8EGQWSemxZiyEstY309fpoAKO3ectCSrCpUqvkNTLw5gijjCE0N/Dzk+WwyCd+Oo29ShCsuR9emXwoCtSoLx8dMogPzxHxZr9jzJ1Ycy0u2n7x4mjzICso9JQZUtjTjdytr x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR04MB1969; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BL2PR04MB1969; BCL:0; PCL:0; RULEID:; SRVR:BL2PR04MB1969; x-forefront-prvs: 088552DE73 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(24454002)(377424004)(479174004)(377454003)(122556002)(36756003)(2501003)(4001350100001)(5002640100001)(189998001)(99286002)(10400500002)(3846002)(6116002)(102836003)(1220700001)(5004730100002)(5001770100001)(3660700001)(15974865002)(586003)(5008740100001)(50986999)(2900100001)(66066001)(92566002)(83716003)(106116001)(3280700002)(77096005)(86362001)(107886002)(19580395003)(19580405001)(2950100001)(54356999)(76176999)(87936001)(81166005)(11100500001)(82746002)(148743002)(18886075002); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR04MB1969; H:BL2PR04MB1969.namprd04.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2016 08:24:14.9106 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR04MB1969 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 >On 03/18/2016 05:49 AM, Damien Le Moal wrote: >> >> libata: Set longer timeout for SETFEATURES_SPINUP >> >> For SATA drives with power-up in standby (PUIS) feature set, >> SETFEATURES_SPINUP execution may be required to get >> complete IDENTIFY data. However, the timeout used for its >> execution is the same as for all other SETFEATURES commands, >> that is, 5 seconds. This is too short for some disks to complete >> timeout and allow IDENTIFY to return complete data (e.g. >> disks with large indirection tables stored on media), resulting >> in ata_dev_read_id to fail. For this feature, allow a larger >> timeout of 30 seconds. >> >Reviewed-by: Hannes Reinecke > >(BTW, you might want to add your Signed-off-by:, too :-) Hannes, Sorry about this. Here it is... libata: Set longer timeout for SETFEATURES_SPINUP For SATA drives with power-up in standby (PUIS) feature set, SETFEATURES_SPINUP execution may be required to get complete IDENTIFY data. However, the timeout used for its execution is the same as for all other SETFEATURES commands, that is, 5 seconds. This is too short for some disks to complete spinup and allow IDENTIFY to return complete data (e.g. disks with large indirection tables stored on media), resulting in ata_dev_read_id to fail. For this feature, allow a larger timeout of 30 seconds. Signed-off-by: Damien Le Moal ------------------------ Damien Le Moal, Ph.D. Sr. Manager, System Software Group, HGST Research, HGST, a Western Digital company Damien.LeMoal@hgst.com (+81) 0466-98-3593 (ext. 513593) 1 kirihara-cho, Fujisawa, Kanagawa, 252-0888 Japan www.hgst.com Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer: This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system. diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e83fc3d..ecbbee2 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4537,7 +4537,8 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature) tf.protocol = ATA_PROT_NODATA; tf.nsect = feature; - err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); + err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, + enable == SETFEATURES_SPINUP ? SETFEATURES_SPINUP_TIMEOUT : 0); DPRINTK("EXIT, err_mask=%x\n", err_mask); return err_mask; diff --git a/include/linux/ata.h b/include/linux/ata.h index fed3641..e3a9ab6 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -371,6 +371,7 @@ enum { SETFEATURES_AAM_OFF = 0xC2, SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ + SETFEATURES_SPINUP_TIMEOUT = 30000, SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */ SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */