Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71791
b: refs/heads/master
c: aaa092a
h: refs/heads/master
i:
  71789: 2087cd3
  71787: a1b2cc3
  71783: 89b4965
  71775: 46ba10e
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Oct 20, 2007
1 parent b0396d7 commit c64804f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 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: 5c1ad8b30587694590691d6a83b1e7adaa7ca6d0
refs/heads/master: aaa092a114696f4425cd57c4d7fa05110007e247
13 changes: 8 additions & 5 deletions trunk/drivers/ata/sata_sis.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,25 +166,28 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, unsigned int sc_reg)
return addr;
}

static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg, u32 *val)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg);
u32 val, val2 = 0;
u32 val2 = 0;
u8 pmr;

if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */
return 0xffffffff;

pci_read_config_byte(pdev, SIS_PMR, &pmr);

pci_read_config_dword(pdev, cfg_addr, &val);
pci_read_config_dword(pdev, cfg_addr, val);

if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
(pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
pci_read_config_dword(pdev, cfg_addr+0x10, &val2);

return (val|val2) & 0xfffffffb; /* avoid problems with powerdowned ports */
*val |= val2;
*val &= 0xfffffffb; /* avoid problems with powerdowned ports */

return 0;
}

static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
Expand Down Expand Up @@ -214,7 +217,7 @@ static int sis_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
return -EINVAL;

if (ap->flags & SIS_FLAG_CFGSCR)
return sis_scr_cfg_read(ap, sc_reg);
return sis_scr_cfg_read(ap, sc_reg, val);

pci_read_config_byte(pdev, SIS_PMR, &pmr);

Expand Down

0 comments on commit c64804f

Please sign in to comment.