* [PATCH 4/7] tg3: PCI command adjustment
@ 2007-10-19 21:36 Matt Carlson
2007-10-21 23:17 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Matt Carlson @ 2007-10-19 21:36 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, Michael Chan
This patch changes the way the driver works with the PCI command
register. It adjusts the access size from dwords to words. This patch
is done both as a PCI configuration space cleanup and as preparatory
work for PCI error recovery.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 68472ce..9920751 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -5029,10 +5029,7 @@ static int tg3_poll_fw(struct tg3 *tp)
/* Save PCI command register before chip reset */
static void tg3_save_pci_state(struct tg3 *tp)
{
- u32 val;
-
- pci_read_config_dword(tp->pdev, TG3PCI_COMMAND, &val);
- tp->pci_cmd = val;
+ pci_read_config_word(tp->pdev, PCI_COMMAND, &tp->pci_cmd);
}
/* Restore PCI state after chip reset */
@@ -5055,7 +5052,7 @@ static void tg3_restore_pci_state(struct tg3 *tp)
PCISTATE_ALLOW_APE_SHMEM_WR;
pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, val);
- pci_write_config_dword(tp->pdev, TG3PCI_COMMAND, tp->pci_cmd);
+ pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd);
if (!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 495a1df..1d5b2a3 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2421,7 +2421,7 @@ struct tg3 {
#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */
u32 led_ctrl;
- u32 pci_cmd;
+ u16 pci_cmd;
char board_part_number[24];
#define TG3_VER_SIZE 32
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 4/7] tg3: PCI command adjustment
2007-10-19 21:36 [PATCH 4/7] tg3: PCI command adjustment Matt Carlson
@ 2007-10-21 23:17 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-10-21 23:17 UTC (permalink / raw)
To: mcarlson; +Cc: netdev, andy, mchan
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Fri, 19 Oct 2007 14:36:53 -0700
> This patch changes the way the driver works with the PCI command
> register. It adjusts the access size from dwords to words. This patch
> is done both as a PCI configuration space cleanup and as preparatory
> work for PCI error recovery.
>
> Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
I will apply this patch but I can imagine this 32-bit store
did things for us that will no longer be done.
For example, it might have been clearing error indications
in the PCI_STATUS reguster.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-21 23:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19 21:36 [PATCH 4/7] tg3: PCI command adjustment Matt Carlson
2007-10-21 23:17 ` David Miller
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).