libata fixes
PATCH 1/1 libata fixes
Please pull from 'upstream' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
to obtain fixes for last-minute problems noticed in current build, following GregKH's PCI merge.
drivers/scsi/sata_mv.c | 16 ---------------- drivers/scsi/sata_sis.c | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 25 deletions(-)
commit 8add788574694c5aed04fcb281a5c999e40cd8f6
Author: Jeff Garzik <[email protected]> Date: Thu Sep 8 23:07:29 2005 -0400
[libata] minor fixes
* sata_mv: remove pci_intx(), now that the same function is in PCI core
* sata_sis: fix variable initialization bug, trim trailing whitespace
drivers/scsi/sata_mv.c +0 -16
@@ -699,22 +699,6 @@ static int mv_host_init(struct ata_probereturn rc; } -/* move to PCI layer, integrate w/ MSI stuff */ -static void pci_intx (struct pci_dev *pdev,int enable) -{ -u16 pci_command, new; - -pci_read_config_word (pdev,PCI_COMMAND , &pci_command); - -if (enable) - new = pci_command & ~PCI_COMMAND_INTX_DISABLE ; -else - new = pci_command |PCI_COMMAND_INTX_DISABLE ; - -if (new != pci_command) -pci_write_config_word (pdev,PCI_COMMAND , pci_command); -} -static int mv_init_one (struct pci_dev *pdev,const struct pci_device_id *ent) {static int printed_version =0 ;
drivers/scsi/sata_sis.c +11 -9
@@ -55,7 +55,7 @@ enum {SIS180_SATA1_OFS =0x10 ,/* offset from sata0->sata1 phy regs */ SIS182_SATA1_OFS =0x20 ,/* offset from sata0->sata1 phy regs */ SIS_PMR =0x90 ,/* port mapping register */ -SIS_PMR_COMBINED =0x30 , +SIS_PMR_COMBINED =0x30 ,/* random bits */ SIS_FLAG_CFGSCR = (1 << 30), /* host flag: SCRs via PCI cfg */
@@ -147,11 +147,13 @@ static unsigned int get_scr_cfg_addr(uns {unsigned int addr =SIS_SCR_BASE + (4 * sc_reg); -if (port_no) +if (port_no) {if (device ==0x182 ) addr +=SIS182_SATA1_OFS ;else addr +=SIS180_SATA1_OFS ; + } +return addr; }
@@ -166,10 +168,10 @@ static u32 sis_scr_cfg_read (struct ata_return 0xffffffff ;pci_read_config_byte (pdev,SIS_PMR , &pmr); - +pci_read_config_dword (pdev, cfg_addr, &val); -if ((pdev->device ==0x182 ) || (pmr &SIS_PMR_COMBINED )) +if ((pdev->device ==0x182 ) || (pmr &SIS_PMR_COMBINED ))pci_read_config_dword (pdev, cfg_addr+0x10 , &val2);return val|val2;
@@ -185,7 +187,7 @@ static void sis_scr_cfg_write (struct atreturn ;pci_read_config_byte (pdev,SIS_PMR , &pmr); - +pci_write_config_dword (pdev, cfg_addr, val);if ((pdev->device ==0x182 ) || (pmr &SIS_PMR_COMBINED ))
@@ -195,7 +197,7 @@ static void sis_scr_cfg_write (struct atstatic u32 sis_scr_read (struct ata_port *ap,unsigned int sc_reg) {struct pci_dev *pdev =to_pci_dev (ap->host_set->dev); -u32 val,val2; +u32 val, val2 =0 ;u8 pmr;if (sc_reg >SCR_CONTROL )
@@ -209,9 +211,9 @@ static u32 sis_scr_read (struct ata_port val =inl (ap->ioaddr.scr_addr + (sc_reg *4 ));if ((pdev->device ==0x182 ) || (pmr &SIS_PMR_COMBINED )) - val2 =inl (ap->ioaddr.scr_addr + (sc_reg *4 )+0x10 ); + val2 =inl (ap->ioaddr.scr_addr + (sc_reg *4 ) +0x10 ); -return val|val2; +return val | val2; }static void sis_scr_write (struct ata_port *ap,unsigned int sc_reg,u32 val)
@@ -223,7 +225,7 @@ static void sis_scr_write (struct ata_poreturn ;pci_read_config_byte (pdev,SIS_PMR , &pmr); - +if (ap->flags &SIS_FLAG_CFGSCR )sis_scr_cfg_write (ap, sc_reg, val);else {
Hello Jeff,
i have seen you have corrected a bug with a unused variable in sata_sis.c. one time.
But i have seen this problem 2 times.
my git data are not acually i have used.
git pull rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git git checkout -f upstream
may be it is already fixed.
drivers/scsi/sata_sis.c +0 -0
@@ -159,17 +161,17 @@ static u32 sis_scr_cfg_read (struct ata_ {struct pci_dev *pdev =to_pci_dev (ap->host_set->dev); unsigned int cfg_addr = get_scr_cfg_addr(ap->port_no, sc_reg,
pdev->device);
- u32 val, val2;
+ u32 val, 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);- if ((pdev->device == 0x182) || (pmr & SIS_PMR_COMBINED))
+ if ((pdev->device == 0x182) || (pmr & SIS_PMR_COMBINED))
pci_read_config_dword(pdev, cfg_addr+0x10, &val2);
return val|val2;Quoted 95 lines
Please pull from 'upstream' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
to obtain fixes for last-minute problems noticed in current build, following GregKH's PCI merge.
drivers/scsi/sata_mv.c | 16 ---------------- drivers/scsi/sata_sis.c | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 25 deletions(-)drivers/scsi/sata_sis.c +11
-10@@ -55,7 +55,7 @@ enum {SIS180_SATA1_OFS =0x10 ,/* offset from sata0->sata1 phy regs */ SIS182_SATA1_OFS =0x20 ,/* offset from sata0->sata1 phy regs */ SIS_PMR =0x90 ,/* port mapping register */ -SIS_PMR_COMBINED =0x30 , +SIS_PMR_COMBINED =0x30 ,/* random bits */ SIS_FLAG_CFGSCR = (1 << 30), /* host flag: SCRs via PCI cfg */@@ -147,11 +147,13 @@ static unsigned int get_scr_cfg_addr(uns {unsigned int addr =SIS_SCR_BASE + (4 * sc_reg); -if (port_no) +if (port_no) {if (device ==0x182 ) addr +=SIS182_SATA1_OFS ;else addr +=SIS180_SATA1_OFS ; + } +return addr; }@@ -166,10 +168,10 @@ static u32 sis_scr_cfg_read (struct ata_return 0xffffffff ;pci_read_config_byte (pdev,SIS_PMR , &pmr); - +pci_read_config_dword (pdev, cfg_addr, &val); -if ((pdev->device ==0x182 ) || (pmr &SIS_PMR_COMBINED )) +if ((pdev->device ==0x182 ) || (pmr &SIS_PMR_COMBINED ))pci_read_config_dword (pdev, cfg_addr+0x10 , &val2);return val|val2;@@ -185,7 +187,7 @@ static void sis_scr_cfg_write (struct atreturn ;pci_read_config_byte (pdev,SIS_PMR , &pmr); - +pci_write_config_dword (pdev, cfg_addr, val);if ((pdev->device ==0x182 ) || (pmr &SIS_PMR_COMBINED ))@@ -195,7 +197,7 @@ static void sis_scr_cfg_write (struct atstatic u32 sis_scr_read (struct ata_port *ap,unsigned int sc_reg) {struct pci_dev *pdev =to_pci_dev (ap->host_set->dev); -u32 val,val2; +u32 val, val2 =0 ;u8 pmr;if (sc_reg >SCR_CONTROL )@@ -209,9 +211,9 @@ static u32 sis_scr_read (struct ata_port val =inl (ap->ioaddr.scr_addr + (sc_reg *4 ));if ((pdev->device ==0x182 ) || (pmr &SIS_PMR_COMBINED )) - val2 =inl (ap->ioaddr.scr_addr + (sc_reg *4 )+0x10 ); + val2 =inl (ap->ioaddr.scr_addr + (sc_reg *4 ) +0x10 ); -return val|val2; +return val | val2; }static void sis_scr_write (struct ata_port *ap,unsigned int sc_reg,u32 val)@@ -223,7 +225,7 @@ static void sis_scr_write (struct ata_poreturn ;pci_read_config_byte (pdev,SIS_PMR , &pmr); - +if (ap->flags &SIS_FLAG_CFGSCR )sis_scr_cfg_write (ap, sc_reg, val);else { -
Quoted 6 lines · Uwe Koziolek
Hello Jeff,
i have seen you have corrected a bug with a unused variable in
sata_sis.c. one time.
But i have seen this problem 2 times.
Quoted 6 lines
my git data are not acually i have used.
git pull rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git git checkout -f upstreammay be it is already fixed.
Sorry, I cannot fully understand your email.
Please check 2.6.13-git9 from http://www.kernel.org/ and see if you feel further updates are needed. Everything relevant has been sent to Linus.
Jeff
patch for sata_sis.c
Hello Jeff,
There is an uninitialized variable issue in sata_sis.c, version 2.6.13-git10. Please check the patch.
Uwe Koziolek
drivers/scsi/sata_sis.c +1 -1
@@ -159,7 +159,7 @@ static u32 sis_scr_cfg_read (struct ata_ {struct pci_dev *pdev =to_pci_dev (ap->host_set->dev);unsigned int cfg_addr =get_scr_cfg_addr (ap->port_no, sc_reg, pdev->device); -u32 val, val2; +u32 val, val2 =0 ;u8 pmr;if (sc_reg ==SCR_ERROR )/* doesn't exist in PCI cfg space */