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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E531C4321E for ; Thu, 1 Dec 2022 09:02:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbiLAJC2 (ORCPT ); Thu, 1 Dec 2022 04:02:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbiLAJCK (ORCPT ); Thu, 1 Dec 2022 04:02:10 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8294531DC4; Thu, 1 Dec 2022 01:02:09 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id EBE405C0162; Thu, 1 Dec 2022 04:02:08 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 01 Dec 2022 04:02:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1669885328; x=1669971728; bh=Tr903Ha6Gn GkBubWESk087w5xs8HydaDZLktcx+BB4A=; b=dXYCXi+KFlOmGUtP2XGiezXVYe GOkuSUaMiwFCI0nevqHRkHxEezGdjE+fK5q2oKUTPfPW+qyJbQmuSGrWSHi6iGo3 rJU0gv0uMcGvnm6rrT1kdfZmpRQ8qhtfYjBVuzyoxrfTcQ/YfY+QdSQlqeSWECpH UKQ+vRurXL3D+j+wLzQuoxfMDUPVBsNsueNdIcu2XJADPrABcBN7GiOXP3Nctq65 17Z3nX2lnzyn+R2CKkd2YnwDbGxYY1sXHqxZ4qHbbA0uuXKUnyTBYH+nUYkb/pxI 1NUD6zT7lNXxezrjkkIRynHerlpIvyVZlxNeKFzgA+CbNGKr0zlGsrW4RJow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669885328; x=1669971728; bh=Tr903Ha6GnGkBubWESk087w5xs8H ydaDZLktcx+BB4A=; b=ukTsSL5N5FrwOrv4HQKUWAP0huyiaZ9mQ1NuOEws4Svf rpk+X1F2qfHkbTNPjd/NgvjmWtPnYdCuT70ASZDVyGqijIqCCOGNQPSG4dz5TLNa ZkJVLYYIkArZ+joGaMdEMVGMFAgOnI7j2HD8s9ta/CPk4Tp29rBwsC8JKAYi11jB o9nESw5ycTDycCXWg8+7gMxHJsZy3x5c+BYiuVsxgae5TUWmhNcjmv/l+qJ2R2by I957Mr2QaGt4vF+GeCotP4KoPPbHy4LxjOpy6zqHbsL5LdXzyfkHo3xWoJ8PHCRg nJGDXBdrSeatIkJVU5KAKUHL+bFGAGO2XIRyLhXVXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrtdeggdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1B769B60086; Thu, 1 Dec 2022 04:02:08 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: In-Reply-To: References: <1669860811-171746-1-git-send-email-dh10.jung@samsung.com> <1669860811-171746-3-git-send-email-dh10.jung@samsung.com> Date: Thu, 01 Dec 2022 10:01:44 +0100 From: "Arnd Bergmann" To: "Greg Kroah-Hartman" , "Daehwan Jung" Cc: "Rob Herring" , "Krzysztof Kozlowski" , "Alim Akhtar" , "Mathias Nyman" , "Linus Walleij" , "Colin Ian King" , "Artur Bujdoso" , "Juergen Gross" , "Tomer Maimon" , "open list:USB SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , "open list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , "open list" , sc.suh@samsung.com, taehyun.cho@samsung.com, jh0801.jung@samsung.com, eomji.oh@samsung.com Subject: Re: [RFC PATCH v1 2/2] usb: host: add xhci-exynos to support Exynos SOCs Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 1, 2022, at 09:06, Greg Kroah-Hartman wrote: > On Thu, Dec 01, 2022 at 11:13:31AM +0900, Daehwan Jung wrote: >> This driver works with xhci platform driver. It needs to override >> functions of xhci_plat_hc_driver. Wakelocks are used for sleep/wakeup >> scenario of system. > > So this means that no other platform xhci driver can be supported in the > same system at the same time. > > Which kind of makes sense as that's not anything a normal system would > have, BUT it feels very odd. This whole idea of "override the platform > driver" feels fragile, why not make these just real platform drivers and > have the xhci platform code be a library that the other ones can use? > That way you have more control overall, right? Agreed, having another layer here (hcd -> xhci -> xhcd_platform -> xhcd_exynos) would fit perfectly well into how other SoC specific drivers are abstracted. This could potentially also help reduce the amount of code duplication between other soc specific variants (mtk, tegra, mvebu, ...) that are all platform drivers but don't share code with xhci-plat.c. Alternatively, it seems that all of the xhci-exynos support could just be part of the generic xhci-platform driver: as far as I can tell, none of the added code is exynos specific at all, instead it is a generic xhci that is using the wakeup_source framework. It should be possible to check at runtime whether an xhci-platform instance uses the wakeup source or not, and then have the same driver work across more platforms. Arnd 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 7FD5AC4321E for ; Thu, 1 Dec 2022 09:03:40 +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:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=thycBmYumER1Wx3//uPEzjbubo34EZ3qa5YH+ecsVDM=; b=mNzhOHXw8PadAp iBB9Tiem1Sk6+Yf+E4DMeLxjalAtThOuX2/0R+1dG8NJpYMpMtoBPFZyVq93bSfQkYNhsXWWCf6Cu PXGF6jT0LeAJw09SaJcgKcaEK4LpwCrpLcP+bRCtIM6dg5IQR/WFz2G4X2YF74ILRsFbBXZG5wGGd t06TsI8mG23FYyQLH4gCav0ZEYz7wjLMoGpr6e5G+VC6CGML3tqXtO42lT60+jZQBhR/ZAFKalUQF R6TgPRoivCRiFtk8RV47bzDG7rFdXzI5LgdMLKO6p6q6J9/r5qsEUYUiPUa8sDprxIUq53lAzQwqB Usom6Ssi+BS45YHzrLxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0fSU-00685Z-Lk; Thu, 01 Dec 2022 09:02:18 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0fSR-0067yZ-95 for linux-arm-kernel@lists.infradead.org; Thu, 01 Dec 2022 09:02:17 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id EBE405C0162; Thu, 1 Dec 2022 04:02:08 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 01 Dec 2022 04:02:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1669885328; x=1669971728; bh=Tr903Ha6Gn GkBubWESk087w5xs8HydaDZLktcx+BB4A=; b=dXYCXi+KFlOmGUtP2XGiezXVYe GOkuSUaMiwFCI0nevqHRkHxEezGdjE+fK5q2oKUTPfPW+qyJbQmuSGrWSHi6iGo3 rJU0gv0uMcGvnm6rrT1kdfZmpRQ8qhtfYjBVuzyoxrfTcQ/YfY+QdSQlqeSWECpH UKQ+vRurXL3D+j+wLzQuoxfMDUPVBsNsueNdIcu2XJADPrABcBN7GiOXP3Nctq65 17Z3nX2lnzyn+R2CKkd2YnwDbGxYY1sXHqxZ4qHbbA0uuXKUnyTBYH+nUYkb/pxI 1NUD6zT7lNXxezrjkkIRynHerlpIvyVZlxNeKFzgA+CbNGKr0zlGsrW4RJow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669885328; x=1669971728; bh=Tr903Ha6GnGkBubWESk087w5xs8H ydaDZLktcx+BB4A=; b=ukTsSL5N5FrwOrv4HQKUWAP0huyiaZ9mQ1NuOEws4Svf rpk+X1F2qfHkbTNPjd/NgvjmWtPnYdCuT70ASZDVyGqijIqCCOGNQPSG4dz5TLNa ZkJVLYYIkArZ+joGaMdEMVGMFAgOnI7j2HD8s9ta/CPk4Tp29rBwsC8JKAYi11jB o9nESw5ycTDycCXWg8+7gMxHJsZy3x5c+BYiuVsxgae5TUWmhNcjmv/l+qJ2R2by I957Mr2QaGt4vF+GeCotP4KoPPbHy4LxjOpy6zqHbsL5LdXzyfkHo3xWoJ8PHCRg nJGDXBdrSeatIkJVU5KAKUHL+bFGAGO2XIRyLhXVXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrtdeggdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1B769B60086; Thu, 1 Dec 2022 04:02:08 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: In-Reply-To: References: <1669860811-171746-1-git-send-email-dh10.jung@samsung.com> <1669860811-171746-3-git-send-email-dh10.jung@samsung.com> Date: Thu, 01 Dec 2022 10:01:44 +0100 From: "Arnd Bergmann" To: "Greg Kroah-Hartman" , "Daehwan Jung" Cc: "Rob Herring" , "Krzysztof Kozlowski" , "Alim Akhtar" , "Mathias Nyman" , "Linus Walleij" , "Colin Ian King" , "Artur Bujdoso" , "Juergen Gross" , "Tomer Maimon" , "open list:USB SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , "open list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , "open list" , sc.suh@samsung.com, taehyun.cho@samsung.com, jh0801.jung@samsung.com, eomji.oh@samsung.com Subject: Re: [RFC PATCH v1 2/2] usb: host: add xhci-exynos to support Exynos SOCs X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221201_010215_702422_B53C87B0 X-CRM114-Status: GOOD ( 18.82 ) 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, Dec 1, 2022, at 09:06, Greg Kroah-Hartman wrote: > On Thu, Dec 01, 2022 at 11:13:31AM +0900, Daehwan Jung wrote: >> This driver works with xhci platform driver. It needs to override >> functions of xhci_plat_hc_driver. Wakelocks are used for sleep/wakeup >> scenario of system. > > So this means that no other platform xhci driver can be supported in the > same system at the same time. > > Which kind of makes sense as that's not anything a normal system would > have, BUT it feels very odd. This whole idea of "override the platform > driver" feels fragile, why not make these just real platform drivers and > have the xhci platform code be a library that the other ones can use? > That way you have more control overall, right? Agreed, having another layer here (hcd -> xhci -> xhcd_platform -> xhcd_exynos) would fit perfectly well into how other SoC specific drivers are abstracted. This could potentially also help reduce the amount of code duplication between other soc specific variants (mtk, tegra, mvebu, ...) that are all platform drivers but don't share code with xhci-plat.c. Alternatively, it seems that all of the xhci-exynos support could just be part of the generic xhci-platform driver: as far as I can tell, none of the added code is exynos specific at all, instead it is a generic xhci that is using the wakeup_source framework. It should be possible to check at runtime whether an xhci-platform instance uses the wakeup source or not, and then have the same driver work across more platforms. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel