Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp139608pxj; Thu, 3 Jun 2021 03:00:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwuFg2HpIdgeSNY8bhN9+pqPEO9XvoUhZ7SP2Pt97rEvQPmMWSA1/uGzHwO2SRgRsW5Bs6 X-Received: by 2002:a05:6402:40c:: with SMTP id q12mr42397519edv.0.1622714442383; Thu, 03 Jun 2021 03:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622714442; cv=none; d=google.com; s=arc-20160816; b=PuwEpbQeckHBCqfYEeWZCaehtzmqGNfiYEF+IlFDzvkz/B+Qa3gMhINSfpyZ617INg 6jsqfxeB0DMIy05zRtI/fbMht/qP5J63GM05dJC8BRsrLlgIPDRUcxGEO5BXUtcmDqab /iwHT4gdMlJXFbMPwWt4q5cQNg0sk7BSJp51mRBC7U+TEknzwREYKUN2xgoER7dMFgLo l0mEZFlIS+o6zhMQKIIfHlep5BLC9uvML94+4rMfdJpahbx7jpgC7Hrlt2oNaVqgZI0O //LNJnWVIpXX7114PCfCXWSUtDuSZRd6MMywStup+Du3K7OH9OGM53mPBuWeHVO/gFt2 b9iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=SSZQam37MvjdV92UuVrQYX1iZ4LDAER928vqdf2wtvg=; b=TFO3IjBz09oMgAPUjT8E/3eIj2p4FibwhL7q5P4sq13Hx4ZT8UI35NNwYmW3hyC33b bjIqMcas6dPulj7maWKZw/WHTVnrR/6ce7DkdF/7r7acYpv0iBmta5iR3ggiS7CgXDMQ 4oqdLhG+wz5Ai2V9utwUkd80s0eik8b5++jMSR92n9diXaNQgYoCCK4KB+9uwqnWVpda okOPldmM8Wfbu6VUpTgQZFUf5vgVU8pIqUvLKluvJx/VeU1fgvKuGb9gz/USLVOOqQL7 OdJrHaCmvgM6z0CVo1V87rv0zmH2Qef9T+bdbYyhqzFhO/xcTWWa68LTh6N1tkGOI4d8 gygg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=mAm39BGW; 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 hs26si1953424ejc.307.2021.06.03.03.00.19; Thu, 03 Jun 2021 03:00:42 -0700 (PDT) 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=@denx.de header.s=phobos-20191101 header.b=mAm39BGW; 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 S229747AbhFCJ7I (ORCPT + 99 others); Thu, 3 Jun 2021 05:59:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFCJ7H (ORCPT ); Thu, 3 Jun 2021 05:59:07 -0400 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4279EC06174A; Thu, 3 Jun 2021 02:57:23 -0700 (PDT) Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id A1BEC81FB2; Thu, 3 Jun 2021 11:57:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1622714241; bh=SSZQam37MvjdV92UuVrQYX1iZ4LDAER928vqdf2wtvg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=mAm39BGWDCGZSGf7fMTpbX/lRe+3AidPstqZkPHZEY/AL926F0LBAOsifvFSxuhVo EPfHsHPEF16sShwBP/b8U1Uspr7LfvJMbNArMTd1FAR/leDaL7F94ks48SfZHUDXL4 fd1B0+Xm8KM7CNoY0SyAThSmkCCA9GG1GYr2NLlG4LSuMjXG2RXyiE8+Td1YeObfQe OpH1y7B4s19Ka+g6TLWgEJv3F/ezycGfk/i7Sv335lA3CrX6KXeU0unDWViSmV19WG umkY2wmCvfIka0hPwOYVzd4FZzSVVnReTSz4F0MKCSXCcdKOYzED50e3lixFkCGydB GsYM+T8Z3ZPIg== Subject: Re: [PATCH 02/10] i2c: xiic: Add standard mode support for > 255 byte read transfers To: Raviteja Narayanam , "linux-i2c@vger.kernel.org" , Michal Simek Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , git References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> <20210531131948.19477-3-raviteja.narayanam@xilinx.com> <0f167c21-6bc7-0806-a536-55658a199a5b@denx.de> From: Marek Vasut Message-ID: Date: Thu, 3 Jun 2021 11:57:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/3/21 7:33 AM, Raviteja Narayanam wrote: [...] >>> + if (i2c->dynamic) { >>> + u8 bytes; >>> + u16 val; >>> + >>> + /* Clear and enable Rx full interrupt. */ >>> + xiic_irq_clr_en(i2c, XIIC_INTR_RX_FULL_MASK | >>> + XIIC_INTR_TX_ERROR_MASK); >>> + >>> + /* >>> + * We want to get all but last byte, because the TX_ERROR >> IRQ >>> + * is used to indicate error ACK on the address, and >>> + * negative ack on the last received byte, so to not mix >>> + * them receive all but last. >>> + * In the case where there is only one byte to receive >>> + * we can check if ERROR and RX full is set at the same time >>> + */ >>> + rx_watermark = msg->len; >>> + bytes = min_t(u8, rx_watermark, IIC_RX_FIFO_DEPTH); >>> + bytes--; >>> + >>> + xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, bytes); >>> + >>> + local_irq_save(flags); >>> + if (!(msg->flags & I2C_M_NOSTART)) >>> + /* write the address */ >>> + xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, >>> + i2c_8bit_addr_from_msg(msg) | >>> + XIIC_TX_DYN_START_MASK); >>> + >>> + xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK); >>> + >>> + /* If last message, include dynamic stop bit with length */ >>> + val = (i2c->nmsgs == 1) ? XIIC_TX_DYN_STOP_MASK : 0; >>> + val |= msg->len; >>> + >>> + xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, val); >>> + local_irq_restore(flags); >> >> Is local_irq_save()/local_irq_restore() used here to prevent concurrent >> access to the XIIC ? > > These were used to fix the timing constraint between two register writes to the IP. > As we have discussed last time, these are removed in " [PATCH 08/10] i2c: xiic: Remove interrupt enable/disable in Rx path". > Now they are no longer needed since our IP is fixed. > For legacy IP versions, driver is switching to 'AXI I2C standard mode' of operation in > " [PATCH 07/10] i2c: xiic: Switch to Xiic standard mode for i2c-read". I see, I would expect such fixes to be at the beginning of the series, so they can be picked into linux-stable. In fact, now that you mention the bugfixes which I posted a year ago, they also fixed a multitude of locking issues on SMP in the xiic driver. Has this series been tested on SMP Zynq or ZynqMP extensively ?