Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1863732ybc; Wed, 20 Nov 2019 05:23:56 -0800 (PST) X-Google-Smtp-Source: APXvYqwFB0/M2yJmnNt/2ftZrfYS4GncbyOD/klhdQrqHn2K9z5JWk+mAjcfaZ5SXolrlZsdnygs X-Received: by 2002:a17:906:5786:: with SMTP id k6mr5415349ejq.294.1574256236110; Wed, 20 Nov 2019 05:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574256236; cv=none; d=google.com; s=arc-20160816; b=z2FJUvdBms1rgVw9AhYjtLhU/JVjVYd2TAdqwbTGlb2H18Ycb7ugaqsIwmGsd+cOrG ezRyWEei3lSWhWc6iuWDnoPZKv7z/bMWWjH84c077h8YN0+A07l+t95AwHI6ksG0pUR2 rv+mWKRFwDrLOhITkHA/7H4JkuRBOWJAadVE/56qTGtcvnirv+UhfADq3vu7HPiC8LPW t8cz+OBGP2arr4FpU0c1ml54Zmsd4gSFm7mkArC7ycU0K2muJRdx87OUbpVbejIiUjCd sn3RzVOKoVDxcG3oyrdnL1wQhaVrSA5gNd6fSUAgTqmFoYgF2iJBfpcdyr02xdhS0We/ up+A== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=c18RNqeQqZJJjoZDe1IOCPHd07cYIVcsGN1k1gJQ+aE=; b=mCRzoPprwANOBgWKhRGGnH3xUCasI3UE/wgjm2/NMvov//IFD4OrEN6Cmg5PBbenPf UdDGGzimjz9MNfsD2wGt1NwrK6nt2+aBORqTes7tPbs3rv/MbboUAmpPeeKoz9MWiPbG 1i5ZYmpvyvUWhzKZ6siwkmhcPRadQBchkKXQO3qRbm11kmJWCzWibHNZREauF+I+6bDH ScbslVcj2KczoxUfXxoAID9uRDfRDNA89B0IrbKIa3sjr5vNuUChGNp0c9jGWnM5g5AF H3/NVqGGPIq6zPci8Ph3Uh/nBe3s14N2pE5g0bWBGFtwBQW5U2nh0yGEdK04ITSbB48v U2Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aNZvl0j2; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a18si16516441ejj.100.2019.11.20.05.23.31; Wed, 20 Nov 2019 05:23:56 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=aNZvl0j2; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729399AbfKTL6Q (ORCPT + 99 others); Wed, 20 Nov 2019 06:58:16 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29400 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728908AbfKTL6Q (ORCPT ); Wed, 20 Nov 2019 06:58:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574251093; 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: in-reply-to:in-reply-to:references:references; bh=c18RNqeQqZJJjoZDe1IOCPHd07cYIVcsGN1k1gJQ+aE=; b=aNZvl0j2t6TuTQGCEW3U1KVhwldYACpOkP1i7QqDBJRWerKjeqi3FH6G4+etC+fmRnIySp gCu92s7lcmFFroCPdKSWNxrbz6FmBwBJT39N5LVJXN5jdVogArW/3/uoQzSSBKeQ0BkJ8l 0wflBuHcA+B49tDAbRVSRodfOCeoKWs= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-OmL23OgHM8qhlylYKLS0sw-1; Wed, 20 Nov 2019 06:58:12 -0500 Received: by mail-qv1-f70.google.com with SMTP id w2so16934947qvz.10 for ; Wed, 20 Nov 2019 03:58:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iOCL9BxQIaJyHhhqANHCxmzOITQkpYoVUEJdfnrVoo4=; b=V86n/ue6d9JMoTV8OxZkheMpCYXG+nUPN1dC4o4cEVg69V63HOsvPsQCOtxB8HlNIm mTpVE11OrQNP5H+VjBlkKJuzm+jIoaodnNRHQ9gIEXvhajwKMbZNAK3eUTyTjMn4ycae ipnUVGGJHpj3qmSvgJmdBRyuwN+u+xJqRSq2ztP2DQD1IagFfOkBwIDMIceukX/LbPe2 cnBKULDdgM8PKSigQ/WriEPuTy/PJzDhOqU0NKM6NbDHufADRgGdyO/fMFfRZ1pZE5iW vRkHghXWlbmJFhiMwpnPzdJ3c6XxHI15xAEItpHpimPwjMGObXRJ/92v9rf1pCx6oOaP r4ZA== X-Gm-Message-State: APjAAAU2nqFWmxlyXlc3/VaP1Yibpb55xiiW/m8wuJJBXLZIuQZxUX1t /yvCv9Z/8+ETju1ODD0zYW3jtjvginIIDmRQ8S4SsU1cjsYIrL81/hGqWwSoWtgReEIjsGmIhBy SLQy3kz+Nnx1ZYeohbCZqA5HYaa6E1OvRnZEpSLhf X-Received: by 2002:a37:9083:: with SMTP id s125mr1985628qkd.192.1574251092233; Wed, 20 Nov 2019 03:58:12 -0800 (PST) X-Received: by 2002:a37:9083:: with SMTP id s125mr1985616qkd.192.1574251091976; Wed, 20 Nov 2019 03:58:11 -0800 (PST) MIME-Version: 1.0 References: <20191017121901.13699-1-kherbst@redhat.com> <20191119214955.GA223696@google.com> <20191120101816.GX11621@lahna.fi.intel.com> <20191120112212.GA11621@lahna.fi.intel.com> <20191120115127.GD11621@lahna.fi.intel.com> In-Reply-To: From: Karol Herbst Date: Wed, 20 Nov 2019 12:58:00 +0100 Message-ID: Subject: Re: [PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges To: Mika Westerberg Cc: "Rafael J. Wysocki" , Bjorn Helgaas , LKML , Lyude Paul , "Rafael J . Wysocki" , Linux PCI , Linux PM , dri-devel , nouveau , Dave Airlie , Mario Limonciello X-MC-Unique: OmL23OgHM8qhlylYKLS0sw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org overall, what I really want to know is, _why_ does it work on windows? Or what are we doing differently on Linux so that it doesn't work? If anybody has any idea on how we could dig into this and figure it out on this level, this would probably allow us to get closer to the root cause? no? On Wed, Nov 20, 2019 at 12:54 PM Karol Herbst wrote: > > for newer Windows the firmware uses bit 0x80 on 0x248 (Q0L2 being the > field name) on the bridge controller to turn of the device, on other > versions it uses the "older"? 0xb0 register and the P0LD field, which > is documented, where the former is not. > > On Wed, Nov 20, 2019 at 12:51 PM Mika Westerberg > wrote: > > > > On Wed, Nov 20, 2019 at 01:22:16PM +0200, Mika Westerberg wrote: > > > If (((OSYS <=3D 0x07D9) || ((OSYS =3D=3D 0x07DF) && (_REV= =3D=3D > > > 0x05)))) > > > { > > > > The OSYS comes from this (in DSDT): > > > > If (_OSI ("Windows 2009")) > > { > > OSYS =3D 0x07D9 > > } > > > > If (_OSI ("Windows 2012")) > > { > > OSYS =3D 0x07DC > > } > > > > If (_OSI ("Windows 2013")) > > { > > OSYS =3D 0x07DD > > } > > > > If (_OSI ("Windows 2015")) > > { > > OSYS =3D 0x07DF > > } > > > > So I guess this particular check tries to identify Windows 7 and older, > > and Linux. > > > > > If ((PIOF =3D=3D Zero)) > > > { > > > P0LD =3D One > > > TCNT =3D Zero > > > While ((TCNT < LDLY)) > > > { > > > If ((P0LT =3D=3D 0x08)) > > > { > > > Break > > > } > > > > > > Sleep (0x10) > > > TCNT +=3D 0x10 > > > } > > > > > > P0RM =3D One > > > P0AP =3D 0x03 > > > } > > > ElseIf ((PIOF =3D=3D One)) > > > { > > > P1LD =3D One > > > TCNT =3D Zero > > > While ((TCNT < LDLY)) > > > { > > > If ((P1LT =3D=3D 0x08)) > > > { > > > Break > > > } > > > > > > Sleep (0x10) > > > TCNT +=3D 0x10 > > > } > > > > > > P1RM =3D One > > > P1AP =3D 0x03 > > > } > > > ElseIf ((PIOF =3D=3D 0x02)) > > > { > > > P2LD =3D One > > > TCNT =3D Zero > > > While ((TCNT < LDLY)) > > > { > > > If ((P2LT =3D=3D 0x08)) > > > { > > > Break > > > } > > > > > > Sleep (0x10) > > > TCNT +=3D 0x10 > > > } > > > > > > P2RM =3D One > > > P2AP =3D 0x03 > > > } > > > > > > If ((PBGE !=3D Zero)) > > > { > > > If (SBDL (PIOF)) > > > { > > > MBDL =3D GMXB (PIOF) > > > PDUB (PIOF, MBDL) > > > } > > > } > > > } > > > Else > > > { > > > LKDS (PIOF) > > > } > > > > > > If ((DerefOf (SCLK [Zero]) !=3D Zero)) > > > { > > > PCRO (0xDC, 0x100C, DerefOf (SCLK [One])) > > > Sleep (0x10) > > > } > > > > > > GPPR (PIOF, Zero) > > > If ((OSYS !=3D 0x07D9)) > > > { > > > DIWK (PIOF) > > > } > > > > > > \_SB.SGOV (0x01010004, Zero) > > > Sleep (0x14) > > > Return (Zero) > > > } > >