From patchwork Thu Feb 29 14:15:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 21154 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp426388dyb; Thu, 29 Feb 2024 06:17:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUpeoc4Pa+OubL1f47i8N5UGkockI2u082q2JN0NFRZ1GqqDqMIhmE59Djc66+HEffyGCeddlyYUnQscksjF9jSSgy/nQ== X-Google-Smtp-Source: AGHT+IH3tJW/eufRtbBklJlZqfN/ehHQlyajImeoWshInhuKPf/kJnZN6KIvdfYCLSQk6VI4NQLh X-Received: by 2002:a05:6a00:1398:b0:6e5:9a0a:8b82 with SMTP id t24-20020a056a00139800b006e59a0a8b82mr1405756pfg.20.1709216276967; Thu, 29 Feb 2024 06:17:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709216276; cv=pass; d=google.com; s=arc-20160816; b=klhg2CaJUC6D5RL+SrXscgKCpz6csmBeNLggsksjicpPieSUOImnIUHCaNTUlL9HiM oOw0UCkjkVHDsLaokXKQXZ2kb7/yBDyqxWQsFIP7v9sTKYKIpQ8kjvcDnM/rr8WXA/E3 cT9zS0A/TKeuQzsu5JLd/SbTydbICuOWz0nOYilXoL42I79i9MqzrYmaXKSKXupvh3wb 723/wBn4yTQf0GgPd0/nVGMtqpgoIopCSBXeWm9+f5jNiEQ9iwV17FfxcaLo22KmYIsK M5vUfzefCFc3JuKaCbbPTKEDcyKdJNlv/8u2K9mSIo9DdSpqEBf0dAFI4Y7u2w2gI4qX ZFDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=dQR77Ohf9Ft7UqgPafYk2gt6DAiG/6MEe3qWS1f2ydk=; fh=S1JXykGn8s83VQzPRjkanrg93kX6oJVbyHnK1JmVqsw=; b=JWD/deiuRbrxHAdcH7KGyoe2qpKsXQKJ8p7QMeil5Lh7Czwe4pdjS5j1f2AK8WMCMt 877D/rTNLpMxuFicJkziBThWlqwjnIHel4izHZi27gjEPCtxn++UB9g7J7tfmtxCvMW4 TOgArz7W1d17a92Epdg6rtTvdwABbcOs2M3wRYoTPEkiwwQ/afwijuacz2I+ZStUWqDf tYsr21DWCy9l0xc0PLkopTuidKto9PZPGiRGbRnPK0x6aW+M1Qpkms4mMgnqWxRTqDM/ nfOVdJvzHBvkgfPNq3/MeGicp9tE7dwbXbymFgpMcIzqbkv4rRI8XzmTcEIyU+1ITC1S UBIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bwRPX7Ja; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-86815-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86815-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s8-20020a637708000000b005dc8a58a865si1487174pgc.631.2024.02.29.06.17.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 06:17:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86815-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bwRPX7Ja; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-86815-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86815-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 00AB2287D77 for ; Thu, 29 Feb 2024 14:17:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C188137763; Thu, 29 Feb 2024 14:16:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="bwRPX7Ja" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94AB867C71; Thu, 29 Feb 2024 14:16:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709216175; cv=none; b=cqFrN4TUJU94xo+Pqlq7aJgAWP/3xRZi9p96WrjcVbmZNCEFhNcCslAlW+fEzQ6JqGUCokcXd5iYD8grO53+2ZRaol1nJ57JG8gE06UW1fzLPCYaRz2SKJDy0+wOCR3RySiV5Rq+OjP6/OEo+7vVcdISR8a5mMCveIfrylyy9oE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709216175; c=relaxed/simple; bh=r0gdwpdiOcVEmYzeCAbf/LsPLFItzMu7ondxBP6yQLQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Y//hKS1ZGIXnz8E8gaf73h/skm87jhXYDdhsCkcX7mbIaNERIWYawGB1gdnM54ZP/0usCafYSFGLx7pLISm2b/npDBIrY365jr6HAWeEt4zQ5hFexZTwiWM62pzqklzWP28hJB6rdVH1eamMLoOJ0rBpuS2MQShGejuvyDWBgXI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=bwRPX7Ja; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id ECC1040004; Thu, 29 Feb 2024 14:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709216165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dQR77Ohf9Ft7UqgPafYk2gt6DAiG/6MEe3qWS1f2ydk=; b=bwRPX7JacO2MqgeOrYY9nCIKDgdJqkmz4U/5JC5VIS8aLVO8VL62a2WQS0P+dbHk2pPpBf kk5NLB1pmi14PA1604TcfL6I8Oh0XkwMVXFnEnQzWsFhpzaoWDklGIs0b6SO/WRfaznCQu cHud7CxjXguKT8MCy2lKjx62r5d+azDBr+nhxL1QqZnUbKzF2Ey2etjYkHx1YoK6N2rCix +jZp7paGnOyPg2dP9hdt/dw8kyxPoC3mvMlmCOCm/iIOVnl8JeiF9CYSctrlXiroOEhs56 hb+74nKThKdQLk72GVjxeoso4zEOnLufho9LCsPlqbBzVFXfdSSGeuXoNLUGcQ== From: Herve Codina To: Vadim Fedorenko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Herve Codina , Yury Norov , Andy Shevchenko , Rasmus Villemoes Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Andrew Lunn , Mark Brown , Christophe Leroy , Thomas Petazzoni Subject: [PATCH v5 0/5] Add support for QMC HDLC Date: Thu, 29 Feb 2024 15:15:48 +0100 Message-ID: <20240229141554.836867-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792243166725507021 X-GMAIL-MSGID: 1792243166725507021 Hi, This series introduces the QMC HDLC support. Patches were previously sent as part of a full feature series and were previously reviewed in that context: "Add support for QMC HDLC, framer infrastructure and PEF2256 framer" [1] In order to ease the merge, the full feature series has been split and needed parts were merged in v6.8-rc1: - "Prepare the PowerQUICC QMC and TSA for the HDLC QMC driver" [2] - "Add support for framer infrastructure and PEF2256 framer" [3] This series contains patches related to the QMC HDLC part (QMC HDLC driver): - Introduce the QMC HDLC driver (patches 1 and 2) - Add timeslots change support in QMC HDLC (patch 3) - Add framer support as a framer consumer in QMC HDLC (patch 4) Compare to the original full feature series, a modification was done on patch 3 in order to use a coherent prefix in the commit title. I kept the patches unsquashed as they were previously sent and reviewed. Of course, I can squash them if needed. Compared to the previous iteration: https://lore.kernel.org/linux-kernel/20240222142219.441767-1-herve.codina@bootlin.com/ this v5 series mainly: - Update some piece of code to improve readability. - Release resources before printing error messages. - Use 'struct device *dev' and dev_err_probe() in probe(). - Use guard() and scoped_guard() from cleanup.h for spinlock locking. Best regards, Hervé [1]: https://lore.kernel.org/linux-kernel/20231115144007.478111-1-herve.codina@bootlin.com/ [2]: https://lore.kernel.org/linux-kernel/20231205152116.122512-1-herve.codina@bootlin.com/ [3]: https://lore.kernel.org/linux-kernel/20231128132534.258459-1-herve.codina@bootlin.com/ Changes v4 -> v5 - Patch 1 Update QMC_HDLC_RX_ERROR_FLAGS to improve readability. Display an error message after releasing resources instead of before. Use 'struct device *dev' in probe(). Use dev_err_probe() in probe(). Do not print a message on -ENOMEM. Use guard() and scoped_guard(). - Patch 3 Use '(). See' constructing in kernel-doc instead of '() (See ...' Add 'Co-developed-by: Herve Codina ' - Patch 4 Use 'struct device *dev' in probe(). Use dev_err_probe() in probe(). Use '%64pb' instead of '%*pb' in printk formats. - Patch 5 Use 'struct device *dev' in probe(). Use guard() Changes v3 -> v4 - Patch 1 Remove of.h and of_platform.h includes, add mod_devicetable.h. Add a blank line in the includes list. - Path 2 No changes. - v3 patches 3 and 4 removed - Patch 3 (new patch in v4) Introduce bitmap_{scatter,gather}() based on the original patch done by Andy Shevchenko. Address comments already done on the original patch: https://lore.kernel.org/lkml/20230926052007.3917389-3-andriy.shevchenko@linux.intel.com/ - Removed the returned values. - Used 'unsigned int' for all indexes. - Added a 'visual' description of the operations in kernel-doc. - Described the relationship between bitmap_scatter() and bitmap_gather(). - Moved bitmap_{scatter,gather}() to the bitmap.h file. - Improved bitmap_{scatter,gather}() test. - Reworked the commit log. - Patch 4 (v3 patch 5) Use bitmap_{scatter,gather}() - Patches 5 (v3 patch 6) No changes. Changes v2 -> v3 - Patch 1 Remove 'inline' function specifier from .c file. Fix a bug introduced when added WARN_ONCE(). The warn condition must be desc->skb (descriptor used) instead of !desc->skb. Remove a lock/unlock section locking the entire qmc_hdlc_xmit() function. - Patch 5 Use bitmap_from_u64() everywhere instead of bitmap_from_arr32() and bitmap_from_arr64(). Changes v1 -> v2 - Patch 1 Use the same qmc_hdlc initialisation in qmc_hcld_recv_complete() than the one present in qmc_hcld_xmit_complete(). Use WARN_ONCE() - Patch 3 (new patch in v2) Make bitmap_onto() available to users - Patch 4 (new patch in v2) Introduce bitmap_off() - Patch 5 (patch 3 in v1) Use bitmap_*() functions - Patch 6 (patch 4 in v1) No changes Changes compare to the full feature series: - Patch 3 Use 'net: wan: fsl_qmc_hdlc:' as commit title prefix Patches extracted: - Patch 1 : full feature series patch 7 - Patch 2 : full feature series patch 8 - Patch 3 : full feature series patch 20 - Patch 4 : full feature series patch 27 Andy Shevchenko (1): lib/bitmap: Introduce bitmap_scatter() and bitmap_gather() helpers Herve Codina (4): net: wan: Add support for QMC HDLC MAINTAINERS: Add the Freescale QMC HDLC driver entry net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support net: wan: fsl_qmc_hdlc: Add framer support MAINTAINERS | 7 + drivers/net/wan/Kconfig | 12 + drivers/net/wan/Makefile | 1 + drivers/net/wan/fsl_qmc_hdlc.c | 787 +++++++++++++++++++++++++++++++++ include/linux/bitmap.h | 101 +++++ lib/test_bitmap.c | 42 ++ 6 files changed, 950 insertions(+) create mode 100644 drivers/net/wan/fsl_qmc_hdlc.c Reviewed-by: Andy Shevchenko