Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1636183lqo; Sat, 18 May 2024 11:46:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcj8jok+zzWn/66YMtKDyGj19S70ZecBh6/KdjZBLBnI3sVtbWn3k73TkkqHwDCyFslPDSeoIfBrAE0W32Nw03x/s0lnzQJdcIZjPJDQ== X-Google-Smtp-Source: AGHT+IFDXtxSpnhKgUZj5jhNrnxZIusOhl+2JzCJl90akc3kUd9tEKTLBlcCcW4Rr2NytQyU2DX3 X-Received: by 2002:a17:906:7fda:b0:a59:a38c:5580 with SMTP id a640c23a62f3a-a5a2d53b036mr1588960466b.6.1716058009133; Sat, 18 May 2024 11:46:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716058009; cv=pass; d=google.com; s=arc-20160816; b=SxDNmzXYw+7ZRvZUCd5enTklifMilgukzUDU+ZNlFnEN0/9kuiRdmX1RYLoZltmD7n +EfuZFFqSoKYIUWKe0sgJXE5T72FC4CKi4K7rf0CSqdBXVu6sgXkf/KdEGG/iI008yn7 5RTqP7ia8zNBLhG9aG6BNgg37nxbqVyG2Z/0TyVeI4pHAODBq6o3LdeLVuO7ZSz4nlwU ycy3QAgLKed1tSfHlfGL2LsRoUl8cvAi9X3uC2ZJYx0aw5nGVQAbFMWFPdzmPrfgfTHe NqK88BEBlsp1z+MteXlB5QxPLux4cyhPGcZSGkvGVTw7syw7vYNBPt4fyEib28q53wvZ 9Vrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=9djOyDzIwBQusyklZ2YD4qYZAylObyZGVkEBmhlVpqY=; fh=bMQcf9gRLcIc/8yPI4NL/KfVP0h/ofqPwMcE1uSKohQ=; b=ACtDfyEnzSrk66rYRpwb8eSb6hzsm4tAtBEVkLtIlv50NtOmEzNKoxsJZRPyn7/8OD ITsQGIz8AxgR98pU4qhoJsoXt/bai74TrBXi7zSXYCxK48l+Ac8f+UCnblsIywGpMPIa dknSjM/YqT6ONW5PY9ddhI0smkzpOxH2ny/3+TKJkBidmrxEQ3xxPeehx1eKau/B/tlk XKnI551iUmcQece5qYl5Z5uB7MHN+GJcCkgD8J+gGlCp2UFVotFcWW+zsuAtfeLrjByS p0dF3PNdoYmb8aAZjtY7jW0qN07BZCzWOumvailIg1S5HnA7HVU/8jvPC0bHZCCiODZM V3Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=korsgaard.com); spf=pass (google.com: domain of linux-kernel+bounces-182937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182937-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a7c7f7122si631208266b.175.2024.05.18.11.46.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 May 2024 11:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=korsgaard.com); spf=pass (google.com: domain of linux-kernel+bounces-182937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182937-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BDFE51F22184 for ; Sat, 18 May 2024 18:46:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 880685C603; Sat, 18 May 2024 18:46:26 +0000 (UTC) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FD244501C; Sat, 18 May 2024 18:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716057986; cv=none; b=q6fVYvjEmiHiAZ2P4/qtu4HWJ0A/Ld86fTj6EZK7v8n9w38JHeNoOGhRPLqCcghZTQrDViAb6K/pjhUnvMabJ/yu5m+QIeRbjVy2BTBrcktR7+8oMvHcvzTmvUzjVivizAck3bavvZfR6Zb8shkXnbQyCT3iXFkW4Hh+58iHRFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716057986; c=relaxed/simple; bh=0a34K2H4C4Vm0M1n57HCMou9farWng/dA6As0pDr+Zk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=GPj1QqaJI49RXPUyXcna1STREQyGwQOlsh8L2b6VGVra1lGhaJHbEPzJVSwbwUDYm+Z1jW0HiCAKlU4AwbBUzOACfOAZ2B3Me9dzDDa3UVYMKy+IK7Rcq+aQc6prHWZ6kaPOzepRau953vnSrzpRhA5DICSgzlnEkZeWjnKfnZ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=korsgaard.com; spf=pass smtp.mailfrom=korsgaard.com; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=korsgaard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=korsgaard.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 56BBA1C0003; Sat, 18 May 2024 18:46:13 +0000 (UTC) Received: from peko by dell.be.48ers.dk with local (Exim 4.96) (envelope-from ) id 1s8P4O-00Asw1-1z; Sat, 18 May 2024 20:46:12 +0200 From: Peter Korsgaard To: Grygorii Tertychnyi Cc: Andrew Lunn , Thomas Gleixner , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, bsp-development.geo@leica-geosystems.com, Grygorii Tertychnyi Subject: Re: [PATCH] i2c: ocores: set IACK bit after core is enabled References: <20240517191000.11390-1-grygorii.tertychnyi@leica-geosystems.com> Date: Sat, 18 May 2024 20:46:12 +0200 In-Reply-To: <20240517191000.11390-1-grygorii.tertychnyi@leica-geosystems.com> (Grygorii Tertychnyi's message of "Fri, 17 May 2024 21:10:00 +0200") Message-ID: <87wmnrnekr.fsf@dell.be.48ers.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: peter@korsgaard.com >>>>> "Grygorii" == Grygorii Tertychnyi writes: > Setting IACK bit when core is disabled does not clear the "Interrupt Flag" > bit in the status register, and the interrupt remains pending. > Sometimes it causes failure for the very first message transfer, that is > usually a device probe. > Hence, set IACK bit after core is enabled to clear pending interrupt. > Signed-off-by: Grygorii Tertychnyi I no longer have access to a device with i2c-ocores, but it sounds sensible so: Acked-by: Peter Korsgaard > --- > drivers/i2c/busses/i2c-ocores.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c > index a0af027db04c..a52f8fd4e2fe 100644 > --- a/drivers/i2c/busses/i2c-ocores.c > +++ b/drivers/i2c/busses/i2c-ocores.c > @@ -439,8 +439,8 @@ static int ocores_init(struct device *dev, struct ocores_i2c *i2c) > oc_setreg(i2c, OCI2C_PREHIGH, prescale >> 8); > /* Init the device */ > - oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK); > oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_EN); > + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK); > return 0; > } > -- > 2.43.0 -- Bye, Peter Korsgaard