From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Osipenko Subject: Re: [PATCH V17 3/6] i2c: tegra: fix maximum transfer size Date: Fri, 8 Feb 2019 21:38:26 +0300 Message-ID: References: <1549648195-3989-1-git-send-email-skomatineni@nvidia.com> <1549648195-3989-3-git-send-email-skomatineni@nvidia.com> <0c30dfe0-1174-0056-5ef6-432b75de2353@gmail.com> <3e4db3e9-8198-f1bf-f909-492bf1ff8c56@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Sowjanya Komatineni , "thierry.reding@gmail.com" , Jonathan Hunter , Mantravadi Karthik , Shardar Mohammed , Timo Alho Cc: "wsa@the-dreams.de" , "peda@axentia.se" , "linux-tegra@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-i2c@vger.kernel.org" , "stable@vger.kernel.org" List-Id: linux-i2c@vger.kernel.org 08.02.2019 21:37, Sowjanya Komatineni пишет: >>>>>> static const struct i2c_adapter_quirks tegra194_i2c_quirks = { >>>>>> .flags = I2C_AQ_NO_ZERO_LEN, >>>>>> + .max_write_len = 65535 - I2C_PACKET_HEADER_SIZE, >>>>> >>>>> Ideally it should be SZ_64K - I2C_PACKET_HEADER_SIZE to not miss the one byte, otherwise good to me: >>>>> >>>>> Reviewed-by: Dmitry Osipenko >>>> >>>> With SZ_64K - I2C_PACKET_HEADR_Size, When we compute dma_buf_size >>>> = max_write_len + I2C_PACKET_HEADER_SIZE, dma_buf_size will be >>>> SZ_64K which is 0x10000 apbdma dma count limit should be < 64K >>>> meaning 65535 max is allowed >>>> >>> >>> But it's for the GPCDMA, does it have the same 64K limit as APB DMA? >> > 64K limit is for APBDMA. This patch has APBDMA support only. No GPCDMA support so buf size limit is based on APBDMA. > GPCDMA supports upto 1GB. > > I think dma_buf_size is only for buffer allocation so shouldn’t harm for exact 64K. > Will take a look at dma driver... > > All msg reads, max length is 65535 > All msg writes, max length requests is also limited to 65535 due to u16 type of msg.len So, In any case, we don’t need 65536 bytes. > Confused, yeah with max write quirk, max transfer can be 64K. > > Will change to 64K instead of 65535. > Good, thank you! Everything else looks good to me.