* RE: FW: + qla3xxx-is-bust.patch added to -mm tree
@ 2006-07-13 18:13 Ron Mercer
0 siblings, 0 replies; 9+ messages in thread
From: Ron Mercer @ 2006-07-13 18:13 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, Linux Driver
>
> Freeing a kernel interrupt reservation does not imply that
> your hardware has stopped delivering them... in a shared
> interrupt situation, the code sequence
>
> free_irq()
> perform some action
>
> could cause the kernel to call _another_ driver's interrupt
> handling routine over and over again, until _your_ hardware
> stops raising the interrupt condition.
>
> Jeff
I guess misunderstood your original comment. I am not "masking"
interrupts before issuing the reset. I am shutting them off. The device
will not issue any more interrupts until it is reinitialized and
interrupts turned back on.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: FW: + qla3xxx-is-bust.patch added to -mm tree
2006-07-13 16:57 Ron Mercer
@ 2006-07-13 17:06 ` Jeff Garzik
0 siblings, 0 replies; 9+ messages in thread
From: Jeff Garzik @ 2006-07-13 17:06 UTC (permalink / raw)
To: Ron Mercer; +Cc: netdev, linux-driver
Ron Mercer wrote:
> Jeff,
>
> Regarding your June 22nd post:
>
>> 14) Surely there is a better way to down the adapter than masking the
>> interrupts and resetting the adapter? If this is ever used in non-MSI
>
>> situations (common in Linux today), there is the possibility of
>> screaming interrupts, in shared-interrupt situations.
>
>
> The actual downing of the adapter frees interrupts before issuing a
> reset. Perhaps you are referring to the ql_reset_work() path? This
> handles chip reset requests generated by the iSCSI driver or iSCSI
> firmware. What you see is that interrupts are masked and reset is
> allowed to continue. I have made a change where the interrupt is freed
> before the reset continues. I will post a new patch that covers all
> issues tomorrow.
Freeing a kernel interrupt reservation does not imply that your hardware
has stopped delivering them... in a shared interrupt situation, the
code sequence
free_irq()
perform some action
could cause the kernel to call _another_ driver's interrupt handling
routine over and over again, until _your_ hardware stops raising the
interrupt condition.
Jeff
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: FW: + qla3xxx-is-bust.patch added to -mm tree
@ 2006-07-13 16:57 Ron Mercer
2006-07-13 17:06 ` Jeff Garzik
0 siblings, 1 reply; 9+ messages in thread
From: Ron Mercer @ 2006-07-13 16:57 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, linux-driver
Jeff,
Regarding your June 22nd post:
> 14) Surely there is a better way to down the adapter than masking the
> interrupts and resetting the adapter? If this is ever used in non-MSI
> situations (common in Linux today), there is the possibility of
> screaming interrupts, in shared-interrupt situations.
The actual downing of the adapter frees interrupts before issuing a
reset. Perhaps you are referring to the ql_reset_work() path? This
handles chip reset requests generated by the iSCSI driver or iSCSI
firmware. What you see is that interrupts are masked and reset is
allowed to continue. I have made a change where the interrupt is freed
before the reset continues. I will post a new patch that covers all
issues tomorrow.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: FW: + qla3xxx-is-bust.patch added to -mm tree
2006-06-28 23:07 Ron Mercer
2006-06-28 23:24 ` Andrew Morton
2006-06-29 1:37 ` Jeff Garzik
@ 2006-06-29 3:41 ` Doug Maxey
2 siblings, 0 replies; 9+ messages in thread
From: Doug Maxey @ 2006-06-29 3:41 UTC (permalink / raw)
To: Ron Mercer; +Cc: Andrew Morton, netdev, Linux Driver
On Wed, 28 Jun 2006 16:07:22 PDT, "Ron Mercer" wrote:
> >
> > Is the device hotpluggable? If so, this:
> >
> > qdev->index = cards_found;
> >
> > in the probe() handler might do odd things - it'll just keep
> > increasing as the card is removed and re-added.
> >
> > iirc, that's a common problem with net drivers. AFAICT it'll
> > cause only cosmetic oddities here.
> >
> >
>
> Not sure if the device supports hotplug. I'm looking into it. Either
> way, I will be removing qdev->index. It's not needed.
>
Oh indeed it will on System p, the new name for the power series.
Both it and the qla4xxx on a single adapter can (and will) be moved
between partitions, preceded by a hot-unplug in the DLPAR environment.
++doug
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: FW: + qla3xxx-is-bust.patch added to -mm tree
2006-06-28 23:07 Ron Mercer
2006-06-28 23:24 ` Andrew Morton
@ 2006-06-29 1:37 ` Jeff Garzik
2006-06-29 3:41 ` Doug Maxey
2 siblings, 0 replies; 9+ messages in thread
From: Jeff Garzik @ 2006-06-29 1:37 UTC (permalink / raw)
To: Ron Mercer; +Cc: Andrew Morton, netdev, Linux Driver
Ron Mercer wrote:
>> Is the device hotpluggable? If so, this:
>>
>> qdev->index = cards_found;
>>
>> in the probe() handler might do odd things - it'll just keep
>> increasing as the card is removed and re-added.
>>
>> iirc, that's a common problem with net drivers. AFAICT it'll
>> cause only cosmetic oddities here.
>>
>>
>
> Not sure if the device supports hotplug. I'm looking into it. Either
If its a PCI device, it does... depends more on the bus than the device.
> way, I will be removing qdev->index. It's not needed.
Sounds good.
> I am working on the remaining items that Jeff pointed out when he
> reviewed my driver. I will forward a patch built against what you
> currently have when I'm done.
>
> Now that the driver is in mm tree, is there anything I need to do to get
> it into Linus' tree?
Fix the stuff I pointed out...
Jeff
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: FW: + qla3xxx-is-bust.patch added to -mm tree
2006-06-28 23:07 Ron Mercer
@ 2006-06-28 23:24 ` Andrew Morton
2006-06-29 1:37 ` Jeff Garzik
2006-06-29 3:41 ` Doug Maxey
2 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2006-06-28 23:24 UTC (permalink / raw)
To: Ron Mercer; +Cc: netdev, Linux-Driver
"Ron Mercer" <ron.mercer@qlogic.com> wrote:
>
> >
> > Is the device hotpluggable? If so, this:
> >
> > qdev->index = cards_found;
> >
> > in the probe() handler might do odd things - it'll just keep
> > increasing as the card is removed and re-added.
> >
> > iirc, that's a common problem with net drivers. AFAICT it'll
> > cause only cosmetic oddities here.
> >
> >
>
> Not sure if the device supports hotplug. I'm looking into it. Either
> way, I will be removing qdev->index. It's not needed.
>
> I am working on the remaining items that Jeff pointed out when he
> reviewed my driver. I will forward a patch built against what you
> currently have when I'm done.
OK.
> Now that the driver is in mm tree, is there anything I need to do to get
> it into Linus' tree?
It should go via Jeff. I added it to -mm just to get it a bit of
attention, more reviewers, extra compile coverage testing, etc.
If you want to consider the patch in -mm to be the reference copy then
that's fine. You should do maintenance work against that patch and I'll
add it to the patches which I send to Jeff on Thursdays until he merges it
or rejects it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: FW: + qla3xxx-is-bust.patch added to -mm tree
@ 2006-06-28 23:07 Ron Mercer
2006-06-28 23:24 ` Andrew Morton
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Ron Mercer @ 2006-06-28 23:07 UTC (permalink / raw)
To: Andrew Morton; +Cc: netdev, Linux Driver
>
> Is the device hotpluggable? If so, this:
>
> qdev->index = cards_found;
>
> in the probe() handler might do odd things - it'll just keep
> increasing as the card is removed and re-added.
>
> iirc, that's a common problem with net drivers. AFAICT it'll
> cause only cosmetic oddities here.
>
>
Not sure if the device supports hotplug. I'm looking into it. Either
way, I will be removing qdev->index. It's not needed.
I am working on the remaining items that Jeff pointed out when he
reviewed my driver. I will forward a patch built against what you
currently have when I'm done.
Now that the driver is in mm tree, is there anything I need to do to get
it into Linus' tree?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: FW: + qla3xxx-is-bust.patch added to -mm tree
2006-06-26 19:02 Ron Mercer
@ 2006-06-26 19:24 ` Andrew Morton
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2006-06-26 19:24 UTC (permalink / raw)
To: Ron Mercer; +Cc: jeff, bunk, netdev, linux-driver
On Mon, 26 Jun 2006 12:02:21 -0700
"Ron Mercer" <ron.mercer@qlogic.com> wrote:
> The attached patch fixes the compile bugs you indicated plus some of
> Jeff Garzik's concerns.
>
> - Removed non-NAPI code.
> - Removed un-needed PCI_POSTING macro.
> - Converted msleep() to ssleep() where waiting > 1 sec.
> - Broke up ql_link_state_machine into two functions for indent purposes.
> - Cleaned up ql3xxx_remove().
> - Cleaned up banner print and moved to probe.
> - Got rid of tx_lock. Not needed.
> - Fix send routine for big endian mapping problem.
> - Version change to k35.
>
> Built and tested on the latest git tree on x86 and PPC64 platforms.
Thanks.
Is the device hotpluggable? If so, this:
qdev->index = cards_found;
in the probe() handler might do odd things - it'll just keep increasing as
the card is removed and re-added.
iirc, that's a common problem with net drivers. AFAICT it'll cause only
cosmetic oddities here.
^ permalink raw reply [flat|nested] 9+ messages in thread
* FW: + qla3xxx-is-bust.patch added to -mm tree
@ 2006-06-26 19:02 Ron Mercer
2006-06-26 19:24 ` Andrew Morton
0 siblings, 1 reply; 9+ messages in thread
From: Ron Mercer @ 2006-06-26 19:02 UTC (permalink / raw)
To: Andrew Morton; +Cc: Jeff Garzik, Adrian Bunk, netdev, linux-driver
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
Andrew Morton,
The attached patch fixes the compile bugs you indicated plus some of
Jeff Garzik's concerns.
- Removed non-NAPI code.
- Removed un-needed PCI_POSTING macro.
- Converted msleep() to ssleep() where waiting > 1 sec.
- Broke up ql_link_state_machine into two functions for indent purposes.
- Cleaned up ql3xxx_remove().
- Cleaned up banner print and moved to probe.
- Got rid of tx_lock. Not needed.
- Fix send routine for big endian mapping problem.
- Version change to k35.
Built and tested on the latest git tree on x86 and PPC64 platforms.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
[-- Attachment #2: qla3xxx-v2.02.00-k35.patch --]
[-- Type: application/octet-stream, Size: 17071 bytes --]
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0ff814b..11a31f2 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2258,10 +2258,6 @@ config QLA3XXX
To compile this driver as a module, choose M here: the module
will be called qla3xxx.
-config QLA3XXX_NAPI
- bool "NAPI Support"
- depends on QLA3XXX
-
endmenu
#
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 4ab7b74..fd8997e 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -38,7 +38,7 @@
#define DRV_NAME "qla3xxx"
#define DRV_STRING "QLogic ISP3XXX Network Driver"
-#define DRV_VERSION "v2.02.00-k33"
+#define DRV_VERSION "v2.02.00-k35"
#define PFX DRV_NAME " "
static const char ql3xxx_driver_name[] = DRV_NAME;
@@ -95,7 +95,7 @@ static void ql_sem_unlock(struct ql3_ada
spin_lock_irqsave(&qdev->hw_lock, hw_flags);
writel(sem_mask, &port_regs->CommonRegs.semaphoreReg);
- PCI_POSTING(&port_regs->CommonRegs.semaphoreReg);
+ readl(&port_regs->CommonRegs.semaphoreReg);
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
}
@@ -122,7 +122,7 @@ static int ql_wait_for_drvr_lock(struct
(QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index)
* 2) << 1)) {
if (i < 10) {
- msleep(1000);
+ ssleep(1);
i++;
} else {
printk(KERN_ERR PFX "%s: Timed out waiting for "
@@ -184,7 +184,7 @@ static void ql_write_common_reg(struct q
spin_lock_irqsave(&qdev->hw_lock, hw_flags);
writel(value, (u32 *) reg);
- PCI_POSTING(reg);
+ readl(reg);
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
return;
}
@@ -199,7 +199,7 @@ static void ql_write_page0_reg(struct ql
if (qdev->current_page != 0)
ql_set_register_page(qdev,0);
writel(value, (u32 *) reg);
- PCI_POSTING(reg);
+ readl(reg);
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
return;
@@ -215,7 +215,7 @@ static void ql_write_page1_reg(struct ql
if (qdev->current_page != 1)
ql_set_register_page(qdev,1);
writel(value, (u32 *) reg);
- PCI_POSTING(reg);
+ readl(reg);
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
return;
@@ -231,7 +231,7 @@ static void ql_write_page2_reg(struct ql
if (qdev->current_page != 2)
ql_set_register_page(qdev,2);
writel(value, (u32 *) reg);
- PCI_POSTING(reg);
+ readl(reg);
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
return;
@@ -1241,6 +1241,67 @@ static int ql_port_start(struct ql3_adap
return 0;
}
+static void ql_finish_auto_neg(struct ql3_adapter *qdev)
+{
+ if (!ql_auto_neg_error(qdev)) {
+ if (test_bit(QL_LINK_MASTER,&qdev->flags)) {
+ /* configure the MAC */
+ if (netif_msg_link(qdev))
+ printk(KERN_DEBUG PFX
+ "%s: Configuring link.\n",
+ qdev->ndev->
+ name);
+ ql_mac_cfg_soft_reset(qdev, 1);
+ ql_mac_cfg_gig(qdev,
+ (ql_get_link_speed
+ (qdev) ==
+ SPEED_1000));
+ ql_mac_cfg_full_dup(qdev,
+ ql_is_link_full_dup
+ (qdev));
+ ql_mac_cfg_pause(qdev,
+ ql_is_neg_pause
+ (qdev));
+ ql_mac_cfg_soft_reset(qdev, 0);
+
+ /* enable the MAC */
+ if (netif_msg_link(qdev))
+ printk(KERN_DEBUG PFX
+ "%s: Enabling mac.\n",
+ qdev->ndev->
+ name);
+ ql_mac_enable(qdev, 1);
+ }
+
+ if (netif_msg_link(qdev))
+ printk(KERN_DEBUG PFX
+ "%s: Change port_link_state LS_DOWN to LS_UP.\n",
+ qdev->ndev->name);
+ qdev->port_link_state = LS_UP;
+ netif_start_queue(qdev->ndev);
+ netif_carrier_on(qdev->ndev);
+ if (netif_msg_link(qdev))
+ printk(KERN_INFO PFX
+ "%s: Link is up at %d Mbps, %s duplex.\n",
+ qdev->ndev->name,
+ ql_get_link_speed(qdev),
+ ql_is_link_full_dup(qdev)
+ ? "full" : "half");
+
+ } else { /* Remote error detected */
+
+ if (test_bit(QL_LINK_MASTER,&qdev->flags)) {
+ if (netif_msg_link(qdev))
+ printk(KERN_DEBUG PFX
+ "%s: Remote error detected. "
+ "Calling ql_port_start().\n",
+ qdev->ndev->
+ name);
+ ql_port_start(qdev); /* Restart port */
+ }
+ }
+}
+
static void ql_link_state_machine(struct ql3_adapter *qdev)
{
u32 curr_link_state;
@@ -1273,69 +1334,12 @@ static void ql_link_state_machine(struct
printk(KERN_DEBUG PFX
"%s: curr_link_state = LS_UP.\n",
qdev->ndev->name);
- if (ql_is_auto_neg_complete(qdev)) {
- if (!ql_auto_neg_error(qdev)) {
- if (test_bit(QL_LINK_MASTER,&qdev->flags)) {
- /* configure the MAC */
- if (netif_msg_link(qdev))
- printk(KERN_DEBUG PFX
- "%s: Configuring link.\n",
- qdev->ndev->
- name);
- ql_mac_cfg_soft_reset(qdev, 1);
- ql_mac_cfg_gig(qdev,
- (ql_get_link_speed
- (qdev) ==
- SPEED_1000));
- ql_mac_cfg_full_dup(qdev,
- ql_is_link_full_dup
- (qdev));
- ql_mac_cfg_pause(qdev,
- ql_is_neg_pause
- (qdev));
- ql_mac_cfg_soft_reset(qdev, 0);
-
- /* enable the MAC */
- if (netif_msg_link(qdev))
- printk(KERN_DEBUG PFX
- "%s: Enabling mac.\n",
- qdev->ndev->
- name);
- ql_mac_enable(qdev, 1);
- }
-
- if (netif_msg_link(qdev))
- printk(KERN_DEBUG PFX
- "%s: Change port_link_state LS_DOWN to LS_UP.\n",
- qdev->ndev->name);
- qdev->port_link_state = LS_UP;
- netif_start_queue(qdev->ndev);
- netif_carrier_on(qdev->ndev);
- if (netif_msg_link(qdev))
- printk(KERN_INFO PFX
- "%s: Link is up at %d Mbps, %s duplex.\n",
- qdev->ndev->name,
- ql_get_link_speed(qdev),
- ql_is_link_full_dup(qdev)
- ? "full" : "half");
-
- } else { /* Remote error detected */
-
- if (test_bit(QL_LINK_MASTER,&qdev->flags)) {
- if (netif_msg_link(qdev))
- printk(KERN_DEBUG PFX
- "%s: Remote error detected. "
- "Calling ql_port_start().\n",
- qdev->ndev->
- name);
- ql_port_start(qdev); /* Restart port */
- }
- }
- }
-
- if (qdev->port_link_state == LS_UP) {
+ if (ql_is_auto_neg_complete(qdev))
+ ql_finish_auto_neg(qdev);
+
+ if (qdev->port_link_state == LS_UP)
ql_link_down_detect_clear(qdev);
- }
+
}
break;
@@ -1689,11 +1693,7 @@ static void ql_process_mac_rx_intr(struc
skb->ip_summed = CHECKSUM_NONE;
skb->protocol = eth_type_trans(skb, qdev->ndev);
-#ifdef CONFIG_QLA3XXX_NAPI
netif_receive_skb(skb);
-#else
- netif_rx(skb);
-#endif
qdev->ndev->last_rx = jiffies;
lrg_buf_cb2->skb = NULL;
@@ -1768,11 +1768,7 @@ static void ql_process_macip_rx_intr(str
skb2->ip_summed = CHECKSUM_NONE;
skb2->protocol = eth_type_trans(skb2, qdev->ndev);
-#ifdef CONFIG_QLA3XXX_NAPI
netif_receive_skb(skb2);
-#else
- netif_rx(skb2);
-#endif
ndev->last_rx = jiffies;
lrg_buf_cb2->skb = NULL;
@@ -1780,109 +1776,6 @@ static void ql_process_macip_rx_intr(str
ql_release_to_lrg_buf_free_list(qdev, lrg_buf_cb2);
}
-#ifndef CONFIG_QLA3XXX_NAPI
-/*
- * Procedure: ql_intr_handler
- *
- */
-static int ql_intr_handler(unsigned long curr_adapter)
-{
- struct ql3_adapter *qdev = (struct ql3_adapter *)curr_adapter;
- struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers;
- struct net_rsp_iocb *net_rsp;
- int max_ios_per_intr = 10;
- struct net_device *ndev = qdev->ndev;
-
- spin_lock(&qdev->adapter_lock);
-
- /* While there are entries in the completion queue. */
- while ((cpu_to_le32(*(qdev->prsp_producer_index)) !=
- qdev->rsp_consumer_index) && max_ios_per_intr) {
- max_ios_per_intr--;
- net_rsp = qdev->rsp_current;
- switch (net_rsp->opcode) {
-
- case OPCODE_OB_MAC_IOCB_FN0:
- case OPCODE_OB_MAC_IOCB_FN2:
- ql_process_mac_tx_intr(qdev,
- (struct ob_mac_iocb_rsp *) net_rsp);
- break;
-
- case OPCODE_IB_MAC_IOCB:
- ql_process_mac_rx_intr(qdev, (struct ib_mac_iocb_rsp *)
- net_rsp);
- break;
-
- case OPCODE_IB_IP_IOCB:
- ql_process_macip_rx_intr(qdev,
- (struct ib_ip_iocb_rsp *) net_rsp);
- break;
- default:
- {
- u32 *tmp = (u32 *) net_rsp;
- printk(KERN_ERR PFX
- "%s: Hit default case, "
- "not handled!\n"
- " dropping the packet, opcode = "
- "%x.\n",
- ndev->name, net_rsp->opcode);
- printk(KERN_ERR PFX
- "0x%08lx 0x%08lx 0x%08lx 0x%08lx \n",
- (unsigned long int)tmp[0],
- (unsigned long int)tmp[1],
- (unsigned long int)tmp[2],
- (unsigned long int)tmp[3]);
- }
- }
-
- qdev->rsp_consumer_index++;
-
- if (qdev->rsp_consumer_index == NUM_RSP_Q_ENTRIES) {
- qdev->rsp_consumer_index = 0;
- qdev->rsp_current = qdev->rsp_q_virt_addr;
- } else {
- qdev->rsp_current++;
- }
- }
-
- ql_update_lrg_bufq_prod_index(qdev);
-
- if (qdev->small_buf_release_cnt >= 16) {
- while (qdev->small_buf_release_cnt >= 16) {
- qdev->small_buf_q_producer_index++;
-
- if (qdev->small_buf_q_producer_index ==
- NUM_SBUFQ_ENTRIES)
- qdev->small_buf_q_producer_index = 0;
- qdev->small_buf_release_cnt -= 8;
- }
-
- ql_write_common_reg(qdev,
- (u32 *) & port_regs->CommonRegs.
- rxSmallQProducerIndex,
- qdev->small_buf_q_producer_index);
- }
-
- ql_write_common_reg(qdev,
- (u32 *) & port_regs->CommonRegs.rspQConsumerIndex,
- qdev->rsp_consumer_index);
-
- if (unlikely(netif_queue_stopped(qdev->ndev))) {
- spin_lock(&qdev->tx_cb_lock);
- if (netif_queue_stopped(qdev->ndev) &&
- (qdev->tx_free_count > (NUM_REQ_Q_ENTRIES / 4))) {
- printk(KERN_DEBUG PFX "%s: waking queue.\n",
- qdev->ndev->name);
- netif_wake_queue(qdev->ndev);
- }
- spin_unlock(&qdev->tx_cb_lock);
- }
-
- spin_unlock(&qdev->adapter_lock);
- return 10 - max_ios_per_intr;
-}
-
-#else /* !CONFIG_QLA3XXX_NAPI */
static int ql_tx_rx_clean(struct ql3_adapter *qdev,
int *tx_cleaned, int *rx_cleaned, int work_to_do)
{
@@ -2000,7 +1893,6 @@ quit_polling:
}
return 1;
}
-#endif /* CONFIG_QLA3XXX_NAPI */
static irqreturn_t ql3xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
{
@@ -2048,15 +1940,11 @@ static irqreturn_t ql3xxx_isr(int irq, v
queue_work(qdev->workqueue, &qdev->reset_work);
spin_unlock(&qdev->adapter_lock);
} else if (value & ISP_IMR_DISABLE_CMPL_INT) {
-#ifdef CONFIG_QLA3XXX_NAPI
ql_disable_interrupts(qdev);
if (likely(netif_rx_schedule_prep(ndev)))
__netif_rx_schedule(ndev);
else
ql_enable_interrupts(qdev);
-#else
- handled = ql_intr_handler((unsigned long)qdev);
-#endif
} else {
return IRQ_NONE;
}
@@ -2072,9 +1960,6 @@ static int ql3xxx_send(struct sk_buff *s
struct ob_mac_iocb_req *mac_iocb_ptr;
u64 map;
- if (!spin_trylock(&qdev->tx_lock))
- return NETDEV_TX_LOCKED;
-
if (unlikely((tx_buf_ptr = ql_alloc_txbuf(qdev)) == NULL)) {
if (!netif_queue_stopped(ndev)) {
netif_stop_queue(ndev);
@@ -2083,7 +1968,6 @@ static int ql3xxx_send(struct sk_buff *s
"\r%s: No TX resources, stop queue.",
ndev->name);
}
- spin_unlock(&qdev->tx_lock);
return NETDEV_TX_BUSY;
}
@@ -2098,8 +1982,8 @@ static int ql3xxx_send(struct sk_buff *s
mac_iocb_ptr->buf_addr0_low = cpu_to_le32(LS_64BITS(map));
mac_iocb_ptr->buf_addr0_high = cpu_to_le32(MS_64BITS(map));
mac_iocb_ptr->buf_0_len = cpu_to_le32(skb->len | OB_MAC_IOCB_REQ_E);
- pci_unmap_addr_set(map_list, mapaddr, map);
- pci_unmap_len_set(map_list, maplen, skb->len);
+ pci_unmap_addr_set(tx_buf_ptr, mapaddr, map);
+ pci_unmap_len_set(tx_buf_ptr, maplen, skb->len);
/* Make sure all the descriptors written */
wmb();
@@ -2115,10 +1999,9 @@ static int ql3xxx_send(struct sk_buff *s
(u32 *) & port_regs->CommonRegs.reqQProducerIndex,
qdev->req_producer_index);
- spin_unlock(&qdev->tx_lock);
ndev->trans_start = jiffies;
if (netif_msg_tx_queued(qdev))
- printk(KERN_DEBUG PFX "%s: tx queued, slot %td, len %d\n",
+ printk(KERN_DEBUG PFX "%s: tx queued, slot %d, len %d\n",
ndev->name, qdev->req_producer_index, skb->len);
return NETDEV_TX_OK;
@@ -2848,7 +2731,7 @@ static int ql_adapter_reset(struct ql3_a
if ((value & ISP_CONTROL_SR) == 0)
break;
- msleep(1000);
+ ssleep(1);
} while ((--max_wait_time));
/*
@@ -2886,7 +2769,7 @@ static int ql_adapter_reset(struct ql3_a
if ((value & ISP_CONTROL_FSR) == 0) {
break;
}
- msleep(1000);
+ ssleep(1);
} while ((--max_wait_time));
}
if (max_wait_time == 0)
@@ -2951,25 +2834,25 @@ static void ql_display_dev_info(struct n
struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev);
struct pci_dev *pdev = qdev->pdev;
- printk(KERN_ERR PFX
+ printk(KERN_INFO PFX
"\n%s Adapter %d RevisionID %d found on PCI slot %d.\n",
DRV_NAME, qdev->index, qdev->chip_rev_id, qdev->pci_slot);
- printk(KERN_ERR PFX
+ printk(KERN_INFO PFX
"%s Interface.\n",
test_bit(QL_LINK_OPTICAL,&qdev->flags) ? "OPTICAL" : "COPPER");
/*
* Print PCI bus width/type.
*/
- printk(KERN_ERR PFX
+ printk(KERN_INFO PFX
"Bus interface is %s %s.\n",
((qdev->pci_width == 64) ? "64-bit" : "32-bit"),
((qdev->pci_x) ? "PCI-X" : "PCI"));
- printk(KERN_ERR PFX
+ printk(KERN_INFO PFX
"mem IO base address adjusted = 0x%p\n",
qdev->mem_map_registers);
- printk(KERN_ERR PFX "Interrupt number = %d\n", pdev->irq);
+ printk(KERN_INFO PFX "Interrupt number = %d\n", pdev->irq);
if (netif_msg_probe(qdev))
printk(KERN_INFO PFX
@@ -3002,9 +2885,7 @@ static int ql_adapter_down(struct ql3_ad
del_timer_sync(&qdev->adapter_timer);
-#ifdef CONFIG_QLA3XXX_NAPI
netif_poll_disable(ndev);
-#endif
if (do_reset) {
int soft_reset;
@@ -3081,9 +2962,7 @@ static int ql_adapter_up(struct ql3_adap
mod_timer(&qdev->adapter_timer, jiffies + HZ * 1);
-#ifdef CONFIG_QLA3XXX_NAPI
netif_poll_enable(ndev);
-#endif
ql_enable_interrupts(qdev);
return 0;
@@ -3288,7 +3167,7 @@ static void ql_reset_work(struct ql3_ada
16) | ISP_CONTROL_RI));
}
- msleep(1000);
+ ssleep(1);
} while (--max_wait_time);
if (value & ISP_CONTROL_SR) {
@@ -3432,7 +3311,6 @@ static int __devinit ql3xxx_probe(struct
spin_lock_init(&qdev->adapter_lock);
spin_lock_init(&qdev->hw_lock);
- spin_lock_init(&qdev->tx_lock);
spin_lock_init(&qdev->tx_cb_lock);
/* Set driver entry points */
@@ -3447,10 +3325,8 @@ static int __devinit ql3xxx_probe(struct
ndev->tx_timeout = ql3xxx_tx_timeout;
ndev->watchdog_timeo = 5 * HZ;
-#ifdef CONFIG_QLA3XXX_NAPI
ndev->poll = &ql_poll;
ndev->weight = 64;
-#endif
qdev->irq = ndev->irq = pdev->irq;
@@ -3512,6 +3388,11 @@ static int __devinit ql3xxx_probe(struct
qdev->adapter_timer.expires = jiffies + HZ * 2; /* two second delay */
qdev->adapter_timer.data = (unsigned long)qdev;
+ if(!cards_found) {
+ printk(KERN_ALERT PFX "%s\n", DRV_STRING);
+ printk(KERN_ALERT PFX "Driver name: %s, Version: %s.\n",
+ DRV_NAME, DRV_VERSION);
+ }
ql_display_dev_info(ndev);
cards_found++;
@@ -3534,32 +3415,12 @@ static void __devexit ql3xxx_remove(stru
{
struct net_device *ndev = pci_get_drvdata(pdev);
struct ql3_adapter *qdev = netdev_priv(ndev);
- int index = 0;
-
- if (ndev == NULL) {
- printk(KERN_ERR PFX "%s: ndev == NULL, leaving.\n", qdev->ndev->name);
- return;
- }
unregister_netdev(ndev);
qdev = netdev_priv(ndev);
- if (qdev == NULL) {
- printk(KERN_ERR PFX "%s: qdev == NULL, leaving.\n",
- ndev->name);
- return;
- }
- /* Disable interrupts for this card. */
ql_disable_interrupts(qdev);
- /*
- * Wait for any resets to complete...
- */
- while (test_bit((QL_RESET_ACTIVE | QL_RESET_START | QL_RESET_PER_SCSI),
- &qdev->flags))
- msleep(1000);
-
- index = qdev->index;
if (qdev->workqueue) {
cancel_delayed_work(&qdev->reset_work);
cancel_delayed_work(&qdev->tx_timeout_work);
@@ -3583,9 +3444,6 @@ static struct pci_driver ql3xxx_driver =
static int __init ql3xxx_init_module(void)
{
- printk(KERN_ALERT PFX "%s\n", DRV_STRING);
- printk(KERN_ALERT PFX "Driver name: %s, Version: %s.\n",
- DRV_NAME, DRV_VERSION);
return pci_register_driver(&ql3xxx_driver);
}
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h
index 9e2629a..29e0275 100644
--- a/drivers/net/qla3xxx.h
+++ b/drivers/net/qla3xxx.h
@@ -749,7 +749,6 @@ struct ql3xxx_local_ram_registers {
/*
* I/O register
*/
-#define PCI_POSTING(a) (readl(a))
enum {
CONTROL_REG = 0,
@@ -965,7 +964,6 @@ struct eeprom_data {
* Below are a number compiler switches for controlling driver behavior.
* Some are not supported under certain conditions and are notated as such.
*/
-/* #define CONFIG_QLA3XXX_NAPI */
#define QL3XXX_VENDOR_ID 0x1077
#define QL3022_DEVICE_ID 0x3022
@@ -1138,7 +1136,6 @@ struct ql3_adapter {
u32 tx_count;
/* Transmit Buffers */
- spinlock_t tx_lock;
spinlock_t tx_cb_lock;
u32 tx_free_count;
struct ql_tx_buf_cb *tx_free_list;
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-07-13 18:13 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 18:13 FW: + qla3xxx-is-bust.patch added to -mm tree Ron Mercer
-- strict thread matches above, loose matches on Subject: below --
2006-07-13 16:57 Ron Mercer
2006-07-13 17:06 ` Jeff Garzik
2006-06-28 23:07 Ron Mercer
2006-06-28 23:24 ` Andrew Morton
2006-06-29 1:37 ` Jeff Garzik
2006-06-29 3:41 ` Doug Maxey
2006-06-26 19:02 Ron Mercer
2006-06-26 19:24 ` Andrew Morton
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.