* [PATCH] sata_sis: fix SCR read breakage
@ 2007-10-18 2:53 Tejun Heo
2007-10-19 2:23 ` Tejun Heo
2007-10-20 2:57 ` Jeff Garzik
0 siblings, 2 replies; 3+ messages in thread
From: Tejun Heo @ 2007-10-18 2:53 UTC (permalink / raw)
To: Jeff Garzik, linux-ide
SCR read for controllers which uses PCI configuration space for SCR
access got broken while adding @val argument to SCR accessors. Fix
it.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/ata/sata_sis.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 8d98a9f..dc8e5c0 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -166,11 +166,11 @@ 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 */
@@ -178,13 +178,16 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
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)
@@ -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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] sata_sis: fix SCR read breakage
2007-10-18 2:53 [PATCH] sata_sis: fix SCR read breakage Tejun Heo
@ 2007-10-19 2:23 ` Tejun Heo
2007-10-20 2:57 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2007-10-19 2:23 UTC (permalink / raw)
To: Jeff Garzik, linux-ide
Tejun Heo wrote:
> SCR read for controllers which uses PCI configuration space for SCR
> access got broken while adding @val argument to SCR accessors. Fix
> it.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
JFYI, reporter of bug 9164 confirmed the fix.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sata_sis: fix SCR read breakage
2007-10-18 2:53 [PATCH] sata_sis: fix SCR read breakage Tejun Heo
2007-10-19 2:23 ` Tejun Heo
@ 2007-10-20 2:57 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-10-20 2:57 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide
Tejun Heo wrote:
> SCR read for controllers which uses PCI configuration space for SCR
> access got broken while adding @val argument to SCR accessors. Fix
> it.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> drivers/ata/sata_sis.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
applied
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-10-20 2:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-18 2:53 [PATCH] sata_sis: fix SCR read breakage Tejun Heo
2007-10-19 2:23 ` Tejun Heo
2007-10-20 2:57 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).