Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5307459ybh; Wed, 7 Aug 2019 04:06:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9HSV3P0SNqKzfMdtgiXp71zxUlUCwlee7h8/aAdKs3vgS41goZUfiG5PbpeWfcxNumKgS X-Received: by 2002:a17:90a:ac11:: with SMTP id o17mr7883580pjq.134.1565175980439; Wed, 07 Aug 2019 04:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565175980; cv=none; d=google.com; s=arc-20160816; b=TKef3aibSaz9e9wgUxxMKdXlsmONoeIMVH2MhGsW8fmnhZmnT1YGisgHSpWe8L/NZu F8ek4H6XOkvKXG7ZEzL174sazurAJ6fP13QmchJGjvrUElmiAwJoUR93uKn3q+U3ux7W 98AaPbfLWBf3z4390XTMkGe4cxrcycCElwUqAUeNUL7kGMTfbD0k0d/39Jmmxa1bQnFj mTcwbYl12/tz6xd3UcIw/9JaI437XOOTr0W3RCUd5rxT7jezKAVbl1GV8je8Xw2mQk3T SiZtjpAtlxoyYXFFcbCFTrGpXjwhy8aVDgGiwF1e2juX5PMghap3mNkq0kQFcumsFALu TFCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=nIyjRqOCV+fa1wLbVQ5oPPsgl+jCvyZgKCB0XcNKbgg=; b=zUiff5BSSs/7ItHRc5Z75T2LkTaldCgkpXfIo5zi9/eO4cJxpkSw3Its7AyNSyLLTC TI7xsTY++jxNA0tpz7nR7N7pby3q/0ix3d7fBwFnRHxhnmyAoa76WqV3tAMORytFGpGq PkcpUE1SCdjGzPWNOTUcMsQrwmzC9lBzlXZLEWZ8XP0DhK+DeH8rfWRWjIjBi7qYhVVc qX3Jqeh7hHF/pLICXTwxYqh4w5WnWQOPzDWOGoRr4HTqJ/QwwnyhvwiS2/ITXrK2zzTu udULuU9o6gXK7hCZcggVj5hBAfxqCWqEGVKDrTORXOwyRwzOI//Bl5mNiA0YkeAR9HtU 22Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cxQpOi2u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si45258941pld.318.2019.08.07.04.06.04; Wed, 07 Aug 2019 04:06:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cxQpOi2u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387435AbfHGLFb (ORCPT + 99 others); Wed, 7 Aug 2019 07:05:31 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:39142 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbfHGLFa (ORCPT ); Wed, 7 Aug 2019 07:05:30 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x77B5LtZ028565; Wed, 7 Aug 2019 06:05:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1565175921; bh=nIyjRqOCV+fa1wLbVQ5oPPsgl+jCvyZgKCB0XcNKbgg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=cxQpOi2upgbFMxfhgV/yXDjyMTgt2bQVI906VDgUS8FtjAqFhOxsr65b9nX3fBC4/ xgWpOCTxcejRAS7V10Quw2K9kUrrV6tifR3K+gZUPXWyye44o80px7gqYWDmQ1HfD6 nsrcgsqPmiP+WC5qkB/CI7CXriIYUJkCCxe49R8Q= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x77B5LTn029362 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Aug 2019 06:05:21 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 7 Aug 2019 06:05:21 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 7 Aug 2019 06:05:20 -0500 Received: from [137.167.41.248] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x77B5IRL002412; Wed, 7 Aug 2019 06:05:18 -0500 Subject: Re: [PATCH v10 0/6] Introduced new Cadence USBSS DRD Driver. To: Pawel Laszczak , Pavel Machek CC: "gregkh@linuxfoundation.org" , "felipe.balbi@linux.intel.com" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jbergsagel@ti.com" , "nsekhar@ti.com" , "nm@ti.com" , Suresh Punnoose , Jayshri Dajiram Pawar , Rahul Kumar , Anil Joy Varughese References: <1563733939-21214-1-git-send-email-pawell@cadence.com> <20190721190335.GA19831@xo-6d-61-c0.localdomain> <20190722114839.GA10515@kroah.com> <20190722115644.GA12069@amd> <20190722210021.GA25235@amd> From: Roger Quadros Message-ID: <93b4a702-227b-0410-a414-76873088ad72@ti.com> Date: Wed, 7 Aug 2019 14:05:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pawel, On 23/07/2019 07:32, Pawel Laszczak wrote: > Hi, > >> On Mon 2019-07-22 13:56:44, Pavel Machek wrote: >>> Hi! >>> >>>>>>> This patch introduce new Cadence USBSS DRD driver to linux kernel. >>>>>>> >>>>>>> The Cadence USBSS DRD Controller is a highly configurable IP Core which >>>>>>> can be instantiated as Dual-Role Device (DRD), Peripheral Only and >>>>>>> Host Only (XHCI)configurations. >>>>>> >>>>>> I see you are using debugfs to select between DRD, peripheral-onlyh and XHCI... >>>>>> >>>>>> Is that good idea? >>>>> >>>>> Yes driver allows selecting dr_mode by debugfs. Controller also support such functionality >>>>> so I don't understand why would it not be a good idea. >>>>> >>>>> I personally use this for testing but it can be used to limit controller functionality without >>>>> recompiling kernel. >>>> >>>> debugfs is ONLY for debugging, never rely on it being enabled, or >>>> mounted, on a system in order to have any normal operation happen. >>>> >>>> So for testing, yes, this is fine. If this is going to be the normal >>>> api/interface for how to control this driver, no, that is not acceptable >>>> at all. >>> >>> It makes a lot of sense for end-user to toggle this... for example >>> when he is lacking right cable for proper otg detection. As it is >>> third driver offering this functionality, I believe we should stop >>> treating it as debugging. >> >> At least renesas usb controller seems to have variables in sysfs: >> drivers/phy/renesas/phy-rcar-gen3-usb2.c : functions role_show and >> role_store. See also >> Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2 . >> >> I believe this driver should do same. >> > > CDNS3 driver use the role framework and also has such variable defined > in role switch framework. > > https://elixir.bootlin.com/linux/latest/source/drivers/usb/roles/class.c Can we get rid of the debugfs interface for user initiated role change and just rely on role switch framework via sysfs? We do need user initiated role changes in production systems. So we can't rely on debugfs for this. -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki