Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2601366rdb; Wed, 21 Feb 2024 12:58:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX9AQ2Buhvcq4j3w/UX5fEKLOOxpH4V1RFoMxJaDhmT5XsBYaf30ewXQwN1YPLJEyKPfBu0XLS8z2koX/NU/AQgqXJ2qUJDlqMwrBqIeA== X-Google-Smtp-Source: AGHT+IHAp2V3d6J3zdbaMXVmt6APAiT5qAs7H44Z9TUW9wZII51LIXGtIPXQ64vxuy6+Th2LX1w+ X-Received: by 2002:a17:903:298b:b0:1db:c143:abbb with SMTP id lm11-20020a170903298b00b001dbc143abbbmr16191003plb.29.1708549119907; Wed, 21 Feb 2024 12:58:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708549119; cv=pass; d=google.com; s=arc-20160816; b=UMINEFczHu0Yx7ECQUQ+JBzeYry31dTNP8QfFDSxNXhWaEIPWI79aZ3qzLAgwn0EzZ Ny2Zb0tRSdXG4A0dxkfMCm78AKVTkMDp5Bc7dMKrGhcCrIUn4uJM0Px9859M4b0z/SVt i05VzgWmUe//GJ+cL5pOu9HW4zfhX+GiKHJVUJld5od82PW7F9u0hfeLtGCPfCuSaPQe QPSnuRZRGqy+XVYGuWlsRtTLexcVGQgB2xsx7ZNa78kw5JfQ036+izcCF2tqD6GmZxeq RX+f53Wdw7hXTIwDVQOSxPdn5ds8/Sdo7juUHz8Ch/Uib6XETVqR7EnSjiuIR3bObsJc oHPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vYyQcyi8Esye0ldgTOLtdMApI3UgiB/1OGcxMgxPN3Y=; fh=pkOrEQeAmANUPnB60kVC0lxCC4G7vYDHqcgY1s9+c2c=; b=WLJ2CReLzYnntucyhO65+7rst+H0r3SLi/UhqqZjnyz1ijUX+zj2lhR33Oh2fLR52t wW4+nga91Zj9Y8tZfRKasO/0sy/Bz0wWuoEQ3ix3tECNUaeEy1tKmyeNfLjsLLhLeMQj 0AMmLopP6r6bjOnck8Bi/U21LNzZBNPsTiLQ9QiB9VlqYevsGn30xeLMuOaY0n72aV5V M6EmpZdX2CyiZSz1wCjs+n8vxzOCIz/uH9cfNpoSnbIZn4mWOjTGwoK4xEoZJGaAEQym +C12iWvJqFTyzA8GGKWTMQ7LhIluZzNF0IN7o5KrYeh0rEOFKhJ4PbcLru5RzN6nScJN VtUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZzW9GLDx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75484-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q6-20020a170902a3c600b001dbc1be3778si1453989plb.383.2024.02.21.12.58.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75484-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZzW9GLDx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75484-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 98946B2314C for ; Wed, 21 Feb 2024 20:58:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B907586AE2; Wed, 21 Feb 2024 20:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZzW9GLDx" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DA58C3A1AF; Wed, 21 Feb 2024 20:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708549107; cv=none; b=BjPDfDpgAr1qIoHDkW3LOFParCaTNQGzQ7wH9iVwSzhZYSLNc+7DmNuhIerT9+PA703p3dsS4r2wdJeSb9bhHknUoAg6RrKy38FCACadwPnmU2zYjzVI8gJDcfgB2U8ykG/Dt08nM1ktGacdZniuhIFDI6kp17y862aSTz0GdU4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708549107; c=relaxed/simple; bh=a+JDh1FFIqaHPqou/rENlBnsnFcJSsYpw/0jB2FoUoY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n6IwQrSvMbYjOhAWr15TY7OKdITw5g9tvAURvrIA7+spQDU+lKGtkAUUbWGshmlkYV8kT4er7Ec0WNPwV9iAeL4QGIKSykekgn9YBl3l16ihnrttEdm0spny75hwTL+8QTii3ME8AJwhN24utV9BFPkiASQBlnJPNX9fyL/SdF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZzW9GLDx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3251C433F1; Wed, 21 Feb 2024 20:58:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708549107; bh=a+JDh1FFIqaHPqou/rENlBnsnFcJSsYpw/0jB2FoUoY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZzW9GLDxb7lMYGUDAEl7xKagQesuhRDH5tGnzJDx77zfodhK451n19WiFHEVZ18oK LZmEuD+F+jqE9z+CqZqQvvLVzFMNVhxz/DL6SbXHS5f9YGLtH2jiNw0dCBeTkNZ/OK HltrjmeafGoV1mxz2LAIt7wlPQhbROVKjK+2RPbGp0QUMnvyiAjliw3+z7nYuDicyx 0jiTxTbS2/USJMcLoCPUOyg5P37TOPe0L1N5UJqo0r8n/+xJSr7on8EmuqICdiOy7M 9JKClM8DyQXi+a24RW0uUYoL9ut3uSUTMMY9mJzU0Fru6xB2IinIttIdZl07PzDt9d Cp4u+/V2rVo7w== Date: Wed, 21 Feb 2024 21:58:23 +0100 From: Andi Shyti To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, Corey Minyard , Andrew Manley , Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] i2c: imx: when being a target, mark the last read as processed Message-ID: References: <20240221193013.14233-2-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240221193013.14233-2-wsa+renesas@sang-engineering.com> Hi Wolfram and Corey, On Wed, Feb 21, 2024 at 08:27:13PM +0100, Wolfram Sang wrote: > From: Corey Minyard > > When being a target, NAK from the controller means that all bytes have > been transferred. So, the last byte needs also to be marked as > 'processed'. Otherwise index registers of backends may not increase. > > Signed-off-by: Corey Minyard > Tested-by: Andrew Manley > Reviewed-by: Andrew Manley > Reviewed-by: Oleksij Rempel > [wsa: fixed comment and commit message to properly describe the case] > Signed-off-by: Wolfram Sang is this a fix? Andi > --- > > Changes since v2: > * updated commit message and comment > > In the stalled discussion[1], it seems I couldn't make my suggestions > clear. So, here are the changes how I meant them. I hope this can be > agreed on. > > [1] http://patchwork.ozlabs.org/project/linux-i2c/patch/20211112133956.655179-3-minyard@acm.org/ > > drivers/i2c/busses/i2c-imx.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index 88a053987403..60e813137f84 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -803,6 +803,11 @@ static irqreturn_t i2c_imx_slave_handle(struct imx_i2c_struct *i2c_imx, > ctl &= ~I2CR_MTX; > imx_i2c_write_reg(ctl, i2c_imx, IMX_I2C_I2CR); > imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR); > + > + /* flag the last byte as processed */ > + i2c_imx_slave_event(i2c_imx, > + I2C_SLAVE_READ_PROCESSED, &value); > + > i2c_imx_slave_finish_op(i2c_imx); > return IRQ_HANDLED; > } > -- > 2.43.0 >