Skip to content

Commit

Permalink
Merge branch 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/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
  • Loading branch information
Linus Torvalds committed Feb 2, 2010
2 parents e770a0f + bc10e87 commit 7fbcca2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
4 changes: 2 additions & 2 deletions arch/sh/kernel/cpu/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root;
static int clk_debugfs_register_one(struct clk *c)
{
int err;
struct dentry *d, *child;
struct dentry *d, *child, *child_tmp;
struct clk *pa = c->parent;
char s[255];
char *p = s;
Expand Down Expand Up @@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c)

err_out:
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(c->dentry);
return err;
Expand Down
8 changes: 4 additions & 4 deletions arch/sh/kernel/dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,18 +892,18 @@ static struct unwinder dwarf_unwinder = {

static void dwarf_unwinder_cleanup(void)
{
struct dwarf_cie *cie;
struct dwarf_fde *fde;
struct dwarf_cie *cie, *cie_tmp;
struct dwarf_fde *fde, *fde_tmp;

/*
* Deallocate all the memory allocated for the DWARF unwinder.
* Traverse all the FDE/CIE lists and remove and free all the
* 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);

list_for_each_entry(fde, &dwarf_fde_list, link)
list_for_each_entry_safe(fde, fde_tmp, &dwarf_fde_list, link)
kfree(fde);

kmem_cache_destroy(dwarf_reg_cachep);
Expand Down
15 changes: 6 additions & 9 deletions drivers/spi/spi_sh_msiof.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,12 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
int edge;

/*
* CPOL CPHA TSCKIZ RSCKIZ TEDG REDG(!)
* 0 0 10 10 1 0
* 0 1 10 10 0 1
* 1 0 11 11 0 1
* 1 1 11 11 1 0
*
* (!) Note: REDG is inverted recommended data sheet setting
* CPOL CPHA TSCKIZ RSCKIZ TEDG REDG
* 0 0 10 10 1 1
* 0 1 10 10 0 0
* 1 0 11 11 0 0
* 1 1 11 11 1 1
*/

sh_msiof_write(p, FCTR, 0);
sh_msiof_write(p, TMDR1, 0xe2000005 | (lsb_first << 24));
sh_msiof_write(p, RMDR1, 0x22000005 | (lsb_first << 24));
Expand All @@ -193,7 +190,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
edge = cpol ? cpha : !cpha;

tmp |= edge << 27; /* TEDG */
tmp |= !edge << 26; /* REDG */
tmp |= edge << 26; /* REDG */
tmp |= (tx_hi_z ? 2 : 0) << 22; /* TXDIZ */
sh_msiof_write(p, CTR, tmp);
}
Expand Down
17 changes: 16 additions & 1 deletion drivers/usb/host/r8a66597-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,17 @@ static void disable_controller(struct r8a66597 *r8a66597)
{
int port;

/* disable interrupts */
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++)
r8a66597_disable_port(r8a66597, port);
Expand Down Expand Up @@ -2466,6 +2475,12 @@ static int __devinit r8a66597_probe(struct platform_device *pdev)
r8a66597->rh_timer.data = (unsigned long)r8a66597;
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++) {
INIT_LIST_HEAD(&r8a66597->pipe_queue[i]);
init_timer(&r8a66597->td_timer[i]);
Expand Down

0 comments on commit 7fbcca2

Please sign in to comment.