Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751465AbdFZSGA (ORCPT ); Mon, 26 Jun 2017 14:06:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:42906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751376AbdFZSFz (ORCPT ); Mon, 26 Jun 2017 14:05:55 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B58322BD5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org MIME-Version: 1.0 In-Reply-To: <20170626070129.14744-1-kai.heng.feng@canonical.com> References: <20170626070129.14744-1-kai.heng.feng@canonical.com> From: Andy Lutomirski Date: Mon, 26 Jun 2017 11:05:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] nvme: explicitly disable APST on quirked devices To: Kai-Heng Feng Cc: Andrew Lutomirski , Christoph Hellwig , linux-nvme , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1157 Lines: 27 On Mon, Jun 26, 2017 at 12:01 AM, Kai-Heng Feng wrote: > A user reports APST is enabled, even when the NVMe is quirked or with > option "default_ps_max_latency_us=0". > > The current logic will not set APST if the device is quirked. But the > NVMe in question will enable APST automatically. > > Separate the logic "apst is supported" and "to enable apst", so we can > use the latter one to explicitly disable APST at initialiaztion. Reviewed-by: Andy Lutomirski That being said, I smell a giant WTF here. The affected hardware seems to have APST on by default, and APST is buggy so the disk stops working when APST is on. So here's the $1M question: how does the system *boot*? After all, it's running for a while before the kernel gets around to turning off APST, and I really doubt that BIOS does this. Here's a wild theory: what if the problem on all these disks is actually our CSTS polling? Could it be that some of the disks implement CSTS reads in firmware and malfunction if CSTS is read while in PS4? This would be a blatant spec violation, but that's never stopped anyone before... --Andy