Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2422723pxp; Mon, 21 Mar 2022 19:58:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbhDpsLFPNqIfKRWP0FVlUBlanM0trv4vUsE/d+GGiaNQClI0aVy0ppgaqUa9EUQyxOkt8 X-Received: by 2002:a17:90a:5643:b0:1bf:ac1f:a1de with SMTP id d3-20020a17090a564300b001bfac1fa1demr2488498pji.224.1647917923154; Mon, 21 Mar 2022 19:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647917923; cv=none; d=google.com; s=arc-20160816; b=so7iQ4OCdek0rAhZRSfmq+mLrFlyrjujos+B/P/e2lXUHAox2bJP2xxieRj0y9Hjag C/YWhB0K4ZAQJEZeeURMbbXcUtTVXt212lF04UOIj9yOYvtFXjc6DstVVZYS0sflCDD6 IIIgzeaAOunkX3S/VUSZ4FVdSKczDFhIvezKPn7OE4vv9UD7W/iQ1yF4IAO+L7nt4TFH jMh0kP2ghxcVRvvEy4c8sxOllJbwsf+v7UJf8k2Q4g1cV/LpwwsP9zGmDo4JJKIC6Hn5 kU3Wz/3FDqv500S5QcJvvsadplHNhR2lVMtTQB2/7nNnFD8CDHTKlg0lUTcdBKX6WJ8H l8mA== 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=Wg8ulElWefjUy8WdToGEm+k8v4gQftkGZswy6AnLq/o=; b=W2MAPhmpGUo84X7srss0Yp2s3FAX0Ggy+VdIXOyU4HPAePp8/7XWK04gAZ0VOWJldv uPRY/I96kpfTEx8aBjv1NuXmOza2KV2fGhKhyby920EAvkp5ap2zH2aNtu0/yvS9tQSO XQwClS9Moh7SMtpaC/e5pCEkNUfZMO/UQwRERZ81EuP2goaV5jwsBhP43rXVrjR/wa1C y4NAYFJ85/h+Wf26Ax29vboJloifivnHpF1Uj5UVQHtr/cnZx2ZXf33CHslJ/HheIt5R 0YVyluvOH22znNH8QoMgoFpiIk+hUtWy/9RSXW6Lvfy00UgrINKlFGiIjzhV33bzUuFt TBWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=UyxvlZug; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b28-20020a631b5c000000b003816043f126si13854076pgm.795.2022.03.21.19.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 19:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=UyxvlZug; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 76B483EB91; Mon, 21 Mar 2022 19:32:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235556AbiCVCdO (ORCPT + 99 others); Mon, 21 Mar 2022 22:33:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235557AbiCVCdM (ORCPT ); Mon, 21 Mar 2022 22:33:12 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 723F13E5C1 for ; Mon, 21 Mar 2022 19:31:45 -0700 (PDT) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220322023143epoutp01b031eb93de23d585172d9d627c244893~ekyWuTK001570315703epoutp018 for ; Tue, 22 Mar 2022 02:31:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220322023143epoutp01b031eb93de23d585172d9d627c244893~ekyWuTK001570315703epoutp018 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1647916303; bh=Wg8ulElWefjUy8WdToGEm+k8v4gQftkGZswy6AnLq/o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UyxvlZugqtOJcYki3Qgc4ERzxrBbACb7BL42ZYkXI0dHffmJuRB1UncnxDTdVR8tj sN4JYRjEKggqM/z5oQ2OQ0uKZ+uMe4LUEYglcQ5acljc8D6r/veJPmKEKAovAPjV0e LvV5RmJqjWqbT6yGeKWD6TDhl1wPT7YaX9NkeXoE= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220322023143epcas2p2b7b26fb7daf01ff136c85ae978dcc6d0~ekyWP4OA-1336213362epcas2p2v; Tue, 22 Mar 2022 02:31:43 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.98]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4KMwV06yTtz4x9QY; Tue, 22 Mar 2022 02:31:36 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id BC.7A.10444.80539326; Tue, 22 Mar 2022 11:31:36 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20220322023135epcas2p1e01c89cf0a307b20f5aeb9a9cf2a419a~ekyPfb2Zd2973129731epcas2p1t; Tue, 22 Mar 2022 02:31:35 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220322023135epsmtrp26f301602e1fb4ca3e9ca5b4ced0def5a~ekyPesrEz0789107891epsmtrp2s; Tue, 22 Mar 2022 02:31:35 +0000 (GMT) X-AuditID: b6c32a45-513ff700000228cc-72-623935081f11 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id FD.AB.29871.70539326; Tue, 22 Mar 2022 11:31:35 +0900 (KST) Received: from ubuntu (unknown [12.36.155.120]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220322023135epsmtip244cf20c177cf6796cce3b6f64947a76c~ekyPQ-wGC0206302063epsmtip2j; Tue, 22 Mar 2022 02:31:35 +0000 (GMT) Date: Tue, 22 Mar 2022 11:30:18 +0900 From: Jung Daehwan To: =?iso-8859-1?Q?Bj=F8rn?= Mork Cc: Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Howard Yen , Jack Pham , Puma Hsu , "J . Avila" , sc.suh@samsung.com Subject: Re: [PATCH v3 4/4] usb: host: add xhci-exynos driver Message-ID: <20220322023018.GC67215@ubuntu> MIME-Version: 1.0 In-Reply-To: <87r16v9uo2.fsf@miraculix.mork.no> User-Agent: Mutt/1.5.24 (2015-08-30) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJsWRmVeSWpSXmKPExsWy7bCmmS6HqWWSwe1fwhY/t7NZPDmyiN2i efF6Novrf94zWrQ/v8BmcXnXHDaLRctamS2aN01htZi5Vtmi6+4NRgcuj8t9vUweCzaVeize 85LJY//cNeweBxdMZfTo27KK0ePzJrkA9qhsm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwND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307b20f5aeb9a9cf2a419a X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----.rW42XXn7_Ji6OxwuAF4RAMbP.qed.OeqKlvEhSLhB3noATS=_22cbc0_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220321090205epcas2p15ac16f281554b663062e0e31666defab References: <1647853194-62147-1-git-send-email-dh10.jung@samsung.com> <1647853194-62147-5-git-send-email-dh10.jung@samsung.com> <87r16v9uo2.fsf@miraculix.mork.no> X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 ------.rW42XXn7_Ji6OxwuAF4RAMbP.qed.OeqKlvEhSLhB3noATS=_22cbc0_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Mon, Mar 21, 2022 at 04:45:01PM +0100, Bj?rn Mork wrote: > Daehwan Jung writes: > > > +++ b/drivers/usb/host/xhci-exynos.c > > @@ -0,0 +1,982 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * xhci-exynos.c - xHCI host controller driver platform Bus Glue for Exynos. > > + * > > + * Copyright (C) 2022 Samsung Electronics Incorporated - http://www.samsung.com > > + * Author: Daehwan Jung > > + * > > + * A lot of code borrowed from the Linux xHCI driver. > > + */ > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include "xhci.h" > > +#include "xhci-plat.h" > > +#include "xhci-mvebu.h" > > +#include "xhci-rcar.h" > > The xhci-plat.c file is Copyright (C) 2012 Texas Instruments Incorporated > You can't just steal it. > > Besides, even if you could, this isn't about copying as much code as > posible from A to B. The point is to add as *little* code as possible > to support your hardware. > Hi bjorn, Thanks for your comment. I will write more detail about copyright on next submission. > > +static int xhci_exynos_vendor_init(struct xhci_hcd *xhci) > > +{ > > + /* TODO */ > > + return 0; > > +} > > And you didn't even add that? > > > +static int xhci_exynos_wake_lock(struct xhci_hcd_exynos *xhci_exynos, > > + int is_main_hcd, int is_lock) > > +{ > > + struct usb_hcd *hcd = xhci_exynos->hcd; > > + struct xhci_hcd *xhci = hcd_to_xhci(hcd); > > + struct wakeup_source *main_wakelock, *shared_wakelock; > > + > > + main_wakelock = xhci_exynos->main_wakelock; > > + shared_wakelock = xhci_exynos->shared_wakelock; > > Are these fields initialized anywhere? > > > > + > > + if (xhci->xhc_state & XHCI_STATE_REMOVING) > > + return -ESHUTDOWN; > > + > > + if (is_lock) { > > bool? > Yes, Currently I use it as if bool. > > + if (is_main_hcd) > > another bool? Same > > > + __pm_stay_awake(main_wakelock); > > + else > > + __pm_stay_awake(shared_wakelock); > > + } else { > > + if (is_main_hcd) > > + __pm_relax(main_wakelock); > > + else > > + __pm_relax(shared_wakelock); > > + } > > Looks interesting. Are you signalling relax/wakeups events to the PM > core on device suspend/resume? Why? I want to enter system sleep if possible at this point. It's related to power scenario on my SOC. > > > +static int xhci_exynos_address_device(struct usb_hcd *hcd, struct usb_device *udev) > > +{ > > + struct xhci_hcd *xhci; > > + int ret; > > + > > + ret = xhci_address_device(hcd, udev); > > + xhci = hcd_to_xhci(hcd); > > + > > + return ret; > > +} > > What's left here if we drop the unused parts? > There's some missing code. Thanks.. > > +#ifdef CONFIG_OF > > +static const struct xhci_plat_priv xhci_plat_marvell_armada = { > > + .init_quirk = xhci_mvebu_mbus_init_quirk, > > +}; > > + > > +static const struct xhci_plat_priv xhci_plat_marvell_armada3700 = { > > + .plat_setup = xhci_mvebu_a3700_plat_setup, > > + .init_quirk = xhci_mvebu_a3700_init_quirk, > > +}; > > > Right... > > > +#ifdef CONFIG_ACPI > > +static const struct acpi_device_id usb_xhci_acpi_match[] = { > > + /* XHCI-compliant USB Controller */ > > + { "PNP0D10", }, > > + { } > > +}; > > +MODULE_DEVICE_TABLE(acpi, usb_xhci_acpi_match); > > +#endif > > Nice one > > There's no need to copy me if you plan to resend any of this. I'm just > a drive-by reader here anyway, and I've seen enough. > > Good luck! > > > > > Bj?rn > ------.rW42XXn7_Ji6OxwuAF4RAMbP.qed.OeqKlvEhSLhB3noATS=_22cbc0_ Content-Type: text/plain; charset="utf-8" ------.rW42XXn7_Ji6OxwuAF4RAMbP.qed.OeqKlvEhSLhB3noATS=_22cbc0_--