From patchwork Thu Jul 6 18:06:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 116817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2760365vqx; Thu, 6 Jul 2023 11:39:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZtYaAKk1RG08XuuKFBHpUXhS6H2Ve7y3SZ7Ui+sfjxmBPO6NJ2r1+Qp5njpRsSOPdtcsi X-Received: by 2002:a17:902:da92:b0:1b8:b841:3ff2 with SMTP id j18-20020a170902da9200b001b8b8413ff2mr2327307plx.64.1688668796884; Thu, 06 Jul 2023 11:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688668796; cv=none; d=google.com; s=arc-20160816; b=dnw4y8WmE5Aft8XeacENE92tyxyl2Ap55FksFPwB5OqjAtanXhI4zAL8EWStLuqEDj S2zasLsK4nX2DrVO9Vufv/0RGDIqlcfD/r6zUExOwqxNNLhf+OWFvl/ptg3EI65w52pY CcLilnmjm/1yKzKKa5L/UNQMmsMQ5+xgIENNou0H5NWnNXNiwAjY4wfwbLZoXXTXseu3 sR+fPjerIfjkZ1qH46cFYsykXUQmpNLrZi1TeM3NqtZEZWFTFKHEfVVJkImpg/oVbFpz AZoTEU5SywdPi+fsXQiN2dLvijBb4SoVHZ7egb9hVpdaHfaeyPg6ozS2dUtUgktSQEDH pujw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4tKQ7n4PPQ0pHVlMYrxnbhxqeHpKpn3WB38GUnwxXx4=; fh=xKaA0HvrP/rGJKqL9R+n+oI5bbkoTHtvmDOiV1u2/WU=; b=A0EGFa1btdseg7AGIt+dmDLlgnFjjj8jKL9VuVdG2b1U8/DIOhXzAbIiFdcpsTCPe4 5Zqvsg/rDP6L+hjV5Bqdi8M1JShPnyGqO1Hs2aHlJFr2dWx1uarvnTCI+5+v/i4Rt/+v pmCEO4Im6b+PKv3aQ92XYT1fmZrBdqBWgu2fqdt9+3cgtZyMcOSoU4mZmRmvq6ljjOAx Ft25k6WG5yZ0NizGevhS/DKPKwZgSbR/egkXIu0HdD8QXSsASEJcVequlfW2yKJ3AR/9 cMgtcUNKz2gCrBqcbKjbritUfet+XBZ8DKJPAu3TYWMV/F+Dt1IAw8Xuxs+XBsD9OfYT wSIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hp.com header.s=mimecast20180716 header.b=SyGqpZj5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=hp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a170902d4cd00b001b8c4168e20si1783402plg.58.2023.07.06.11.39.26; Thu, 06 Jul 2023 11:39:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hp.com header.s=mimecast20180716 header.b=SyGqpZj5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=hp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232265AbjGFSIx (ORCPT + 99 others); Thu, 6 Jul 2023 14:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbjGFSIu (ORCPT ); Thu, 6 Jul 2023 14:08:50 -0400 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 06 Jul 2023 11:08:04 PDT Received: from us-smtp-delivery-162.mimecast.com (us-smtp-delivery-162.mimecast.com [170.10.133.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F20BB1BE8 for ; Thu, 6 Jul 2023 11:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hp.com; s=mimecast20180716; t=1688666884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4tKQ7n4PPQ0pHVlMYrxnbhxqeHpKpn3WB38GUnwxXx4=; b=SyGqpZj5flhOpIjmO0t+QQwNOWJ0ZOVmPfin080Xe3PcXItN0B+A31fLz+yBe8lczGAgMJ hEzOWNF3KO+4yQlzMfmM4sUrplpDyuiUO9KwtT/lZNr0Cg2zwjjSNthLRuMVXlwnQDoXgy xJSmaO3929RZX+V8+Qk9puq+ArsFYhA= Received: from g1t6213.austin.hp.com (g1t6213.austin.hp.com [15.73.96.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-458-drDjnOWVNyKBnno0OWCBag-1; Thu, 06 Jul 2023 14:06:58 -0400 X-MC-Unique: drDjnOWVNyKBnno0OWCBag-1 Received: from g1t6215.austin.hpicorp.net (g1t6215.austin.hpicorp.net [15.67.1.191]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by g1t6213.austin.hp.com (Postfix) with ESMTPS id 5CE3E8C; Thu, 6 Jul 2023 18:06:56 +0000 (UTC) Received: from jam-buntu.lan (unknown [15.74.50.248]) by g1t6215.austin.hpicorp.net (Postfix) with ESMTP id 4FF55C; Thu, 6 Jul 2023 18:06:55 +0000 (UTC) From: Alexandru Gagniuc To: linux-nvme@lists.infradead.org Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-kernel@vger.kernel.org, eniac-xw.zhang@hp.com, Alexandru Gagniuc , stable@vger.kernel.org Subject: [PATCH] nvme-pci: Add suspend quirk for HP mt645 thin client Date: Thu, 6 Jul 2023 18:06:53 +0000 Message-Id: <20230706180653.761247-1-alexandru.gagniuc@hp.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: hp.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770697571974891056?= X-GMAIL-MSGID: =?utf-8?q?1770697571974891056?= The HP Elite mt645 thin client exhibits resume times of over one minute when using the normal nvme resume path. BIOS has tried to work around this by setting the "StorageD3Enable" ACPI property, but only if it detected the "Linux-HPI-Hybrid-Graphics" _OSI() flag. This flag does not exist, so the BIOS workaround can't work. Instead, just set NVME_QUIRK_SIMPLE_SUSPEND when running on an mt645. The DMI_PRODUCT_NAME cannot be used because this string can be changed in the field. Match against DMI_BOARD_NAME, which should be immutable. Cc: stable@vger.kernel.org Signed-off-by: Alexandru Gagniuc --- drivers/nvme/host/pci.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 492f319ebdf3..25b59f5ce874 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2897,6 +2897,15 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev) if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) && dmi_match(DMI_BOARD_NAME, "LNVNB161216")) return NVME_QUIRK_SIMPLE_SUSPEND; + } else if (dmi_match(DMI_SYS_VENDOR, "HP") && + (dmi_match(DMI_BOARD_NAME, "8B0F") || + dmi_match(DMI_BOARD_NAME, "8B59"))) { + /* + * Force simple suspend to work around long resume latencies + * (1 minute or longer). + */ + dev_info(&pdev->dev, "simple suspend quirk for HP mt645\n"); + return NVME_QUIRK_SIMPLE_SUSPEND; } return 0;