Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14832
b: refs/heads/master
c: bd7ce5b
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Renninger authored and Len Brown committed Nov 30, 2005
1 parent ea9ab8d commit 7a8ebbd
Show file tree
Hide file tree
Showing 29 changed files with 86 additions and 367 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: 5666c0947ede0432ba5148570aa66ffb9febff5b
refs/heads/master: bd7ce5b5ff930c29b1c0405051e9c9388660b785
5 changes: 2 additions & 3 deletions trunk/Documentation/usb/error-codes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ USB-specific:

-EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable
in the current interface altsetting.
(b) ISO packet is larger than the endpoint maxpacket.
(c) requested data transfer length is invalid: negative
or too large for the host controller.
(b) ISO packet is biger than endpoint maxpacket
(c) requested data transfer size is invalid (negative)

-ENOSPC This request would overcommit the usb bandwidth reserved
for periodic transfers (interrupt, isochronous).
Expand Down
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 15
EXTRAVERSION =-rc4
EXTRAVERSION =-rc3
NAME=Affluent Albatross

# *DOCUMENTATION*
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ acpi_add_single_object(struct acpi_device **child,
*
* TBD: Assumes LDM provides driver hot-plug capability.
*/
result = acpi_bus_find_driver(device);
acpi_bus_find_driver(device);

end:
if (!result)
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/char/drm/drm_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,7 @@ int drm_addctx(struct inode *inode, struct file *filp,

if (ctx.handle != DRM_KERNEL_CONTEXT) {
if (dev->driver->context_ctor)
if (!dev->driver->context_ctor(dev, ctx.handle)) {
DRM_DEBUG( "Running out of ctxs or memory.\n");
return -ENOMEM;
}
dev->driver->context_ctor(dev, ctx.handle);
}

ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);
Expand Down
25 changes: 7 additions & 18 deletions trunk/drivers/hwmon/w83792d.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ static const u8 W83792D_REG_LEVELS[3][4] = {
0xE2 } /* (bit3-0) SmartFanII: Fan3 Level 3 */
};

#define W83792D_REG_GPIO_EN 0x1A
#define W83792D_REG_CONFIG 0x40
#define W83792D_REG_VID_FANDIV 0x47
#define W83792D_REG_CHIPID 0x49
Expand Down Expand Up @@ -258,7 +257,7 @@ DIV_TO_REG(long val)
{
int i;
val = SENSORS_LIMIT(val, 1, 128) >> 1;
for (i = 0; i < 7; i++) {
for (i = 0; i < 6; i++) {
if (val == 0)
break;
val >>= 1;
Expand Down Expand Up @@ -1283,8 +1282,8 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
w83792d_init_client(new_client);

/* A few vars need to be filled upon startup */
for (i = 0; i < 7; i++) {
data->fan_min[i] = w83792d_read_value(new_client,
for (i = 1; i <= 7; i++) {
data->fan_min[i - 1] = w83792d_read_value(new_client,
W83792D_REG_FAN_MIN[i]);
}

Expand All @@ -1307,20 +1306,10 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
device_create_file_fan(new_client, 1);
device_create_file_fan(new_client, 2);
device_create_file_fan(new_client, 3);

/* Read GPIO enable register to check if pins for fan 4,5 are used as
GPIO */
val1 = w83792d_read_value(new_client, W83792D_REG_GPIO_EN);
if (!(val1 & 0x40))
device_create_file_fan(new_client, 4);
if (!(val1 & 0x20))
device_create_file_fan(new_client, 5);

val1 = w83792d_read_value(new_client, W83792D_REG_PIN);
if (val1 & 0x40)
device_create_file_fan(new_client, 6);
if (val1 & 0x04)
device_create_file_fan(new_client, 7);
device_create_file_fan(new_client, 4);
device_create_file_fan(new_client, 5);
device_create_file_fan(new_client, 6);
device_create_file_fan(new_client, 7);

device_create_file_temp1(new_client); /* Temp1 */
device_create_file_temp_add(new_client, 2); /* Temp2 */
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/usb/atm/cxacru.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,6 @@ static const struct usb_device_id cxacru_usb_ids[] = {
{ /* V = Conexant P = ADSL modem (Hasbani project) */
USB_DEVICE(0x0572, 0xcb00), .driver_info = (unsigned long) &cxacru_cb00
},
{ /* V = Conexant P = ADSL modem (Well PTI-800 */
USB_DEVICE(0x0572, 0xcb02), .driver_info = (unsigned long) &cxacru_cb00
},
{ /* V = Conexant P = ADSL modem */
USB_DEVICE(0x0572, 0xcb01), .driver_info = (unsigned long) &cxacru_cb00
},
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/usb/core/hcd-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)
goto done;
}
}
synchronize_irq(dev->irq);

/* FIXME until the generic PM interfaces change a lot more, this
* can't use PCI D1 and D2 states. For example, the confusion
Expand Down Expand Up @@ -393,7 +392,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev)

dev->dev.power.power_state = PMSG_ON;

clear_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
hcd->saw_irq = 0;

if (hcd->driver->resume) {
retval = hcd->driver->resume(hcd);
Expand Down
15 changes: 5 additions & 10 deletions trunk/drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,12 +1315,11 @@ static int hcd_unlink_urb (struct urb *urb, int status)
* finish unlinking the initial failed usb_set_address()
* or device descriptor fetch.
*/
if (!test_bit(HCD_FLAG_SAW_IRQ, &hcd->flags)
&& hcd->self.root_hub != urb->dev) {
if (!hcd->saw_irq && hcd->self.root_hub != urb->dev) {
dev_warn (hcd->self.controller, "Unlink after no-IRQ? "
"Controller is probably using the wrong IRQ."
"\n");
set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
hcd->saw_irq = 1;
}

urb->status = status;
Expand Down Expand Up @@ -1650,15 +1649,13 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r)
struct usb_hcd *hcd = __hcd;
int start = hcd->state;

if (unlikely(start == HC_STATE_HALT ||
!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
if (start == HC_STATE_HALT)
return IRQ_NONE;
if (hcd->driver->irq (hcd, r) == IRQ_NONE)
return IRQ_NONE;

set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);

if (unlikely(hcd->state == HC_STATE_HALT))
hcd->saw_irq = 1;
if (hcd->state == HC_STATE_HALT)
usb_hc_died (hcd);
return IRQ_HANDLED;
}
Expand Down Expand Up @@ -1771,8 +1768,6 @@ int usb_add_hcd(struct usb_hcd *hcd,

dev_info(hcd->self.controller, "%s\n", hcd->product_desc);

set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);

/* till now HC has been in an indeterminate state ... */
if (hcd->driver->reset && (retval = hcd->driver->reset(hcd)) < 0) {
dev_err(hcd->self.controller, "can't reset\n");
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/usb/core/hcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ struct usb_hcd { /* usb_bus.hcpriv points to this */
* hardware info/state
*/
const struct hc_driver *driver; /* hw-specific hooks */

/* Flags that need to be manipulated atomically */
unsigned long flags;
#define HCD_FLAG_HW_ACCESSIBLE 0x00000001
#define HCD_FLAG_SAW_IRQ 0x00000002

unsigned saw_irq : 1;
unsigned can_wakeup:1; /* hw supports wakeup? */
unsigned remote_wakeup:1;/* sw should use wakeup? */
unsigned rh_registered:1;/* is root hub registered? */
Expand Down
46 changes: 8 additions & 38 deletions trunk/drivers/usb/host/ehci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
return 0;
}

/* called during probe() after chip reset completes */
static int ehci_pci_setup(struct usb_hcd *hcd)
/* called by khubd or root hub (re)init threads; leaves HC in halt state */
static int ehci_pci_reset(struct usb_hcd *hcd)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
Expand All @@ -141,11 +141,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
if (retval)
return retval;

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

/* NOTE: only the parts below this line are PCI-specific */

switch (pdev->vendor) {
Expand All @@ -159,8 +154,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
/* AMD8111 EHCI doesn't work, according to AMD errata */
if (pdev->device == 0x7463) {
ehci_info(ehci, "ignoring AMD8111 (errata)\n");
retval = -EIO;
goto done;
return -EIO;
}
break;
case PCI_VENDOR_ID_NVIDIA:
Expand Down Expand Up @@ -213,8 +207,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
/* REVISIT: per-port wake capability (PCI 0x62) currently unused */

retval = ehci_pci_reinit(ehci, pdev);
done:
return retval;

/* finish init */
return ehci_init(hcd);
}

/*-------------------------------------------------------------------------*/
Expand All @@ -233,36 +228,14 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
unsigned long flags;
int rc = 0;

if (time_before(jiffies, ehci->next_statechange))
msleep(10);

/* Root hub was already suspended. Disable irq emission and
* mark HW unaccessible, bail out if RH has been resumed. Use
* the spinlock to properly synchronize with possible pending
* RH suspend or resume activity.
*
* This is still racy as hcd->state is manipulated outside of
* any locks =P But that will be a different fix.
*/
spin_lock_irqsave (&ehci->lock, flags);
if (hcd->state != HC_STATE_SUSPENDED) {
rc = -EINVAL;
goto bail;
}
writel (0, &ehci->regs->intr_enable);
(void)readl(&ehci->regs->intr_enable);

clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
bail:
spin_unlock_irqrestore (&ehci->lock, flags);

// could save FLADJ in case of Vaux power loss
// ... we'd only use it to handle clock skew

return rc;
return 0;
}

static int ehci_pci_resume(struct usb_hcd *hcd)
Expand All @@ -278,9 +251,6 @@ static int ehci_pci_resume(struct usb_hcd *hcd)
if (time_before(jiffies, ehci->next_statechange))
msleep(100);

/* Mark hardware accessible again as we are out of D3 state by now */
set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);

/* If CF is clear, we lost PCI Vaux power and need to restart. */
if (readl(&ehci->regs->configured_flag) != FLAG_CF)
goto restart;
Expand Down Expand Up @@ -349,7 +319,7 @@ static const struct hc_driver ehci_pci_hc_driver = {
/*
* basic lifecycle operations
*/
.reset = ehci_pci_setup,
.reset = ehci_pci_reset,
.start = ehci_run,
#ifdef CONFIG_PM
.suspend = ehci_pci_suspend,
Expand Down
24 changes: 8 additions & 16 deletions trunk/drivers/usb/host/ehci-q.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,6 @@ submit_async (
int epnum;
unsigned long flags;
struct ehci_qh *qh = NULL;
int rc = 0;

qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list);
epnum = ep->desc.bEndpointAddress;
Expand All @@ -927,28 +926,21 @@ submit_async (
#endif

spin_lock_irqsave (&ehci->lock, flags);
if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
&ehci_to_hcd(ehci)->flags))) {
rc = -ESHUTDOWN;
goto done;
}

qh = qh_append_tds (ehci, urb, qtd_list, epnum, &ep->hcpriv);
if (unlikely(qh == NULL)) {
rc = -ENOMEM;
goto done;
}

/* Control/bulk operations through TTs don't need scheduling,
* the HC and TT handle it when the TT has a buffer ready.
*/
if (likely (qh->qh_state == QH_STATE_IDLE))
qh_link_async (ehci, qh_get (qh));
done:
if (likely (qh != NULL)) {
if (likely (qh->qh_state == QH_STATE_IDLE))
qh_link_async (ehci, qh_get (qh));
}
spin_unlock_irqrestore (&ehci->lock, flags);
if (unlikely (qh == NULL))
if (unlikely (qh == NULL)) {
qtd_list_free (ehci, urb, qtd_list);
return rc;
return -ENOMEM;
}
return 0;
}

/*-------------------------------------------------------------------------*/
Expand Down
18 changes: 2 additions & 16 deletions trunk/drivers/usb/host/ehci-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,6 @@ static int intr_submit (

spin_lock_irqsave (&ehci->lock, flags);

if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
&ehci_to_hcd(ehci)->flags))) {
status = -ESHUTDOWN;
goto done;
}

/* get qh and force any scheduling errors */
INIT_LIST_HEAD (&empty);
qh = qh_append_tds (ehci, urb, &empty, epnum, &ep->hcpriv);
Expand Down Expand Up @@ -1462,11 +1456,7 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb,

/* schedule ... need to lock */
spin_lock_irqsave (&ehci->lock, flags);
if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
&ehci_to_hcd(ehci)->flags)))
status = -ESHUTDOWN;
else
status = iso_stream_schedule (ehci, urb, stream);
status = iso_stream_schedule (ehci, urb, stream);
if (likely (status == 0))
itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
spin_unlock_irqrestore (&ehci->lock, flags);
Expand Down Expand Up @@ -1825,11 +1815,7 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb,

/* schedule ... need to lock */
spin_lock_irqsave (&ehci->lock, flags);
if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
&ehci_to_hcd(ehci)->flags)))
status = -ESHUTDOWN;
else
status = iso_stream_schedule (ehci, urb, stream);
status = iso_stream_schedule (ehci, urb, stream);
if (status == 0)
sitd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
spin_unlock_irqrestore (&ehci->lock, flags);
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/usb/host/ohci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

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

#undef OHCI_VERBOSE_DEBUG /* not always helpful */
// #define OHCI_VERBOSE_DEBUG /* not always helpful */

/* For initializing controller (mask in an HCFS mode too) */
#define OHCI_CONTROL_INIT OHCI_CTRL_CBSR
Expand Down Expand Up @@ -253,10 +253,6 @@ static int ohci_urb_enqueue (
spin_lock_irqsave (&ohci->lock, flags);

/* don't submit to a dead HC */
if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
retval = -ENODEV;
goto fail;
}
if (!HC_IS_RUNNING(hcd->state)) {
retval = -ENODEV;
goto fail;
Expand Down
Loading

0 comments on commit 7a8ebbd

Please sign in to comment.