Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp315470pxb; Thu, 5 Nov 2020 00:14:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJmRrq560DCLAjvwDAqYOaJweLGJ8hAiqMH+a6lO4KRjBwOovwOfVENZBxG1wL2UN6ipC2 X-Received: by 2002:a17:906:3852:: with SMTP id w18mr1104977ejc.551.1604564084905; Thu, 05 Nov 2020 00:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604564084; cv=none; d=google.com; s=arc-20160816; b=maAxJXPxevokd04ALRXCfz0JhdyATBXv56oo5qnUugZUmDauv/zKC8UZvF7rg+5HLO r8ZvgOFPoKo+qzzSz8v7fFVzq8GEFFylykoSJq4FYT0W7ICOT0k74/O8NOLZHCKWHKU9 L+3WOzDy+KrX12h3sSLfzg9Q7F9fGUEe/FLVlvZPwwTh27kNKe5973iA1d7b/6fMLfBf /XV664gSqDk//ET7TNZjV5CGiLu0N+GQl/B00Tj2uycfDPO2xLeow/Ku+6S1YFhNHWME iki5Z0Ae61Ybog3QWSzmz7JCXwWuj8aRIozYipxoSgKhQgae3mJi+1pzijiDPGVZlLDE adxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=u7VceP9EIJyP1WdZq41UI9GffxXizeWBZW8ZyCMQqJI=; b=02CNTUhQEPJlQNkv5SftIuIF9W3xBt7JjNLvSHSprDpkEVaBhTGO9SjYPR6mN9ZVYZ ZfITf+u192YVEwLnHCJ81xOv5fL9/Pl0X1CXzWhPPk5V7sxm4T53bvUHap55E45/jhf8 80fANcP8iUuYLLHCO6ymC4jaEQJsHswrpaFVKMNmzppfOFRAguw26ptwXv7XUJc4XeXW FRxPRvFUo+ypZNvQoPQb7zgTpH88YEcD9ZoI4HJBurJVfbrJNowN21nw6J4y6YS8C6ko gMPHQEk4Sp63mBGH8ZfRmpVF/VJV8HgffMkVYlmG3X/RXzVXNOWmeC6ew8LEGjTnwZ6f bwGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=ins9tDVY; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ml11si578475ejb.697.2020.11.05.00.14.22; Thu, 05 Nov 2020 00:14:44 -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=fail header.i=@kemnade.info header.s=20180802 header.b=ins9tDVY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729386AbgKEIMo (ORCPT + 99 others); Thu, 5 Nov 2020 03:12:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725287AbgKEIMn (ORCPT ); Thu, 5 Nov 2020 03:12:43 -0500 Received: from mail.andi.de1.cc (mail.andi.de1.cc [IPv6:2a01:238:4321:8900:456f:ecd6:43e:202c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA9CEC0613CF; Thu, 5 Nov 2020 00:12:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=u7VceP9EIJyP1WdZq41UI9GffxXizeWBZW8ZyCMQqJI=; b=ins9tDVYC0pdDkTd82t93yaiS3 cN/1e+7/utKFGrIsTmEteckzrIZ0J50omwL3zqfB3uwZ4IvBh+gfzsB7nUUpQY/1zfVAX6lCsg0q6 oc3xx7s4PCXUHSIkWcNF0w8V35NOLmZveco/G3UAizP7Jh5CJ206xm/0lz5dWLnv0eQA=; Received: from p200300ccff0ddc001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:ff0d:dc00:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1kaaNh-0005Nz-II; Thu, 05 Nov 2020 09:12:29 +0100 Date: Thu, 5 Nov 2020 09:12:28 +0100 From: Andreas Kemnade To: Brad Campbell Cc: Guenter Roeck , Jean Delvare , Arnd Bergmann , rydberg@bitmath.org, linux-hwmon@vger.kernel.org, "linux-kernel@vger.kernel.org" , hns@goldelico.com Subject: Re: [PATCH] applesmc: Re-work SMC comms v2 Message-ID: <20201105091228.128624ba@aktux> In-Reply-To: <3c72ccc3-4de1-b5d0-423d-7b8c80991254@fnarfbargle.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> <10027199-5d31-93e7-9bd8-7baaebff8b71@roeck-us.net> <70331f82-35a1-50bd-685d-0b06061dd213@fnarfbargle.com> <3c72ccc3-4de1-b5d0-423d-7b8c80991254@fnarfbargle.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Nov 2020 18:26:24 +1100 Brad Campbell wrote: > Commit fff2d0f701e6 ("hwmon: (applesmc) avoid overlong udelay()") introduced > an issue whereby communication with the SMC became unreliable with write > errors like : > > [ 120.378614] applesmc: send_byte(0x00, 0x0300) fail: 0x40 > [ 120.378621] applesmc: LKSB: write data fail > [ 120.512782] applesmc: send_byte(0x00, 0x0300) fail: 0x40 > [ 120.512787] applesmc: LKSB: write data fail > > The original code appeared to be timing sensitive and was not reliable with > the timing changes in the aforementioned commit. > > This patch re-factors the SMC communication to remove the timing > dependencies and restore function with the changes previously committed. > > v2 : Address logic and coding style > > Reported-by: Andreas Kemnade > Fixes: fff2d0f701e6 ("hwmon: (applesmc) avoid overlong udelay()") > Signed-off-by: Brad Campbell > Still works here: Tested-by: Andreas Kemnade # MacBookAir6,2