* [PATCH net-next] cnic: Fix mmap regression.
@ 2012-06-29 19:32 Michael Chan
2012-06-29 22:34 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Michael Chan @ 2012-06-29 19:32 UTC (permalink / raw)
To: davem; +Cc: netdev
commit 1f85d58cdf15354a7120fc9ccc9bb9c45b53af88
cnic: Remove uio mem[0].
introduced a regression as older versions of userspace app still rely
on this mmap. Restore the mmap functionality and get the base address
from pci_resource_start() as the nedev->base_addr has been deprecated for
PCI devices.
Update version to 2.5.12.
Signed-off-by: Michael Chan <mchan@broadocm.com>
---
drivers/net/ethernet/broadcom/cnic.c | 8 +++++++-
drivers/net/ethernet/broadcom/cnic_if.h | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index f897306..22ad7b6 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -1063,9 +1063,13 @@ static int cnic_init_uio(struct cnic_dev *dev)
uinfo = &udev->cnic_uinfo;
- uinfo->mem[0].memtype = UIO_MEM_NONE;
+ uinfo->mem[0].addr = pci_resource_start(dev->pcidev, 0);
+ uinfo->mem[0].internal_addr = dev->regview;
+ uinfo->mem[0].memtype = UIO_MEM_PHYS;
if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
+ uinfo->mem[0].size = MB_GET_CID_ADDR(TX_TSS_CID +
+ TX_MAX_TSS_RINGS + 1);
uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen &
PAGE_MASK;
if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX)
@@ -1075,6 +1079,8 @@ static int cnic_init_uio(struct cnic_dev *dev)
uinfo->name = "bnx2_cnic";
} else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) {
+ uinfo->mem[0].size = pci_resource_len(dev->pcidev, 0);
+
uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk &
PAGE_MASK;
uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk);
diff --git a/drivers/net/ethernet/broadcom/cnic_if.h b/drivers/net/ethernet/broadcom/cnic_if.h
index 54f68f0..5cb8888 100644
--- a/drivers/net/ethernet/broadcom/cnic_if.h
+++ b/drivers/net/ethernet/broadcom/cnic_if.h
@@ -14,8 +14,8 @@
#include "bnx2x/bnx2x_mfw_req.h"
-#define CNIC_MODULE_VERSION "2.5.11"
-#define CNIC_MODULE_RELDATE "June 27, 2012"
+#define CNIC_MODULE_VERSION "2.5.12"
+#define CNIC_MODULE_RELDATE "June 29, 2012"
#define CNIC_ULP_RDMA 0
#define CNIC_ULP_ISCSI 1
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net-next] cnic: Fix mmap regression.
2012-06-29 19:32 [PATCH net-next] cnic: Fix mmap regression Michael Chan
@ 2012-06-29 22:34 ` David Miller
2012-07-05 21:59 ` Michael Chan
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-06-29 22:34 UTC (permalink / raw)
To: mchan; +Cc: netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 29 Jun 2012 12:32:45 -0700
> commit 1f85d58cdf15354a7120fc9ccc9bb9c45b53af88
> cnic: Remove uio mem[0].
>
> introduced a regression as older versions of userspace app still rely
> on this mmap. Restore the mmap functionality and get the base address
> from pci_resource_start() as the nedev->base_addr has been deprecated for
> PCI devices.
>
> Update version to 2.5.12.
>
> Signed-off-by: Michael Chan <mchan@broadocm.com>
I really couldn't believe what you guys were doing in the original
commit, but I decided to let you do stupid things and find out the
hard way that removing any user visible interface is basically
impossible.
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] cnic: Fix mmap regression.
2012-06-29 22:34 ` David Miller
@ 2012-07-05 21:59 ` Michael Chan
2012-07-05 22:36 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Michael Chan @ 2012-07-05 21:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Fri, 2012-06-29 at 15:34 -0700, David Miller wrote:
> From: "Michael Chan" <mchan@broadcom.com>
> Date: Fri, 29 Jun 2012 12:32:45 -0700
>
> > commit 1f85d58cdf15354a7120fc9ccc9bb9c45b53af88
> > cnic: Remove uio mem[0].
> >
> > introduced a regression as older versions of userspace app still rely
> > on this mmap. Restore the mmap functionality and get the base address
> > from pci_resource_start() as the nedev->base_addr has been deprecated for
> > PCI devices.
> >
> > Update version to 2.5.12.
> >
> > Signed-off-by: Michael Chan <mchan@broadocm.com>
>
> I really couldn't believe what you guys were doing in the original
> commit, but I decided to let you do stupid things and find out the
> hard way that removing any user visible interface is basically
> impossible.
>
> Applied, thanks.
>
David, this patch plus the earlier commit are also needed for the net
tree because netdev->base_addr was removed there. Can you apply these
directly to the net tree? Or you want me to send you the equivalent
patches for net. Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-05 23:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29 19:32 [PATCH net-next] cnic: Fix mmap regression Michael Chan
2012-06-29 22:34 ` David Miller
2012-07-05 21:59 ` Michael Chan
2012-07-05 22:36 ` David Miller
2012-07-05 23:34 ` Michael Chan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox