From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDE8BC47082 for ; Thu, 3 Jun 2021 09:59:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC8B9613F1 for ; Thu, 3 Jun 2021 09:59:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC8B9613F1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NfZ9yc/0pGRkXNn5746F/qVRDjKklFq/HS8oq/Goosk=; b=kRQq4xZzMydGTgsMUqZ67WAgd0 U6vuTrB7e0pgRM5OyUYATgaP/ASnhtZRnrZqvdTNu818QkHhiEdU7Pu/E/0ZnnSct5wLrMWfETy3z /+d4xOKRkFHojbj7tZvbdFYmbjd00tk7/YyVaCP3tWd+O/6KM0VI33KVOFDQh7D5eMttngFCD4P4Z r0/ji11ItyTRWQnq1OraOFQhYpOy73tZ/PuuIQMUrwf0fD6nu3nitN2Mvp5ke1pQmhv0xIl5oX1AJ QfaWXPFzYlVqRvnWr2WWo5QbuPJpI+EIzKlQL7TncZWFkn6q25agn0PBq5vxarhSSNmFNd59gHx/+ EJP3MAcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lok6U-007xCH-64; Thu, 03 Jun 2021 09:57:30 +0000 Received: from phobos.denx.de ([85.214.62.61]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lok6M-007x9C-Th for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 09:57:25 +0000 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-Language: en-US X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_025723_461245_4E03888D X-CRM114-Status: GOOD ( 20.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 ? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel