Kuninori Morimoto | 1 Feb 2012 01:28
Gravatar

[PATCH v2] usb: ch9.h: usb_endpoint_maxp() uses __le16_to_cpu()

The usb/ch9.h will be installed to /usr/include/linux,
and it is used from user space.
But le16_to_cpu() is only defined for kernel code.
Without this patch, user space compile will be broken.
Special thanks to Stefan Becker

Cc: stable@... # 3.2
Reported-by: Stefan Becker <chemobejk@...>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...>
---
Stefan, Alan, Sergei, thank you very much for some advice

v1 -> v2

- modify Subject and comment
- used __le16_to_cpu() instead of __KERNEL__
- Add Cc statble

 include/linux/usb/ch9.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 61b2905..3b6f628 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
 <at>  <at>  -589,7 +589,7  <at>  <at>  static inline int usb_endpoint_is_isoc_out(
  */
 static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
 {
-	return le16_to_cpu(epd->wMaxPacketSize);
(Continue reading)

Kuninori Morimoto | 1 Feb 2012 01:35
Gravatar

Re: [PATCH v2] usb: ch9.h: usb_endpoint_maxp() uses __le16_to_cpu()


Grr. Sorry this patch has typo.

X stable@...
O stable@...

give me v3 chance

At Tue, 31 Jan 2012 16:28:22 -0800 (PST),
【RSO】森本 wrote:
> 
> The usb/ch9.h will be installed to /usr/include/linux,
> and it is used from user space.
> But le16_to_cpu() is only defined for kernel code.
> Without this patch, user space compile will be broken.
> Special thanks to Stefan Becker
> 
> Cc: stable@... # 3.2
> Reported-by: Stefan Becker <chemobejk@...>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...>
> ---
> Stefan, Alan, Sergei, thank you very much for some advice
> 
> v1 -> v2
> 
> - modify Subject and comment
> - used __le16_to_cpu() instead of __KERNEL__
> - Add Cc statble
> 
>  include/linux/usb/ch9.h |    2 +-
(Continue reading)

Kuninori Morimoto | 1 Feb 2012 01:43
Gravatar

[PATCH v3] usb: ch9.h: usb_endpoint_maxp() uses __le16_to_cpu()

The usb/ch9.h will be installed to /usr/include/linux,
and be used from user space.
But le16_to_cpu() is only defined for kernel code.
Without this patch, user space compile will be broken.
Special thanks to Stefan Becker

Cc: stable@... # 3.2
Reported-by: Stefan Becker <chemobejk@...>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...>
---
v2 -> v3

- typo fix stable@...

 include/linux/usb/ch9.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 61b2905..3b6f628 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
 <at>  <at>  -589,7 +589,7  <at>  <at>  static inline int usb_endpoint_is_isoc_out(
  */
 static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
 {
-	return le16_to_cpu(epd->wMaxPacketSize);
+	return __le16_to_cpu(epd->wMaxPacketSize);
 }

 /*-------------------------------------------------------------------------*/
(Continue reading)

Loh Tien Hock | 1 Feb 2012 03:18
Picon

Re: Designware USB OTG driver upstream questions

Hi Nikolai,

Sorry for the late reply.

Yes, ozlabs patchwork code is refactored from synopsys version, as far
as I understand. Are you referring to the parameter OTG_EN_DED_TX_FIFO
in the configuration? If that's the case, the core in our platform
does uses dedicated FIFO.

Thanks.

On Wed, Jan 25, 2012 at 8:26 PM, Nikolai Zhubr <n-a-zhubr@...> wrote:
>
> Hello,
> 24.01.2012 20:02, Loh Tien Hock:
>
>> Hi Nikolai.
>>
>> I tried the patch with g_serial. it needed some fix I have in my
>> company's repository for slave mode. Dma mode works correctly.
>
>
> Because the code in ozlabs patchwork does not seem to have anything new or different (compared to synopsys
version) with respect to the problem I'm observing, I'd guess you only tried core(s) with a so called
"Dedicated FIFO Enhancement". Then it might work indeed.
>
> However, the driver should either refuse to work without dedicated FIFOs present and state so honestly,
or actually support such configuration correctly. Otherwise, it is still broken.
>
> Personally, I'd prefer this configuration supported rather then refused, of course.
(Continue reading)

Alex,Shi | 1 Feb 2012 03:33
Picon
Favicon

patch review: try setup MSI/MSIX in usb core

On Thu, 2012-01-12 at 10:37 -0500, Alan Stern wrote:
> On Thu, 12 Jan 2012, Alex,Shi wrote:
> 
> > Thanks, Sarah. I understand your concern now. 
> > Maybe checking MSI first in usb_hcd_request_irqs is your favorite too,
> > right? 
> > 
> > I take a quick glance on the code. May we have 2 ways to implement it.
> > 
> > A, move current xhci code and a few MSI related objects into usb_hcd
> > core code and structure. the skeleton like below. 
> 
> MSI is used only for PCI, right?  Therefore we should try to keep as
> much as possible of the core MSI-related code in hcd-pci.c, not in
> hcd.c.
> 

Considering all of your suggestions, I write a draft patch to enable
MSI/MSIX support in usb core. It base on my 2 patches that check MSI in
xhci driver.
The patch was tested with NEC uPD720200 usb 3.0 HCD and our Intel usb
3.0 pantherpoint, and can resume from S3 mode. 
Now it just open the MSI checking for XHCI driver. but other driver is
easy to enable this capability by assign HCD_MSI_FIRST on driver's
flags. 

Be leaking of enough knowledge of USB and hardware ENV, there are still
some problems didn't resolved, like how to get the max msix counter
during hcd pci probe? testing on some platforms without PCI bus. 

(Continue reading)

Sainsburys Finance | 1 Feb 2012 07:30
Picon

LOAN OFFER............AT 3% INTEREST RATE

Attn,

We give out loans within the range of $5,000 and above with an interest rate of 3%. Our loans are well insured
for maximum security is our priority. Sainsburys Finance is a leading online provider of finance.

Lender's Name: Mr.Kester Switch
Tel Number:  +44 701 117 3877
Fax Number:  +44 871 503 5094
Lender's Email: sainsburysfinance@...

Interested applicants are advice to get back to us via email for our application
form.

Regards
Mrs Cherry Anderson
Sainsburys Finance.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Shengzhou Liu | 1 Feb 2012 10:20
Favicon

[PATCH] powerpc/usb: fix issue of CPU halt when missing USB PHY clock

when missing USB PHY clock, kernel booting up will halt during USB
initialization. We should check USBGP[PHY_CLK_VALID] bit to avoid
CPU hang in this case.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@...>
---
 drivers/usb/host/ehci-fsl.c |   11 +++++++++--
 drivers/usb/host/ehci-fsl.h |    1 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index b556a72..834237e 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
 <at>  <at>  -239,7 +239,7  <at>  <at>  static void ehci_fsl_setup_phy(struct ehci_hcd *ehci,
 	ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]);
 }

-static void ehci_fsl_usb_setup(struct ehci_hcd *ehci)
+static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
 {
 	struct usb_hcd *hcd = ehci_to_hcd(ehci);
 	struct fsl_usb2_platform_data *pdata;
 <at>  <at>  -299,12 +299,19  <at>  <at>  static void ehci_fsl_usb_setup(struct ehci_hcd *ehci)
 #endif
 		out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001);
 	}
+
+	if (!(in_be32(non_ehci + FSL_SOC_USB_CTRL) & CTRL_PHY_CLK_VALID)) {
+		printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n");
(Continue reading)

Pavan Kondeti | 1 Feb 2012 11:11

Re: [PATCH] powerpc/usb: fix issue of CPU halt when missing USB PHY clock

On 2/1/2012 2:50 PM, Shengzhou Liu wrote:
> diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
> index b556a72..834237e 100644
> --- a/drivers/usb/host/ehci-fsl.c
> +++ b/drivers/usb/host/ehci-fsl.c
>  <at>  <at>  -239,7 +239,7  <at>  <at>  static void ehci_fsl_setup_phy(struct ehci_hcd *ehci,
>  	ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]);
>  }
>  
> -static void ehci_fsl_usb_setup(struct ehci_hcd *ehci)
> +static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
>  {
>  	struct usb_hcd *hcd = ehci_to_hcd(ehci);
>  	struct fsl_usb2_platform_data *pdata;
>  <at>  <at>  -299,12 +299,19  <at>  <at>  static void ehci_fsl_usb_setup(struct ehci_hcd *ehci)
>  #endif
>  		out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001);
>  	}
> +
> +	if (!(in_be32(non_ehci + FSL_SOC_USB_CTRL) & CTRL_PHY_CLK_VALID)) {
> +		printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n");
> +		return -1;

Please return a proper error code. -ENODEV ?

> +	}
> +	return 0;
>  }
>  

(Continue reading)

Bjørn Mork | 1 Feb 2012 12:56
Picon
Favicon
Gravatar

[PATCH v2] usb: cdc-wdm: cannot wait forever for blocking read/write on reset

We need to ensure that no URBs are submitted during reset.  Taking any of
the mutexes can deadlock against either wdm_read or wdm_write. Define a
new WDM_RESETTING flag indicating to read/write that a reset is in progress.

Signed-off-by: Bjørn Mork <bjorn@...>
---
Something like this then, maybe?  Now I have absolutely no idea about what 
errors to expect from read and write in this situation, so that may need
fixing. But the overall strategy should work.  Somewhat tested, and it
works better than the current code and does not break anything obvious
for me.

Bjørn

 drivers/usb/class/cdc-wdm.c |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index f63601a..786cd4f 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
 <at>  <at>  -70,6 +70,7  <at>  <at>  MODULE_DEVICE_TABLE (usb, wdm_ids);
 #define WDM_POLL_RUNNING	6
 #define WDM_RESPONDING		7
 #define WDM_SUSPENDING		8
+#define WDM_RESETTING		9

 #define WDM_MAX			16

 <at>  <at>  -340,6 +341,13  <at>  <at>  static ssize_t wdm_write
(Continue reading)

Bjørn Mork | 1 Feb 2012 16:05
Picon
Favicon
Gravatar

[PATCH v2 3/5] usb: cdc-wdm: adding usb_cdc_wdm_register subdriver support

This driver can be used as a subdriver of another USB driver, allowing
it to export a Device Managment interface consisting of a single interrupt
endpoint with no dedicated USB interface.

Some devices provide a Device Management function combined with a wwan
function in a single USB interface having three endpoints (bulk in/out
+ interrupt).  If the interrupt endpoint is used exclusively for DM
notifications, then this driver can support that as a subdriver
provided that the wwan driver calls the appropriate entry points on
probe, suspend, resume, pre_reset, post_reset and disconnect.

The main driver must have full control over all interface related
settings, including the needs_remote_wakeup flag. A manage_power
function must be provided by the main driver.

A manage_power stub doing direct flag manipulation is used in normal
driver mode.

Signed-off-by: Bjørn Mork <bjorn@...>
---
 drivers/usb/class/cdc-wdm.c |   62 ++++++++++++++++++++++++++++++++++++++++---
 include/linux/usb/cdc-wdm.h |   19 +++++++++++++
 2 files changed, 77 insertions(+), 4 deletions(-)
 create mode 100644 include/linux/usb/cdc-wdm.h

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 3dd050c..8945b8d 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
 <at>  <at>  -23,6 +23,7  <at>  <at> 
(Continue reading)


Gmane