From: Simon Horman <simon.horman@corigine.com>
To: Sean Anderson <seanga2@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v4 10/10] net: sunhme: Consolidate common probe tasks
Date: Sun, 26 Mar 2023 09:57:17 +0200 [thread overview]
Message-ID: <ZB/63cE1DtYNpgtV@corigine.com> (raw)
In-Reply-To: <a4ecd20b-5d13-893b-2329-f6dd0c565ad5@gmail.com>
On Sat, Mar 25, 2023 at 12:06:41PM -0400, Sean Anderson wrote:
> On 3/25/23 05:10, Simon Horman wrote:
> > On Fri, Mar 24, 2023 at 01:51:36PM -0400, Sean Anderson wrote:
> > > Most of the second half of the PCI/SBUS probe functions are the same.
> > > Consolidate them into a common function.
> > >
> > > Signed-off-by: Sean Anderson <seanga2@gmail.com>
> >
> > Hi Sean,
> >
> > overall this looks good.
> > But I (still?) have some concerns about handling hm_revision.
> >
> > ...
> >
> > > diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> > > index bd1925f575c4..ec85aef35bf9 100644
> > > --- a/drivers/net/ethernet/sun/sunhme.c
> > > +++ b/drivers/net/ethernet/sun/sunhme.c
> > > @@ -2430,6 +2430,58 @@ static void happy_meal_addr_init(struct happy_meal *hp,
> > > }
> > > }
> > > +static int happy_meal_common_probe(struct happy_meal *hp,
> > > + struct device_node *dp)
> > > +{
> > > + struct net_device *dev = hp->dev;
> > > + int err;
> > > +
> > > +#ifdef CONFIG_SPARC
> > > + hp->hm_revision = of_getintprop_default(dp, "hm-rev", hp->hm_revision);
> >
> > Previously the logic, for SPARC for PCI went something like this:
> >
> > /* in happy_meal_pci_probe() */
> > hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff);
> > if (hp->hm_revision == 0xff)
> > hp->hm_revision = 0xc0 | (pdev->revision & 0x0f);
> >
> > Now it goes something like this:
> >
> > /* in happy_meal_pci_probe() */
> > hp->hm_revision = 0xc0 | (pdev->revision & 0x0f);
> > /* in happy_meal_common_probe() */
> > hp->hm_revision = of_getintprop_default(dp, "hm-rev", hp->hm_revision);
> >
> > Is this intentional?
> >
> > Likewise, for sbus (which implies SPARC) the logic was something like:
> >
> > /* in happy_meal_sbus_probe_one() */
> > hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff);
> > if (hp->hm_revision == 0xff)
> > hp->hm_revision = 0xa0;
> >
> > And now goes something like this:
> >
> > /* in happy_meal_pci_probe() */
> > hp->hm_revision = 0xa0;
> > /* in happy_meal_common_probe() */
> > hp->hm_revision = of_getintprop_default(dp, "hm-rev", hp->hm_revision);
>
> Yes, this is intentional. Logically, they are the same; we just set up the default
> before calling of_getintprop_default instead of after.
Thanks, I see that now :)
And I have no further questions about this patch.
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2023-03-26 8:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 17:51 [PATCH net-next v4 00/10] net: sunhme: Probe/IRQ cleanups Sean Anderson
2023-03-24 17:51 ` [PATCH net-next v4 01/10] net: sunhme: Fix uninitialized return code Sean Anderson
2023-03-25 8:17 ` Simon Horman
2023-03-25 8:26 ` Simon Horman
2023-03-24 17:51 ` [PATCH net-next v4 02/10] net: sunhme: Just restart autonegotiation if we can't bring the link up Sean Anderson
2023-03-24 17:51 ` [PATCH net-next v4 03/10] net: sunhme: Remove residual polling code Sean Anderson
2023-03-24 17:51 ` [PATCH net-next v4 04/10] net: sunhme: Unify IRQ requesting Sean Anderson
2023-03-24 17:51 ` [PATCH net-next v4 05/10] net: sunhme: Alphabetize includes Sean Anderson
2023-03-24 17:51 ` [PATCH net-next v4 06/10] net: sunhme: Switch SBUS to devres Sean Anderson
2023-03-24 17:51 ` [PATCH net-next v4 07/10] net: sunhme: Consolidate mac address initialization Sean Anderson
2023-03-24 17:51 ` [PATCH net-next v4 08/10] net: sunhme: Clean up mac address init Sean Anderson
2023-03-24 17:51 ` [PATCH net-next v4 09/10] net: sunhme: Inline error returns Sean Anderson
2023-03-25 8:24 ` Simon Horman
2023-03-25 8:29 ` Simon Horman
2023-03-24 17:51 ` [PATCH net-next v4 10/10] net: sunhme: Consolidate common probe tasks Sean Anderson
2023-03-25 9:10 ` Simon Horman
2023-03-25 16:06 ` Sean Anderson
2023-03-26 7:57 ` Simon Horman [this message]
2023-03-27 7:50 ` [PATCH net-next v4 00/10] net: sunhme: Probe/IRQ cleanups patchwork-bot+netdevbpf
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=ZB/63cE1DtYNpgtV@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=seanga2@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox