Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1640238pxb; Fri, 6 Nov 2020 15:23:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJylfDg3nnG7g/4dol6vomRgHG9re2c3ZuiJGNTXXJOPax4DJ0hYGVAt8fkhfQ/Fc9irp6BF X-Received: by 2002:a50:ff10:: with SMTP id a16mr4576570edu.83.1604705034865; Fri, 06 Nov 2020 15:23:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604705034; cv=none; d=google.com; s=arc-20160816; b=zGHlbZH9NOjXkuAUUvdlt2gjbLopXLe8HKswdyHEzyq/mdHUBqJLBLA5rp8cPrTvzH BjTZDQsedUvscLkuYY9lzJpRKlYjsthKDDVHVgzR4V7TE2nyYMIfKnG+G0CMnGYLv8RE IC8ir6CWR3/CuNmR8/ZOh0qp/BbZXZzLL+/K0Bf6jC0DR7eADlL8x+Dct+GqEOzetN0J waHYKYz2ngyXULcsBjw8oim7g+Mmx17/JNRfjEjg7cgMKqsVjuKEWqSRXmaR+JjXN+ix VrJ02l/MBPwa/yZ4wRDDjtTm9MxDLBl+Sns6Y/HCmEnRkj/zk5qmP6nhmKtoNMPgM3Ps 7Qgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9kgi0XFLYWD6SBPla2WObtfMjgECeVYCZRoQd1futD0=; b=nwI2cnaj1LN6h12yHQYHfqSSNEgfDBZxfC8lHkZBu0Bgzm3Tx9bCTQSTXuU7pq4z0v rPfvnKntqc9Uunj+YA+VqDk4JCZuWCtBcoL61uOz7o+CkvsMyjYbH+97FwuiU+Q73QjP pm5jn6nbKkUcXu41r4xY4BqFlvin3hD7iIHl5+kw35gegaq0DAnSJXFiSynCxKICzXSd KNEZX1pwvLpizvutFZ8yJNqrTatksTJjcfcOaAjylmscmKXybqvnbOiNEwYBp/1VTrjZ HLKdBkn1Rtx7jDaSDUEeSuCn1m2eK5GCQYrC5usxQvA75/mEUB3QEz+D8M0T/M2CcxJe uvYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HTj0zMH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id j11si2130739edy.158.2020.11.06.15.23.32; Fri, 06 Nov 2020 15:23:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HTj0zMH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728270AbgKFXWF (ORCPT + 99 others); Fri, 6 Nov 2020 18:22:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbgKFXWE (ORCPT ); Fri, 6 Nov 2020 18:22:04 -0500 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2957C0613CF; Fri, 6 Nov 2020 15:22:02 -0800 (PST) Received: by mail-qk1-x743.google.com with SMTP id 12so2702170qkl.8; Fri, 06 Nov 2020 15:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9kgi0XFLYWD6SBPla2WObtfMjgECeVYCZRoQd1futD0=; b=HTj0zMH1IJDsOOrRiedp+5luIkjzzA3oO6+2Di7/2QwarPAUQbSQMnjFB/+6BEqA8G 3WxkdJ2hKJrQtq0BGVLiA/KY9+5tkTrMt1yNey7ELX3Ke/+Tdf89PqkbECUBN6ORBz9+ D42lzaAiHwN84PphlafQmYxF7COHaemXRzUPJgN58GiWItn2jlORW0nUmY3lxZEjXCaJ 9XBkp58yN8pQQPeETTidCfGrWDgahpu/RomYIxpHfP1Q32Di/r9LYp/JEXUpcg4uutir Up8Lz0kWdixZkW9mmolP9z/k0Mj+vF20ygCvlUI2395UXghmlJ5r+HA3iqHDbdoVWBNP fxig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9kgi0XFLYWD6SBPla2WObtfMjgECeVYCZRoQd1futD0=; b=Mc/6tTA1Gm0CGzNwl2+ALzSuh1wcV5x3mLfWAed0FfSUpH+8c2SFGII4BLW9PQO9L4 B4lcrppcv/JuWMmU6RIUHcb1GA9TbSpPvYqT0LG6GwKNvl9Dq/cLrtYlmvRtenBFz52u Z7BgZeIXEJ63ZyrgZmW1kYk8VGT2drel/D4xU0GfKMI65HsJhmjzeO9sxndHskwhQYmt 33UtOuC97xlkw4M1wDkFZ1hDtoFCVH6HVvfN4ThRltGXABQ/ldo0cA7TAXkaHAD/JBLo nVuwRY38fIfFAZL3kl94WPV9QJTjIgCPCY8dead2g3jXsqoFfTF+UKR7FUo0gX0tg075 QOAg== X-Gm-Message-State: AOAM532pgvpRM9Gzi+2z+3b/lKJrQvc8DCzcSPrt48nLtNCTdchD2nc7 PfW0V6I1adksxvGiAm9ek6A= X-Received: by 2002:a37:d0c:: with SMTP id 12mr3931626qkn.418.1604704921837; Fri, 06 Nov 2020 15:22:01 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id m2sm1577647qtu.62.2020.11.06.15.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 15:22:00 -0800 (PST) Date: Fri, 6 Nov 2020 16:21:59 -0700 From: Nathan Chancellor To: Matt Turner Cc: Arnd Bergmann , Henrik Rydberg , Jean Delvare , Guenter Roeck , Richard Fontana , Dmitry Torokhov , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] hwmon: applesmc: avoid overlong udelay() Message-ID: <20201106232159.GA3586073@ubuntu-m3-large-x86> References: <20201106231710.GA29287@macbook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201106231710.GA29287@macbook> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 06, 2020 at 06:17:10PM -0500, Matt Turner wrote: > On my late 2013 Macbook Pro, I have a couple of scripts that set the > fans to auto or full-speed: > > fan-hi: > #!/bin/sh > sudo sh -c 'echo 1 > /sys/devices/platform/applesmc.768/fan1_manual > echo 1 > /sys/devices/platform/applesmc.768/fan2_manual > cat /sys/devices/platform/applesmc.768/fan1_max > /sys/devices/platform/applesmc.768/fan1_output > cat /sys/devices/platform/applesmc.768/fan2_max > /sys/devices/platform/applesmc.768/fan2_output' > > fan-auto: > #!/bin/sh > sudo sh -c 'echo 0 > /sys/devices/platform/applesmc.768/fan1_manual > echo 0 > /sys/devices/platform/applesmc.768/fan2_manual' > > Running ./fan-hi and then ./fan-auto on Linux v5.6 works and doesn't > cause any problems, but after updating to v5.9 I see this in dmesg: > > [Nov 6 17:24] applesmc: send_byte(0x01, 0x0300) fail: 0x40 > [ +0.000005] applesmc: FS! : write data fail > [ +0.191777] applesmc: send_byte(0x30, 0x0300) fail: 0x40 > [ +0.000009] applesmc: F0Tg: write data fail > [ +7.097416] applesmc: send_byte(0x00, 0x0300) fail: 0x40 > [ +0.000006] applesmc: FS! : write data fail > > and the fan controls don't work. > > Googling turned up this [1] which looks like the same problem. They said > it began occurring between v5.7 and v5.8, so I looked and found this > commit. > > After reverting commit fff2d0f701e6753591609739f8ab9be1c8e80ebb from > v5.9, I no longer see the errors in dmesg and the fan controls work > again. > > Any ideas what the problem is? > > Thanks, > Matt > > [1] https://stackoverflow.com/questions/63505469/cant-write-data-to-applesmc-error-after-upgrade-to-arch-linux-kernel-5-8-1 > There is another thread on this regression: https://lore.kernel.org/lkml/20200930105442.3f642f6c@aktux/ Looks like Brad Campbell has a patch that has some success in fixing the regression (although others are saying it breaks their setup...): https://lore.kernel.org/lkml/3c72ccc3-4de1-b5d0-423d-7b8c80991254@fnarfbargle.com/ Might be worth giving it a shot and jumping in so you get CC'd on further revisions. Cheers, Nathan