Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1948953imu; Fri, 14 Dec 2018 03:27:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/XvKvtWUCR10ixngHX3TSQYy1rG1rdvpQL2JntB3zJIMg11i3jUkTJ7OdogQPuF7lfsN6hp X-Received: by 2002:a17:902:f091:: with SMTP id go17mr2551744plb.235.1544786841028; Fri, 14 Dec 2018 03:27:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544786841; cv=none; d=google.com; s=arc-20160816; b=INl581MAHNaB4bn6QW2fApdBdOMiF2ewwJCfGCPLNWl+kvuOOSMp3hlAbJHpcve3w8 E11GOjIDeWnOKOewP2UzF79r75UrUHvoHY+RXfX979aafP9u6DtR00QzmICMutTO8rni b93UoXqw2AU60ZlPpQvOoTpFr8zQpxYUT/qhHJqBPmR46qzhJHryQLYxC9sK29JBuA1z E8K8X5xFeA9m3pTt5St6lFnUez6DNRv6OFVY/3HGbosJcD8TQ5gaBi1s1ZuBlEjiq4Ky YwRB5xCBuM4iigo5mKLl+yXoKBzwHlhjD9XTBbmMrrzvGBooTAu06yEqVOWoLiWVXeta Z+gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=g4K7jXzzlPbTZe8GwSbXMtTxkOWRGMyv2aHyOcxpX4o=; b=D8sl1N4G2FXK4uJFqh6113+NO4tsHAyfki3bjzz6Vl3OP0zmn2N2vOjyN35j9cNjge +H1DyXCLuRW2I2jeP+Fy39gG1CIhibNT9qJvffX15QTQG2ONAAL1bnjFdl4VbaqDp3oi ClQBbbo5l+5114HChHHWQvSqE28SN6bj98ixVEke/Y7LPcDTcNjOAmiQmlobWpFv+c4X YBIpE3qow/JGtKCxrhklnvD0CtZETJ4GjqrBOZvfvpvxGvBLK1gN2+aAKGHtUOIFXQXn OXhRnEYd7Zqh8dyj5+WKP1dAkLBe3L+ZPm/GGTvp5Yn2O1N4Y0LHuGPDrCLxsQgsLTyF nUWg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si4012215pgc.236.2018.12.14.03.27.06; Fri, 14 Dec 2018 03:27:20 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729615AbeLNL0L (ORCPT + 99 others); Fri, 14 Dec 2018 06:26:11 -0500 Received: from mga18.intel.com ([134.134.136.126]:8404 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729129AbeLNL0L (ORCPT ); Fri, 14 Dec 2018 06:26:11 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2018 03:26:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,352,1539673200"; d="asc'?scan'208";a="302166815" Received: from pipin.fi.intel.com (HELO localhost) ([10.237.72.175]) by fmsmga006.fm.intel.com with ESMTP; 14 Dec 2018 03:26:06 -0800 From: Felipe Balbi To: Sekhar Nori , Peter Chen , pawell@cadence.com Cc: rogerq@ti.com, devicetree@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, lkml , adouglas@cadence.com, jbergsagel@ti.com, nm@ti.com, sureshp@cadence.com, peter.chen@nxp.com, pjez@cadence.com, kurahul@cadence.com Subject: Re: [RFC PATCH v2 08/15] usb:cdns3: Implements device operations part of the API In-Reply-To: References: <1542535751-16079-1-git-send-email-pawell@cadence.com> <1542535751-16079-9-git-send-email-pawell@cadence.com> <5BFE8883.7090802@ti.com> <6b19b55c-66d7-439e-df8f-7b311b45af5e@ti.com> <5a41de27-cd1f-0cfd-ccdc-dccbf0854fcb@ti.com> <87bm5ol6zt.fsf@linux.intel.com> Date: Fri, 14 Dec 2018 13:26:02 +0200 Message-ID: <875zvwl585.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Sekhar Nori writes: >>>>>> All this should be part of comments in code along with information a= bout >>>>>> controller versions which suffer from the errata. >>>>>> >>>>>> Is there a version of controller available which does not have the >>>>>> defect? Is there a future plan to fix this? >>>>>> >>>>>> If any of that is yes, you probably want to handle this with runtime >>>>>> detection of version (like done with DWC3_REVISION_XXX macros). >>>>>> Sometimes the hardware-read versions themselves are incorrect, so its >>>>>> better to introduce a version specific compatible too like >>>>>> "cdns,usb-1.0.0" (as hinted to by Rob Herring as well). >>>>>> >>>>> >>>>> custom match_ep is used and works with all versions of the gen1 >>>>> controller. Future (gen2) releases of the controller won=E2=80=99t ha= ve such >>>>> limitation but there is no plan to change current (gen1) functionality >>>>> of the controller. >>>>> >>>>> I will add comment before cdns3_gadget_match_ep function. >>>>> Also I will change cdns,usb3 to cdns,usb3-1.0.0 and add additional >>>>> cdns,usb3-1.0.1 compatible. >>>>> >>>>> cdns,usb3-1.0.1 will be for current version of controller which I use. >>>>> cdns,usb3-1.0.0 will be for older version - Peter Chan platform. >>>>> I now that I have some changes in controller, and one of them require >>>>> some changes in DRD driver. It will be safer to add two separate >>>>> version in compatibles. >>>>> >>>> >>>> Pawel, could we have correct register to show controller version? It is >>>> better we could version judgement at runtime instead of static compati= ble. >>> >>> Agree with detecting IP version at runtime. >>> >>> But please have some indication of version in compatible string too, >>=20 >> why? Runtime detection by revision register should be the way to go if >> the HW provides it. Why duplicate the information in compatible string? >>=20 >>> especially since you already know there is going to be another revision >>> of hardware. It has the advantage that one can easily grep to see which >>> hardware is running current version of controller without having access >>> to the hardware itself. Becomes useful later on when its time to >>> clean-up unused code when boards become obsolete or for requesting >>> testing help. >>=20 >> This doesn't sound like a very strong argument, actually. Specially when >> you consider that, since driver will do revision checking based on >> revision register, you already have strings to grep. Moreover, we don't >> usually drop support just like that. > > AFAICS, it is impossible to know just by grep'ing if there is any > hardware still supported in kernel and using DWC3_REVISION_194A, for > example. but why do you even care?=20 > If we are never going to drop support for any revision, this does not > matter much. > > Also, once you have the controller supported behind PCI, then I guess > you are pretty much tied to having to read hardware revision at runtime. that's another argument *for* using runtime detection, not against it. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlwTk0oACgkQzL64meEa mQYA5w/9FY3dE8D+YHmrb3tnHyR6vwaTBRUsHcVyJ1J0yspewdcd/07/VcXfnD28 ebvRVP4Idebgch5S9J/CRMYE1LAn/SMDYyZshye/iuOv1SMReVaPo9YW5/hFPKGX r8BfKhE/4qHMVWeTN1euiYr8iTtPldBcZ+1R3+JxDyYqFL8XD0c6bgeVrHfSBBBn CrqqAn6boJCurIAQ7DpRhrN84hz4zI5dbRM5vAvEWerqjxl2LU3ADvX6KQzSM81J BqdIo6ucOok3FAlhg9OVeA+IceRMjdvHFisN1Tlcqu2ZmacneGZuNvQ1/0l7B6Th ciDraD8jWbIYxCl/m9tmLPC8qx6Od5o4s19ZYCBwVtgJTTypzIC1c3MHcD6a3rcG WOlT7kPB7xr2H8UUXmd3l6ZzOFrJpLPfQPihvQNt6Uy3aQjt4WXvYiIyS8XciXkn 8TduIbwJ0mAuivKrTBOUGWE6oCMnJs8x2oz+Ytoli9FkhxgXsfWhYBgZlLcZB6nT h5Obm7VtLAaskRpSe4vIV/Wg4Qac7OcjYL4WytDuL79A6py05DZ5kigxLUfToPyF OPcwGHAOjri82WZIDzksQY9hB7yBuxAWGL6tERnamRtxCN1qIczzxlTttQq5dF4q 4hV2JhbROuNDETAUzAS6c8ypj0+d/ngF75m/vhsqr23J8SEkYjk= =hfQv -----END PGP SIGNATURE----- --=-=-=--