Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10421973ybi; Wed, 24 Jul 2019 22:56:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCKX+HmyOCezYIPrI/ha6yvR2xyfSlQBTaXJBmKyeVU4sGiCiZ+lXrj/6nwFU1tLPuoY9O X-Received: by 2002:aa7:93a8:: with SMTP id x8mr15417268pff.49.1564034204594; Wed, 24 Jul 2019 22:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034204; cv=none; d=google.com; s=arc-20160816; b=Iexu15HrXdyPV9Y85nnRuYj95FdQxWSYB52P/Fy/xh03qUEjn4U8cZ+0EcVUV9Wkmj 7S3dUwOmvatReu2pRofwgNUdKwtrcCapt5Xtp+sF2vg6l3oJqBpged0gXxC4kz6TZm7y IxKOApVFwQU1m7YAsuHifRA1gbvQPgu+lH948mwMeWL7BLSxMmQ1sndl3vAm7RZxG1OG LP9W6SrSMmF2TWb1SRQf5pWjeVJJwO16rnGl0Hj9xmVoyWq7r220o6njcE7/BS3b3Z/b oFcAAjUrdVoWEDwGeeswoIZ3Q2/XcTTp55SbxoohToFWvUAwz1sLNEytmaWAZo91TU+4 3gKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0tZwABtTebLVl7n2rTFjtypUjxnzV12M2QhPpvhG4dA=; b=yFOELmV9ZWWX0Gf2CroD6OYfjpsQe1HdToJph3GunehoAiwQ4utPjrbvZYz96M2SKv rRmKQVMvVvRodW0mAbnAto0FAgrgegS3sly6HFQDmnRuaog27RoVcSOTecRZ5CTT/O1t jYXCeOpFx22FYKI24zflVx3JgCQQBg/LgjxSFVijUQ7i8xFqCwRW+YkNs7RIUpVPcimn SE3S2lvncePBOAsaE+jq8qBFpPtPLJakxZRPERCQU6REn4otBHLMbeVZnk5LvwUZOzMd OqAKEhqeiK0pzxZDxw9SCOnXDmuXQ/qFp9ZEndMcONTx5yCGfAKN5r/sfkAiOlMgK18b 2b6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QBSGaNWW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si15265204plb.20.2019.07.24.22.56.30; Wed, 24 Jul 2019 22:56:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QBSGaNWW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404094AbfGYFjd (ORCPT + 99 others); Thu, 25 Jul 2019 01:39:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404050AbfGYFj3 (ORCPT ); Thu, 25 Jul 2019 01:39:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4154422C7C; Thu, 25 Jul 2019 05:39:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033168; bh=/buIL5Dy76vjXaqEV9HtE3MekR1LN3sN8RMpqKcVehk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QBSGaNWWd0NKerKAIZLcsv41OhlhtC8ModawagH3Ps9SCuEPrHtyZ5upZ4PAwluiz /2nBoIPTkLcT6wh2pXVh74hChw6y2itsrCPE0xJOlr/ZinVslVhpTz4ynCGQlCv7u0 SZsD2aIZhmLyI3Q5GA1eyVQEfzYzMXn23Cma7GDM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hannes Reinecke , Masato Suzuki , Damien Le Moal , Tejun Heo , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 114/271] libata: dont request sense data on !ZAC ATA devices Date: Wed, 24 Jul 2019 21:19:43 +0200 Message-Id: <20190724191705.015100934@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit ca156e006add67e4beea7896be395160735e09b0 ] ZAC support added sense data requesting on error for both ZAC and ATA devices. This seems to cause erratic error handling behaviors on some SSDs where the device reports sense data availability and then delivers the wrong content making EH take the wrong actions. The failure mode was sporadic on a LITE-ON ssd and couldn't be reliably reproduced. There is no value in requesting sense data from non-ZAC ATA devices while there's a significant risk of introducing EH misbehaviors which are difficult to reproduce and fix. Let's do the sense data dancing only for ZAC devices. Reviewed-by: Hannes Reinecke Tested-by: Masato Suzuki Reviewed-by: Damien Le Moal Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/libata-eh.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 01306c018398..ccc80ff57eb2 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1490,7 +1490,7 @@ static int ata_eh_read_log_10h(struct ata_device *dev, tf->hob_lbah = buf[10]; tf->nsect = buf[12]; tf->hob_nsect = buf[13]; - if (ata_id_has_ncq_autosense(dev->id)) + if (dev->class == ATA_DEV_ZAC && ata_id_has_ncq_autosense(dev->id)) tf->auxiliary = buf[14] << 16 | buf[15] << 8 | buf[16]; return 0; @@ -1737,7 +1737,8 @@ void ata_eh_analyze_ncq_error(struct ata_link *link) memcpy(&qc->result_tf, &tf, sizeof(tf)); qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48; qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ; - if ((qc->result_tf.command & ATA_SENSE) || qc->result_tf.auxiliary) { + if (dev->class == ATA_DEV_ZAC && + ((qc->result_tf.command & ATA_SENSE) || qc->result_tf.auxiliary)) { char sense_key, asc, ascq; sense_key = (qc->result_tf.auxiliary >> 16) & 0xff; @@ -1791,10 +1792,11 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, } switch (qc->dev->class) { - case ATA_DEV_ATA: case ATA_DEV_ZAC: if (stat & ATA_SENSE) ata_eh_request_sense(qc, qc->scsicmd); + /* fall through */ + case ATA_DEV_ATA: if (err & ATA_ICRC) qc->err_mask |= AC_ERR_ATA_BUS; if (err & (ATA_UNC | ATA_AMNF)) -- 2.20.1