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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 BB379C169C4 for ; Mon, 11 Feb 2019 17:58:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8416C21B69 for ; Mon, 11 Feb 2019 17:58:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="afdd2kBC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730480AbfBKR60 (ORCPT ); Mon, 11 Feb 2019 12:58:26 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:33271 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbfBKR6Z (ORCPT ); Mon, 11 Feb 2019 12:58:25 -0500 Received: by mail-lj1-f193.google.com with SMTP id f24-v6so9608860ljk.0 for ; Mon, 11 Feb 2019 09:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UqQIZzNmDnZpCt4StvvI7wOIlDHA3KTRWKKbAkZ++bY=; b=afdd2kBCxPEafV2vKx1/kpJa5ngmp4INRcCntYtJhFOykhV5R0GJd8L/WqSzvPNPHg hdCuke6cV9WFENwHLxSURrTPu/QWyKxCsgyukWnMHWKdK9BrUdNmqMLF3pgnrnnsb3dJ Xt9bnouogtUjQ00zAjGfGiFJkFuzCw5LHVg8gumUJiAfuF14OgRoZjxdjzz4YiAABvIu TsRHPMKGEz7ZjZHabeaOnTdq5bebH3LB6iL/3nRxdtl/e7XnOJIDHa0t2gp2wdzlyVES q2JgIKh7LxZf+4Bg4T9ZVKNSd/pJH5ibTMMsiQjQlxdZgCvCWEPl0qSdBGXvWV1+NZH5 7aIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UqQIZzNmDnZpCt4StvvI7wOIlDHA3KTRWKKbAkZ++bY=; b=ITDfOnmYH2JaYFNUwSvWUQTzzgkgFdUtbjGboqxdyKHtiXj6/dKibt4gw8F3tixqRW D/YomweOxmwQc2YQxxga7elOrBdQeAB3jitGjEgUIf0DdNBWfRFGlBOC4Kk4l/dCZLQy TL7SwaO9n3RLe4a1R7AFJmlwJP/00+oqYcIS1w1FFo5Tc3FwngSwKpoz72/wptJH6+9F aaiCz0r05abTL7Ny8NEsHMCIiNp3dF+a/OUCmCnbWr6lpeA670Typ8XjXt4AGlV6N5RM B3i8NPyGi6B0Mvcgq/u1mGmCqbxM9K8dM/xAQriSkQVu9EL653uAjOhRS82aBqDNqmNe weNA== X-Gm-Message-State: AHQUAuYBXI7rP9cWAKbh5elQ/Q03uN5NN63zFZtJoBBRezAY8V4UNkcf T08g34/GJqUCdKo3a8Z1CAtzQ4c4 X-Google-Smtp-Source: AHgI3IZ8H8OxygKRXsvpoHkeBrWN06DdmDZLZHtmE38ub6NcY7ijNWFA0ktikflccbmncfhon+21CQ== X-Received: by 2002:a2e:8156:: with SMTP id t22-v6mr7609124ljg.32.1549907902193; Mon, 11 Feb 2019 09:58:22 -0800 (PST) Received: from [192.168.2.145] (ppp91-79-175-49.pppoe.mtu-net.ru. [91.79.175.49]) by smtp.googlemail.com with ESMTPSA id w16-v6sm2283300ljw.11.2019.02.11.09.58.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 09:58:21 -0800 (PST) Subject: Re: [PATCH V18 3/6] i2c: tegra: fix maximum transfer size From: Dmitry Osipenko To: Sasha Levin , Sowjanya Komatineni , thierry.reding@gmail.com, jonathanh@nvidia.com Cc: wsa@the-dreams.de, peda@axentia.se, stable@vger.kernel.org References: <1549652382-5476-3-git-send-email-skomatineni@nvidia.com> <20190211172603.0CE06222A2@mail.kernel.org> <15526ece-3067-4a9e-ba32-9ef37116ee4c@gmail.com> Message-ID: <7784b5fb-0f09-c838-63a3-16b82d6c7c98@gmail.com> Date: Mon, 11 Feb 2019 20:58:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <15526ece-3067-4a9e-ba32-9ef37116ee4c@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 11.02.2019 20:42, Dmitry Osipenko пишет: > 11.02.2019 20:26, Sasha Levin пишет: >> Hi, >> >> [This is an automated email] >> >> This commit has been processed because it contains a -stable tag. >> The stable tag indicates that it's relevant for the following trees: all >> >> The bot has tested the following trees: v4.20.7, v4.19.20, v4.14.98, v4.9.155, v4.4.173, v3.18.134. >> >> v4.20.7: Failed to apply! Possible dependencies: >> 0604ee4aefa2 ("i2c: tegra: Add missing kerneldoc for some fields") >> b67d4530cdad ("i2c: tegra: Fix Maximum transfer size") >> c990bbafdb11 ("i2c: tegra: Cleanup kerneldoc comments") >> >> v4.19.20: Failed to apply! Possible dependencies: >> 0604ee4aefa2 ("i2c: tegra: Add missing kerneldoc for some fields") >> b67d4530cdad ("i2c: tegra: Fix Maximum transfer size") >> c96c0f268380 ("i2c: tegra: use core to detect 'no zero length' quirk") >> c990bbafdb11 ("i2c: tegra: Cleanup kerneldoc comments") >> >> v4.14.98: Failed to apply! Possible dependencies: >> 0604ee4aefa2 ("i2c: tegra: Add missing kerneldoc for some fields") >> b67d4530cdad ("i2c: tegra: Fix Maximum transfer size") >> c5907c6b96f1 ("i2c: tegra: Add support for Tegra194") >> c96c0f268380 ("i2c: tegra: use core to detect 'no zero length' quirk") >> c990bbafdb11 ("i2c: tegra: Cleanup kerneldoc comments") >> >> v4.9.155: Failed to apply! Possible dependencies: >> 0604ee4aefa2 ("i2c: tegra: Add missing kerneldoc for some fields") >> 6bec23bff914 ("i2c: mlxcpld: add master driver for mellanox systems") >> ae3923a284cc ("i2c: busses: make i2c_adapter_quirks const") >> b67d4530cdad ("i2c: tegra: Fix Maximum transfer size") >> c02b7bf532f7 ("i2c: mux: mellanox: add driver") >> c5907c6b96f1 ("i2c: tegra: Add support for Tegra194") >> c96c0f268380 ("i2c: tegra: use core to detect 'no zero length' quirk") >> c990bbafdb11 ("i2c: tegra: Cleanup kerneldoc comments") >> >> v4.4.173: Failed to apply! Possible dependencies: >> 0194621b2253 ("IB/rdmavt: Create module framework and handle driver registration") >> 0604ee4aefa2 ("i2c: tegra: Add missing kerneldoc for some fields") >> 1f50ad2c86cd ("i2c: tegra: Add runtime power-management support") >> 21e9efd92bb5 ("i2c: tegra: disable clock before returning error") >> 497fbe24987b ("i2c: tegra: enable multi master mode for tegra210") >> 50a5ba876908 ("i2c: mux: demux-pinctrl: add driver") >> 685143a1598b ("i2c: tegra: use readl_poll_timeout after config_load reg programmed") >> 6bec23bff914 ("i2c: mlxcpld: add master driver for mellanox systems") >> 7f866986e705 ("leds: add PM8058 LEDs driver") >> 8700e3e7c485 ("Soft RoCE driver") >> 9d7cffaf99f5 ("leds: Add driver for the ISSI IS31FL32xx family of LED controllers") >> ae3923a284cc ("i2c: busses: make i2c_adapter_quirks const") >> b67d4530cdad ("i2c: tegra: Fix Maximum transfer size") >> be4fdf99fa4d ("leds: add driver for Mellanox systems LEDs") >> c02b7bf532f7 ("i2c: mux: mellanox: add driver") >> c5907c6b96f1 ("i2c: tegra: Add support for Tegra194") >> c96c0f268380 ("i2c: tegra: use core to detect 'no zero length' quirk") >> c990bbafdb11 ("i2c: tegra: Cleanup kerneldoc comments") >> f5076685b3aa ("i2c: tegra: Fix missing blank lines after declarations") >> >> v3.18.134: Failed to apply! Possible dependencies: >> 1f50ad2c86cd ("i2c: tegra: Add runtime power-management support") >> 21e9efd92bb5 ("i2c: tegra: disable clock before returning error") >> 497fbe24987b ("i2c: tegra: enable multi master mode for tegra210") >> 5b25b13ab08f ("sys_membarrier(): system-wide memory barrier (generic, x86)") >> 685143a1598b ("i2c: tegra: use readl_poll_timeout after config_load reg programmed") >> 6bec23bff914 ("i2c: mlxcpld: add master driver for mellanox systems") >> 6f4664b2e2c2 ("i2c: tegra: update CONFIG_LOAD for new conifiguration") >> 8700e3e7c485 ("Soft RoCE driver") >> 93c1edb27f9e ("mlxsw: Introduce Mellanox switch driver core") >> a7405844da1c ("i2c: at91: make use of the new infrastructure for quirks") >> ae3923a284cc ("i2c: busses: make i2c_adapter_quirks const") >> b94c820f3780 ("i2c: cpm: make use of the new infrastructure for quirks") >> be4fdf99fa4d ("leds: add driver for Mellanox systems LEDs") >> c02b7bf532f7 ("i2c: mux: mellanox: add driver") >> c5907c6b96f1 ("i2c: tegra: Add support for Tegra194") >> c96c0f268380 ("i2c: tegra: use core to detect 'no zero length' quirk") >> d57f5dedde18 ("i2c: tegra: add support for fast plus (FM+) mode clock rate") >> d64a818859af ("i2c: at91: add support for runtime PM") >> f5076685b3aa ("i2c: tegra: Fix missing blank lines after declarations") >> >> >> How should we proceed with this patch? > > I guess it will be fine to either limit backporting down to just 5.0 or 4.20 (taking the kerneldoc dependency). Though probably most ideal variant will be to split the fix into two patches: first fixes the max transfer for older Tegra's and second for T194 specifically. Either way should be good enough since realistically none of upstream-supported devices should ever hit the bug (but that's not 100% of course). > Sowjanya, So the first patch could looks like this: ----------- static const struct i2c_adapter_quirks tegra_i2c_quirks = { .flags = I2C_AQ_NO_ZERO_LEN, .max_read_len = 4096, - .max_write_len = 4096, + .max_write_len = 4096 - 12, }; ----------- And then you should change the stable tag to "Cc: stable@vger.kernel.org # 4.4+" The second patch will be somewhat like this: ----------- +/* Packet header size in bytes */ +#define I2C_PACKET_HEADER_SIZE 12 + #define I2C_MST_FIFO_STATUS 0x0b8 #define I2C_MST_FIFO_STATUS_RX_MASK 0xff #define I2C_MST_FIFO_STATUS_RX_SHIFT 0 #define I2C_MST_FIFO_STATUS_TX_MASK 0xff0000 #define I2C_MST_FIFO_STATUS_TX_SHIFT 16 @@ -899,12 +902,13 @@ static const struct i2c_algorithm tegra_i2c_algo = { /* payload size is only 12 bit */ static const struct i2c_adapter_quirks tegra_i2c_quirks = { .flags = I2C_AQ_NO_ZERO_LEN, - .max_read_len = 4096, - .max_write_len = 4096 - 12, + .max_read_len = SZ_4K, + .max_write_len = SZ_4K - I2C_PACKET_HEADER_SIZE, }; static const struct i2c_adapter_quirks tegra194_i2c_quirks = { .flags = I2C_AQ_NO_ZERO_LEN, + .max_write_len = SZ_64K - I2C_PACKET_HEADER_SIZE, }; static const struct tegra_i2c_hw_feature tegra20_i2c_hw = { ----------- And then the stable tag for the second patch will be: "Cc: stable@vger.kernel.org # 4.20+".