Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210853
b: refs/heads/master
c: 6b3d2cc
h: refs/heads/master
i:
  210851: f3ba9c1
v: v3
  • Loading branch information
Linus Torvalds committed Sep 20, 2010
1 parent 5360e93 commit 88d8084
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 71 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: dd173abfead903c7df54e977535973f3312cd307
refs/heads/master: 6b3d2cc4e07a609fc7354daba2889a260053e5d6
4 changes: 2 additions & 2 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3942,7 +3942,7 @@ F: drivers/char/isicom.c
F: include/linux/isicom.h

MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
M: Felipe Balbi <felipe.balbi@nokia.com>
M: Felipe Balbi <balbi@ti.com>
L: linux-usb@vger.kernel.org
T: git git://gitorious.org/usb/usb.git
S: Maintained
Expand Down Expand Up @@ -4240,7 +4240,7 @@ S: Maintained
F: drivers/char/hw_random/omap-rng.c

OMAP USB SUPPORT
M: Felipe Balbi <felipe.balbi@nokia.com>
M: Felipe Balbi <balbi@ti.com>
M: David Brownell <dbrownell@users.sourceforge.net>
L: linux-usb@vger.kernel.org
L: linux-omap@vger.kernel.org
Expand Down
51 changes: 31 additions & 20 deletions trunk/arch/frv/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ static int restore_sigcontext(struct sigcontext __user *sc, int *_gr8)
struct user_context *user = current->thread.user;
unsigned long tbr, psr;

/* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall;

tbr = user->i.tbr;
psr = user->i.psr;
if (copy_from_user(user, &sc->sc_context, sizeof(sc->sc_context)))
Expand Down Expand Up @@ -250,6 +253,8 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set)
struct sigframe __user *frame;
int rsig;

set_fs(USER_DS);

frame = get_sigframe(ka, sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
Expand Down Expand Up @@ -293,22 +298,23 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set)
(unsigned long) (frame->retcode + 2));
}

/* set up registers for signal handler */
__frame->sp = (unsigned long) frame;
__frame->lr = (unsigned long) &frame->retcode;
__frame->gr8 = sig;

/* Set up registers for the signal handler */
if (current->personality & FDPIC_FUNCPTRS) {
struct fdpic_func_descriptor __user *funcptr =
(struct fdpic_func_descriptor __user *) ka->sa.sa_handler;
__get_user(__frame->pc, &funcptr->text);
__get_user(__frame->gr15, &funcptr->GOT);
struct fdpic_func_descriptor desc;
if (copy_from_user(&desc, funcptr, sizeof(desc)))
goto give_sigsegv;
__frame->pc = desc.text;
__frame->gr15 = desc.GOT;
} else {
__frame->pc = (unsigned long) ka->sa.sa_handler;
__frame->gr15 = 0;
}

set_fs(USER_DS);
__frame->sp = (unsigned long) frame;
__frame->lr = (unsigned long) &frame->retcode;
__frame->gr8 = sig;

/* the tracer may want to single-step inside the handler */
if (test_thread_flag(TIF_SINGLESTEP))
Expand All @@ -323,7 +329,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set)
return 0;

give_sigsegv:
force_sig(SIGSEGV, current);
force_sigsegv(sig, current);
return -EFAULT;

} /* end setup_frame() */
Expand All @@ -338,6 +344,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
struct rt_sigframe __user *frame;
int rsig;

set_fs(USER_DS);

frame = get_sigframe(ka, sizeof(*frame));

if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
Expand Down Expand Up @@ -392,22 +400,23 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
}

/* Set up registers for signal handler */
__frame->sp = (unsigned long) frame;
__frame->lr = (unsigned long) &frame->retcode;
__frame->gr8 = sig;
__frame->gr9 = (unsigned long) &frame->info;

if (current->personality & FDPIC_FUNCPTRS) {
struct fdpic_func_descriptor __user *funcptr =
(struct fdpic_func_descriptor __user *) ka->sa.sa_handler;
__get_user(__frame->pc, &funcptr->text);
__get_user(__frame->gr15, &funcptr->GOT);
struct fdpic_func_descriptor desc;
if (copy_from_user(&desc, funcptr, sizeof(desc)))
goto give_sigsegv;
__frame->pc = desc.text;
__frame->gr15 = desc.GOT;
} else {
__frame->pc = (unsigned long) ka->sa.sa_handler;
__frame->gr15 = 0;
}

set_fs(USER_DS);
__frame->sp = (unsigned long) frame;
__frame->lr = (unsigned long) &frame->retcode;
__frame->gr8 = sig;
__frame->gr9 = (unsigned long) &frame->info;

/* the tracer may want to single-step inside the handler */
if (test_thread_flag(TIF_SINGLESTEP))
Expand All @@ -422,7 +431,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
return 0;

give_sigsegv:
force_sig(SIGSEGV, current);
force_sigsegv(sig, current);
return -EFAULT;

} /* end setup_rt_frame() */
Expand All @@ -437,7 +446,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
int ret;

/* Are we from a system call? */
if (in_syscall(__frame)) {
if (__frame->syscallno != -1) {
/* If so, check system call restarting.. */
switch (__frame->gr8) {
case -ERESTART_RESTARTBLOCK:
Expand All @@ -456,6 +465,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
__frame->gr8 = __frame->orig_gr8;
__frame->pc -= 4;
}
__frame->syscallno = -1;
}

/* Set up the stack frame */
Expand Down Expand Up @@ -538,10 +548,11 @@ static void do_signal(void)
break;

case -ERESTART_RESTARTBLOCK:
__frame->gr8 = __NR_restart_syscall;
__frame->gr7 = __NR_restart_syscall;
__frame->pc -= 4;
break;
}
__frame->syscallno = -1;
}

/* if there's no signal to deliver, we just put the saved sigmask
Expand Down
9 changes: 2 additions & 7 deletions trunk/drivers/serial/amba-pl010.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,9 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios,
spin_unlock_irqrestore(&uap->port.lock, flags);
}

static void pl010_set_ldisc(struct uart_port *port)
static void pl010_set_ldisc(struct uart_port *port, int new)
{
int line = port->line;

if (line >= port->state->port.tty->driver->num)
return;

if (port->state->port.tty->ldisc->ops->num == N_PPS) {
if (new == N_PPS) {
port->flags |= UPF_HARDPPS_CD;
pl010_enable_ms(port);
} else
Expand Down
17 changes: 9 additions & 8 deletions trunk/drivers/serial/mfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,6 @@ static void hsu_global_init(void)
}

phsu = hsu;

hsu_debugfs_init(hsu);
return;

Expand All @@ -1435,18 +1434,20 @@ static void hsu_global_init(void)

static void serial_hsu_remove(struct pci_dev *pdev)
{
struct hsu_port *hsu;
int i;
void *priv = pci_get_drvdata(pdev);
struct uart_hsu_port *up;

hsu = pci_get_drvdata(pdev);
if (!hsu)
if (!priv)
return;

for (i = 0; i < 3; i++)
uart_remove_one_port(&serial_hsu_reg, &hsu->port[i].port);
/* For port 0/1/2, priv is the address of uart_hsu_port */
if (pdev->device != 0x081E) {
up = priv;
uart_remove_one_port(&serial_hsu_reg, &up->port);
}

pci_set_drvdata(pdev, NULL);
free_irq(hsu->irq, hsu);
free_irq(pdev->irq, priv);
pci_disable_device(pdev);
}

Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/usb/host/ehci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
ehci->broken_periodic = 1;
ehci_info(ehci, "using broken periodic workaround\n");
}
if (pdev->device == 0x0806 || pdev->device == 0x0811
|| pdev->device == 0x0829) {
ehci_info(ehci, "disable lpm for langwell/penwell\n");
ehci->has_lpm = 0;
}
break;
case PCI_VENDOR_ID_TDI:
if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/usb/musb/musb_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,14 @@ static const struct file_operations musb_regdump_fops = {

static int musb_test_mode_open(struct inode *inode, struct file *file)
{
file->private_data = inode->i_private;

return single_open(file, musb_test_mode_show, inode->i_private);
}

static ssize_t musb_test_mode_write(struct file *file,
const char __user *ubuf, size_t count, loff_t *ppos)
{
struct musb *musb = file->private_data;
struct seq_file *s = file->private_data;
struct musb *musb = s->private;
u8 test = 0;
char buf[18];

Expand Down
78 changes: 51 additions & 27 deletions trunk/drivers/usb/otg/twl4030-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,20 @@ static void twl4030_i2c_access(struct twl4030_usb *twl, int on)
}
}

static void twl4030_phy_power(struct twl4030_usb *twl, int on)
static void __twl4030_phy_power(struct twl4030_usb *twl, int on)
{
u8 pwr;
u8 pwr = twl4030_usb_read(twl, PHY_PWR_CTRL);

if (on)
pwr &= ~PHY_PWR_PHYPWD;
else
pwr |= PHY_PWR_PHYPWD;

pwr = twl4030_usb_read(twl, PHY_PWR_CTRL);
WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0);
}

static void twl4030_phy_power(struct twl4030_usb *twl, int on)
{
if (on) {
regulator_enable(twl->usb3v1);
regulator_enable(twl->usb1v8);
Expand All @@ -365,15 +374,13 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on)
twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0,
VUSB_DEDICATED2);
regulator_enable(twl->usb1v5);
pwr &= ~PHY_PWR_PHYPWD;
WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0);
__twl4030_phy_power(twl, 1);
twl4030_usb_write(twl, PHY_CLK_CTRL,
twl4030_usb_read(twl, PHY_CLK_CTRL) |
(PHY_CLK_CTRL_CLOCKGATING_EN |
PHY_CLK_CTRL_CLK32K_EN));
} else {
pwr |= PHY_PWR_PHYPWD;
WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0);
} else {
__twl4030_phy_power(twl, 0);
regulator_disable(twl->usb1v5);
regulator_disable(twl->usb1v8);
regulator_disable(twl->usb3v1);
Expand All @@ -387,19 +394,25 @@ static void twl4030_phy_suspend(struct twl4030_usb *twl, int controller_off)

twl4030_phy_power(twl, 0);
twl->asleep = 1;
dev_dbg(twl->dev, "%s\n", __func__);
}

static void twl4030_phy_resume(struct twl4030_usb *twl)
static void __twl4030_phy_resume(struct twl4030_usb *twl)
{
if (!twl->asleep)
return;

twl4030_phy_power(twl, 1);
twl4030_i2c_access(twl, 1);
twl4030_usb_set_mode(twl, twl->usb_mode);
if (twl->usb_mode == T2_USB_MODE_ULPI)
twl4030_i2c_access(twl, 0);
}

static void twl4030_phy_resume(struct twl4030_usb *twl)
{
if (!twl->asleep)
return;
__twl4030_phy_resume(twl);
twl->asleep = 0;
dev_dbg(twl->dev, "%s\n", __func__);
}

static int twl4030_usb_ldo_init(struct twl4030_usb *twl)
Expand All @@ -408,8 +421,8 @@ static int twl4030_usb_ldo_init(struct twl4030_usb *twl)
twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0xC0, PROTECT_KEY);
twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x0C, PROTECT_KEY);

/* put VUSB3V1 LDO in active state */
twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);
/* Keep VUSB3V1 LDO in sleep state until VBUS/ID change detected*/
/*twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);*/

/* input to VUSB3V1 LDO is from VBAT, not VBUS */
twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1);
Expand Down Expand Up @@ -502,6 +515,26 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl)
return IRQ_HANDLED;
}

static void twl4030_usb_phy_init(struct twl4030_usb *twl)
{
int status;

status = twl4030_usb_linkstat(twl);
if (status >= 0) {
if (status == USB_EVENT_NONE) {
__twl4030_phy_power(twl, 0);
twl->asleep = 1;
} else {
__twl4030_phy_resume(twl);
twl->asleep = 0;
}

blocking_notifier_call_chain(&twl->otg.notifier, status,
twl->otg.gadget);
}
sysfs_notify(&twl->dev->kobj, NULL, "vbus");
}

static int twl4030_set_suspend(struct otg_transceiver *x, int suspend)
{
struct twl4030_usb *twl = xceiv_to_twl(x);
Expand Down Expand Up @@ -550,7 +583,6 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev)
struct twl4030_usb_data *pdata = pdev->dev.platform_data;
struct twl4030_usb *twl;
int status, err;
u8 pwr;

if (!pdata) {
dev_dbg(&pdev->dev, "platform_data not available\n");
Expand All @@ -569,10 +601,7 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev)
twl->otg.set_peripheral = twl4030_set_peripheral;
twl->otg.set_suspend = twl4030_set_suspend;
twl->usb_mode = pdata->usb_mode;

pwr = twl4030_usb_read(twl, PHY_PWR_CTRL);

twl->asleep = (pwr & PHY_PWR_PHYPWD);
twl->asleep = 1;

/* init spinlock for workqueue */
spin_lock_init(&twl->lock);
Expand Down Expand Up @@ -610,15 +639,10 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev)
return status;
}

/* The IRQ handler just handles changes from the previous states
* of the ID and VBUS pins ... in probe() we must initialize that
* previous state. The easy way: fake an IRQ.
*
* REVISIT: a real IRQ might have happened already, if PREEMPT is
* enabled. Else the IRQ may not yet be configured or enabled,
* because of scheduling delays.
/* Power down phy or make it work according to
* current link state.
*/
twl4030_usb_irq(twl->irq, twl);
twl4030_usb_phy_init(twl);

dev_info(&pdev->dev, "Initialized TWL4030 USB module\n");
return 0;
Expand Down
Loading

0 comments on commit 88d8084

Please sign in to comment.