Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4840566ybi; Tue, 28 May 2019 03:26:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEp2dNZl/4ygakxwkIPd1jTOKT94pw8r3C9zIwC1/Y14/0pT3ih43qwj6Ibi+J73ev4v2G X-Received: by 2002:a17:90a:2e89:: with SMTP id r9mr4769769pjd.117.1559039195730; Tue, 28 May 2019 03:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559039195; cv=none; d=google.com; s=arc-20160816; b=W5eyosbkDMrWn4Z7C76RdCUTAp6IXmj2vseC2bpGxPomlLn25hP51KiNNKoG/Dsce8 acUp8H2sOj1MGDtM0vShiJmfDJavGcR8NXF5EmwO16pfVj97mbaF8CiMNkOCyuzkoajj MCo8U2wLEVJYLbubBSxH2yBPmfuHeKZL9DA3usaymDSbDvELuctOHSCn3SaDaikNyo6S q/PyAo9okRPM+ofh0ysb3TZWD6FVeb6dD8KwT/pcydsZWlZiPlC64P9bWEibsDYb+xNa jOCLmVdUH0LxRDYFw2A6/APfbl/ewtMeiDvYeJ2AX+GxiZA82kV2ZwLtFbgxoL/dYT7L y7SA== 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=T5iuSAMP2DESPFgY998VdnFPXc4mS6vzkQkmLRquhXA=; b=dsI8GpCCv0lfYnbNiIN6cM2cRji/jkzxwh4ydKMfNFCJ+vxv8YBOE6RRRe9R755aOz NwUZJ+505UJo5D5JKIwNQaN5n4nqA1GJeNSdmR8jZNH4djV+aJWvNSISTqh+Zd0JUVpD e4dv9jQWOnZBQiqE6Rx4pfFKbF3sFBGc/LFl/B3wn90Vh2jhGrFHf3WdyL9vwQqaIcKe eYbSqlfhLeqHKJB5nzz2RsWWqvWI5Bfkhha6jAlZ41SVkT+cq+KACwTpAUXCovi65O9S IPbmnXv6vOsMNzxAtmL2UzJ8w82+RKCG7E0bFVKeHLz3emOhdgInmToF68FqgOmiNIrL A5Ow== 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 a8si7022549pgm.592.2019.05.28.03.26.19; Tue, 28 May 2019 03:26:35 -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; 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 S1726732AbfE1KTu (ORCPT + 99 others); Tue, 28 May 2019 06:19:50 -0400 Received: from mga17.intel.com ([192.55.52.151]:9291 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbfE1KTu (ORCPT ); Tue, 28 May 2019 06:19:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 03:19:49 -0700 X-ExtLoop1: 1 Received: from pipin.fi.intel.com (HELO pipin) ([10.237.72.175]) by fmsmga001.fm.intel.com with ESMTP; 28 May 2019 03:19:48 -0700 From: Felipe Balbi To: Ran Wang Cc: Greg Kroah-Hartman , "open list\:DESIGNWARE USB3 DRD IP DRIVER" , open list , Rob Herring , "devicetree\@vger.kernel.org" Subject: RE: [PATCH] usb: dwc3: Enable the USB snooping In-Reply-To: References: <20171115060459.45375-1-ran.wang_1@nxp.com> <87ineb9b5v.fsf@linux.intel.com> <87shdfet90.fsf@linux.intel.com> Date: Tue, 28 May 2019 13:19:47 +0300 Message-ID: <87k1eaanjw.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Ran Wang writes: > Hi Felipe, > > Sorry for the late reply: > > On Wednesday, November 15, 2017 18:23, Felipe Balbi wrote: that's 1.5 year ago. I really don't remember the details of this conversation >> Ran Wang writes: >> >> Ran Wang writes: >> >> > Add support for USB3 snooping by asserting bits in register >> >> > DWC3_GSBUSCFG0 for data and descriptor. >> >> >> >> we know *how* to enable a feature :-) It's always the same, you >> >> fiddle with some registers and it works. What you failed to tell us is: >> >> >> >> a) WHY do you need this? >> >> b) WHY do we need another DT property for this? >> >> c) WHAT does this mean for PCI devices? >> > >> > So far I cannot have the answer for you, will get you back after some >> > discussion with my colleagues. >> >> IOW, you have no idea why you need this, right? We're not patching things for >> the sake of patching things. We need to understand what these changes mean >> to the HW before we send out a patch publicly. >> >> Remember that the moment a patch like this is accepted, it has the potential of >> changing behavior for *ALL* users. >> >> >> > + } >> >> > + >> >> > + dwc3_writel(dwc->regs, DWC3_GSBUSCFG0, cfg); >> >> >> >> this will *always* read and write GSBUSCFG0 even for those platforms >> >> which don't need to change anything on this register. You should just >> >> bail out early if !dwc->dma_coherent >> >> >> >> Also, I think dma_coherent is likely not the best name for this property. >> >> >> >> Another question is: Why wasn't this setup properly during >> >> coreConsultant instantiation of the RTL? Do you have devices on the >> >> market already that need this or is this some early FPGA model or test-only >> ASIC? >> > >> > Yes, you are right. Actually I thought that all dwc3 IP will have >> > this register, and it can be controlled by DTS property. >> >> they all *have* the register, however, it's sort of expected that RTL engineer will >> setup good defaults when instantiating the RTL using SNPS' >> coreConsultant tool. >> >> Does your platform work without this patch? > > On Layerscape SoC (such as LS1088A, LS1046A, LS1043A) When I add 'dma-coherent' > to USB nodes without this patch, dwc3 will fail on device enumeration as below: > [ 3.610620] xhci-hcd xhci-hcd.2.auto: WARNING: Host System Error > [ 3.630609] usb usb2-port1: couldn't allocate usb_device Right, and same as before: are these devices in the market or are you dealing with pre-silicon prototypes? >> >> > /* Global Debug Queue/FIFO Space Available Register */ >> >> > #define DWC3_GDBGFIFOSPACE_NUM(n) ((n) & 0x1f) >> >> > #define DWC3_GDBGFIFOSPACE_TYPE(n) (((n) << 5) & 0x1e0) >> >> > @@ -859,6 +867,7 @@ struct dwc3_scratchpad_array { >> >> > * 3 - Reserved >> >> > * @imod_interval: set the interrupt moderation interval in 250ns >> >> > * increments or 0 to disable. >> >> > + * @dma_coherent: set if enable dma-coherent. >> >> >> >> you're not enabling dma coherency, you're enabling cache snooping. >> >> And this property should describe that. Also, keep in mind that >> >> different devices may want different cache types for each of those >> >> fields, so your property would have to be a lot more complex. Something like: >> >> >> >> snps,cache-type = , , ... >> >> >> >> Then driver would have to parse this properly to setup GSBUSCFG0. > > According to the DesignWare Cores SuperSpeed USB 3.0 Controller Databook (v2.60a), > it has described Type Bit Assignments for all supported master bus type: > AHB, AXI3, AXI4 and Native. I found the bit definition are different among them. > So, for the example you gave above, feel a little bit confused. > Did you mean: > snps,cache-type = , , , yeah, something like that. >> > Got it, learn a lot, need more time to digest and test, thanks for >> > your patiently explanation. >> >> no problem, please figure out the answers to my previous questions, without >> which I can't accept your patch. ^^^ I still don't have all the answers -- balbi