提交 7fbcca25 编写于 作者: L Linus Torvalds

Merge branch 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Fix access to released memory in clk_debugfs_register_one()
  sh: Fix access to released memory in dwarf_unwinder_cleanup()
  usb: r8a66597-hdc disable interrupts fix
  spi: spi_sh_msiof: Fixed data sampling on the correct edge
...@@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root; ...@@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root;
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
int err; int err;
struct dentry *d, *child; struct dentry *d, *child, *child_tmp;
struct clk *pa = c->parent; struct clk *pa = c->parent;
char s[255]; char s[255];
char *p = s; char *p = s;
...@@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c)
err_out: err_out:
d = c->dentry; d = c->dentry;
list_for_each_entry(child, &d->d_subdirs, d_u.d_child) list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
debugfs_remove(child); debugfs_remove(child);
debugfs_remove(c->dentry); debugfs_remove(c->dentry);
return err; return err;
......
...@@ -892,18 +892,18 @@ static struct unwinder dwarf_unwinder = { ...@@ -892,18 +892,18 @@ static struct unwinder dwarf_unwinder = {
static void dwarf_unwinder_cleanup(void) static void dwarf_unwinder_cleanup(void)
{ {
struct dwarf_cie *cie; struct dwarf_cie *cie, *cie_tmp;
struct dwarf_fde *fde; struct dwarf_fde *fde, *fde_tmp;
/* /*
* Deallocate all the memory allocated for the DWARF unwinder. * Deallocate all the memory allocated for the DWARF unwinder.
* Traverse all the FDE/CIE lists and remove and free all the * Traverse all the FDE/CIE lists and remove and free all the
* memory associated with those data structures. * memory associated with those data structures.
*/ */
list_for_each_entry(cie, &dwarf_cie_list, link) list_for_each_entry_safe(cie, cie_tmp, &dwarf_cie_list, link)
kfree(cie); kfree(cie);
list_for_each_entry(fde, &dwarf_fde_list, link) list_for_each_entry_safe(fde, fde_tmp, &dwarf_fde_list, link)
kfree(fde); kfree(fde);
kmem_cache_destroy(dwarf_reg_cachep); kmem_cache_destroy(dwarf_reg_cachep);
......
...@@ -173,15 +173,12 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, ...@@ -173,15 +173,12 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
int edge; int edge;
/* /*
* CPOL CPHA TSCKIZ RSCKIZ TEDG REDG(!) * CPOL CPHA TSCKIZ RSCKIZ TEDG REDG
* 0 0 10 10 1 0 * 0 0 10 10 1 1
* 0 1 10 10 0 1 * 0 1 10 10 0 0
* 1 0 11 11 0 1 * 1 0 11 11 0 0
* 1 1 11 11 1 0 * 1 1 11 11 1 1
*
* (!) Note: REDG is inverted recommended data sheet setting
*/ */
sh_msiof_write(p, FCTR, 0); sh_msiof_write(p, FCTR, 0);
sh_msiof_write(p, TMDR1, 0xe2000005 | (lsb_first << 24)); sh_msiof_write(p, TMDR1, 0xe2000005 | (lsb_first << 24));
sh_msiof_write(p, RMDR1, 0x22000005 | (lsb_first << 24)); sh_msiof_write(p, RMDR1, 0x22000005 | (lsb_first << 24));
...@@ -193,7 +190,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, ...@@ -193,7 +190,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
edge = cpol ? cpha : !cpha; edge = cpol ? cpha : !cpha;
tmp |= edge << 27; /* TEDG */ tmp |= edge << 27; /* TEDG */
tmp |= !edge << 26; /* REDG */ tmp |= edge << 26; /* REDG */
tmp |= (tx_hi_z ? 2 : 0) << 22; /* TXDIZ */ tmp |= (tx_hi_z ? 2 : 0) << 22; /* TXDIZ */
sh_msiof_write(p, CTR, tmp); sh_msiof_write(p, CTR, tmp);
} }
......
...@@ -216,8 +216,17 @@ static void disable_controller(struct r8a66597 *r8a66597) ...@@ -216,8 +216,17 @@ static void disable_controller(struct r8a66597 *r8a66597)
{ {
int port; int port;
/* disable interrupts */
r8a66597_write(r8a66597, 0, INTENB0); r8a66597_write(r8a66597, 0, INTENB0);
r8a66597_write(r8a66597, 0, INTSTS0); r8a66597_write(r8a66597, 0, INTENB1);
r8a66597_write(r8a66597, 0, BRDYENB);
r8a66597_write(r8a66597, 0, BEMPENB);
r8a66597_write(r8a66597, 0, NRDYENB);
/* clear status */
r8a66597_write(r8a66597, 0, BRDYSTS);
r8a66597_write(r8a66597, 0, NRDYSTS);
r8a66597_write(r8a66597, 0, BEMPSTS);
for (port = 0; port < r8a66597->max_root_hub; port++) for (port = 0; port < r8a66597->max_root_hub; port++)
r8a66597_disable_port(r8a66597, port); r8a66597_disable_port(r8a66597, port);
...@@ -2466,6 +2475,12 @@ static int __devinit r8a66597_probe(struct platform_device *pdev) ...@@ -2466,6 +2475,12 @@ static int __devinit r8a66597_probe(struct platform_device *pdev)
r8a66597->rh_timer.data = (unsigned long)r8a66597; r8a66597->rh_timer.data = (unsigned long)r8a66597;
r8a66597->reg = (unsigned long)reg; r8a66597->reg = (unsigned long)reg;
/* make sure no interrupts are pending */
ret = r8a66597_clock_enable(r8a66597);
if (ret < 0)
goto clean_up3;
disable_controller(r8a66597);
for (i = 0; i < R8A66597_MAX_NUM_PIPE; i++) { for (i = 0; i < R8A66597_MAX_NUM_PIPE; i++) {
INIT_LIST_HEAD(&r8a66597->pipe_queue[i]); INIT_LIST_HEAD(&r8a66597->pipe_queue[i]);
init_timer(&r8a66597->td_timer[i]); init_timer(&r8a66597->td_timer[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册