All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pnx8550: Fix broken write_config_byte() function in arch/mips/pci/ops-pnx8550.c
@ 2007-01-05  5:56 Davy Chan
  2007-01-08 15:26 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Davy Chan @ 2007-01-05  5:56 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

(Looks like not many people write single bytes to the PCI configuration
 registers on a PNX8550-based system.)

There's a serious typo in the function:
  arch/mips/pci/ops-pnx8550.c:write_config_byte()

The parameter passed to the function config_access() is PCI_CMD_CONFIG_READ
instead of PCI_CMD_CONFIG_WRITE. This renders any attempts to write
a single byte to the PCI configuration registers useless.

This problem does not exist for write_config_word() nor write_config_dword().

This problem has been there since kernel v2.6.17 and is still there
as of kernel v2.6.19.1.

Patch attached.

See ya...

d.c.


[-- Attachment #2: ops-pnx8550.c.patch --]
[-- Type: text/plain, Size: 411 bytes --]

--- linux-2.6.17.13-orig/arch/mips/pci/ops-pnx8550.c	2006-09-10 01:17:04.000000000 +0800
+++ linux-2.6.17.13/arch/mips/pci/ops-pnx8550.c	2007-01-04 13:49:37.000000000 +0800
@@ -202,7 +202,7 @@
 		break;
 	}
 
-	err = config_access(PCI_CMD_CONFIG_READ, bus, devfn, where, ~(1 << (where & 3)), &data);
+	err = config_access(PCI_CMD_CONFIG_WRITE, bus, devfn, where, ~(1 << (where & 3)), &data);
 
 	return err;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] pnx8550: Fix broken write_config_byte() function in arch/mips/pci/ops-pnx8550.c
  2007-01-05  5:56 [PATCH] pnx8550: Fix broken write_config_byte() function in arch/mips/pci/ops-pnx8550.c Davy Chan
@ 2007-01-08 15:26 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2007-01-08 15:26 UTC (permalink / raw)
  To: Davy Chan; +Cc: linux-mips

On Fri, Jan 05, 2007 at 01:56:46PM +0800, Davy Chan wrote:

> There's a serious typo in the function:
>   arch/mips/pci/ops-pnx8550.c:write_config_byte()
> 
> The parameter passed to the function config_access() is PCI_CMD_CONFIG_READ
> instead of PCI_CMD_CONFIG_WRITE. This renders any attempts to write
> a single byte to the PCI configuration registers useless.
> 
> This problem does not exist for write_config_word() nor write_config_dword().
> 
> This problem has been there since kernel v2.6.17 and is still there
> as of kernel v2.6.19.1.

The bug exists even in 2.6.16 which is the oldest -stable branch I'm still
maintaining on linux-mips.org.

Patch applied.  Standard rant, please add a Signed-off-by: line.  See
Documentation/SubmittingPatches for what this is about.

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-08 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-05  5:56 [PATCH] pnx8550: Fix broken write_config_byte() function in arch/mips/pci/ops-pnx8550.c Davy Chan
2007-01-08 15:26 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.