Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2334212ybv; Mon, 24 Feb 2020 03:29:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxPPZDM5yScOEmTAOemzYiw+IjKSuTDnmZzt9qI/5LxkuuRdpI7m2AQDQNmjfV0XDFfpmjm X-Received: by 2002:a9d:21c5:: with SMTP id s63mr26440994otb.142.1582543746602; Mon, 24 Feb 2020 03:29:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582543746; cv=none; d=google.com; s=arc-20160816; b=ROBTmEldn41KvglXl4MoasJqQGEO+MEeDqSskeTJc3HC9qAZHJNamknwqK21CUXMcN m+84PmLb7wk70oBQRPiStrYga6MI4X6d0SbwzGKMpzuHNm2+0z743hlG9Ig8sYytrbiL R5I3GicOne5/1/e+dQUFzdRl2KUhZCivVL82Dccti/yDF+lP2HHVrlDEOs8lJY1qR3zw Q3Xxr22y1FehnAgYOmPCDoiRrBOmopGeVNkNxWTE7MacDbz/mzcVeC0MM5jFe8Uwf6B/ s1dEcUCZS0UfKvIoxglQQHHrmXYEHeAd5sHZU++gpyKq7O8fIrW0CYOXEl6O9xFdtM+E ndeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=n/5E3N1+2qg4CtczFSVqim16dXCReRm2Aif0zCSuqvs=; b=x6XsKcxJxhc/vWBQdSC/ZvaERq0kI8hWwmh6X+qy6wCIEVEGI702be17yzDimqo97s vhw94eXfVVC0GcEgUCvwWl2NyZVz16VMXVDcC6gVD4yDHZbQmreOBlpOck3ZJIsQQbFK QjlTqiHzpCztNfFBZPCsi8mgTwea6VnAJ0AZmuk0HkvgfOCiPxGuFgt+Q0/OdU2Xi7uo olbC+8jWcntcoRovURoh6QBOWcMN9FDcWk5aJAkQumigJIFokJo3oCQOhXkKyP/PYs9h RFt5lk0cC8MOxWytdfbZWRY+G+i5hyNBunf2A22qh21DdCjzlcNyqtPEo2Ru9S58lp+T GIWw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z199si4423502oia.192.2020.02.24.03.28.55; Mon, 24 Feb 2020 03:29:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727310AbgBXL1p (ORCPT + 99 others); Mon, 24 Feb 2020 06:27:45 -0500 Received: from mga12.intel.com ([192.55.52.136]:50199 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726509AbgBXL1p (ORCPT ); Mon, 24 Feb 2020 06:27:45 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 03:27:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,480,1574150400"; d="scan'208";a="349902804" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.163]) by fmsmga001.fm.intel.com with SMTP; 24 Feb 2020 03:27:41 -0800 Received: by lahna (sSMTP sendmail emulation); Mon, 24 Feb 2020 13:27:40 +0200 Date: Mon, 24 Feb 2020 13:27:40 +0200 From: Mika Westerberg To: Andy Shevchenko Cc: Guenter Roeck , Martin Volf , Jean Delvare , Wolfram Sang , linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org, Linux Kernel Mailing List , Jarkko Nikula Subject: Re: [regression] nct6775 does not load in 5.4 and 5.5, bisected to b84398d6d7f90080 Message-ID: <20200224112740.GL2667@lahna.fi.intel.com> References: <1bdbac08-86f8-2a57-2b0d-8cd2beb2a1c0@roeck-us.net> <85356d1a-f90d-e94d-16eb-1071d4e94753@roeck-us.net> <20200224101800.GJ2667@lahna.fi.intel.com> <20200224103731.GA10400@smile.fi.intel.com> <20200224105121.GK2667@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200224105121.GK2667@lahna.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2020 at 12:51:25PM +0200, Mika Westerberg wrote: > > I'm wondering if > > > > pci_dev_is_present(...); > > > > returns false here. > > Well that might also be the case since lspci shows this: > > 00:1f.0 ISA bridge: Intel Corporation Z390 Chipset LPC/eSPI Controller (rev 10) > 00:1f.3 Audio device: Intel Corporation Cannon Lake PCH cAVS (rev 10) > 00:1f.4 SMBus: Intel Corporation Cannon Lake PCH SMBus Controller (rev 10) > > PMC is 1f.2 and not present here. However, it may be that the PMC is > still there it just does not "enumerate" because its devid/vendorid are > set to 0xffff. Similar hiding was done for the P2SB bridge. Actually I think this is the case here. I don't know the iTCO_wdt well enough to say if it could live without the ICH_RES_IO_SMI. It looks like this register is used to disable SMI generation but not sure how well it works if it is left to BIOS to configure. I suppose these systems should use WDAT instead. Martin, can you try the below patch? diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index ba87305f4332..c16e5ad08641 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1593,7 +1593,7 @@ i801_add_tco_cnl(struct i801_priv *priv, struct pci_dev *pci_dev, static void i801_add_tco(struct i801_priv *priv) { u32 base_addr, tco_base, tco_ctl, ctrl_val; - struct pci_dev *pci_dev = priv->pci_dev; + struct pci_dev *pmc_dev, *pci_dev = priv->pci_dev; struct resource tco_res[3], *res; unsigned int devfn; @@ -1620,7 +1620,12 @@ static void i801_add_tco(struct i801_priv *priv) * Power Management registers. */ devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 2); - pci_bus_read_config_dword(pci_dev->bus, devfn, ACPIBASE, &base_addr); + pmc_dev = pci_get_slot(pci_dev->bus, devfn); + if (!pmc_dev) { + dev_info(&pci_dev->dev, "PMC device disabled, not enabling iTCO\n"); + return; + } + pci_read_config_dword(pmc_dev, ACPIBASE, &base_addr); res = &tco_res[ICH_RES_IO_SMI]; res->start = (base_addr & ~1) + ACPIBASE_SMI_OFF; @@ -1630,15 +1635,17 @@ static void i801_add_tco(struct i801_priv *priv) /* * Enable the ACPI I/O space. */ - pci_bus_read_config_dword(pci_dev->bus, devfn, ACPICTRL, &ctrl_val); + pci_read_config_dword(pmc_dev, ACPICTRL, &ctrl_val); ctrl_val |= ACPICTRL_EN; - pci_bus_write_config_dword(pci_dev->bus, devfn, ACPICTRL, ctrl_val); + pci_write_config_dword(pmc_dev, ACPICTRL, ctrl_val); if (priv->features & FEATURE_TCO_CNL) priv->tco_pdev = i801_add_tco_cnl(priv, pci_dev, tco_res); else priv->tco_pdev = i801_add_tco_spt(priv, pci_dev, tco_res); + pci_dev_put(pmc_dev); + if (IS_ERR(priv->tco_pdev)) dev_warn(&pci_dev->dev, "failed to create iTCO device\n"); }