Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5309218rwb; Sun, 4 Dec 2022 19:01:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf6FdPprsk3pRNZiaHUhw1yUBVdhbuhLJ3tJJh7QVyFDXjSQUAymo/cn6vZikfxa4ExoWXbt X-Received: by 2002:a17:90a:460b:b0:218:8a84:aeca with SMTP id w11-20020a17090a460b00b002188a84aecamr80018404pjg.63.1670209277485; Sun, 04 Dec 2022 19:01:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670209277; cv=none; d=google.com; s=arc-20160816; b=cgu0BArO2dc2t3N3oyTpQUuZAIh++KpK7XZXWUQSW/0RNf1oYcv/GU/8fDyA0ptvHH sXFNCWdCBlhJ9WzfUIOVZQX3z8Qk73Ka4fZfmBqIlWGlGD0ug+AupLrWcQ6dOd6o/cSh lPFeRqEumeDApcV6FtzOZ0500kS8Y1EfFgWOlXTXDc8+2sd8KdXlggAO5QJTMJgsJaB+ jW+dBLA8qq0CVGLg8/GUhpdlsxUKP5QC9uEHi++S9HQIdf4ls1BK/NP56BWkdQmGor1I r7Hr9emONYFgMGX4QEYVDF//7m1LDnvgwGQULhS7YROlxAdzMiNvcAyqE7oy51WYxEVK DHng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:user-agent :in-reply-to:mime-version:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=t3r1eSa3NMhGWj5E9vHOcmDhjhBVmQtWQLLxmViU1oQ=; b=xz+Iqis96G22GDy0CZR82UhmVgCTTBDU1sjPIN63VvwIksasVpVKmKhOSuRDS5+ncO lDsUL9RzBUdsEDVfb5avF2pfheSfX+3QBbKATaHy+GjeWZs4Rpsnkr9cxfXPqn7pW9ui QTATzzykZITBiwTPrFj35JugggtIun+P6Cvb/rOTnLwc7cGtRjaXiWEG4j/2HxIVMlkU lH6lauaihhRuyzZ23fZeccXEKjwH1WNtBL9I2s8Iprc3/+Npi8xR/uTzpb3DoqpCLvyr gcSaNuoD9Rvdd/iT0cnMvETB4El7Mu8YQYqtRrqOXv8N0qC/o4DdE3ArPXr5aAYUJiuF 2Eyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Tz+chi/w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a17090a868400b00219d274efcdsi1850244pjn.75.2022.12.04.19.01.04; Sun, 04 Dec 2022 19:01:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Tz+chi/w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231191AbiLECd4 (ORCPT + 83 others); Sun, 4 Dec 2022 21:33:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbiLECdy (ORCPT ); Sun, 4 Dec 2022 21:33:54 -0500 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31DD0640C for ; Sun, 4 Dec 2022 18:33:52 -0800 (PST) Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20221205023350epoutp0297bac74bdaaeea2400b5d5c61203f93b~txP2aB1XU1248012480epoutp02R for ; Mon, 5 Dec 2022 02:33:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20221205023350epoutp0297bac74bdaaeea2400b5d5c61203f93b~txP2aB1XU1248012480epoutp02R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1670207630; bh=t3r1eSa3NMhGWj5E9vHOcmDhjhBVmQtWQLLxmViU1oQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tz+chi/wjJDEphsHi+FSCdxumBNqgJQHHNgax8TRdt/aUCTBGUikjv0opOoRdT3PU KAvTmKwpIdDwHOUm+1WLY64JOls6OIs99x09obboPsKvJ9V3cVLaBnBL9LeUawxsC4 jESygoflhV4saiy8oY24o5xYrbV7W5SGbuy4cxao= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20221205023349epcas2p3c58fed1b7e0147398b9d3e8ec8d15975~txP15BVok2165521655epcas2p3t; Mon, 5 Dec 2022 02:33:49 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.100]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4NQSKT2Fllz4x9Pp; Mon, 5 Dec 2022 02:33:49 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id D2.BD.10048.D885D836; Mon, 5 Dec 2022 11:33:49 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20221205023348epcas2p368016dfb7cd9b13057269142d9f76812~txP06Z-QD2953529535epcas2p3a; Mon, 5 Dec 2022 02:33:48 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221205023348epsmtrp177d1f0ad128a440a4158d8cf9c5cca17~txP05arms2949029490epsmtrp1O; Mon, 5 Dec 2022 02:33:48 +0000 (GMT) X-AuditID: b6c32a45-7a3fe70000002740-22-638d588d561f Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id B0.36.18644.C885D836; Mon, 5 Dec 2022 11:33:48 +0900 (KST) Received: from ubuntu (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221205023348epsmtip2f490df09b8313f11f5b997e3e415e4da~txP0lwW3D0370003700epsmtip2L; Mon, 5 Dec 2022 02:33:48 +0000 (GMT) Date: Mon, 5 Dec 2022 11:28:09 +0900 From: Jung Daehwan To: Mathias Nyman Cc: Arnd Bergmann , Greg Kroah-Hartman , 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 Message-ID: <20221205022809.GC54922@ubuntu> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Brightmail-Tracker: H4sIAAAAAAAAA02TfVRTZRzHz7O73V3A5XU4eZoHnTMtQNhLvFyMeSyUruk5QXR6sw5etuvG GWw72yjqH0hlLF4UeSkdJG8KtDA8G4q8SAeEgjqJgSFgCBSSQHSQdZBDUO220fG/z/P7/t5/ 58EQ/hIqxFJ0Ztqoo1LFqC/72s2gqNCC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h595/GTPTdXlhQmEZu58bCD+Rmiw+y2qxqeaEoxWZCzfJT/YV 4bmY+2t1ovcCbxdhQ+Z5veeiuk+rnzrn43Nj9hQ75leSLJPXVHyVDrpkynPlxvPjeVtijT2L ov8pyWfm+f65f2FxQWy51NeOOdOOBtz+VaPxR9b4yR2ezLRDvdIGCq9c5ymxFGckGmoxFxUn AgALJsisUAMAAA== X-CMS-MailID: 20221205023348epcas2p368016dfb7cd9b13057269142d9f76812 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----3fo7lev8HRxwEdfRbJiPjGY7XcYF58l8nMiK-NSEDm8eBp4M=_1539a_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221201021942epcas2p2429ed37e1f6146b6e1a5bef23141b3f7 References: <1669860811-171746-1-git-send-email-dh10.jung@samsung.com> <1669860811-171746-3-git-send-email-dh10.jung@samsung.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ------3fo7lev8HRxwEdfRbJiPjGY7XcYF58l8nMiK-NSEDm8eBp4M=_1539a_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Fri, Dec 02, 2022 at 02:22:39PM +0200, Mathias Nyman wrote: > On 1.12.2022 11.01, Arnd Bergmann wrote: > >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? > > Agree that overriding the generic platform driver xhci_hc_platform_driver > from this exynos driver is odd. > > But I don't understand how this works. > Where are the hcds created and added when this xhci-exonys driver binds to > the device? all this driver does in probe is the overriding? > > Am I missing something here? > This works mainly with xhci platform driver. But xhci-exynos needs to override some funtions. xhci-exynos probes first with override own functons and it works with xhci platform driver. > > > >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. > > Sounds reasonable as well, and if some exynos specific code is needed > then just create a xhci_plat_priv struct for exynos and pass it in > of_device_id data like other vendors that use the generic > xhci-platform driver do. > I considered using existing overrides like xhci_plat_priv but I couldn't find a solution. My driver invokes probing xhci platform driver in source code not device tree. Allocation of platform device is done in dwc3_host_init(usb/dwc3/host.c). That's why I can't pass device data to xhci platform driver. > -Mathias > > ------3fo7lev8HRxwEdfRbJiPjGY7XcYF58l8nMiK-NSEDm8eBp4M=_1539a_ Content-Type: text/plain; charset="utf-8" ------3fo7lev8HRxwEdfRbJiPjGY7XcYF58l8nMiK-NSEDm8eBp4M=_1539a_--