All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: dhananjay.phadke@gmail.com
Cc: netdev@vger.kernel.org, rob@netxen.com
Subject: Re: RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registers
Date: Sun, 1 Jul 2007 11:27:49 +0200	[thread overview]
Message-ID: <200707011127.49766.mb@bu3sch.de> (raw)
In-Reply-To: <20070701024730.494758559@netxen.com>

On Sunday 01 July 2007 04:43:27 dhananjay.phadke@gmail.com wrote:
> This patch updates the various access routines to access different
> control and status settings present in different register locations.
> This will fix problems related to working of different ports in
> multi Port card.
> 
> Signed-off by: Dhananjay Phadke <dhananjay@netxen.com>
> Signed-off by: Milan Bag <mbag@netxen.com>
> 
> Index: netdev-2.6/drivers/net/netxen/netxen_nic.h
> ===================================================================
> --- netdev-2.6.orig/drivers/net/netxen/netxen_nic.h
> +++ netdev-2.6/drivers/net/netxen/netxen_nic.h
> @@ -937,6 +937,7 @@ struct netxen_adapter {
>  	struct netxen_ring_ctx *ctx_desc;
>  	struct pci_dev *ctx_desc_pdev;
>  	dma_addr_t ctx_desc_phys_addr;
> +	int intr_scheme;
>  	int (*enable_phy_interrupts) (struct netxen_adapter *);
>  	int (*disable_phy_interrupts) (struct netxen_adapter *);
>  	void (*handle_phy_intr) (struct netxen_adapter *);
> @@ -1080,37 +1081,103 @@ struct net_device_stats *netxen_nic_get_
>  
>  static inline void netxen_nic_disable_int(struct netxen_adapter *adapter)
>  {
> -	/*
> -	 * ISR_INT_MASK: Can be read from window 0 or 1.
> -	 */
> -	writel(0x7ff, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
> +	uint32_t	mask = 0x7ff;
> +	int count = 0;
>  
> +	DPRINTK(1, INFO, "Entered ISR Disable \n");
> +
> +	switch (adapter->portnum) {
> +	case 0:
> +		writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_0));
> +		break;
> +	case 1:
> +		writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_1));
> +		break;
> +	case 2:
> +		writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_2));
> +		break;
> +	case 3:
> +		writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_3));
> +		break;
> +	}
> +
> +	if (adapter->intr_scheme != -1 &&
> +		adapter->intr_scheme != INTR_SCHEME_PERPORT) {
> +		writel(mask,
> +			(void *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
> +	}
> +
> +	/* Window = 0 or 1 */
> +	if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
> +		do {
> +			writel(0xffffffff, (void *)
> +				(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_STATUS)));
> +			mask = readl((void *)
> +					(pci_base_offset(adapter, ISR_INT_VECTOR)));
> +			udelay(10);

This needlessly always delays at least 10 uS, even if it succeed on the
first attempt.
Better do it like I suggested to avoid that.

-- 
Greetings Michael.

  reply	other threads:[~2007-07-01  9:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-01  2:43 RESEND [PATCH 0/3] NetXen: Bug fixes for multiport and blade adapters dhananjay.phadke
2007-07-01  2:43 ` RESEND [PATCH 1/3] NetXen: Fix issue of MSI not working correctly dhananjay.phadke
2007-07-01  2:43 ` RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registers dhananjay.phadke
2007-07-01  9:27   ` Michael Buesch [this message]
2007-07-01  2:43 ` RESEND [PATCH 3/3] NetXen: Graceful teardown of interface and hardware upon module unload dhananjay.phadke
  -- strict thread matches above, loose matches on Subject: below --
2007-07-01 18:55 RESEND [PATCH 0/3] NetXen: Bug fixes for multiport and blade adapters dhananjay.phadke
2007-07-01 18:56 ` RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registers dhananjay.phadke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200707011127.49766.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=dhananjay.phadke@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rob@netxen.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.