Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp250286pxb; Wed, 4 Nov 2020 21:43:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNh18BSZ3xTbWctZ/4AhOjqbSOCDZyfK2flKjKBMyX7wftmEUHTuTJsy89GQqYGpuvU0/V X-Received: by 2002:a50:dac7:: with SMTP id s7mr829962edj.106.1604555005587; Wed, 04 Nov 2020 21:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604555005; cv=none; d=google.com; s=arc-20160816; b=jnu7HSJdcSq8T5M9eam075EiGC1Oq7xRVI2rWaPtYwY3dr67sK1tVFggJUAhifQiY8 flUVIrfA0dUGJnmjXfJ+rPKf+GAo1axUnulDQVD35RlqXCT8KSYq87Bk4aTkLUxmlWNw KFpk6hKZGHkrq9y0UJTdtqiHa8oKqJT7YeVxP9Y2nZy8b/o8EdCsqRGgxcFH07YZarkk Y0SI7UkBNN6QgUw1+pc4oo3HMkHrXgunhL3pOY0JVkZ4FIv0nccp87NEDD8j+yhoegGe fWAT14uAS3F4ehUnzkZzzVAKi2UXk5wHRVObaA3x4Rapdrdz7gK9lAdEji3uA8lsWrN7 3QnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :dkim-signature; bh=HdmY1nXEw7mPert+rZODyMxtkHXZAf8qIUlHp8nOook=; b=eHkL06xEZQwjiICTP9J014PEYRJ89zjFB7W7FHVGugnCnIS/cp0wMg9Zx4cuvpHSaa fWR/Ub3Kzk3YA2LYWVMmIbqoFM4Nf02kurkr1M4xTmbLnsk+2qeuD3mlFliI1q9R9RdR u9Z4+ErEF52mcDTkHyMriv5lDo9Ho5+WhTK4IY5ceM9Ys+6UnU70ViPTaS/BjQxbpGqm QP1u/2uj57N/xGwCy0khjFOw7qX6WvDfzPTBJCvEuaNwI/TP4EJ0q2peIOK1RomZNnTs GnFkOg2opOufkT5wySyJi6aQ+Xe3E44FSd2wnPq6R7zW8+4RkkoaYQolWjnkV4jEuQ3k TjhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fnarfbargle.com header.s=mail header.b=hUQXDN4g; 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=NONE dis=NONE) header.from=fnarfbargle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di27si430009edb.486.2020.11.04.21.43.03; Wed, 04 Nov 2020 21:43:25 -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=@fnarfbargle.com header.s=mail header.b=hUQXDN4g; 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=NONE dis=NONE) header.from=fnarfbargle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726721AbgKEFFq (ORCPT + 99 others); Thu, 5 Nov 2020 00:05:46 -0500 Received: from ns3.fnarfbargle.com ([103.4.19.87]:48828 "EHLO ns3.fnarfbargle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725275AbgKEFFq (ORCPT ); Thu, 5 Nov 2020 00:05:46 -0500 Received: from srv.home ([10.8.0.1] ident=heh2281) by ns3.fnarfbargle.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1kaXSo-0008QJ-QT; Thu, 05 Nov 2020 13:05:34 +0800 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fnarfbargle.com; s=mail; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=HdmY1nXEw7mPert+rZODyMxtkHXZAf8qIUlHp8nOook=; b=hUQXDN4g2qCnH0Ks8dy+DSYXCYnRZ8CLEyTW+8BfljfmcAcbFprgSY4YZK5MgGqzqXV2Y1Pzy2THhNjM23XmGlbi5gcgNgH7ycflHg5hCc+i++oa7lyn69E+HgrL5SDkMRVeAxx8KFg22X6IuZHhCjzQ5rsU25R+i4U5ijLLS6w=; Subject: Re: [REGRESSION] hwmon: (applesmc) avoid overlong udelay() To: Guenter Roeck , Andreas Kemnade , Jean Delvare Cc: Arnd Bergmann , rydberg@bitmath.org, linux-hwmon@vger.kernel.org, "linux-kernel@vger.kernel.org" , hns@goldelico.com References: <20200930105442.3f642f6c@aktux> <20200930164446.GB219887@roeck-us.net> <20201002002251.28462e64@aktux> <7543ef85-727d-96c3-947e-5b18e9e6c44d@roeck-us.net> <20201006090226.4275c824@kemnade.info> <68467f1b-cea1-47ea-a4d4-8319214b072a@fnarfbargle.com> <20201104142057.62493c12@aktux> <2436afef-99c6-c352-936d-567bf553388c@fnarfbargle.com> <7a085650-2399-08c0-3c4d-6cd1fa28a365@roeck-us.net> From: Brad Campbell Message-ID: Date: Thu, 5 Nov 2020 16:05:32 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <7a085650-2399-08c0-3c4d-6cd1fa28a365@roeck-us.net> Content-Type: multipart/mixed; boundary="------------B15AE43E2E2F2EC8D19EEB68" Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------B15AE43E2E2F2EC8D19EEB68 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 5/11/20 3:43 pm, Guenter Roeck wrote: > On 11/4/20 6:18 PM, Brad Campbell wrote: >> On 5/11/20 12:20 am, Andreas Kemnade wrote: >>> On Tue, 3 Nov 2020 16:56:32 +1100 >>> Brad Campbell wrote: >> >>>> If anyone with a Mac having a conventional SMC and seeing issues on 5.9 could test this it'd be appreciated. I'm not saying this code is "correct", but it "works for me". >>>> >>> Seems to work here. >>>   dmesg  | grep applesmc >>> >>> [    1.350782] applesmc: key=561 fan=1 temp=33 index=33 acc=0 lux=2 kbd=1 >>> [    1.350922] applesmc applesmc.768: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info(). >>> [   17.748504] applesmc: wait_status looping 2: 0x4a, 0x4c, 0x4f >>> [  212.008952] applesmc: wait_status looping 2: 0x44, 0x40, 0x4e >>> [  213.033930] applesmc: wait_status looping 2: 0x44, 0x40, 0x4e >>> [  213.167908] applesmc: wait_status looping 2: 0x44, 0x40, 0x4e >>> [  219.087854] applesmc: wait_status looping 2: 0x44, 0x40, 0x4e >>> >>> Tested it on top of 5.9 >> >> Much appreciated Andreas. >> >> I'm not entirely sure where to go from here. I'd really like some wider testing before cleaning this up and submitting it. It puts extra checks & constraints on the comms with the SMC that weren't there previously. >> >> I guess given there doesn't appear to have been a major outcry that the driver broke in 5.9 might indicate that nobody is using it, or that it only broke on certain machines? >> >> Can we get some guidance from the hwmon maintainers on what direction they'd like to take? I don't really want to push this forward without broader testing only to find it breaks a whole heap of machines on the basis that it fixes mine. >> > > Trick question ;-). > > I'd suggest to keep it simple. Your patch seems to be quite complicated > and checks a lot of bits. Reducing that to a minimum would help limiting > the risk that some of those bits are interpreted differently on other > systems. > > Guenter > > Appreciate the feedback. This would be the bare minimum based on the bits use in the original code. If the original code worked "well enough" then this should be relatively safe. Tested on both machines I have access to. Regards, Brad --------------B15AE43E2E2F2EC8D19EEB68 Content-Type: text/plain; charset=UTF-8; name="smc.patch.9" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smc.patch.9" ZGlmZiAtLWdpdCBhL2RyaXZlcnMvaHdtb24vYXBwbGVzbWMuYyBiL2RyaXZlcnMvaHdtb24v YXBwbGVzbWMuYwppbmRleCBhMTg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