linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/ipoib: Convert timers to use timer_setup()
@ 2017-10-05  0:45 Kees Cook
  2017-10-08 13:23 ` Leon Romanovsky
  2017-10-09 16:25 ` Doug Ledford
  0 siblings, 2 replies; 3+ messages in thread
From: Kees Cook @ 2017-10-05  0:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Doug Ledford, Sean Hefty, Hal Rosenstock, Leon Romanovsky,
	Alex Vesker, Erez Shitrit, Ira Weiny, Dasaratharaman Chandramouli,
	Zhu Yanjun, kernel@kyup.com, Kees Cook, Paolo Abeni,
	Niranjana Vishwanathapura, Feras Daoud, Alex Estrin,
	Shamir Rabinovitch, linux-rdma, Yuval Shaia, Thomas Gleixner

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Doug Ledford <dledford@redhat.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Alex Vesker <valex@mellanox.com>
Cc: Erez Shitrit <erezsh@mellanox.com>
Cc: Zhu Yanjun <yanjun.zhu@oracle.com>
Cc: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Yuval Shaia <yuval.shaia@oracle.com>
Cc: linux-rdma@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
This requires commit 686fef928bba ("timer: Prepare to change timer
callback argument type") in v4.14-rc3, but should be otherwise
stand-alone.
---
 drivers/infiniband/ulp/ipoib/ipoib.h      | 2 +-
 drivers/infiniband/ulp/ipoib/ipoib_ib.c   | 6 ++++--
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index 4a5c7a07a631..7cc2b755413d 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -500,7 +500,7 @@ void ipoib_mark_paths_invalid(struct net_device *dev);
 void ipoib_flush_paths(struct net_device *dev);
 struct ipoib_dev_priv *ipoib_intf_alloc(struct ib_device *hca, u8 port,
 					const char *format);
-void ipoib_ib_tx_timer_func(unsigned long ctx);
+void ipoib_ib_tx_timer_func(struct timer_list *t);
 void ipoib_ib_dev_flush_light(struct work_struct *work);
 void ipoib_ib_dev_flush_normal(struct work_struct *work);
 void ipoib_ib_dev_flush_heavy(struct work_struct *work);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 6cd61638b441..918930a0bc70 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -821,9 +821,11 @@ int ipoib_ib_dev_stop(struct net_device *dev)
 	return 0;
 }
 
-void ipoib_ib_tx_timer_func(unsigned long ctx)
+void ipoib_ib_tx_timer_func(struct timer_list *t)
 {
-	drain_tx_cq((struct net_device *)ctx);
+	struct ipoib_dev_priv *priv = from_timer(priv, t, poll_timer);
+
+	drain_tx_cq(priv->dev);
 }
 
 int ipoib_ib_dev_open_default(struct net_device *dev)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index dcc77014018d..77c1b7adbb40 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1666,8 +1666,7 @@ static int ipoib_dev_init_default(struct net_device *dev)
 	priv->dev->dev_addr[2] = (priv->qp->qp_num >>  8) & 0xff;
 	priv->dev->dev_addr[3] = (priv->qp->qp_num) & 0xff;
 
-	setup_timer(&priv->poll_timer, ipoib_ib_tx_timer_func,
-		    (unsigned long)dev);
+	timer_setup(&priv->poll_timer, ipoib_ib_tx_timer_func, 0);
 
 	return 0;
 
-- 
2.7.4


-- 
Kees Cook
Pixel Security

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

* Re: [PATCH] IB/ipoib: Convert timers to use timer_setup()
  2017-10-05  0:45 [PATCH] IB/ipoib: Convert timers to use timer_setup() Kees Cook
@ 2017-10-08 13:23 ` Leon Romanovsky
  2017-10-09 16:25 ` Doug Ledford
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2017-10-08 13:23 UTC (permalink / raw)
  To: Kees Cook
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Doug Ledford, Sean Hefty,
	Hal Rosenstock, Alex Vesker, Erez Shitrit, Ira Weiny,
	Dasaratharaman Chandramouli, Zhu Yanjun,
	kernel-6AxghH7DbtA@public.gmane.org, Paolo Abeni,
	Niranjana Vishwanathapura, Feras Daoud, Alex Estrin,
	Shamir Rabinovitch, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Yuval Shaia, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]

On Wed, Oct 04, 2017 at 05:45:54PM -0700, Kees Cook wrote:
> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.
>
> Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Alex Vesker <valex-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Cc: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Cc: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Cc: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Paolo Abeni <pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
> Signed-off-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
> This requires commit 686fef928bba ("timer: Prepare to change timer
> callback argument type") in v4.14-rc3, but should be otherwise
> stand-alone.
> ---
>  drivers/infiniband/ulp/ipoib/ipoib.h      | 2 +-
>  drivers/infiniband/ulp/ipoib/ipoib_ib.c   | 6 ++++--
>  drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +--
>  3 files changed, 6 insertions(+), 5 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] IB/ipoib: Convert timers to use timer_setup()
  2017-10-05  0:45 [PATCH] IB/ipoib: Convert timers to use timer_setup() Kees Cook
  2017-10-08 13:23 ` Leon Romanovsky
@ 2017-10-09 16:25 ` Doug Ledford
  1 sibling, 0 replies; 3+ messages in thread
From: Doug Ledford @ 2017-10-09 16:25 UTC (permalink / raw)
  To: Kees Cook, linux-kernel
  Cc: Sean Hefty, Hal Rosenstock, Leon Romanovsky, Alex Vesker,
	Erez Shitrit, Ira Weiny, Dasaratharaman Chandramouli, Zhu Yanjun,
	kernel@kyup.com, Paolo Abeni, Niranjana Vishwanathapura,
	Feras Daoud, Alex Estrin, Shamir Rabinovitch, linux-rdma,
	Yuval Shaia, Thomas Gleixner

On Wed, 2017-10-04 at 17:45 -0700, Kees Cook wrote:
> In preparation for unconditionally passing the struct timer_list
> pointer to
> all timer callbacks, switch to using the new timer_setup() and
> from_timer()
> to pass the timer pointer explicitly.
> 
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Sean Hefty <sean.hefty@intel.com>
> Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
> Cc: Leon Romanovsky <leon@kernel.org>
> Cc: Alex Vesker <valex@mellanox.com>
> Cc: Erez Shitrit <erezsh@mellanox.com>
> Cc: Zhu Yanjun <yanjun.zhu@oracle.com>
> Cc: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.co
> m>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Yuval Shaia <yuval.shaia@oracle.com>
> Cc: linux-rdma@vger.kernel.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> This requires commit 686fef928bba ("timer: Prepare to change timer
> callback argument type") in v4.14-rc3, but should be otherwise
> stand-alone.

Thanks, applied.

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

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

end of thread, other threads:[~2017-10-09 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05  0:45 [PATCH] IB/ipoib: Convert timers to use timer_setup() Kees Cook
2017-10-08 13:23 ` Leon Romanovsky
2017-10-09 16:25 ` Doug Ledford

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).