Received: by 10.213.65.68 with SMTP id h4csp2117884imn; Sun, 8 Apr 2018 20:09:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/fc8zsX1qbeW+FlncyK1fPxQmUNi2IioTZ4UnemW8cyrXX/ggcrqM/UuvF3ZHYeU8CWOKh X-Received: by 2002:a17:902:b94c:: with SMTP id h12-v6mr24200624pls.321.1523243342648; Sun, 08 Apr 2018 20:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243342; cv=none; d=google.com; s=arc-20160816; b=c6fwki4P0oMbz/Lh7f4L/jbd9mFSLT11brQMJ+JF2jcVwTAADjfeAwnxttI6BrdHrl nwqlaz8yhcd0G5wmdQhI0xkZuiS/8VqKGWinWfryV8gbRvWTMjAPoBcz5aO38CG+K+ui LdoYtzpgmiF0xNRAcct6H6K4a3cuvd706QhEuJO323EdSp7CLBySssBRpT+3lr63hHyg uDBcUQVbwAN3aQwdyInS/740VbY9SF6ANEa7s655w+WIih7atzt5btnHLXpoyO0+Zbot VfQeyD2PbtL+5lGPUWyigIJW5eUKswq+nMZ8rIOAqw60XswU973qTHAKatPM0jz/Biq6 i3Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=i+dYy8mO6hjS1+vbOw3sdiGZZKC0d32tdIngjJ07sSU=; b=Dg7VQ2SaWd9x4SEyJteRfyLmItMb+RhuQevfb7dYDJzyYRpDTjlV8AVwRMi2PVTGZ1 tn0DQ9fb09whK0OEJejDObuKMjPjZF8/q9Fso15ovQBotd+0CdrrgrDVlzDl4Gnb/I9E Wls3Hkbxf4nx6zrHUzGnYZL/WIcUL7D91byphJkmu9S75pyz+QOXK/+tfTlgIxmsyHym 2yD6Iiy4PMgRyrsfjZU/7ZL85IqGSC/M90JQ0EedE5r0Oeywb7Z6aP5+t0tcN9om8oc6 nwQqTj6F0ES73ghjDKWNSJyzV1a22h399bDr9ojHpdsWN/LoNPBc7t8lPK6bJEw0Cy7I TO4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=eTVfaOdV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si13886458pld.396.2018.04.08.20.08.25; Sun, 08 Apr 2018 20:09:02 -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=@microsoft.com header.s=selector1 header.b=eTVfaOdV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932581AbeDICTe (ORCPT + 99 others); Sun, 8 Apr 2018 22:19:34 -0400 Received: from mail-sn1nam02on0125.outbound.protection.outlook.com ([104.47.36.125]:10314 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755777AbeDIAaV (ORCPT ); Sun, 8 Apr 2018 20:30:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=i+dYy8mO6hjS1+vbOw3sdiGZZKC0d32tdIngjJ07sSU=; b=eTVfaOdVScNcjW7SUXJeBzKVAPWT/hWUBHCIpAgOQRO917QJ0o+B99eTZaPCnH7j+rbRyIiGymjmY9KMW24/c+vHxfANqDh4bitoBeu9ldCF1KcE2fkp3yftMk095NVDIX20/AsR56g95ToS/FEFVBzXjF6dNKdpW6grUB/P9KE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:30:16 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:30:16 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Doug Berger , Tejun Heo , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 126/293] libata: Add the AHCI_HFLAG_YES_ALPM flag Thread-Topic: [PATCH AUTOSEL for 4.9 126/293] libata: Add the AHCI_HFLAG_YES_ALPM flag Thread-Index: AQHTz5kgArvDk9X/W0ajqUJ0CZg0OA== Date: Mon, 9 Apr 2018 00:24:31 +0000 Message-ID: <20180409002239.163177-126-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1032;7:svu7VaIlzP6iFoOVwBAU+2mf3VhrycM4S7KgX65GhelCG7I15IerQUhF4X0upELqMgUBiPs/wK0X9YI2zkFWoWiYkA3T+48EQ1Qhkx7myr0DIsP4x+ixHt5yNqgg6g8uEKPRC5yrNO2SIChNbbBcP5Zh1IIeBEX6yQ5J2eXqWJAuDMA//v1tIynmwqd1HJQcYQlVUMuxkZQLL6efRndFaTXKt5U3kMJT35En/cPr+5myLl/ITlwb1QcEUdIpnvBY;20:qs2f+yeoYBupCrD3oNtJG46ByZpWcmjteOBm1erA9VQmE1lVqMgYProbSMh7hPFIhRDtZaOJcWCaPzxUWNG3w3hYDCB5U3K1NVs9lFKPVaoDr6ZD4Gf5eVjcewIxdEhEArAMAsA1hNu9cAKYsSiJT/8k6fZr/Y///XGxyOlA1us= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 97b20baa-9aa0-4521-8657-08d59db11152 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1032; x-ms-traffictypediagnostic: DM5PR2101MB1032: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1032;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1032; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(39380400002)(346002)(396003)(39860400002)(376002)(366004)(189003)(199004)(5660300001)(76176011)(99286004)(10090500001)(2900100001)(105586002)(305945005)(7736002)(107886003)(2501003)(5250100002)(14454004)(53936002)(4326008)(8936002)(68736007)(25786009)(86612001)(3846002)(66066001)(1076002)(486006)(316002)(72206003)(22452003)(106356001)(186003)(97736004)(6436002)(6116002)(476003)(2616005)(39060400002)(478600001)(6486002)(10290500003)(2906002)(110136005)(54906003)(6512007)(81156014)(81166006)(8676002)(36756003)(11346002)(3660700001)(446003)(6666003)(86362001)(26005)(102836004)(575784001)(3280700002)(6506007)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1032;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Nbi+ao9TwDwE+85HumsnMWY8+HSU+5NRLP0YuRfxRrkE0kwqu4hYAYkcNtV6QZd4jF3Lruho3OOM1hFYxja6XA+R8gYWBIQwyFHu1+GTtTXAHxthYKJaBcQAuvO2xBSOLuSDDpfDu+MFsmpBx1ErxIwBf7UP/L7tJiiUx4soUzmjHgXF7LmDBSUbRo0hvO7MnjApZnVK5dDKz4oJNBHdugIX86mhY8yy7LcaheCe4iJgT6D4LY6XWfMX2jmdAtKPLNH4Lv1JP43usVfpq+kiVVFIbHaZO3mwmjkQ/GcPKm6qSGfBvDt5w+0uOjHLM2U8xTeYZ26RlD/QM4PeIsfzPXYR7ukeW0JBVlnIIgFo1u2ajl5hpUwEMLmgj+kNxK3UhQY62C23M8cIp38wA+PjYM4o+8DLlW7SGsxnvJ7TqMU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97b20baa-9aa0-4521-8657-08d59db11152 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:31.3000 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1032 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Doug Berger [ Upstream commit ef0da1bf767d9e557c6375c7066717eead54cb15 ] Some hardware is capable of supporting Aggresive Link Power Management even though it is not indicated by the Host Capability register. This commit adds the AHCI_HFLAG_YES_ALPM flag to the AHCI library to allow indication of this quirk when the Host Capability register is Read Only and therefore cannot be changed. Signed-off-by: Doug Berger Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin --- drivers/ata/ahci.h | 1 + drivers/ata/libahci.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 0cc08f892fea..bd9ba1640b56 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -248,6 +248,7 @@ enum { AHCI_HFLAG_MULTI_MSI =3D 0, #endif AHCI_HFLAG_WAKE_BEFORE_STOP =3D (1 << 22), /* wake before DMA stop */ + AHCI_HFLAG_YES_ALPM =3D (1 << 23), /* force ALPM cap on */ =20 /* ap->flags bits */ =20 diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 0d028ead99e8..e9eb98a33467 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -503,6 +503,11 @@ void ahci_save_initial_config(struct device *dev, stru= ct ahci_host_priv *hpriv) cap &=3D ~HOST_CAP_FBS; } =20 + if (!(cap & HOST_CAP_ALPM) && (hpriv->flags & AHCI_HFLAG_YES_ALPM)) { + dev_info(dev, "controller can do ALPM, turning on CAP_ALPM\n"); + cap |=3D HOST_CAP_ALPM; + } + if (hpriv->force_port_map && port_map !=3D hpriv->force_port_map) { dev_info(dev, "forcing port_map 0x%x -> 0x%x\n", port_map, hpriv->force_port_map); --=20 2.15.1