From patchwork Wed Oct 18 20:59:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13427904 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 32ECFCDB47E for ; Wed, 18 Oct 2023 21:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=paeiEKKhBcWHLE4pr8qfQK2x1AjXOdhK/9bvFNXnaUw=; b=NOeHgu6mUNqDQ8 RRsa9atDQrPgDmC339TOvMBD+yzn49ugu3nr9tpnGSdj/LKhGkZy0SPycwDhcLK6NY4faP0oikXt9 mo6l+OQ9dFKr586wHp6jLrJXCPZYhJZd7zGME5PP6TejyT7NZIxwdCzcByjLMkmujJi3vDhc7XdbA 3y8EcbjfkiyKspUCP69JdVQMSC//fCMhKbUeK4d6fEiW62OTHnGjgeAqY9G2R6NOsHBB6qP22stQ2 LU6TJ3yS6aZ61GDaQm58h+1AXW+kU6FzT+h3YkAwNJG/Pu3p0VE350Quh/YhWwN8Gyz3s4ab5X+6v Cc6ExtohNfMAfI2u0uww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtDe5-00Fgli-1e; Wed, 18 Oct 2023 21:00:01 +0000 Received: from mail-vi1eur04on062e.outbound.protection.outlook.com ([2a01:111:f400:fe0e::62e] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtDe1-00Fgk7-04 for linux-i3c@lists.infradead.org; Wed, 18 Oct 2023 20:59:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G2NaRYjuHV1EvSHL/hw3hETlT00k1NS/6//zpDf7x/597P6m1QzoSrM6cRjB8ZIQj53xTRvR9RNQFrhaUxNKw8lm/+1hkPTe7QwisN0AcWoHuiDhLxD8osbxC66+CEMF2SbCFWxRBhvXmKHReFAI1AVArcwQH6YePgtVy8+LRsLPj3HatqnFk2dQW8jVK78jWLTpXnD5ovGR3mouKbcxyzhKDl0omR9qU8lIcLrHtvy53o6QCDGGeUzmDy37OUJGNKZExF05w0EpMj4WPUY/a2ZIdZKok5wd06oAPhKSgPv07Xpl/lOWSgC/nRFclY3FJCQzsSOf2CYjNqG7B3v57Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4A7TUodxO7AkkBqM03CJiYKQDrUpiaHEzapJqI1G5GI=; b=A2WR9CNnEoqmo4YwDAemC0TyRT9jRHwMabDgdLJSy/TrXg78X/U4rTx2fbvYwA2jit7Nn4KN07Vp6WVAguhrr8sgMz9XehiKvfsD0p8+exAkpzFzKNZR7Lsq7teUuy8R5cdhKGEpbTlR1Rb9xWnqWM4uJ9R3mAqbKHmM31p2ygku6HGQVB5Jtk/+NVvFF8JysUujiMIV5Vq+Bal9y1XnjBqzEwEEoX0+kcxwFrzsjwjGTpQvHD4wihSpjItqzsQYSgp5F7q7e3CjvibxVvj3u8lBxd0mfOr+ERV1/o8kCVekzYuMLI0xxfe/UlmRscF6iSwxRS6MbeD7eHnUWhjR0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4A7TUodxO7AkkBqM03CJiYKQDrUpiaHEzapJqI1G5GI=; b=qYevKj7LBUAd9OyGfZcamdFHtJBjLwbzRBrTz78iTGTMhi8I3TjjWiiTBNEFXncz0+MuhjQkKSotkvgFmVGW1DJC3UZGuy0W/9eEUd0YmKbufVhvelXTIymhHQhTF1barMW6VuTZnFHxtMHTuVy3kz6Tfz2tU1eF4wpCu4A4qmU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by PAXPR04MB8653.eurprd04.prod.outlook.com (2603:10a6:102:21c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Wed, 18 Oct 2023 20:59:45 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6907.022; Wed, 18 Oct 2023 20:59:45 +0000 From: Frank Li To: miquel.raynal@bootlin.com Cc: Frank.Li@nxp.com, alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, imx@lists.linux.dev, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/6] i3c: master: some improvment for i3c master Date: Wed, 18 Oct 2023 16:59:23 -0400 Message-Id: <20231018205929.3435110-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BY3PR10CA0027.namprd10.prod.outlook.com (2603:10b6:a03:255::32) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: 47a15ac3-1438-4c2b-e7fd-08dbd01d2871 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zgviHGxxJg4ypZjgial0IdL6QpCvjZuVJRsnLkhMRdH06Et71Z+7sjY2LEjsVPWsepT9Bx8R30ZLqUmyddiRvRBfKTqRU2lqhk9QwlljmT5piu7c37WyIJ1GPS5SEJOr1sG2GQPGY5SemLbU6EW39OnpcP7L6mk9l57VMH6KkpvFUFHLYOuUZ/rZe/eIbO9sH0Q4FI+8O9N+nOkwROg/pFvEPTgsll5IQR8UYerDVk25lgPBRDyIpm1eAG4mus/JdT8DnwKSAHhHYWjUn5XPSrIb+h0R6taCWxr2lvJ8cy/c+qSURXBKVBMK1bSQW7cf2PQ41EwtyAv63DOtu0lvuQRzEk0xWljEayBNc8H26bZpE+p8K3BZSjA40jXmfkWVLfeAtdTGmep2BqqVpI9tALZe7RxgWvSaNTo/j411lg4szT9LFMkQq2XwJT3WyUKVL6e9buwV+0TOmxvWuxYqE4HcyAqntF57fUFnVJpz7nZj91QDtoEk/iQCF62w1dUV1LaEKO5HqEEqmdZRtLr5Xsrp91OCiAqvlbupxuYt8ycbMmlO1a4aIsjHwIzx5aXWzGfdQZiLS4d80xFFjNK3fqgj+8TqTOQiPUkTqYg/ue/QajkdYIJBDzHn4RSeP07q X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(346002)(366004)(376002)(396003)(39860400002)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(6512007)(6666004)(6506007)(52116002)(2906002)(4326008)(41300700001)(478600001)(38350700005)(966005)(6486002)(1076003)(26005)(83380400001)(2616005)(36756003)(66476007)(66946007)(6916009)(316002)(66556008)(86362001)(8936002)(8676002)(38100700002)(5660300002)(42413004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lIdqjXKFZ99zQCwhEhQkmOTogZI/?= =?utf-8?q?ks+6r+/fVlJV2iWoDo5Db9QY1Xy5fcISjAdBgJpuHtQmZuf4QpCskkkFOG/9wCfMF?= =?utf-8?q?IW4OJApcBAeM44qMSXzAFC16EodJa1/7Epnkv9ebcQAitJ2IxSyiVqvAU9ME6hov/?= =?utf-8?q?WiUPDhXacAa/OCgs0ZbFJ6DYpC09GkWTkttKPtzI9IDVN2Xwi+xUWCLQSLMlYtoa0?= =?utf-8?q?QoDBq1VULL5dB5Tv9Bu02PW8FTKoBYy5XY7D1qY3vDQSwxyjngdL2dmbObUHYoPyp?= =?utf-8?q?e2LjUvVvukQ5YzYf38hhB3/Gfn1Mq94dYk2WYx+hs9PFUsifnalQ74wy1YcrosSag?= =?utf-8?q?WJqalCBRYViCkWulGJHBVY6DVPjnq7MbqwFR3jHFwmTA7mMmmf6qqovuCg4WbikZf?= =?utf-8?q?eGEUUdBJ1b5AH3bHKF1Pl8RMOaPb16uAjZ2rMtxLUN5aNRb/OUn4n20WixJvv0Srv?= =?utf-8?q?+hC//PQpIdFq0zTrf5ZTB5Dy8+rZDWQKHRizGMD0KBF/JUeTW2Rg/AWCcCItqN6lq?= =?utf-8?q?dbPm/hCHiSWR+ks+BcJw+uH14bc4oue9yXlQ+6hBvvDIuvJtLBlA4QIiQ9/a/4pAn?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FjSJHY?= =?utf-8?q?QaKNey9J4Yo+DcYHOFK7LiDnh72VPGrBnfLZZ0iaRVIbZmcQNwwBtulgMT4t4IURU?= =?utf-8?q?x9667HjoakAP?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47a15ac3-1438-4c2b-e7fd-08dbd01d2871 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 20:59:45.6348 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jSzJMD5uR9b0yB82a5XwVbHXQgGwVgyhkF17OPamT5hcUY4GGArU5vt0xl9XVj4iwA+Iu402wZ1SluGdVvm5cg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8653 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231018_135957_079874_2E55D098 X-CRM114-Status: UNSURE ( 7.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org These are dependent on bugs fixed serial: https://lore.kernel.org/imx/20231016153232.2851095-1-Frank.Li@nxp.com/T/#t There are three major improvement 1. Add actual size in i3c_transfer because i3c allow target early termiate transfer. 2. Add API for i3c_dev_gettstatus_format1 for i3c comand GET_STATUS. 3. svc master enable hotjoin default Change from v1 to v2. - Hotjoin control by sys entry, default enable hotjoin, which standard i3c feature, user can disable by echo 0 > /sys/bus/i3c/i3c-0/hotjoin - use actual_len, add document - using &xfers[i] - still keep check cmd->xfer because i2c and ccc transfer, xfer is NULL. - fixed issue found by checkpatch --strict Frank Li (6): i3c: master: add enable(disable) hot join in sys entry i3c: master: svc: add hot join support i3c: add actual_len in i3c_priv_xfer i3c: svc: rename read_len as actual_len i3c: master: svc return actual transfer data len i3c: add API i3c_dev_gettstatus_format1() to get target device status drivers/i3c/device.c | 24 ++++++ drivers/i3c/internals.h | 1 + drivers/i3c/master.c | 110 ++++++++++++++++++++++++++++ drivers/i3c/master/svc-i3c-master.c | 91 ++++++++++++++++++----- include/linux/i3c/device.h | 3 + include/linux/i3c/master.h | 5 ++ 6 files changed, 217 insertions(+), 17 deletions(-)