Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1258133 > unrolled thread
| Started by | Neil Armstrong <narmstrong@baylibre.com> |
|---|---|
| First post | 2015-10-28 15:20 +0100 |
| Last post | 2015-10-28 15:40 +0100 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[RFC PATCH v2 3/4] net: dsa: mv88e6xxx: add common and ppu remove function Neil Armstrong <narmstrong@baylibre.com> - 2015-10-28 15:20 +0100
Re: [RFC PATCH v2 3/4] net: dsa: mv88e6xxx: add common and ppu remove function Neil Armstrong <narmstrong@baylibre.com> - 2015-10-28 15:40 +0100
Re: [RFC PATCH v2 3/4] net: dsa: mv88e6xxx: add common and ppu remove function Andrew Lunn <andrew@lunn.ch> - 2015-10-28 15:50 +0100
Re: [RFC PATCH v2 3/4] net: dsa: mv88e6xxx: add common and ppu remove function Andrew Lunn <andrew@lunn.ch> - 2015-10-28 15:40 +0100
| From | Neil Armstrong <narmstrong@baylibre.com> |
|---|---|
| Date | 2015-10-28 15:20 +0100 |
| Subject | [RFC PATCH v2 3/4] net: dsa: mv88e6xxx: add common and ppu remove function |
| Message-ID | <qozK3-3GM-65@gated-at.bofh.it> |
With the previously introduced remove callback, add a
mv88e6xxx common remove function to cleanup all resources.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
drivers/net/dsa/mv88e6xxx.c | 18 ++++++++++++++++++
drivers/net/dsa/mv88e6xxx.h | 2 ++
2 files changed, 20 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index b1b14f5..6287096 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -331,6 +331,16 @@ void mv88e6xxx_ppu_state_init(struct dsa_switch *ds)
ps->ppu_timer.function = mv88e6xxx_ppu_reenable_timer;
}
+void mv88e6xxx_ppu_state_remove(struct dsa_switch *ds)
+{
+ struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+
+ del_timer_sync(&ps->ppu_timer);
+
+ cancel_work_sync(&ps->bridge_work);
+ flush_work(&ps->bridge_work);
+}
+
int mv88e6xxx_phy_read_ppu(struct dsa_switch *ds, int addr, int regnum)
{
int ret;
@@ -2083,6 +2093,14 @@ int mv88e6xxx_setup_common(struct dsa_switch *ds)
return 0;
}
+void mv88e6xxx_remove_common(struct dsa_switch *ds)
+{
+ struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+
+ cancel_work_sync(&ps->bridge_work);
+ flush_work(&ps->bridge_work);
+}
+
int mv88e6xxx_setup_global(struct dsa_switch *ds)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h
index 6f9ed5d..64d37a0 100644
--- a/drivers/net/dsa/mv88e6xxx.h
+++ b/drivers/net/dsa/mv88e6xxx.h
@@ -417,6 +417,7 @@ struct mv88e6xxx_hw_stat {
int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active);
int mv88e6xxx_setup_ports(struct dsa_switch *ds);
int mv88e6xxx_setup_common(struct dsa_switch *ds);
+void mv88e6xxx_remove_common(struct dsa_switch *ds);
int mv88e6xxx_setup_global(struct dsa_switch *ds);
int __mv88e6xxx_reg_read(struct mii_bus *bus, int sw_addr, int addr, int reg);
int mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg);
@@ -431,6 +432,7 @@ int mv88e6xxx_phy_read_indirect(struct dsa_switch *ds, int port, int regnum);
int mv88e6xxx_phy_write_indirect(struct dsa_switch *ds, int port, int regnum,
u16 val);
void mv88e6xxx_ppu_state_init(struct dsa_switch *ds);
+void mv88e6xxx_ppu_state_remove(struct dsa_switch *ds);
int mv88e6xxx_phy_read_ppu(struct dsa_switch *ds, int addr, int regnum);
int mv88e6xxx_phy_write_ppu(struct dsa_switch *ds, int addr,
int regnum, u16 val);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Neil Armstrong <narmstrong@baylibre.com> |
|---|---|
| Date | 2015-10-28 15:40 +0100 |
| Message-ID | <qoA3o-3Pi-9@gated-at.bofh.it> |
| In reply to | #1258133 |
Hi Andrew,
On 10/28/2015 03:35 PM, Andrew Lunn wrote:
> On Wed, Oct 28, 2015 at 03:13:16PM +0100, Neil Armstrong wrote:
>> diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
>> index b1b14f5..6287096 100644
>> --- a/drivers/net/dsa/mv88e6xxx.c
>> +++ b/drivers/net/dsa/mv88e6xxx.c
>> @@ -331,6 +331,16 @@ void mv88e6xxx_ppu_state_init(struct dsa_switch *ds)
>> ps->ppu_timer.function = mv88e6xxx_ppu_reenable_timer;
>> }
>>
>> +void mv88e6xxx_ppu_state_remove(struct dsa_switch *ds)
>> +{
>> + struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
>> +
>> + del_timer_sync(&ps->ppu_timer);
>> +
>> + cancel_work_sync(&ps->bridge_work);
>> + flush_work(&ps->bridge_work);
>> +}
>> +
>
> You add this function, but you don't use it anywhere? Also, why
> cancel bridge work, not ppu_work? Or has that been consolidated
> in some patch i'm missing?
>
> Andrew
>
It's called in the next patch, in mv88e6131_remove for mv88e6131.
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2015-10-28 15:50 +0100 |
| Subject | Re: [RFC PATCH v2 3/4] net: dsa: mv88e6xxx: add common and ppu remove function |
| Message-ID | <qoAd4-3T1-31@gated-at.bofh.it> |
| In reply to | #1258183 |
On Wed, Oct 28, 2015 at 03:37:02PM +0100, Neil Armstrong wrote:
> Hi Andrew,
>
> On 10/28/2015 03:35 PM, Andrew Lunn wrote:
> > On Wed, Oct 28, 2015 at 03:13:16PM +0100, Neil Armstrong wrote:
> >> diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
> >> index b1b14f5..6287096 100644
> >> --- a/drivers/net/dsa/mv88e6xxx.c
> >> +++ b/drivers/net/dsa/mv88e6xxx.c
> >> @@ -331,6 +331,16 @@ void mv88e6xxx_ppu_state_init(struct dsa_switch *ds)
> >> ps->ppu_timer.function = mv88e6xxx_ppu_reenable_timer;
> >> }
> >>
> >> +void mv88e6xxx_ppu_state_remove(struct dsa_switch *ds)
> >> +{
> >> + struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
> >> +
> >> + del_timer_sync(&ps->ppu_timer);
> >> +
> >> + cancel_work_sync(&ps->bridge_work);
> >> + flush_work(&ps->bridge_work);
> >> +}
> >> +
> >
> > You add this function, but you don't use it anywhere? Also, why
> > cancel bridge work, not ppu_work? Or has that been consolidated
> > in some patch i'm missing?
> >
> > Andrew
> >
>
> It's called in the next patch, in mv88e6131_remove for mv88e6131.
Hi Neil
It would be better to split this out into a patch of its own, and
include the mv88e6131 change with it.
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2015-10-28 15:40 +0100 |
| Subject | Re: [RFC PATCH v2 3/4] net: dsa: mv88e6xxx: add common and ppu remove function |
| Message-ID | <qoA3o-3Pi-11@gated-at.bofh.it> |
| In reply to | #1258133 |
On Wed, Oct 28, 2015 at 03:13:16PM +0100, Neil Armstrong wrote:
> With the previously introduced remove callback, add a
> mv88e6xxx common remove function to cleanup all resources.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
> drivers/net/dsa/mv88e6xxx.c | 18 ++++++++++++++++++
> drivers/net/dsa/mv88e6xxx.h | 2 ++
> 2 files changed, 20 insertions(+)
>
> diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
> index b1b14f5..6287096 100644
> --- a/drivers/net/dsa/mv88e6xxx.c
> +++ b/drivers/net/dsa/mv88e6xxx.c
> @@ -331,6 +331,16 @@ void mv88e6xxx_ppu_state_init(struct dsa_switch *ds)
> ps->ppu_timer.function = mv88e6xxx_ppu_reenable_timer;
> }
>
> +void mv88e6xxx_ppu_state_remove(struct dsa_switch *ds)
> +{
> + struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
> +
> + del_timer_sync(&ps->ppu_timer);
> +
> + cancel_work_sync(&ps->bridge_work);
> + flush_work(&ps->bridge_work);
> +}
> +
You add this function, but you don't use it anywhere? Also, why
cancel bridge work, not ppu_work? Or has that been consolidated
in some patch i'm missing?
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web