mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Renaud Barbier <renaud.barbier@ge.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] gianfar: prevent resource conflict
Date: Mon, 03 Jun 2013 10:31:50 +0100	[thread overview]
Message-ID: <51AC6286.5030001@ge.com> (raw)
In-Reply-To: <20130601092018.GO32299@pengutronix.de>


>> ---
>>   drivers/net/gianfar.c |   19 ++++++++++++++++++-
>>   1 files changed, 18 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
>> index 96055bd..79113a8 100644
>> --- a/drivers/net/gianfar.c
>> +++ b/drivers/net/gianfar.c
>> @@ -28,6 +28,8 @@
>>   #define RX_BUF_CNT 	PKTBUFSRX
>>   #define BUF_ALIGN	8
>>
>> +static void __iomem *phyregs;
>> +
>>   /*
>>    * Initialize required registers to appropriate values, zeroing
>>    * those we don't care about (unless zero is bad, in which case,
>> @@ -481,8 +483,23 @@ static int gfar_probe(struct device_d *dev)
>>   	edev = &priv->edev;
>>
>>   	priv->regs = dev_request_mem_region(dev, 0);
>> -	priv->phyregs = dev_request_mem_region(dev, 1);
>> +	if (priv->regs == NULL)
>> +		priv->regs = phyregs;
>
> the first resource is for the ethernet registers and no phy registers,
> right?

Indeed

>
>> +
>> +	if (phyregs == NULL) {
>> +		phyregs = dev_request_mem_region(dev, 1);
>> +		if (phyregs == NULL)
>> +			phyregs = priv->regs;
>> +	}
>> +	priv->phyregs = phyregs;
>> +
>>   	priv->phyregs_sgmii = dev_request_mem_region(dev, 2);
>> +	if (priv->phyregs_sgmii == NULL) {
>> +		if (IS_ENABLED(CONFIG_TSECV2))
>> +			priv->phyregs_sgmii = priv->phyregs;
>> +		else
>> +			priv->phyregs_sgmii = priv->regs;
>> +	}
>
> I think you should really register the mdio buses as separate devices
> since it's the mdio buses that are shared between the different
> instances, not the registers. The following may be a starting point
> (untested)
>

Thanks.


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-06-03  9:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 15:15 Renaud Barbier
2013-06-01  9:20 ` Sascha Hauer
2013-06-03  9:31   ` Renaud Barbier [this message]
2013-06-04 17:01     ` Renaud Barbier
2013-06-05  7:12       ` Sascha Hauer
2013-06-05  9:05         ` Renaud Barbier
2013-06-25 13:09 ` [PATCH v2 0/2] " Renaud Barbier
2013-06-25 13:09 ` [PATCH 1/2] ppc: gianfar MDIO buses Renaud Barbier
2013-06-26  6:44   ` Sascha Hauer
2013-06-25 13:10 ` [PATCH 2/2] P2020RDB: update build configuration Renaud Barbier

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=51AC6286.5030001@ge.com \
    --to=renaud.barbier@ge.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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