Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1104926ybv; Sat, 22 Feb 2020 23:12:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzCN8jGMuFOCie6od7Xzxk06WJv7CIoAzCoSOgr3AreJ51qpu2uYbtSz8XVl9GvF0sJxKhR X-Received: by 2002:a05:6830:4a7:: with SMTP id l7mr33630974otd.372.1582441950530; Sat, 22 Feb 2020 23:12:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582441950; cv=none; d=google.com; s=arc-20160816; b=DgxPPdT9JzwLl3sv5BS+tBfxPQNwkwBGau4dcEPczVZaaXMQw0O1Z8A4MFqtha7I91 +IzFxB89Tiovvlc1J49foxhcQrI0mDkSS9VCkWcMKzNRzAj4XffhfzvUCTCHJvJ+ZWnQ Nz2KEoBfR42EJj6BAYStDpG/20jKo/LtORdiwUT++s+LZ6I0rkMKfeQJPHtzXgTxtPT2 PEZc0cjeWg1NdLKvTHI3sqezz+LvHKCVnsEQ8kdYddATvo4J3xfFjsq2Ngf8fXytEvXn 2/6ueuW/wvzKH9+kIgPnctdUCPrUHsCZx+JhYfOHPaOLHQxymwz9+qepp0pjiUH312Bx k0tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ej2mA0aDKKMopxuXumf3+CUyzIgPFsAEreKMxIqqyk8=; b=KsG9cYcVA/MjWXXYxojPvjJzYOIBkOLYHcxPskYSw1/I0F+Tr254Y7UfQWjmmV+s6G /xAQcYfFJnXLfvw9v2xgwR2D0J1NiikOwsuaFyKmGqtNAvdxsFCFYSneJyTLtOfi3vCL XZi4FhbneiYmJb6WrdlMsxAcpqqFs16+z4CCxdG4XmBtLKW7uantWTq9kg5NUi40Gjm0 RF4qmnnwqAk51b/38U5+XGPSo1nQDizKD/YKVP67R75VmQphCKJG0yIoOCUh6qoh1/SJ 5ZYTYp4qlmoufTQ2owes4zUwFmVJClAEX1vLdyFnUDX6t/BGD6Bdab9jnS52tln96D4Y D9hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KRrPqLU7; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x20si4379068otq.222.2020.02.22.23.11.47; Sat, 22 Feb 2020 23:12:30 -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=@gmail.com header.s=20161025 header.b=KRrPqLU7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbgBWHG1 (ORCPT + 99 others); Sun, 23 Feb 2020 02:06:27 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:40706 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725980AbgBWHG1 (ORCPT ); Sun, 23 Feb 2020 02:06:27 -0500 Received: by mail-io1-f65.google.com with SMTP id x1so6975763iop.7; Sat, 22 Feb 2020 23:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ej2mA0aDKKMopxuXumf3+CUyzIgPFsAEreKMxIqqyk8=; b=KRrPqLU78N2bWryhv/jIJ/92+ZqvL2WCSVHcjggg0hfVhIpHc99Pxit1jmBsXaMgqh Ajd1aBpY4R+DlmPmbOh/KVpWUjD5/ZmOrnALTkqIXsEzK/jUPsxGJmhHetq5yciMjKHl 4rD47fM2ylyGHITRXBy1eyvuQFskqma9wQsm0+sr9MryYkXdW7Mh4gRInDvp+k6n0Cau 33LpovCTKwNddLTTt991Irboh2uv3khhxKSAxFRicovQSNv/Qon4dsX1oxQd5AK1RQ6N M3wgcHZGbWPNGgIXd6Bx2eoz7YJGGLjm7CNcornJRvRpLd1LuwIuSQyDuxViIWDWmT3H 5KXg== 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=ej2mA0aDKKMopxuXumf3+CUyzIgPFsAEreKMxIqqyk8=; b=SB0NZthSj3zf7JajgE6J6ysk3iKblXi9tz/Ho72b3eA4DjO9mbVzqCLeqqmFeG4Zk0 J4tU6Yn5F6nKfbZSUNCcVZImGACKhxFkRPUkMFmPPbK5YpHHtfyKkz9k6O/6uMInO2r1 6pDeG4InRavi4NwAp6c/4DPsQpDzmpDxHg+pB4UjlKh9lqlvxNKZ5z9KbLpn0B66oDSC 9QSi8sbo3JOiMe/TPGMkVJ0SMz2WouqxWgLuTSpjb5oQrdVPr+kzYjh9j9u3daZns/MO 6+EbKFSHZiOTnDnuE/MONpMlUrb4DXonzpZPHhaY1QPSDF9CWYg/w0XBCuUg+U3H2Lxk zCVg== X-Gm-Message-State: APjAAAVjkqFvjMLB+w65gfAha31tEPmGRqDLCAZa2Gb2GvQr227kMiZc yzDdjztE3ncOjJipB1OHKW/Q3MO3kaEKz+RXgf0= X-Received: by 2002:a05:6638:3:: with SMTP id z3mr42973455jao.65.1582441586495; Sat, 22 Feb 2020 23:06:26 -0800 (PST) MIME-Version: 1.0 References: <1bdbac08-86f8-2a57-2b0d-8cd2beb2a1c0@roeck-us.net> <85356d1a-f90d-e94d-16eb-1071d4e94753@roeck-us.net> In-Reply-To: From: Martin Volf Date: Sun, 23 Feb 2020 08:06:15 +0100 Message-ID: Subject: Re: [regression] nct6775 does not load in 5.4 and 5.5, bisected to b84398d6d7f90080 To: Guenter Roeck Cc: Mika Westerberg , Jean Delvare , Wolfram Sang , linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Sat, Feb 22, 2020 at 10:26 PM Guenter Roeck wrote: > On 2/22/20 12:49 PM, Martin Volf wrote: > > On Sat, Feb 22, 2020 at 8:05 PM Guenter Roeck wrote: > >> On 2/22/20 9:55 AM, Martin Volf wrote: > >>> On Sat, Feb 22, 2020 at 4:41 PM Guenter Roeck wrote: > >>>> On 2/22/20 3:13 AM, Martin Volf wrote: > >>>>> hardware monitoring sensors NCT6796D on my Asus PRIME Z390M-PLUS > >>>>> motherboard with Intel i7-9700 CPU don't work with 5.4 and newer linux > >>>>> kernels, the driver nct6775 does not load. > >>>>> > >>>>> It is working OK in version 5.3. I have used almost all released stable > >>>>> versions from 5.3.8 to 5.3.16; I didn't try older kernels. > >>> ... > >>>> My wild guess would be that the i801 driver is a bit aggressive with > >>>> reserving memory spaces, but I don't immediately see what it does > >>>> differently in that regard after the offending patch. Does it work > >>>> if you unload the i2c_i801 driver first ? > >>> > >>> Yes, after unloading i2c_i801, the nct6775 works. > > ... > >>> This is diff of /proc/ioports in 5.3.18 with loaded nct6775 and in > >>> 5.4.21 without: > >>> > >>> --- ioports-5.3.18 > >>> +++ ioports-5.4.21 > >>> @@ -2,6 +2,7 @@ > >>> 0000-001f : dma1 > >>> 0020-0021 : pic1 > >>> 002e-0031 : iTCO_wdt > >>> + 002e-0031 : iTCO_wdt > >>> 0040-0043 : timer0 > >>> 0050-0053 : timer1 > > ... > >>> So 0x2e is the resource the two drivers are fighting for. > > ... > >> Yes, and it should not do that, since the range can be used to access > >> different segments of the same chip from multiple drivers. This region > >> should only be reserved temporarily, using request_muxed_region() when > >> needed and release_region() after the access is complete. Either case, > >> I don't immediately see why that region would be interesting for the > >> iTCO watchdog driver. > >> > >> Can you add some debugging into the i801 driver to see what memory regions > >> it reserves, and how it gets to reserve 0x2e..0x31 ? That range really > >> doesn't make any sense to me. > > > > in the function i801_add_tco() in drivers/i2c/busses/i2c-i801.c > > (line 1601 in 5.4.21), there is this code: > > > > /* > > * Power Management registers. > > */ > > devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 2); > > pci_bus_read_config_dword(pci_dev->bus, devfn, ACPIBASE, &base_addr); > > > > res = &tco_res[ICH_RES_IO_SMI]; > > res->start = (base_addr & ~1) + ACPIBASE_SMI_OFF; > > res->end = res->start + 3; > > res->flags = IORESOURCE_IO; > > > > base_addr is 0xffffffff after pci_bus_read_config_dword() call. > > ACPIBASE_SMI_OFF is 0x030, therefore res->start is 0x2e. > > Not that I understand even a bit of this... > > > > Outch. This means that the code is broken. ACPIBASE is not configured, > or disabled, or the code reads from the wrong PCI configuration register. > What I don't understand is why this works with v5.3 kernels; the code > looks just as bad there for me. I must be missing something. Either case, > the only thing you can really do at this point is to blacklist the > iTCO_wdt driver. > > Other than that, we can only hope that someone who understands above > code can provide a fix. Maybe Wolfram has an idea. I have disabled the watchdog subsystem in kernel config (v5.5.5) and the modprobe.d workaround and sensors are working. Thanks a lot for your support! Martin