All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joachim Eastwood <manabian@gmail.com>
To: Alexandre Torgue <alexandre.torgue@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	netdev <netdev@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/4] net: ethernet: dwmac: add Ethernet glue logic for stm32 chip
Date: Mon, 22 Feb 2016 22:52:17 +0100	[thread overview]
Message-ID: <CAGhQ9VzPTgRqqLi4zjHkP-++v5smZ7s52drev1z-AvgXaLuC7Q@mail.gmail.com> (raw)
In-Reply-To: <CAJgp7zwOVEq=hnxfUt7eHZWSFUAwuK6MCVHdH591=xReRUsW8Q@mail.gmail.com>

On 22 February 2016 at 15:50, Alexandre Torgue
<alexandre.torgue@gmail.com> wrote:
> 2016-02-13 14:48 GMT+01:00 Joachim  Eastwood <manabian@gmail.com>:
>> On 3 February 2016 at 15:54, Alexandre TORGUE
>> <alexandre.torgue@gmail.com> wrote:
>>> +       plat_dat->bsp_priv = dwmac;
>>> +       plat_dat->init = stm32_dwmac_init;
>>> +       plat_dat->exit = stm32_dwmac_exit;
>>
>> Instead of using these callbacks could you rather implement the PM
>> callbacks directly in this driver?
>> I don't think it should add much code and it will make it look more
>> like standard driver. This will also give you some more control and
>> flexibility in your code.
>
> I prefer to keep the code as it is. Glue layer is directly linked to
> stmmac driver and I don't want to brake the link between the glue and
> the stmmac driver.

What do you mean by break the link?

There has been numerous of patch sets to make the stmmac "glue"
drivers into more standard platform drivers.
http://marc.info/?l=linux-netdev&m=143159850631093&w=2
http://marc.info/?l=linux-netdev&m=143708560009851&w=2
http://marc.info/?l=linux-netdev&m=143812136600541&w=2

Do you see any advantage by using the init and exit hooks in your
driver instead of using the standard driver PM callbacks and remove
function?
The only "cost" I see is slightly more boilerplate code. But since you
already have init/exit functions you could easily make them into PM
resume/suspend so I doubt there would be much increase in code size.

One other thing;
Do you need to have the PHY mode setup code in the init function which
is called each time on resume?
If you could move it to probe you could drop the interface priv data
member and use plat_dat->interface as stmmac_probe_config_dt() has
already done of_get_phy_mode().


regards,
Joachim Eastwood

WARNING: multiple messages have this Message-ID (diff)
From: manabian@gmail.com (Joachim Eastwood)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] net: ethernet: dwmac: add Ethernet glue logic for stm32 chip
Date: Mon, 22 Feb 2016 22:52:17 +0100	[thread overview]
Message-ID: <CAGhQ9VzPTgRqqLi4zjHkP-++v5smZ7s52drev1z-AvgXaLuC7Q@mail.gmail.com> (raw)
In-Reply-To: <CAJgp7zwOVEq=hnxfUt7eHZWSFUAwuK6MCVHdH591=xReRUsW8Q@mail.gmail.com>

On 22 February 2016 at 15:50, Alexandre Torgue
<alexandre.torgue@gmail.com> wrote:
> 2016-02-13 14:48 GMT+01:00 Joachim  Eastwood <manabian@gmail.com>:
>> On 3 February 2016 at 15:54, Alexandre TORGUE
>> <alexandre.torgue@gmail.com> wrote:
>>> +       plat_dat->bsp_priv = dwmac;
>>> +       plat_dat->init = stm32_dwmac_init;
>>> +       plat_dat->exit = stm32_dwmac_exit;
>>
>> Instead of using these callbacks could you rather implement the PM
>> callbacks directly in this driver?
>> I don't think it should add much code and it will make it look more
>> like standard driver. This will also give you some more control and
>> flexibility in your code.
>
> I prefer to keep the code as it is. Glue layer is directly linked to
> stmmac driver and I don't want to brake the link between the glue and
> the stmmac driver.

What do you mean by break the link?

There has been numerous of patch sets to make the stmmac "glue"
drivers into more standard platform drivers.
http://marc.info/?l=linux-netdev&m=143159850631093&w=2
http://marc.info/?l=linux-netdev&m=143708560009851&w=2
http://marc.info/?l=linux-netdev&m=143812136600541&w=2

Do you see any advantage by using the init and exit hooks in your
driver instead of using the standard driver PM callbacks and remove
function?
The only "cost" I see is slightly more boilerplate code. But since you
already have init/exit functions you could easily make them into PM
resume/suspend so I doubt there would be much increase in code size.

One other thing;
Do you need to have the PHY mode setup code in the init function which
is called each time on resume?
If you could move it to probe you could drop the interface priv data
member and use plat_dat->interface as stmmac_probe_config_dt() has
already done of_get_phy_mode().


regards,
Joachim Eastwood

  reply	other threads:[~2016-02-22 21:52 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 14:54 [PATCH 0/4] Add Ethernet support on STM32F429 Alexandre TORGUE
2016-02-03 14:54 ` Alexandre TORGUE
2016-02-03 14:54 ` [PATCH 1/4] net: ethernet: dwmac: add Ethernet glue logic for stm32 chip Alexandre TORGUE
2016-02-03 14:54   ` Alexandre TORGUE
2016-02-04  0:28   ` kbuild test robot
2016-02-04  0:28     ` kbuild test robot
2016-02-12 14:28   ` kbuild test robot
2016-02-12 14:28     ` kbuild test robot
2016-02-13 13:48   ` Joachim Eastwood
2016-02-13 13:48     ` Joachim Eastwood
2016-02-13 13:48     ` Joachim Eastwood
2016-02-22 14:50     ` Alexandre Torgue
2016-02-22 14:50       ` Alexandre Torgue
2016-02-22 14:50       ` Alexandre Torgue
2016-02-22 21:52       ` Joachim Eastwood [this message]
2016-02-22 21:52         ` Joachim Eastwood
2016-02-22 21:52         ` Joachim Eastwood
2016-02-23  9:59         ` Alexandre Torgue
2016-02-23  9:59           ` Alexandre Torgue
2016-02-23  9:59           ` Alexandre Torgue
2016-02-23 11:21           ` Joachim Eastwood
2016-02-23 11:21             ` Joachim Eastwood
2016-02-23 11:21             ` Joachim Eastwood
2016-02-23 13:17             ` Alexandre Torgue
2016-02-23 13:17               ` Alexandre Torgue
2016-02-23 13:17               ` Alexandre Torgue
2016-02-03 14:54 ` [PATCH 2/4] Documentation: Bindings: Add STM32 DWMAC glue Alexandre TORGUE
2016-02-03 14:54   ` Alexandre TORGUE
2016-02-03 14:54 ` [PATCH 3/4] net: ethernet: stmmac: add support of Synopsys 3.50a MAC IP Alexandre TORGUE
2016-02-03 14:54   ` Alexandre TORGUE
2016-02-03 14:54 ` [PATCH 4/4] ARM: STM32: Enable Ethernet in stm32_defconfig Alexandre TORGUE
2016-02-03 14:54   ` Alexandre TORGUE
2016-02-03 15:21 ` [PATCH 0/4] Add Ethernet support on STM32F429 Giuseppe CAVALLARO
2016-02-03 15:21   ` Giuseppe CAVALLARO
2016-02-09  9:52 ` David Miller
2016-02-09  9:52   ` David Miller
2016-02-12 15:01   ` Alexandre Torgue
2016-02-12 15:01     ` Alexandre Torgue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGhQ9VzPTgRqqLi4zjHkP-++v5smZ7s52drev1z-AvgXaLuC7Q@mail.gmail.com \
    --to=manabian@gmail.com \
    --cc=alexandre.torgue@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.