linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management
@ 2020-07-28  4:28 Vaibhav Gupta
  2020-07-28 12:36 ` Vaibhav Gupta
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Vaibhav Gupta @ 2020-07-28  4:28 UTC (permalink / raw)
  To: Bjorn Helgaas, Bjorn Helgaas, Bjorn Helgaas, Vaibhav Gupta,
	David S. Miller, Jakub Kicinski, Kevin Curtis
  Cc: netdev, linux-kernel-mentees, linux-kernel, Vaibhav Gupta

The .suspend() and .resume() callbacks are not defined for this driver.
Still, their power management structure follows the legacy framework. To
bring it under the generic framework, simply remove the binding of
callbacks from "struct pci_driver".

Change code indentation from space to tab in "struct pci_driver".

Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
---
 drivers/net/wan/farsync.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 7916efce7188..15dacfde6b83 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2636,12 +2636,10 @@ fst_remove_one(struct pci_dev *pdev)
 }
 
 static struct pci_driver fst_driver = {
-        .name		= FST_NAME,
-        .id_table	= fst_pci_dev_id,
-        .probe		= fst_add_one,
-        .remove	= fst_remove_one,
-        .suspend	= NULL,
-        .resume	= NULL,
+	.name		= FST_NAME,
+	.id_table	= fst_pci_dev_id,
+	.probe		= fst_add_one,
+	.remove		= fst_remove_one,
 };
 
 static int __init
-- 
2.27.0

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management
  2020-07-28  4:28 [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management Vaibhav Gupta
@ 2020-07-28 12:36 ` Vaibhav Gupta
  2020-07-28 19:57 ` David Miller
  2020-07-28 20:04 ` Bjorn Helgaas
  2 siblings, 0 replies; 7+ messages in thread
From: Vaibhav Gupta @ 2020-07-28 12:36 UTC (permalink / raw)
  To: Bjorn Helgaas, Bjorn Helgaas, Bjorn Helgaas, Vaibhav Gupta,
	David S. Miller, Jakub Kicinski, Kevin Curtis
  Cc: netdev, linux-kernel-mentees, linux-kernel

This patch is compile-tested only.

Thanks
Vaibhav Gupta
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management
  2020-07-28  4:28 [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management Vaibhav Gupta
  2020-07-28 12:36 ` Vaibhav Gupta
@ 2020-07-28 19:57 ` David Miller
  2020-07-28 20:04 ` Bjorn Helgaas
  2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2020-07-28 19:57 UTC (permalink / raw)
  To: vaibhavgupta40
  Cc: linux-kernel, kevin.curtis, helgaas, netdev, bhelgaas, kuba,
	linux-kernel-mentees

From: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Date: Tue, 28 Jul 2020 09:58:10 +0530

> The .suspend() and .resume() callbacks are not defined for this driver.
> Still, their power management structure follows the legacy framework. To
> bring it under the generic framework, simply remove the binding of
> callbacks from "struct pci_driver".
> 
> Change code indentation from space to tab in "struct pci_driver".
> 
> Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>

Applied.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management
  2020-07-28  4:28 [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management Vaibhav Gupta
  2020-07-28 12:36 ` Vaibhav Gupta
  2020-07-28 19:57 ` David Miller
@ 2020-07-28 20:04 ` Bjorn Helgaas
  2020-07-29 10:17   ` Vaibhav Gupta
  2 siblings, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2020-07-28 20:04 UTC (permalink / raw)
  To: Vaibhav Gupta
  Cc: linux-kernel, Kevin Curtis, netdev, Bjorn Helgaas,
	Jakub Kicinski, linux-kernel-mentees, David S. Miller

On Tue, Jul 28, 2020 at 09:58:10AM +0530, Vaibhav Gupta wrote:
> The .suspend() and .resume() callbacks are not defined for this driver.
> Still, their power management structure follows the legacy framework. To
> bring it under the generic framework, simply remove the binding of
> callbacks from "struct pci_driver".

FWIW, this commit log is slightly misleading because .suspend and
.resume are NULL by default, so this patch actually is a complete
no-op as far as code generation is concerned.

This change is worthwhile because it simplifies the code a little, but
it doesn't convert the driver from legacy to generic power management.
This driver doesn't supply a .pm structure, so it doesn't seem to do
*any* power management.

> Change code indentation from space to tab in "struct pci_driver".
> 
> Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
> ---
>  drivers/net/wan/farsync.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
> index 7916efce7188..15dacfde6b83 100644
> --- a/drivers/net/wan/farsync.c
> +++ b/drivers/net/wan/farsync.c
> @@ -2636,12 +2636,10 @@ fst_remove_one(struct pci_dev *pdev)
>  }
>  
>  static struct pci_driver fst_driver = {
> -        .name		= FST_NAME,
> -        .id_table	= fst_pci_dev_id,
> -        .probe		= fst_add_one,
> -        .remove	= fst_remove_one,
> -        .suspend	= NULL,
> -        .resume	= NULL,
> +	.name		= FST_NAME,
> +	.id_table	= fst_pci_dev_id,
> +	.probe		= fst_add_one,
> +	.remove		= fst_remove_one,
>  };
>  
>  static int __init
> -- 
> 2.27.0
> 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management
  2020-07-28 20:04 ` Bjorn Helgaas
@ 2020-07-29 10:17   ` Vaibhav Gupta
  2020-07-29 12:29     ` Bjorn Helgaas
  0 siblings, 1 reply; 7+ messages in thread
From: Vaibhav Gupta @ 2020-07-29 10:17 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-kernel, Kevin Curtis, netdev, Bjorn Helgaas,
	Jakub Kicinski, linux-kernel-mentees, David S. Miller

On Tue, Jul 28, 2020 at 03:04:13PM -0500, Bjorn Helgaas wrote:
> On Tue, Jul 28, 2020 at 09:58:10AM +0530, Vaibhav Gupta wrote:
> > The .suspend() and .resume() callbacks are not defined for this driver.
> > Still, their power management structure follows the legacy framework. To
> > bring it under the generic framework, simply remove the binding of
> > callbacks from "struct pci_driver".
> 
> FWIW, this commit log is slightly misleading because .suspend and
> .resume are NULL by default, so this patch actually is a complete
> no-op as far as code generation is concerned.
> 
> This change is worthwhile because it simplifies the code a little, but
> it doesn't convert the driver from legacy to generic power management.
> This driver doesn't supply a .pm structure, so it doesn't seem to do
> *any* power management.
> 
Agreed. Actually, as their presence only causes PCI core to call
pci_legacy_suspend/resume() for them, I thought that after removing the binding
from "struct pci_driver", this driver qualifies to be grouped under genric
framework, so used "use generic power management" for the heading.

I should have written "remove legacy bindning".

But David has applied the patch, should I send a v2 or fix to update message?

Thanks
Vaibhav Gupta
> > Change code indentation from space to tab in "struct pci_driver".
> > 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management
  2020-07-29 10:17   ` Vaibhav Gupta
@ 2020-07-29 12:29     ` Bjorn Helgaas
  2020-07-29 13:21       ` Vaibhav Gupta
  0 siblings, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2020-07-29 12:29 UTC (permalink / raw)
  To: Vaibhav Gupta
  Cc: linux-kernel, Kevin Curtis, netdev, Bjorn Helgaas,
	Jakub Kicinski, linux-kernel-mentees, David S. Miller

On Wed, Jul 29, 2020 at 03:47:30PM +0530, Vaibhav Gupta wrote:
> On Tue, Jul 28, 2020 at 03:04:13PM -0500, Bjorn Helgaas wrote:
> > On Tue, Jul 28, 2020 at 09:58:10AM +0530, Vaibhav Gupta wrote:
> > > The .suspend() and .resume() callbacks are not defined for this driver.
> > > Still, their power management structure follows the legacy framework. To
> > > bring it under the generic framework, simply remove the binding of
> > > callbacks from "struct pci_driver".
> > 
> > FWIW, this commit log is slightly misleading because .suspend and
> > .resume are NULL by default, so this patch actually is a complete
> > no-op as far as code generation is concerned.
> > 
> > This change is worthwhile because it simplifies the code a little, but
> > it doesn't convert the driver from legacy to generic power management.
> > This driver doesn't supply a .pm structure, so it doesn't seem to do
> > *any* power management.
>
> Agreed. Actually, as their presence only causes PCI core to call
> pci_legacy_suspend/resume() for them, I thought that after removing
> the binding from "struct pci_driver", this driver qualifies to be
> grouped under genric framework, so used "use generic power
> management" for the heading.
> 
> I should have written "remove legacy bindning".

This removed the *mention* of fst_driver.suspend and fst_driver.resume,
which is important because we want to eventually remove those members
completely from struct pci_driver.

But fst_driver.suspend and fst_driver.resume *exist* before and after
this patch, and they're initialized to zero before and after this
patch.

Since they were zero before, and they're still zero after this patch,
the PCI core doesn't call pci_legacy_suspend/resume().  This patch
doesn't change that at all.

> But David has applied the patch, should I send a v2 or fix to update
> message?

No, I don't think David updates patches after he's applied them.  But
if the situation comes up again, you'll know how to describe it :)

Bjorn
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management
  2020-07-29 12:29     ` Bjorn Helgaas
@ 2020-07-29 13:21       ` Vaibhav Gupta
  0 siblings, 0 replies; 7+ messages in thread
From: Vaibhav Gupta @ 2020-07-29 13:21 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-kernel, Kevin Curtis, netdev, Bjorn Helgaas,
	Jakub Kicinski, linux-kernel-mentees, David S. Miller

On Wed, Jul 29, 2020 at 07:29:54AM -0500, Bjorn Helgaas wrote:
> On Wed, Jul 29, 2020 at 03:47:30PM +0530, Vaibhav Gupta wrote:
> >
> > Agreed. Actually, as their presence only causes PCI core to call
> > pci_legacy_suspend/resume() for them, I thought that after removing
> > the binding from "struct pci_driver", this driver qualifies to be
> > grouped under genric framework, so used "use generic power
> > management" for the heading.
> > 
> > I should have written "remove legacy bindning".
> 
> This removed the *mention* of fst_driver.suspend and fst_driver.resume,
> which is important because we want to eventually remove those members
> completely from struct pci_driver.
> 
> But fst_driver.suspend and fst_driver.resume *exist* before and after
> this patch, and they're initialized to zero before and after this
> patch.
> 
> Since they were zero before, and they're still zero after this patch,
> the PCI core doesn't call pci_legacy_suspend/resume().  This patch
> doesn't change that at all.
>
Got it. Thanks :) 
> > But David has applied the patch, should I send a v2 or fix to update
> > message?
> 
> No, I don't think David updates patches after he's applied them.  But
> if the situation comes up again, you'll know how to describe it :)
> 
Thanks a lot. :D

Vaibhav Gupta
> Bjorn
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

end of thread, other threads:[~2020-07-29 13:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28  4:28 [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management Vaibhav Gupta
2020-07-28 12:36 ` Vaibhav Gupta
2020-07-28 19:57 ` David Miller
2020-07-28 20:04 ` Bjorn Helgaas
2020-07-29 10:17   ` Vaibhav Gupta
2020-07-29 12:29     ` Bjorn Helgaas
2020-07-29 13:21       ` Vaibhav Gupta

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