Netdev List
 help / color / mirror / Atom feed
* tg3 question: Why use misc_host_ctrl not pci_chip_rev_id here?
@ 2013-02-15 22:41 Joe Perches
  2013-02-16 20:54 ` Michael Chan
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2013-02-15 22:41 UTC (permalink / raw)
  To: netdev; +Cc: Jeff Garzik, David Miller, Matt Carlson, Michael Chan

This code is in the original 2002 tg3 commit from Jeff.
(line 15764 today)

static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
[]
	if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0 &&
	    !tg3_flag(tp, PCIX_TARGET_HWBUG)) {
(15764)		u32 chiprevid = GET_CHIP_REV_ID(tp->misc_host_ctrl)

		if (chiprevid == CHIPREV_ID_5701_A0 ||
		    chiprevid == CHIPREV_ID_5701_B0 ||
		    chiprevid == CHIPREV_ID_5701_B2 ||
		    chiprevid == CHIPREV_ID_5701_B5) {

This is the only test of GET_CHIP_REV_ID.

Shouldn't that GET_CHIP_REV_ID(tp->misc_host_ctrl)
and the tests below it be converted to tests like

	tp->pci_chip_rev_id == CHIPREV_ID_5701_A0

to be similar to all the pci_chip_rev_id tests that
the code in the same function uses?

It seems to me through a shallow reading that it's
the same value as tg3_detect_asic_rev() sets it.

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

* Re: tg3 question: Why use misc_host_ctrl not pci_chip_rev_id here?
  2013-02-15 22:41 tg3 question: Why use misc_host_ctrl not pci_chip_rev_id here? Joe Perches
@ 2013-02-16 20:54 ` Michael Chan
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Chan @ 2013-02-16 20:54 UTC (permalink / raw)
  To: Joe Perches; +Cc: netdev, Jeff Garzik, David Miller, Matt Carlson

On Fri, 2013-02-15 at 14:41 -0800, Joe Perches wrote: 
> This code is in the original 2002 tg3 commit from Jeff.
> (line 15764 today)
> 
> static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
> []
> 	if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0 &&
> 	    !tg3_flag(tp, PCIX_TARGET_HWBUG)) {
> (15764)		u32 chiprevid = GET_CHIP_REV_ID(tp->misc_host_ctrl)
> 
> 		if (chiprevid == CHIPREV_ID_5701_A0 ||
> 		    chiprevid == CHIPREV_ID_5701_B0 ||
> 		    chiprevid == CHIPREV_ID_5701_B2 ||
> 		    chiprevid == CHIPREV_ID_5701_B5) {
> 
> This is the only test of GET_CHIP_REV_ID.
> 
> Shouldn't that GET_CHIP_REV_ID(tp->misc_host_ctrl)
> and the tests below it be converted to tests like
> 
> 	tp->pci_chip_rev_id == CHIPREV_ID_5701_A0
> 
> to be similar to all the pci_chip_rev_id tests that
> the code in the same function uses?

Yes, I agree with you that the 2 methods are the same and we should make
everything consistent.  Thanks.

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

end of thread, other threads:[~2013-02-16 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-15 22:41 tg3 question: Why use misc_host_ctrl not pci_chip_rev_id here? Joe Perches
2013-02-16 20:54 ` Michael Chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox