Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp465999iob; Thu, 28 Apr 2022 06:26:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8UHlDwpd1kPw7w/zLtPY6rVaiXd9jNDc90Rr0Hqrw8OxR9Z1OjRvdnhdDxZy3/+yDDTyN X-Received: by 2002:a05:6a00:1256:b0:4fb:1374:2f65 with SMTP id u22-20020a056a00125600b004fb13742f65mr35224938pfi.72.1651152380244; Thu, 28 Apr 2022 06:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651152380; cv=none; d=google.com; s=arc-20160816; b=S6GI6fUfH6JpH5jO0asvlV4irau22kES2XNdE9i9+Xh4Bm+54v77IQ+2Bott6jfuqx PQ3IU7w2e4UAXgkAwFmtvE6qyrlikQsqm8O1khSG8wCPbERkN4JOfxTuYjiCta91khbj vzzElCJOBqODPJurAlzxTu2s2iYSZX/QLAE4YtdyCxyNJW9ksfa/qb7D1nIaje6tFBK0 7RrbeTpj2wp71QLDTBEcQlHeNbKPGpajE4NPKp4DOFIedV7mu5BR0nyCknLMq1/tWOZV PUp7a0e/OGq+t600DSWHoUGO1fYOhMWzM94ONG/d9AYF/FbZG975vjtPjTQ41fUyHSiN /y2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=RG0n7XwgLsMZUQ6vzWbB/5Srd56dXc8hcsHhpkVFxWM=; b=wClDweIez1Z4F0ZQso1EewH7b6CMeEN3qePMefEqLbsWbe5eciQn2wls6GF7RinwWM XNkHW2bkyahOnRXMfFLOPl2QHtG98XrxRQyct6OYU/CHqyfhmPAlDlGzdO/5LfPz9o/X PEzJvUpCIlq75QMCCwGz1GJTCreJ5HTKbdXg3hQxzrbIK2gPgn+fTqqIVppQ1kEb9v1d twtofCec3CUDxlyTEgtdC6IE0EY7z8JFs3thCVxMyUcLhezKhpW9Vxu65DBDJJnrn7sj hyKysSG0ANNnNBRmk4Jy1V6RFIzSAG42YEIzVhejErzj2/PYn3B2xRHXbOizuODnROlk LSGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eIgMY3GZ; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a654b8d000000b0039d945d133fsi4365682pgq.324.2022.04.28.06.26.04; Thu, 28 Apr 2022 06:26:20 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=eIgMY3GZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242918AbiD1FW3 (ORCPT + 99 others); Thu, 28 Apr 2022 01:22:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235900AbiD1FW0 (ORCPT ); Thu, 28 Apr 2022 01:22:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFDB533E9F; Wed, 27 Apr 2022 22:19:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4406361C9A; Thu, 28 Apr 2022 05:19:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41D6AC385A9; Thu, 28 Apr 2022 05:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651123151; bh=UQfVi3ZGeNriIKk381DlRNwfzv/ILBbw7Z6AKGd13XA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eIgMY3GZMKEglFJtWh76V0pJAjxc/sYlKuLCeJWSGsiN+hlLSloUN9DuzeNgCB+VG WJWuMLRBBjP02ElF6KcXYMzZ/R5Ux069rbX4GX5VlEWjaF6Z8mCHcIfUPVCcB08IZ2 sSaHwJ66iP7fCjaSdNvx0TteTLnVX3V1aeLjKqSau3J8ITgz/dzRxkDc9+HGfFfADg eH8MUuY4ZPcAhslrftwE4hUg+oLcaK6EHTsxXaQVKH4ZmvyT8uK+enh0KWO/rr4hSn eLj9YdCkylWSfAG09O7p4RuvT0cDOhOqR5OKDo4iBnXZw6B+ax+95DUu+LV/PV+Lzq DbVFB0orSgIAw== Message-ID: <01ec9962-e210-ce47-57cd-8849cca0a9df@kernel.org> Date: Thu, 28 Apr 2022 07:19:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v4 5/5] usb: host: add xhci-exynos driver Content-Language: en-US To: Jung Daehwan Cc: Mathias Nyman , Greg Kroah-Hartman , "open list:USB XHCI DRIVER" , open list , Howard Yen , Jack Pham , Puma Hsu , "J . Avila" , sc.suh@samsung.com, Krzysztof Kozlowski References: <1650964728-175347-1-git-send-email-dh10.jung@samsung.com> <1650964728-175347-6-git-send-email-dh10.jung@samsung.com> <20220428012941.GF145620@ubuntu> From: Krzysztof Kozlowski In-Reply-To: <20220428012941.GF145620@ubuntu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,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 On 28/04/2022 03:29, Jung Daehwan wrote: > On Tue, Apr 26, 2022 at 02:59:57PM +0200, Krzysztof Kozlowski wrote: >> On 26/04/2022 11:18, Daehwan Jung wrote: >>> This driver is for Samsung Exynos xhci host conroller. It uses xhci-plat >>> driver mainly and extends some functions by xhci hooks and overrides. >>> >>> It supports USB Audio offload with Co-processor. It only cares DCBAA, >>> Device Context, Transfer Ring, Event Ring, and ERST. They are allocated >>> on specific address with xhci hooks. Co-processor could use them directly >>> without xhci driver after then. >> >> This does not look like developed in current Linux kernel, but something >> out-of-tree, with some other unknown modifications. This is not how the >> code should be developed. Please rebase on linux-next and drop any >> unrelated modifications (these which are not sent with this patchset). >> > > I've been developing on linux-next and I rebase before submitting. > Could you tell me one of dropped modifications or patches? > >> (...) >> >>> + >>> +static int xhci_exynos_suspend(struct device *dev) >>> +{ >>> + struct usb_hcd *hcd = dev_get_drvdata(dev); >>> + struct xhci_hcd *xhci = hcd_to_xhci(hcd); >>> + >>> + /* TODO: AP sleep scenario*/ >> >> Shall the patchset be called RFC? >> > OK. I will add RFC for this patch on next submission. > >>> + >>> + return xhci_suspend(xhci, device_may_wakeup(dev)); >>> +} >>> + >>> +static int xhci_exynos_resume(struct device *dev) >>> +{ >>> + struct usb_hcd *hcd = dev_get_drvdata(dev); >>> + struct xhci_hcd *xhci = hcd_to_xhci(hcd); >>> + int ret; >>> + >>> + /* TODO: AP resume scenario*/ >>> + >>> + ret = xhci_resume(xhci, 0); >>> + if (ret) >>> + return ret; >>> + >>> + pm_runtime_disable(dev); >>> + pm_runtime_set_active(dev); >>> + pm_runtime_enable(dev); >>> + >>> + return 0; >>> +} >>> + >>> +static const struct dev_pm_ops xhci_exynos_pm_ops = { >>> + SET_SYSTEM_SLEEP_PM_OPS(xhci_exynos_suspend, xhci_exynos_resume) >>> +}; >>> + >>> +MODULE_DESCRIPTION("xHCI Exynos Host Controller Driver"); >>> +MODULE_LICENSE("GPL"); >> >> You don't have list of compatibles (and missing bindings), driver >> definition, driver registration. Entire solution is not used - nothing >> calls xhci_exynos_vendor_init(), because nothign uses "ops". >> > > xhci_exynos_vendor_init is called in xhci-plat.c (xhci_vendor_init) > [v4,2/5] usb: host: add xhci hooks for xhci-exynos > ops are used in some files(xhci-mem.c, xhci.c ..) and the body of ops is in > all xhci-exynos. Nothing uses the "ops" except xhci_exynos_register_vendor_ops() which is not called anywhere, so the xhci_vendor_init() does not call xhci_exynos_vendor_init(). > > xhci-exynos is not a standalone driver. It could be enabled when other module > makes xhci platform driver probed as it uses xhci platform mainly. It "could be" or "will be"? We do not talk here about theoretical usage of the driver, but a real one. > I thought I just used existing compltible not adding new one. > I will add them if needed. Since you called everything here as "exynos" it is specific to one hardware and not-reusable on anything else. How can then you use some other compatible? It would be a misuse of Devicetree bindings. Unless this is not specific to "exynos", but then please remove any exynos and vendor references and make it integrated in generic XHCI working for all drivers. >> This does not work and it makes it impossible to test it. Please provide >> proper XHCI Exynos driver, assuming you need it and it is not part of >> regular Exynos XHCI drivers (DWC3 and so on). >> > > What makes you think it doesn't work? Not possible to probe. The code cannot be loaded. > I think it's almost proper. I just removed > other IPs code like Co-Processor(we call it abox) or Power Management because > it would make build-error. I've added hooking points in some files(xhci-mem.c, > xhci.c..) and ops are implemented in xhci-exynos. It's mainly operated with > xhci platform driver. Best regards, Krzysztof