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 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 2B5F6E94134 for ; Fri, 6 Oct 2023 22:09:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1DFDC1D9; Sat, 7 Oct 2023 00:08:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1DFDC1D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1696630176; bh=S/N63H4X+QPAGfS1YS/mBfx58DuAbwAsy+1fq8W1EuY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GsXWzqBQTWCI58+UurqTg+svVuRB2oEhNv+58QBgU3bI/sVoe7aJ/Ix4ovedKrOdt QUYgbd9CtuVavh/8H4vkEHZ0tYoxyBDvsuMCSPjSHQ3Y/ydnZkNwyP/3g4J2B5uiEo ZyaxOUi+/XDOV8KENAw8QX2m85HSaqUxl7ZBpqfo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DBA76F80558; Sat, 7 Oct 2023 00:08:25 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6FEEFF8047D; Sat, 7 Oct 2023 00:08:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E05CCF8047D; Sat, 7 Oct 2023 00:08:20 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5C34DF80130 for ; Sat, 7 Oct 2023 00:08:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5C34DF80130 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=lqqUlsyH Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A041A60BB8; Fri, 6 Oct 2023 22:08:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46CD3C433C7; Fri, 6 Oct 2023 22:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696630092; bh=S/N63H4X+QPAGfS1YS/mBfx58DuAbwAsy+1fq8W1EuY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lqqUlsyH7HQbKjX6+5MZaW5p3Joc5/jp6VffbnbSi4frEd/pPhmgULRdlX5REnhpP BK2xli8u32zh+fkxpuHUOLaTi6MD1PXmD4uaT4ger+hlNVtAIdfLCOrFRtKzFzQdQz 2sQXEvvtRBzYF6TTKxDU1a+OboOZzIkfFfzieoDXlciUuulj9kl61ww0wJPKsFKgrl bG0J56gOoLjF3VNIh6eD3ijl/+KNdaIHPaK1qZBx8m+Qm/Nj6jA1it1GsSd/KDmDTO 8t97yI7Q9ito8x5R+7R8OzvwKOZlUfEqCdWiEARsL6pB/CF8A3b9DgN6yKbMV0niw2 jzXwcskBcwReg== Date: Fri, 6 Oct 2023 15:08:10 -0700 From: Jakub Kicinski To: Herve Codina Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Qiang Zhao , Li Yang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Christophe Leroy , Randy Dunlap , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Simon Horman , Christophe JAILLET , Thomas Petazzoni Subject: Re: [PATCH v7 24/30] net: wan: Add framer framework support Message-ID: <20231006150810.09e2c1a9@kernel.org> In-Reply-To: <20230928070652.330429-25-herve.codina@bootlin.com> References: <20230928070652.330429-1-herve.codina@bootlin.com> <20230928070652.330429-25-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: RBNOSVUFSNPANGFPAIXOFCIDC3BTJINT X-Message-ID-Hash: RBNOSVUFSNPANGFPAIXOFCIDC3BTJINT X-MailFrom: kuba@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 28 Sep 2023 09:06:42 +0200 Herve Codina wrote: > +menu "Framer Subsystem" > + > +config GENERIC_FRAMER > + bool "Framer Core" > + help > + Generic Framer support. > + A framer is a component in charge of an E1/T1 line interface. > + Connected usually to a TDM bus, it converts TDM frames to/from E1/T1 > + frames. It also provides information related to the E1/T1 line. > + Used with HDLC, the network can be reached through the E1/T1 line. > + > + This framework is designed to provide a generic interface for framer > + devices present in the kernel. This layer will have the generic > + API by which framer drivers can create framer using the framer > + framework and framer users can obtain reference to the framer. > + All the users of this framework should select this config. maybe make the menu a menuconfig with info about framers but hide the GENERIC_FRAMER symbol? The driver 'select' it anyway, what's the point of prompting the user.. > + if (WARN_ON(!dev)) > + return ERR_PTR(-EINVAL); no defensive programming, let the kernel crash > + ret = framer_pm_runtime_get_sync(framer); > + if (ret < 0 && ret != -EOPNOTSUPP) > + goto err_pm_sync; > + > + ret = 0; /* Override possible ret == -EOPNOTSUPP */ This looks pointless given that ret is either overwritten or not used later on > + mutex_lock(&framer->mutex); > + if (framer->power_count == 0 && framer->ops->power_on) { > + ret = framer->ops->power_on(framer); > + if (ret < 0) { > + dev_err(&framer->dev, "framer poweron failed --> %d\n", ret); > + goto err_pwr_on; > + } > + } > + ++framer->power_count; > + mutex_unlock(&framer->mutex); > + return 0; 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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 BF68FE94134 for ; Fri, 6 Oct 2023 22:09:07 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=lqqUlsyH; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4S2Myp1BJ1z3vZ5 for ; Sat, 7 Oct 2023 09:09:06 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=lqqUlsyH; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=kuba@kernel.org; receiver=lists.ozlabs.org) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4S2Mxp6mTmz2yGF for ; Sat, 7 Oct 2023 09:08:14 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A041A60BB8; Fri, 6 Oct 2023 22:08:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46CD3C433C7; Fri, 6 Oct 2023 22:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696630092; bh=S/N63H4X+QPAGfS1YS/mBfx58DuAbwAsy+1fq8W1EuY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lqqUlsyH7HQbKjX6+5MZaW5p3Joc5/jp6VffbnbSi4frEd/pPhmgULRdlX5REnhpP BK2xli8u32zh+fkxpuHUOLaTi6MD1PXmD4uaT4ger+hlNVtAIdfLCOrFRtKzFzQdQz 2sQXEvvtRBzYF6TTKxDU1a+OboOZzIkfFfzieoDXlciUuulj9kl61ww0wJPKsFKgrl bG0J56gOoLjF3VNIh6eD3ijl/+KNdaIHPaK1qZBx8m+Qm/Nj6jA1it1GsSd/KDmDTO 8t97yI7Q9ito8x5R+7R8OzvwKOZlUfEqCdWiEARsL6pB/CF8A3b9DgN6yKbMV0niw2 jzXwcskBcwReg== Date: Fri, 6 Oct 2023 15:08:10 -0700 From: Jakub Kicinski To: Herve Codina Subject: Re: [PATCH v7 24/30] net: wan: Add framer framework support Message-ID: <20231006150810.09e2c1a9@kernel.org> In-Reply-To: <20230928070652.330429-25-herve.codina@bootlin.com> References: <20230928070652.330429-1-herve.codina@bootlin.com> <20230928070652.330429-25-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , alsa-devel@alsa-project.org, Thomas Petazzoni , Xiubo Li , Linus Walleij , Liam Girdwood , Eric Dumazet , Krzysztof Kozlowski , Fabio Estevam , Qiang Zhao , Shengjiu Wang , Paolo Abeni , devicetree@vger.kernel.org, Conor Dooley , linux-kernel@vger.kernel.org, Nicolin Chen , linux-gpio@vger.kernel.org, Rob Herring , Christophe JAILLET , Jaroslav Kysela , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, Randy Dunlap , Takashi Iwai , Li Yang , Mark Brown , Simon Horman , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, 28 Sep 2023 09:06:42 +0200 Herve Codina wrote: > +menu "Framer Subsystem" > + > +config GENERIC_FRAMER > + bool "Framer Core" > + help > + Generic Framer support. > + A framer is a component in charge of an E1/T1 line interface. > + Connected usually to a TDM bus, it converts TDM frames to/from E1/T1 > + frames. It also provides information related to the E1/T1 line. > + Used with HDLC, the network can be reached through the E1/T1 line. > + > + This framework is designed to provide a generic interface for framer > + devices present in the kernel. This layer will have the generic > + API by which framer drivers can create framer using the framer > + framework and framer users can obtain reference to the framer. > + All the users of this framework should select this config. maybe make the menu a menuconfig with info about framers but hide the GENERIC_FRAMER symbol? The driver 'select' it anyway, what's the point of prompting the user.. > + if (WARN_ON(!dev)) > + return ERR_PTR(-EINVAL); no defensive programming, let the kernel crash > + ret = framer_pm_runtime_get_sync(framer); > + if (ret < 0 && ret != -EOPNOTSUPP) > + goto err_pm_sync; > + > + ret = 0; /* Override possible ret == -EOPNOTSUPP */ This looks pointless given that ret is either overwritten or not used later on > + mutex_lock(&framer->mutex); > + if (framer->power_count == 0 && framer->ops->power_on) { > + ret = framer->ops->power_on(framer); > + if (ret < 0) { > + dev_err(&framer->dev, "framer poweron failed --> %d\n", ret); > + goto err_pwr_on; > + } > + } > + ++framer->power_count; > + mutex_unlock(&framer->mutex); > + return 0; 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 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 18A95E94133 for ; Fri, 6 Oct 2023 22:08:39 +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:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JmLHurMw75fMSbpQGTg5P6amsVZ1S8AGURMf7AogDVc=; b=ANiF1Vdo1+qOT/ AjtynLQjQIvzQ1qBwA0WdsvlnF6NDbLS7Lg/EY9ZQzW2fjBay0dD12yD/tFUg4mOl4v5L1to+5voH ipQZbnTZuEed754NVArsjFAlIKuXsUKOftqQUFSkluY7o5gwnoQJhs4RnWzGHPCqOYDwwH0SdBA7l Va47sMx/4Qz9xDOwlPu7aTs3Rpw6+pFtIM8+1ms5lkLdJMo51TKZXBMFedgtdUlMkOq8sqq6fij52 UG17xM/c1TJ05EodaGNFDdd3/skFrpSI892eeWa0F2wzirlwew7uYaYTcwbmrCxMxSKo2Lw3j0QPA resFZbgDRVzimk2AYmqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qoszX-006ZBq-2p; Fri, 06 Oct 2023 22:08:15 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qoszV-006ZB9-1Y for linux-arm-kernel@lists.infradead.org; Fri, 06 Oct 2023 22:08:14 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A041A60BB8; Fri, 6 Oct 2023 22:08:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46CD3C433C7; Fri, 6 Oct 2023 22:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696630092; bh=S/N63H4X+QPAGfS1YS/mBfx58DuAbwAsy+1fq8W1EuY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lqqUlsyH7HQbKjX6+5MZaW5p3Joc5/jp6VffbnbSi4frEd/pPhmgULRdlX5REnhpP BK2xli8u32zh+fkxpuHUOLaTi6MD1PXmD4uaT4ger+hlNVtAIdfLCOrFRtKzFzQdQz 2sQXEvvtRBzYF6TTKxDU1a+OboOZzIkfFfzieoDXlciUuulj9kl61ww0wJPKsFKgrl bG0J56gOoLjF3VNIh6eD3ijl/+KNdaIHPaK1qZBx8m+Qm/Nj6jA1it1GsSd/KDmDTO 8t97yI7Q9ito8x5R+7R8OzvwKOZlUfEqCdWiEARsL6pB/CF8A3b9DgN6yKbMV0niw2 jzXwcskBcwReg== Date: Fri, 6 Oct 2023 15:08:10 -0700 From: Jakub Kicinski To: Herve Codina Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Qiang Zhao , Li Yang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Christophe Leroy , Randy Dunlap , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Simon Horman , Christophe JAILLET , Thomas Petazzoni Subject: Re: [PATCH v7 24/30] net: wan: Add framer framework support Message-ID: <20231006150810.09e2c1a9@kernel.org> In-Reply-To: <20230928070652.330429-25-herve.codina@bootlin.com> References: <20230928070652.330429-1-herve.codina@bootlin.com> <20230928070652.330429-25-herve.codina@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231006_150813_607599_CBF645A2 X-CRM114-Status: GOOD ( 17.25 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 28 Sep 2023 09:06:42 +0200 Herve Codina wrote: > +menu "Framer Subsystem" > + > +config GENERIC_FRAMER > + bool "Framer Core" > + help > + Generic Framer support. > + A framer is a component in charge of an E1/T1 line interface. > + Connected usually to a TDM bus, it converts TDM frames to/from E1/T1 > + frames. It also provides information related to the E1/T1 line. > + Used with HDLC, the network can be reached through the E1/T1 line. > + > + This framework is designed to provide a generic interface for framer > + devices present in the kernel. This layer will have the generic > + API by which framer drivers can create framer using the framer > + framework and framer users can obtain reference to the framer. > + All the users of this framework should select this config. maybe make the menu a menuconfig with info about framers but hide the GENERIC_FRAMER symbol? The driver 'select' it anyway, what's the point of prompting the user.. > + if (WARN_ON(!dev)) > + return ERR_PTR(-EINVAL); no defensive programming, let the kernel crash > + ret = framer_pm_runtime_get_sync(framer); > + if (ret < 0 && ret != -EOPNOTSUPP) > + goto err_pm_sync; > + > + ret = 0; /* Override possible ret == -EOPNOTSUPP */ This looks pointless given that ret is either overwritten or not used later on > + mutex_lock(&framer->mutex); > + if (framer->power_count == 0 && framer->ops->power_on) { > + ret = framer->ops->power_on(framer); > + if (ret < 0) { > + dev_err(&framer->dev, "framer poweron failed --> %d\n", ret); > + goto err_pwr_on; > + } > + } > + ++framer->power_count; > + mutex_unlock(&framer->mutex); > + return 0; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel