All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v4] USB: ehci-pci: USB host controller support for Intel Quark X1000
  2014-07-01 15:15 ` [PATCH v4] USB: ehci-pci: USB host controller support for Intel Quark X1000 Chen, Alvin
@ 2014-07-01 14:12   ` Alan Stern
  2014-07-02  0:34     ` Jingoo Han
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Stern @ 2014-07-01 14:12 UTC (permalink / raw)
  To: Chen, Alvin; +Cc: Sergei Shtylyov, linux-usb, linux-kernel, Boon Leong Ong

On Tue, 1 Jul 2014, Chen, Alvin wrote:

> From: Bryan O'Donoghue <bryan.odonoghue@intel.com>
> 
> The EHCI packet buffer in/out threshold is programmable for Intel Quark X1000
> USB host controller, and the default value is 0x20 dwords. The in/out threshold
> can be programmed to 0x80 dwords (512 Bytes) to maximize the perfomrance,
> but only when isochronous/interrupt transactions are not initiated by the USB
> host controller. This patch is to reconfigure the packet buffer in/out
> threshold as maximal as possible to maximize the performance, and 0x7F dwords
> (508 Bytes) should be used because the USB host controller initiates
> isochronous/interrupt transactions.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@intel.com>
> Signed-off-by: Alvin (Weike) Chen <alvin.chen@intel.com>

Acked-by: Alan Stern <stern@rowland.harvard.edu>

There's one error in the style...

> diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> index 3e86bf4..429434d 100644
> --- a/drivers/usb/host/ehci-pci.c
> +++ b/drivers/usb/host/ehci-pci.c
> @@ -35,6 +35,21 @@ static const char hcd_name[] = "ehci-pci";
>  #define PCI_DEVICE_ID_INTEL_CE4100_USB	0x2e70
>  
>  /*-------------------------------------------------------------------------*/
> +#define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC		0x0939
> +static inline bool is_intel_quark_x1000(struct pci_dev *pdev)
> +{
> +	return pdev->vendor == PCI_VENDOR_ID_INTEL &&
> +		pdev->device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC;
> +}
> +
> +/*
> +	* 0x84 is the offset of in/out threshold register,
> +	* and it is the same offset as the register of 'hostpc'.
> +	*/

This comment isn't formatted right.  It should be like this:

/*
 * blah blah blah
 * blah blah blah
 */

If you want to submit a corrected version, you can.  Or Greg may be
willing to fix the style when he merges this patch.

Alan Stern


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4] USB: ehci-pci: Add support for Intel Quark X1000 USB
@ 2014-07-01 15:15 Chen, Alvin
  2014-07-01 15:15 ` [PATCH v4] USB: ehci-pci: USB host controller support for Intel Quark X1000 Chen, Alvin
  0 siblings, 1 reply; 4+ messages in thread
From: Chen, Alvin @ 2014-07-01 15:15 UTC (permalink / raw)
  To: Alan Stern; +Cc: Sergei Shtylyov, linux-usb, linux-kernel, Boon Leong Ong

From: "Alvin (Weike) Chen" <alvin.chen@intel.com>

Hi,
Intel Quark X1000 consists of one USB host controller which can be PCI
enumerated. And the exsiting EHCI-PCI framework supports it with the 
default packet buffer in/out threshold. We reconfigure the in/out threshold
as maximal as possible to maximize the performance.

Bryan O'Donoghue (1):
  USB: ehci-pci: USB host controller support for Intel Quark X1000

 drivers/usb/host/ehci-pci.c |   25 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4] USB: ehci-pci: USB host controller support for Intel Quark X1000
  2014-07-01 15:15 [PATCH v4] USB: ehci-pci: Add support for Intel Quark X1000 USB Chen, Alvin
@ 2014-07-01 15:15 ` Chen, Alvin
  2014-07-01 14:12   ` Alan Stern
  0 siblings, 1 reply; 4+ messages in thread
From: Chen, Alvin @ 2014-07-01 15:15 UTC (permalink / raw)
  To: Alan Stern; +Cc: Sergei Shtylyov, linux-usb, linux-kernel, Boon Leong Ong

From: Bryan O'Donoghue <bryan.odonoghue@intel.com>

The EHCI packet buffer in/out threshold is programmable for Intel Quark X1000
USB host controller, and the default value is 0x20 dwords. The in/out threshold
can be programmed to 0x80 dwords (512 Bytes) to maximize the perfomrance,
but only when isochronous/interrupt transactions are not initiated by the USB
host controller. This patch is to reconfigure the packet buffer in/out
threshold as maximal as possible to maximize the performance, and 0x7F dwords
(508 Bytes) should be used because the USB host controller initiates
isochronous/interrupt transactions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@intel.com>
Signed-off-by: Alvin (Weike) Chen <alvin.chen@intel.com>
---
changelog v4:
* Just define the maximum threshold value, and clarify it in the comments.
* Improve the comments.

 drivers/usb/host/ehci-pci.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 3e86bf4..429434d 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -35,6 +35,21 @@ static const char hcd_name[] = "ehci-pci";
 #define PCI_DEVICE_ID_INTEL_CE4100_USB	0x2e70
 
 /*-------------------------------------------------------------------------*/
+#define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC		0x0939
+static inline bool is_intel_quark_x1000(struct pci_dev *pdev)
+{
+	return pdev->vendor == PCI_VENDOR_ID_INTEL &&
+		pdev->device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC;
+}
+
+/*
+	* 0x84 is the offset of in/out threshold register,
+	* and it is the same offset as the register of 'hostpc'.
+	*/
+#define	intel_quark_x1000_insnreg01	hostpc
+
+/* Maximum usable threshold value is 0x7f dwords for both IN and OUT */
+#define INTEL_QUARK_X1000_EHCI_MAX_THRESHOLD	0x007f007f
 
 /* called after powerup, by probe or system-pm "wakeup" */
 static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
@@ -50,6 +65,16 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
 	if (!retval)
 		ehci_dbg(ehci, "MWI active\n");
 
+	/* Reset the threshold limit */
+	if (is_intel_quark_x1000(pdev)) {
+		/*
+		 * For the Intel QUARK X1000, raise the I/O threshold to the
+		 * maximum usable value in order to improve performance.
+		 */
+		ehci_writel(ehci, INTEL_QUARK_X1000_EHCI_MAX_THRESHOLD,
+			ehci->regs->intel_quark_x1000_insnreg01);
+	}
+
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] USB: ehci-pci: USB host controller support for Intel Quark X1000
  2014-07-01 14:12   ` Alan Stern
@ 2014-07-02  0:34     ` Jingoo Han
  0 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2014-07-02  0:34 UTC (permalink / raw)
  To: 'Alan Stern', 'Chen, Alvin'
  Cc: 'Sergei Shtylyov',
	linux-usb, linux-kernel, 'Boon Leong Ong',
	'Jingoo Han'

On Tuesday, July 01, 2014 11:12 PM, Alan Stern wrote: 
> On Tue, 1 Jul 2014, Chen, Alvin wrote:
> 
> > From: Bryan O'Donoghue <bryan.odonoghue@intel.com>
> >
> > The EHCI packet buffer in/out threshold is programmable for Intel Quark X1000
> > USB host controller, and the default value is 0x20 dwords. The in/out threshold
> > can be programmed to 0x80 dwords (512 Bytes) to maximize the perfomrance,
> > but only when isochronous/interrupt transactions are not initiated by the USB
> > host controller. This patch is to reconfigure the packet buffer in/out
> > threshold as maximal as possible to maximize the performance, and 0x7F dwords
> > (508 Bytes) should be used because the USB host controller initiates
> > isochronous/interrupt transactions.
> >
> > Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@intel.com>
> > Signed-off-by: Alvin (Weike) Chen <alvin.chen@intel.com>
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> 
> There's one error in the style...
> 
> > diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> > index 3e86bf4..429434d 100644
> > --- a/drivers/usb/host/ehci-pci.c
> > +++ b/drivers/usb/host/ehci-pci.c
> > @@ -35,6 +35,21 @@ static const char hcd_name[] = "ehci-pci";
> >  #define PCI_DEVICE_ID_INTEL_CE4100_USB	0x2e70
> >
> >  /*-------------------------------------------------------------------------*/
> > +#define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC		0x0939
> > +static inline bool is_intel_quark_x1000(struct pci_dev *pdev)
> > +{
> > +	return pdev->vendor == PCI_VENDOR_ID_INTEL &&
> > +		pdev->device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC;
> > +}
> > +
> > +/*
> > +	* 0x84 is the offset of in/out threshold register,
> > +	* and it is the same offset as the register of 'hostpc'.
> > +	*/
> 
> This comment isn't formatted right.  It should be like this:
> 
> /*
>  * blah blah blah
>  * blah blah blah
>  */
> 
> If you want to submit a corrected version, you can.  Or Greg may be
> willing to fix the style when he merges this patch.
> 
> Alan Stern



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-02  0:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 15:15 [PATCH v4] USB: ehci-pci: Add support for Intel Quark X1000 USB Chen, Alvin
2014-07-01 15:15 ` [PATCH v4] USB: ehci-pci: USB host controller support for Intel Quark X1000 Chen, Alvin
2014-07-01 14:12   ` Alan Stern
2014-07-02  0:34     ` Jingoo Han

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.