Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259309
b: refs/heads/master
c: 18fbb93
h: refs/heads/master
i:
  259307: c7c6c46
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jul 8, 2011
1 parent 2f82f34 commit b0ad3a3
Show file tree
Hide file tree
Showing 24 changed files with 503 additions and 237 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 156833dc3ca3b730127c4b3045c466cca46c2767
refs/heads/master: 18fbb93fbec3cfd6acf46f60990f7ab21c4221dd
23 changes: 23 additions & 0 deletions trunk/Documentation/ABI/testing/sysfs-module
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,26 @@ KernelVersion: 2.6.35
Contact: masa-korg@dsn.okisemi.com
Description: Write/read Option ROM data.


What: /sys/module/ehci_hcd/drivers/.../uframe_periodic_max
Date: July 2011
KernelVersion: 3.1
Contact: Kirill Smelkov <kirr@mns.spb.ru>
Description: Maximum time allowed for periodic transfers per microframe (μs)

[ USB 2.0 sets maximum allowed time for periodic transfers per
microframe to be 80%, that is 100 microseconds out of 125
microseconds (full microframe).

However there are cases, when 80% max isochronous bandwidth is
too limiting. For example two video streams could require 110
microseconds of isochronous bandwidth per microframe to work
together. ]

Through this setting it is possible to raise the limit so that
the host controller would allow allocating more than 100
microseconds of periodic bandwidth per microframe.

Beware, non-standard modes are usually not thoroughly tested by
hardware designers, and the hardware can malfunction when this
setting differ from default 100.
2 changes: 2 additions & 0 deletions trunk/Documentation/usb/ehci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,5 @@ TBD: Interrupt and ISO transfer performance issues. Those periodic
transfers are fully scheduled, so the main issue is likely to be how
to trigger "high bandwidth" modes.

TBD: More than standard 80% periodic bandwidth allocation is possible
through sysfs uframe_periodic_max parameter. Describe that.
2 changes: 2 additions & 0 deletions trunk/drivers/usb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ source "drivers/usb/host/Kconfig"

source "drivers/usb/musb/Kconfig"

source "drivers/usb/renesas_usbhs/Kconfig"

source "drivers/usb/class/Kconfig"

source "drivers/usb/storage/Kconfig"
Expand Down
38 changes: 19 additions & 19 deletions trunk/drivers/usb/atm/ueagle-atm.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ struct uea_cmvs_v1 {
u32 address;
u16 offset;
u32 data;
} __attribute__ ((packed));
} __packed;

struct uea_cmvs_v2 {
u32 group;
u32 address;
u32 offset;
u32 data;
} __attribute__ ((packed));
} __packed;

/* information about currently processed cmv */
struct cmv_dsc_e1 {
Expand Down Expand Up @@ -352,7 +352,7 @@ struct block_index {
__le32 PageAddress;
__le16 dummy1;
__le16 PageNumber;
} __attribute__ ((packed));
} __packed;

#define E4_IS_BOOT_PAGE(PageSize) ((le32_to_cpu(PageSize)) & 0x80000000)
#define E4_PAGE_BYTES(PageSize) ((le32_to_cpu(PageSize) & 0x7fffffff) * 4)
Expand All @@ -367,7 +367,7 @@ struct l1_code {
u8 page_number_to_block_index[E4_MAX_PAGE_NUMBER];
struct block_index page_header[E4_NO_SWAPPAGE_HEADERS];
u8 code[0];
} __attribute__ ((packed));
} __packed;

/* structures describing a block within a DSP page */
struct block_info_e1 {
Expand All @@ -377,7 +377,7 @@ struct block_info_e1 {
__le16 wOvlOffset;
__le16 wOvl; /* overlay */
__le16 wLast;
} __attribute__ ((packed));
} __packed;
#define E1_BLOCK_INFO_SIZE 12

struct block_info_e4 {
Expand All @@ -387,7 +387,7 @@ struct block_info_e4 {
__be32 dwSize;
__be32 dwAddress;
__be16 wReserved;
} __attribute__ ((packed));
} __packed;
#define E4_BLOCK_INFO_SIZE 14

#define UEA_BIHDR 0xabcd
Expand Down Expand Up @@ -467,25 +467,25 @@ struct cmv_e1 {
__le32 dwSymbolicAddress;
__le16 wOffsetAddress;
__le32 dwData;
} __attribute__ ((packed));
} __packed;

struct cmv_e4 {
__be16 wGroup;
__be16 wFunction;
__be16 wOffset;
__be16 wAddress;
__be32 dwData[6];
} __attribute__ ((packed));
} __packed;

/* structures representing swap information */
struct swap_info_e1 {
__u8 bSwapPageNo;
__u8 bOvl; /* overlay */
} __attribute__ ((packed));
} __packed;

struct swap_info_e4 {
__u8 bSwapPageNo;
} __attribute__ ((packed));
} __packed;

/* structures representing interrupt data */
#define e1_bSwapPageNo u.e1.s1.swapinfo.bSwapPageNo
Expand All @@ -499,23 +499,23 @@ union intr_data_e1 {
struct {
struct swap_info_e1 swapinfo;
__le16 wDataSize;
} __attribute__ ((packed)) s1;
} __packed s1;
struct {
struct cmv_e1 cmv;
__le16 wDataSize;
} __attribute__ ((packed)) s2;
} __attribute__ ((packed));
} __packed s2;
} __packed;

union intr_data_e4 {
struct {
struct swap_info_e4 swapinfo;
__le16 wDataSize;
} __attribute__ ((packed)) s1;
} __packed s1;
struct {
struct cmv_e4 cmv;
__le16 wDataSize;
} __attribute__ ((packed)) s2;
} __attribute__ ((packed));
} __packed s2;
} __packed;

struct intr_pkt {
__u8 bType;
Expand All @@ -528,15 +528,15 @@ struct intr_pkt {
union intr_data_e1 e1;
union intr_data_e4 e4;
} u;
} __attribute__ ((packed));
} __packed;

#define E1_INTR_PKT_SIZE 28
#define E4_INTR_PKT_SIZE 64

static struct usb_driver uea_driver;
static DEFINE_MUTEX(uea_mutex);
static const char *chip_name[] = {"ADI930", "Eagle I", "Eagle II", "Eagle III",
"Eagle IV"};
static const char * const chip_name[] = {
"ADI930", "Eagle I", "Eagle II", "Eagle III", "Eagle IV"};

static int modem_index;
static unsigned int debug;
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/usb/gadget/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,11 @@ config USB_R8A66597
dynamically linked module called "r8a66597_udc" and force all
gadget drivers to also be dynamically linked.

config USB_RENESAS_USBHS
config USB_RENESAS_USBHS_UDC
tristate 'Renesas USBHS controller'
depends on SUPERH || ARCH_SHMOBILE
depends on USB_RENESAS_USBHS
select USB_GADGET_DUALSPEED
help
Renesas USBHS is a discrete USB host and peripheral controller chip
that supports both full and high speed USB 2.0 data transfers.
Expand Down
19 changes: 12 additions & 7 deletions trunk/drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ static const char hcd_name [] = "ehci_hcd";
#define EHCI_IAA_MSECS 10 /* arbitrary */
#define EHCI_IO_JIFFIES (HZ/10) /* io watchdog > irq_thresh */
#define EHCI_ASYNC_JIFFIES (HZ/20) /* async idle timeout */
#define EHCI_SHRINK_FRAMES 5 /* async qh unlink delay */
#define EHCI_SHRINK_JIFFIES (DIV_ROUND_UP(HZ, 200) + 1)
/* 200-ms async qh unlink delay */

/* Initial IRQ latency: faster than hw default */
static int log2_irq_thresh = 0; // 0 to 6
Expand Down Expand Up @@ -148,10 +149,7 @@ timer_action(struct ehci_hcd *ehci, enum ehci_timer_action action)
break;
/* case TIMER_ASYNC_SHRINK: */
default:
/* add a jiffie since we synch against the
* 8 KHz uframe counter.
*/
t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1;
t = EHCI_SHRINK_JIFFIES;
break;
}
mod_timer(&ehci->watchdog, t + jiffies);
Expand Down Expand Up @@ -336,6 +334,7 @@ static void ehci_work(struct ehci_hcd *ehci);
#include "ehci-mem.c"
#include "ehci-q.c"
#include "ehci-sched.c"
#include "ehci-sysfs.c"

/*-------------------------------------------------------------------------*/

Expand Down Expand Up @@ -520,7 +519,7 @@ static void ehci_stop (struct usb_hcd *hcd)
ehci_reset (ehci);
spin_unlock_irq(&ehci->lock);

remove_companion_file(ehci);
remove_sysfs_files(ehci);
remove_debug_files (ehci);

/* root hub is shut down separately (first, when possible) */
Expand Down Expand Up @@ -570,6 +569,12 @@ static int ehci_init(struct usb_hcd *hcd)

hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);

/*
* by default set standard 80% (== 100 usec/uframe) max periodic
* bandwidth as required by USB 2.0
*/
ehci->uframe_periodic_max = 100;

/*
* hw default: 1K periodic list heads, one per frame.
* periodic_size can shrink by USBCMD update if hcc_params allows.
Expand Down Expand Up @@ -754,7 +759,7 @@ static int ehci_run (struct usb_hcd *hcd)
* since the class device isn't created that early.
*/
create_debug_files(ehci);
create_companion_file(ehci);
create_sysfs_files(ehci);

return 0;
}
Expand Down
78 changes: 2 additions & 76 deletions trunk/drivers/usb/host/ehci-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,29 +471,6 @@ static int ehci_bus_resume (struct usb_hcd *hcd)

/*-------------------------------------------------------------------------*/

/* Display the ports dedicated to the companion controller */
static ssize_t show_companion(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct ehci_hcd *ehci;
int nports, index, n;
int count = PAGE_SIZE;
char *ptr = buf;

ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
nports = HCS_N_PORTS(ehci->hcs_params);

for (index = 0; index < nports; ++index) {
if (test_bit(index, &ehci->companion_ports)) {
n = scnprintf(ptr, count, "%d\n", index + 1);
ptr += n;
count -= n;
}
}
return ptr - buf;
}

/*
* Sets the owner of a port
*/
Expand Down Expand Up @@ -528,58 +505,6 @@ static void set_owner(struct ehci_hcd *ehci, int portnum, int new_owner)
}
}

/*
* Dedicate or undedicate a port to the companion controller.
* Syntax is "[-]portnum", where a leading '-' sign means
* return control of the port to the EHCI controller.
*/
static ssize_t store_companion(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct ehci_hcd *ehci;
int portnum, new_owner;

ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
new_owner = PORT_OWNER; /* Owned by companion */
if (sscanf(buf, "%d", &portnum) != 1)
return -EINVAL;
if (portnum < 0) {
portnum = - portnum;
new_owner = 0; /* Owned by EHCI */
}
if (portnum <= 0 || portnum > HCS_N_PORTS(ehci->hcs_params))
return -ENOENT;
portnum--;
if (new_owner)
set_bit(portnum, &ehci->companion_ports);
else
clear_bit(portnum, &ehci->companion_ports);
set_owner(ehci, portnum, new_owner);
return count;
}
static DEVICE_ATTR(companion, 0644, show_companion, store_companion);

static inline int create_companion_file(struct ehci_hcd *ehci)
{
int i = 0;

/* with integrated TT there is no companion! */
if (!ehci_is_TDI(ehci))
i = device_create_file(ehci_to_hcd(ehci)->self.controller,
&dev_attr_companion);
return i;
}

static inline void remove_companion_file(struct ehci_hcd *ehci)
{
/* with integrated TT there is no companion! */
if (!ehci_is_TDI(ehci))
device_remove_file(ehci_to_hcd(ehci)->self.controller,
&dev_attr_companion);
}


/*-------------------------------------------------------------------------*/

static int check_reset_complete (
Expand Down Expand Up @@ -891,10 +816,11 @@ static int ehci_hub_control (
* power switching; they're allowed to just limit the
* current. khubd will turn the power back on.
*/
if (HCS_PPC (ehci->hcs_params)){
if ((temp & PORT_OC) && HCS_PPC(ehci->hcs_params)) {
ehci_writel(ehci,
temp & ~(PORT_RWC_BITS | PORT_POWER),
status_reg);
temp = ehci_readl(ehci, status_reg);
}
}

Expand Down
20 changes: 1 addition & 19 deletions trunk/drivers/usb/host/ehci-msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,9 @@ static int ehci_msm_reset(struct usb_hcd *hcd)
int retval;

ehci->caps = USB_CAPLENGTH;
ehci->regs = USB_CAPLENGTH +
HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
dbg_hcs_params(ehci, "reset");
dbg_hcc_params(ehci, "reset");

/* cache the data to minimize the chip reads*/
ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);

hcd->has_tt = 1;
ehci->sbrn = HCD_USB2;

retval = ehci_halt(ehci);
if (retval)
return retval;

/* data structure init */
retval = ehci_init(hcd);
if (retval)
return retval;

retval = ehci_reset(ehci);
retval = ehci_setup(hcd);
if (retval)
return retval;

Expand Down
Loading

0 comments on commit b0ad3a3

Please sign in to comment.