* External interrupts with UIO framework on mpc8313e
From: Frank Prepelica @ 2008-02-11 11:24 UTC (permalink / raw)
To: linuxppc-embedded
Hi everyone!
I'm trying to receive external interrupts on the mpc8313erdb board.
I'm also using the UIO framework to register the interrupt handler.=20
It works for me when I register the interrupt handler for external =
interrupt IRQ4 (irq =3D 20)
But when I'm trying the register the handler for IRQ0(48)-IRQ3(17-19) it =
doesn't.=20
I'm using following simple code:
---snip---
static irqreturn_t intHandler(int irq, struct uio_info *dev_info)
{
printk("name: %s\n", dev_info->name);
return IRQ_HANDLED
}
static struct uio_info myinfo =3D {
.name =3D "IRQ4 Kernel Driver",
.version =3D "1.0.0",
.irq =3D 20,
.irq_flags =3D IRQF_SHARED | IRQF_DISABLED,
.handler =3D intHandler,
};
static int uio_probe(struct device *dev)
{
if(uio_register_device(dev,&myinfo))
{
return -ENODEV;
}
else
{
return 0;
}
}
---snip---
After booting the kernel, the driver (for IRQ4) appears correct in =
/proc/interrups and can be triggered.
I guess, this should also work for IRQ0-IRQ3 but it won't. IRQ0 cannot =
registered to 48 at all and the
other ones appear in /proc/interruts but they cannot be triggered (BUT =
shared with serial or i2c).=20
I also checked the value of the SEMSR register and see that IRQ4 is set =
correctly.
Okay, I thought when I set the SEMSR register manually e.g. IRQ2 to "1" =
and trigger the correct interrupt signal I could see in /proc/stat a =
counting value. Nothing happened. But the BAD counter in =
/proc/interrupts is rising.=20
Furthermore there's a mapping issue between the interrupt id number from =
the board manual
(page 8-10) and the output of /proc/interrupts. The kernel registers the =
i2c devices to=20
ID 16 and 17 although the manual says they are mapped to 14 and 15.
Any hint is appreciate!=20
Best regards
Frank Prepelica
Software Design Engineer
Ubidyne GmbH
Lise-Meitner-Str.-14
89081 Ulm - Germany
Phone:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 +49 731 88 00 71 58
Fax:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 +49 731 88 00 71 99
Email:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
frank.prepelica@ubidyne.com
Homepage:=A0=A0=A0=A0=A0=A0 www.ubidyne.com
=A0
Registered office: Ulm
District court of Ulm: HRB 5295
Managing Directors:
Dipl. Ing. Ken Hawk
Dipl. Ing. Beat M=FCller
Dr. Clemens Rheinfelder
^ permalink raw reply
* Re: Ebony development board
From: Josh Boyer @ 2008-02-11 12:53 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <200802110720.12842.sr@denx.de>
On Mon, 11 Feb 2008 07:20:12 +0100
Stefan Roese <sr@denx.de> wrote:
> Hi Zoltan,
>
> On Saturday 09 February 2008, Zoltan HERPAI wrote:
> > I've recently got an Ebony board (440GP) with the original bootloader
> > (440GP 1.18 ROM Monitor) which I would like to replace with U-boot. Is
> > there a way to boot an U-boot image via TFTP to replace the bootloader,
> > or is it possible only with using a JTAG? I've googled through the
> > mailing list, but most of the related hits are dated back in 2004-2005,
> > they say no, one have to use JTAG, but some time passed since then, and
> > I would like to know if there is a way for this.
>
> Does the original ROM monitor support writing to onboard FLASH? If yes, it
> should be possible.
It doesn't. Theoretically, you can boot Linux and use MTD on the flash
to load U-Boot. I wouldn't recommend it without a JTAG debugger around
to fix things in case they get screwed up.
josh
^ permalink raw reply
* Re: [PATCH v4] [POWERPC] MPC8360E-RDK: device tree, board file and defconfig
From: Anton Vorontsov @ 2008-02-11 13:01 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <20080201135640.GA10966@localhost.localdomain>
On Fri, Feb 01, 2008 at 04:56:40PM +0300, Anton Vorontsov wrote:
> This is new board made by Freescale Semiconductor Inc. and
> Logic Product Development.
>
> Currently supported:
> 1. UEC{1,2,7,4};
> 2. I2C;
> 3. SPI;
> 4. NS16550 serial;
> 5. PCI and miniPCI;
> 6. Intel NOR StrataFlash X16 64Mbit PC28F640P30T85;
> 7. Graphics controller, Fujitsu MB86277.
>
> Not supported so far:
> 1. StMICRO NAND512W3A2BN6E, 512 Mbit (supported with FSL UPM patches);
> 2. QE Serial UCCs (tested to not work with ucc_uart driver, reason
> unknown, yet);
> 3. ADC AD7843 (tested to work, but support via device tree depends on
> major SPI rework, GPIO API, etc);
> 4. FHCI USB (will send RFC patches soon).
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>
> Hello Kumar,
>
> It would be great if we can get this into the 2.6.25.
Is there any chance this will hit 2.6.25?..
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH] Fix for Freescale ppc cores: major revision detection
From: Kumar Gala @ 2008-02-11 15:01 UTC (permalink / raw)
To: Martin Langer; +Cc: linuxppc-dev
In-Reply-To: <20080209174748.GA3245@tuba>
On Feb 9, 2008, at 11:47 AM, Martin Langer wrote:
> Ppc cores by Freescale are using the configuration field instead of
> the
> major revision field for their major revision number. Those field
> definitions come from include/asm-powerpc/reg.h.
>
> Look at the pdf below and you will see that PVR_MAJ() does a wrong
> shift
> for ppc cores by Freescale. This patch fixes it.
>
> http://www.freescale.com/files/archives/doc/support_info/PPCPVR.pdf
This doc doesn't encompass the e500/book-e cores that don't follow the
same pattern.
The code should probably be something like:
#ifdef CONFIG_FSL_BOOKE
maj = PVR_MAJ(pvr);
#else
maj = (pvr >> 8) & 0xff;
#endif
>
>
>
> Signed-Off-By: Martin Langer <martin-langer@gmx.de>
>
>
> --- arch/powerpc/kernel/setup-common.c.ORIGINAL 2008-02-08
> 22:22:56.000000000 +0100
> +++ arch/powerpc/kernel/setup-common.c 2008-02-09 18:18:36.000000000
> +0100
> @@ -241,7 +241,7 @@
> /* If we are a Freescale core do a simple check so
> * we dont have to keep adding cases in the future */
> if (PVR_VER(pvr) & 0x8000) {
> - maj = PVR_MAJ(pvr);
> + maj = (pvr >> 8) & 0xF;
> min = PVR_MIN(pvr);
> } else {
> switch (PVR_VER(pvr)) {
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH 1/5] Tsi108_eth: add missing linking to driver data
From: Jeff Garzik @ 2008-02-11 15:28 UTC (permalink / raw)
To: Alexandre Bounine; +Cc: netdev, linuxppc-dev
In-Reply-To: <1B5F013528140F45B5C671039279CA5702A9609F@NANUK.pc.tundra.com>
Alexandre Bounine wrote:
> Bug fix for tsi108_eth network driver.
> This patch adds missing linking to driver data.
>
> Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
> ---
>
> diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
> linux-2.6.24-fix/drivers/net/tsi108_eth.c
> --- linux-2.6.24/drivers/net/tsi108_eth.c 2008-01-24
> 17:58:37.000000000 -0500
> +++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
> 14:30:04.000000000 -0500
> @@ -1629,6 +1629,7 @@ tsi108_init_one(struct platform_device *
> goto register_fail;
> }
>
> + platform_set_drvdata(pdev, dev);
> printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: %s\n",
> dev->name, print_mac(mac, dev->dev_addr));
> #ifdef DEBUG
ACK, but your patches are unusable because they are word-wrapped
^ permalink raw reply
* [PATCH] [POWERPC] Remove generated files on make clean
From: Kumar Gala @ 2008-02-11 15:32 UTC (permalink / raw)
To: linuxppc-dev; +Cc: David Gibson
vmlinux.lds and dtc-parser.tab.h get created but never cleaned up.
---
arch/powerpc/boot/Makefile | 2 ++
arch/powerpc/kernel/Makefile | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 49797a4..63d07cc 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -147,6 +147,8 @@ HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
targets += dtc-src/dtc-parser.tab.c
targets += dtc-src/dtc-lexer.lex.c
+clean-files += dtc-src/dtc-parser.tab.h
+
ifdef DTC_GENPARSER
BISON = bison
FLEX = flex
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 0662ae4..c1baf9d 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -104,3 +104,5 @@ quiet_cmd_systbl_chk = CALL $<
PHONY += systbl_chk
systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
$(call cmd,systbl_chk)
+
+clean-files := vmlinux.lds
--
1.5.3.8
^ permalink raw reply related
* Re: [PATCH v4] [POWERPC] MPC8360E-RDK: device tree, board file and defconfig
From: Kumar Gala @ 2008-02-11 15:32 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080211130132.GA6445@localhost.localdomain>
On Feb 11, 2008, at 7:01 AM, Anton Vorontsov wrote:
> On Fri, Feb 01, 2008 at 04:56:40PM +0300, Anton Vorontsov wrote:
>> This is new board made by Freescale Semiconductor Inc. and
>> Logic Product Development.
>>
>> Currently supported:
>> 1. UEC{1,2,7,4};
>> 2. I2C;
>> 3. SPI;
>> 4. NS16550 serial;
>> 5. PCI and miniPCI;
>> 6. Intel NOR StrataFlash X16 64Mbit PC28F640P30T85;
>> 7. Graphics controller, Fujitsu MB86277.
>>
>> Not supported so far:
>> 1. StMICRO NAND512W3A2BN6E, 512 Mbit (supported with FSL UPM
>> patches);
>> 2. QE Serial UCCs (tested to not work with ucc_uart driver, reason
>> unknown, yet);
>> 3. ADC AD7843 (tested to work, but support via device tree depends on
>> major SPI rework, GPIO API, etc);
>> 4. FHCI USB (will send RFC patches soon).
>>
>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>> ---
>>
>> Hello Kumar,
>>
>> It would be great if we can get this into the 2.6.25.
>
> Is there any chance this will hit 2.6.25?..
Not really. It seemed like there were a lot of other patches this
really depend on getting so I was waiting to see how that fell out.
As Linus, just released 2.6.25-rc1 lets queue this up for 2.6.26.
- k
^ permalink raw reply
* Re: [PATCH][RESEND] drivers/base: export (un)register_memory_notifier
From: Greg KH @ 2008-02-11 15:22 UTC (permalink / raw)
To: Jan-Bernd Themann
Cc: Jan-Bernd Themann, netdev, Dave Hansen, linux-kernel,
Thomas Klein, linux-ppc, Christoph Raisch
In-Reply-To: <200802111147.51225.ossthema@de.ibm.com>
On Mon, Feb 11, 2008 at 11:47:50AM +0100, Jan-Bernd Themann wrote:
> On Monday 11 February 2008 11:12, Dave Hansen wrote:
> > On Mon, 2008-02-11 at 10:49 +0100, Jan-Bernd Themann wrote:
> > > are you the right person to address this patch to?
> >
> > You might want to check the top of the file. ;)
> >
> > > --- a/drivers/base/memory.c
> > > +++ b/drivers/base/memory.c
> > > @@ -52,11 +52,13 @@ int register_memory_notifier(struct notifier_block *nb)
> > > {
> > > return blocking_notifier_chain_register(&memory_chain, nb);
> > > }
> > > +EXPORT_SYMBOL(register_memory_notifier);
> > >
> > > void unregister_memory_notifier(struct notifier_block *nb)
> > > {
> > > blocking_notifier_chain_unregister(&memory_chain, nb);
> > > }
> > > +EXPORT_SYMBOL(unregister_memory_notifier);
> >
> > Is there a particular reason these can't be GPL?
> >
>
> I don't object to make them GPL. Greg, what do you think?
They should be _GPL to match the rest of the driver core.
Care to resend this?
thanks,
greg k-h
^ permalink raw reply
* [PATCH] drivers/base: export gpl (un)register_memory_notifier
From: Jan-Bernd Themann @ 2008-02-11 15:57 UTC (permalink / raw)
To: Dave Hansen
Cc: Themann, Jan-Bernd, netdev, linux-kernel, Thomas Klein, linux-ppc,
Christoph Raisch, Greg KH
Drivers like eHEA need memory notifiers in order to
update their internal DMA memory map when memory is added
to or removed from the system.
Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
---
Hi,
this is the modified version with EXPORT_SYMBOL_GPL
Regards,
Jan-Bernd
drivers/base/memory.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7ae413f..f5a0bf1 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -52,11 +52,13 @@ int register_memory_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&memory_chain, nb);
}
+EXPORT_SYMBOL_GPL(register_memory_notifier);
void unregister_memory_notifier(struct notifier_block *nb)
{
blocking_notifier_chain_unregister(&memory_chain, nb);
}
+EXPORT_SYMBOL_GPL(unregister_memory_notifier);
/*
* register_memory - Setup a sysfs device for a memory block
--
1.5.2
^ permalink raw reply related
* Re: [PATCH] drivers/base: export gpl (un)register_memory_notifier
From: Sam Ravnborg @ 2008-02-11 16:02 UTC (permalink / raw)
To: Jan-Bernd Themann
Cc: Themann, Jan-Bernd, netdev, Dave Hansen, linux-kernel,
Thomas Klein, linux-ppc, Christoph Raisch, Greg KH
In-Reply-To: <200802111657.07534.ossthema@de.ibm.com>
On Mon, Feb 11, 2008 at 04:57:06PM +0100, Jan-Bernd Themann wrote:
> Drivers like eHEA need memory notifiers in order to
> update their internal DMA memory map when memory is added
> to or removed from the system.
Can you please add proper kernel-doc formatted comments
when you export a symbol so others can get a clue
what the exported function is supposed to do.
Sam
^ permalink raw reply
* Re: [PATCH] drivers/base: export gpl (un)register_memory_notifier
From: Dave Hansen @ 2008-02-11 16:04 UTC (permalink / raw)
To: Jan-Bernd Themann
Cc: Themann, Jan-Bernd, netdev, linux-kernel, Thomas Klein, linux-ppc,
Christoph Raisch, Greg KH
In-Reply-To: <200802111657.07534.ossthema@de.ibm.com>
On Mon, 2008-02-11 at 16:57 +0100, Jan-Bernd Themann wrote:
> Drivers like eHEA need memory notifiers in order to
> update their internal DMA memory map when memory is added
> to or removed from the system.
Could you post this with the new users as well so we can make sure
they're not abusing this in some way?
-- Dave
^ permalink raw reply
* Re: [PATCH v4] [POWERPC] MPC8360E-RDK: device tree, board file and defconfig
From: Anton Vorontsov @ 2008-02-11 16:06 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <33A3857D-9829-40CA-9A8E-751C2C417E5E@kernel.crashing.org>
On Mon, Feb 11, 2008 at 09:32:20AM -0600, Kumar Gala wrote:
>
> On Feb 11, 2008, at 7:01 AM, Anton Vorontsov wrote:
>
> >On Fri, Feb 01, 2008 at 04:56:40PM +0300, Anton Vorontsov wrote:
> >>This is new board made by Freescale Semiconductor Inc. and
> >>Logic Product Development.
> >>
> >>Currently supported:
> >>1. UEC{1,2,7,4};
> >>2. I2C;
> >>3. SPI;
> >>4. NS16550 serial;
> >>5. PCI and miniPCI;
> >>6. Intel NOR StrataFlash X16 64Mbit PC28F640P30T85;
> >>7. Graphics controller, Fujitsu MB86277.
> >>
> >>Not supported so far:
> >>1. StMICRO NAND512W3A2BN6E, 512 Mbit (supported with FSL UPM
> >>patches);
> >>2. QE Serial UCCs (tested to not work with ucc_uart driver, reason
> >> unknown, yet);
> >>3. ADC AD7843 (tested to work, but support via device tree depends on
> >> major SPI rework, GPIO API, etc);
> >>4. FHCI USB (will send RFC patches soon).
> >>
> >>Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> >>---
> >>
> >>Hello Kumar,
> >>
> >>It would be great if we can get this into the 2.6.25.
> >
> >Is there any chance this will hit 2.6.25?..
>
> Not really. It seemed like there were a lot of other patches this
> really depend on getting so I was waiting to see how that fell out.
Hm... This particular patch doesn't depend on any other patches.
This is "basic support" patch with intent to be in time for .25.
NAND/ADC/FHCI support is .26 material, of course, and that's exactly
why "basic support" patch doesn't include these bits.
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH] net: NEWEMAC: Remove "rgmii-interface" from rgmii matching table
From: Jeff Garzik @ 2008-02-11 16:08 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, netdev, Stefan Roese
In-Reply-To: <20080206064947.7e91d833@zod.rchland.ibm.com>
Josh Boyer wrote:
> On Wed, 6 Feb 2008 13:21:59 +0100
> Stefan Roese <sr@denx.de> wrote:
>
>> With the removal the the "rgmii-interface" device_type property from the
>> dts files, the newemac driver needs an update to only rely on compatible
>> property.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
upon further reflection, ACK, take this via ppc tree
^ permalink raw reply
* [PATCH] drivers/base: export gpl (un)register_memory_notifier
From: Jan-Bernd Themann @ 2008-02-11 16:24 UTC (permalink / raw)
To: Dave Hansen
Cc: Themann, Jan-Bernd, netdev, linux-kernel, Thomas Klein, linux-ppc,
Christoph Raisch, Greg KH
Drivers like eHEA need memory notifiers in order to
update their internal DMA memory map when memory is added
to or removed from the system.
Patch for eHEA memory hotplug support that uses these functions:
http://www.spinics.net/lists/netdev/msg54484.html
Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
---
Hi,
the eHEA patch belongs to a patchset that is usually
added by Jeff Garzik once this dependency (EXPORTS)
is resolved.
Regards,
Jan-Bernd
drivers/base/memory.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7ae413f..f5a0bf1 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -52,11 +52,13 @@ int register_memory_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&memory_chain, nb);
}
+EXPORT_SYMBOL_GPL(register_memory_notifier);
void unregister_memory_notifier(struct notifier_block *nb)
{
blocking_notifier_chain_unregister(&memory_chain, nb);
}
+EXPORT_SYMBOL_GPL(unregister_memory_notifier);
/*
* register_memory - Setup a sysfs device for a memory block
--
1.5.2
^ permalink raw reply related
* [PATCH 1/5 v2] Tsi108_eth: add missing linking to driver data
From: Alexandre Bounine @ 2008-02-11 16:31 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev
Bug fix for tsi108_eth network driver.
This patch adds missing linking to driver data.=20
=20=20=20
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-01-24
17:58:37.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
14:30:04.000000000 -0500
@@ -1629,6 +1629,7 @@ tsi108_init_one(struct platform_device *
goto register_fail;
}
=20
+ platform_set_drvdata(pdev, dev);
printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: %s\n",
dev->name, print_mac(mac, dev->dev_addr));
#ifdef DEBUG
---=0D
=0D
Important Notice: This message is intended for the use of the individual to=
whom it is addressed and may contain information which is privileged, conf=
idential and/or exempt from disclosure under applicable law. If the reader =
of this message is not the intended recipient, or is not the employee or ag=
ent responsible for delivering the message to the intended recipient, you a=
re hereby notified that any dissemination, distribution, or copying of this=
communication is strictly prohibited. If you have received this communicat=
ion in error, please notify the sender immediately by telephone or return e=
-mail and delete the original message from your systems. Thank you. =0D
^ permalink raw reply
* [PATCH 2/5 v2] Tsi108_eth: fix detection of 1000Mb mode
From: Alexandre Bounine @ 2008-02-11 16:31 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev
Bug fix for tsi108_eth network driver.
This patch fixes a problem with detection of 1000Mb speed.=20
=20=20=20
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06
15:09:19.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
15:34:12.000000000 -0500
@@ -1287,6 +1287,7 @@ static void tsi108_init_phy(struct net_d
spin_lock_irqsave(&phy_lock, flags);
}
=20
+ data->mii_if.supports_gmii =3D
mii_check_gmii_support(&data->mii_if);
printk(KERN_DEBUG "PHY_STAT reg contains %08x\n", phyval);
data->phy_ok =3D 1;
data->init_media =3D 1;
@@ -1584,7 +1585,6 @@ tsi108_init_one(struct platform_device *
data->mii_if.phy_id =3D einfo->phy;
data->mii_if.phy_id_mask =3D 0x1f;
data->mii_if.reg_num_mask =3D 0x1f;
- data->mii_if.supports_gmii =3D
mii_check_gmii_support(&data->mii_if);
=20
data->phy =3D einfo->phy;
data->phy_type =3D einfo->phy_type;
---=0D
=0D
Important Notice: This message is intended for the use of the individual to=
whom it is addressed and may contain information which is privileged, conf=
idential and/or exempt from disclosure under applicable law. If the reader =
of this message is not the intended recipient, or is not the employee or ag=
ent responsible for delivering the message to the intended recipient, you a=
re hereby notified that any dissemination, distribution, or copying of this=
communication is strictly prohibited. If you have received this communicat=
ion in error, please notify the sender immediately by telephone or return e=
-mail and delete the original message from your systems. Thank you. =0D
^ permalink raw reply
* [PATCH 3/5 v2] Tsi108_eth: remove not needed code
From: Alexandre Bounine @ 2008-02-11 16:32 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev
Code clean-up for tsi108_eth network driver.
This patch removes not needed dummy read and the corresponding comment.
The PHY logic requires two reads from the status register to get=20
current link status. This is done correctly inside mii_check_media().=20=20
=20=20=20
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06
15:47:35.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
15:54:14.000000000 -0500
@@ -297,18 +297,11 @@ static void tsi108_check_phy(struct net_
u32 speed;
unsigned long flags;
=20
- /* Do a dummy read, as for some reason the first read
- * after a link becomes up returns link down, even if
- * it's been a while since the link came up.
- */
-
spin_lock_irqsave(&phy_lock, flags);
=20
if (!data->phy_ok)
goto out;
=20
- tsi108_read_mii(data, MII_BMSR);
-
duplex =3D mii_check_media(&data->mii_if, netif_msg_link(data),
data->init_media);
data->init_media =3D 0;
---=0D
=0D
Important Notice: This message is intended for the use of the individual to=
whom it is addressed and may contain information which is privileged, conf=
idential and/or exempt from disclosure under applicable law. If the reader =
of this message is not the intended recipient, or is not the employee or ag=
ent responsible for delivering the message to the intended recipient, you a=
re hereby notified that any dissemination, distribution, or copying of this=
communication is strictly prohibited. If you have received this communicat=
ion in error, please notify the sender immediately by telephone or return e=
-mail and delete the original message from your systems. Thank you. =0D
^ permalink raw reply
* [PATCH 4/5 v2] Tsi108_eth: fix link recovery after disconnect
From: Alexandre Bounine @ 2008-02-11 16:32 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev
Bug fix for tsi108_eth network driver.
This patch fixes a problem with link recovery after connection was lost.
=20=20=20
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06
16:16:00.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
16:57:41.000000000 -0500
@@ -338,22 +338,21 @@ static void tsi108_check_phy(struct net_
=20
TSI_WRITE(TSI108_MAC_CFG2, mac_cfg2_reg);
TSI_WRITE(TSI108_EC_PORTCTRL, portctrl_reg);
+ }
=20
- if (data->link_up =3D=3D 0) {
- /* The manual says it can take 3-4 usecs
for the speed change
- * to take effect.
- */
- udelay(5);
-
- spin_lock(&data->txlock);
- if (is_valid_ether_addr(dev->dev_addr)
&& data->txfree)
- netif_wake_queue(dev);
+ if (data->link_up =3D=3D 0) {
+ /* The manual says it can take 3-4 usecs for the
speed change
+ * to take effect.
+ */
+ udelay(5);
=20
- data->link_up =3D 1;
- spin_unlock(&data->txlock);
- }
- }
+ spin_lock(&data->txlock);
+ if (is_valid_ether_addr(dev->dev_addr) &&
data->txfree)
+ netif_wake_queue(dev);
=20
+ data->link_up =3D 1;
+ spin_unlock(&data->txlock);
+ }
} else {
if (data->link_up =3D=3D 1) {
netif_stop_queue(dev);
@@ -1267,12 +1266,11 @@ static void tsi108_init_phy(struct net_d
* PHY_STAT register before the link up status bit is set.
*/
=20
- data->link_up =3D 1;
+ data->link_up =3D 0;
=20
while (!((phyval =3D tsi108_read_mii(data, MII_BMSR)) &
BMSR_LSTATUS)) {
if (i++ > (MII_READ_DELAY / 10)) {
- data->link_up =3D 0;
break;
}
spin_unlock_irqrestore(&phy_lock, flags);
---=0D
=0D
Important Notice: This message is intended for the use of the individual to=
whom it is addressed and may contain information which is privileged, conf=
idential and/or exempt from disclosure under applicable law. If the reader =
of this message is not the intended recipient, or is not the employee or ag=
ent responsible for delivering the message to the intended recipient, you a=
re hereby notified that any dissemination, distribution, or copying of this=
communication is strictly prohibited. If you have received this communicat=
ion in error, please notify the sender immediately by telephone or return e=
-mail and delete the original message from your systems. Thank you. =0D
^ permalink raw reply
* [PATCH 5/5 v2] Tsi108_eth: Add ethtool support
From: Alexandre Bounine @ 2008-02-11 16:32 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev
Add ethtool support to tsi108_eth network driver.
=20=20=20
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06
17:10:53.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
18:09:43.000000000 -0500
@@ -36,6 +36,7 @@
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -1519,12 +1520,46 @@ static void tsi108_init_mac(struct net_d
TSI_WRITE(TSI108_EC_INTMASK, ~0);
}
=20
+static int tsi108_get_settings(struct net_device *dev, struct
ethtool_cmd *cmd)
+{
+ struct tsi108_prv_data *data =3D netdev_priv(dev);
+ unsigned long flags;
+ int rc;
+=09
+ spin_lock_irqsave(&data->txlock, flags);
+ rc =3D mii_ethtool_gset(&data->mii_if, cmd);
+ spin_unlock_irqrestore(&data->txlock, flags);
+
+ return rc;
+}
+
+static int tsi108_set_settings(struct net_device *dev, struct
ethtool_cmd *cmd)
+{
+ struct tsi108_prv_data *data =3D netdev_priv(dev);
+ unsigned long flags;
+ int rc;
+
+ spin_lock_irqsave(&data->txlock, flags);
+ rc =3D mii_ethtool_sset(&data->mii_if, cmd);
+ spin_unlock_irqrestore(&data->txlock, flags);
+=09
+ return rc;
+}
+
static int tsi108_do_ioctl(struct net_device *dev, struct ifreq *rq,
int cmd)
{
struct tsi108_prv_data *data =3D netdev_priv(dev);
+ if (!netif_running(dev))
+ return -EINVAL;
return generic_mii_ioctl(&data->mii_if, if_mii(rq), cmd, NULL);
}
=20
+static const struct ethtool_ops tsi108_ethtool_ops =3D {
+ .get_link =3D ethtool_op_get_link,
+ .get_settings =3D tsi108_get_settings,
+ .set_settings =3D tsi108_set_settings,
+};
+
static int
tsi108_init_one(struct platform_device *pdev)
{
@@ -1589,6 +1624,7 @@ tsi108_init_one(struct platform_device *
dev->get_stats =3D tsi108_get_stats;
netif_napi_add(dev, &data->napi, tsi108_poll, 64);
dev->do_ioctl =3D tsi108_do_ioctl;
+ dev->ethtool_ops =3D &tsi108_ethtool_ops;
=20
/* Apparently, the Linux networking code won't use
scatter-gather
* if the hardware doesn't do checksums. However, it's faster
---=0D
=0D
Important Notice: This message is intended for the use of the individual to=
whom it is addressed and may contain information which is privileged, conf=
idential and/or exempt from disclosure under applicable law. If the reader =
of this message is not the intended recipient, or is not the employee or ag=
ent responsible for delivering the message to the intended recipient, you a=
re hereby notified that any dissemination, distribution, or copying of this=
communication is strictly prohibited. If you have received this communicat=
ion in error, please notify the sender immediately by telephone or return e=
-mail and delete the original message from your systems. Thank you. =0D
^ permalink raw reply
* Re: [PATCH 1/5 v2] Tsi108_eth: add missing linking to driver data
From: Jeff Garzik @ 2008-02-11 16:40 UTC (permalink / raw)
To: Alexandre Bounine; +Cc: netdev, linuxppc-dev
In-Reply-To: <1B5F013528140F45B5C671039279CA5702A9638A@NANUK.pc.tundra.com>
Alexandre Bounine wrote:
> Bug fix for tsi108_eth network driver.
> This patch adds missing linking to driver data.
>
> Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
> ---
>
> diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
> linux-2.6.24-fix/drivers/net/tsi108_eth.c
> --- linux-2.6.24/drivers/net/tsi108_eth.c 2008-01-24
> 17:58:37.000000000 -0500
> +++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
> 14:30:04.000000000 -0500
> @@ -1629,6 +1629,7 @@ tsi108_init_one(struct platform_device *
> goto register_fail;
> }
>
> + platform_set_drvdata(pdev, dev);
> printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: %s\n",
> dev->name, print_mac(mac, dev->dev_addr));
> #ifdef DEBUG
still getting word-wrapped... even the patch header is mangled across
multiple lines
^ permalink raw reply
* Re: [PATCH] drivers/base: export gpl (un)register_memory_notifier
From: Dave Hansen @ 2008-02-11 16:47 UTC (permalink / raw)
To: Jan-Bernd Themann
Cc: Thomas Klein, Themann, Jan-Bernd, netdev, apw, linux-kernel,
Thomas Klein, linux-ppc, Christoph Raisch, Badari Pulavarty,
Greg KH
In-Reply-To: <200802111724.12416.ossthema@de.ibm.com>
On Mon, 2008-02-11 at 17:24 +0100, Jan-Bernd Themann wrote:
> the eHEA patch belongs to a patchset that is usually
> added by Jeff Garzik once this dependency (EXPORTS)
> is resolved.
I know that's already in mainline but, man, that code is nasty. It has
stuff indented 7 levels or so and is virtually impossible to read.
This:
> int ehea_create_busmap(void)
> {
> u64 vaddr = EHEA_BUSMAP_START;
> unsigned long high_section_index = 0;
> int i;
>
> /*
> * Sections are not in ascending order -> Loop over all sections and
> * find the highest PFN to compute the required map size.
> */
> ehea_bmap.valid_sections = 0;
>
> for (i = 0; i < NR_MEM_SECTIONS; i++)
> if (valid_section_nr(i))
> high_section_index = i;
is also completely bogus for arch-independent code. If someone ever
wants to do ppc without sparsemem (or redoes internal sparsemem
interfaces), this code will break.
Also, keeping your own mapping of all of memory is really nasty. With
SPARSEMEM_EXTREME/VMEMMAP you can have extremely sparse physical memory,
and this:
> ehea_bmap.entries = high_section_index + 1;
> ehea_bmap.vaddr = vmalloc(ehea_bmap.entries * sizeof(*ehea_bmap.vaddr));
could theoretically consume all of memory if the sections are very sparse.
Could you please try to explain what the heck this driver is doing?
We'll try to fix up the generic interfaces so that you can deal with
things in a more generic fashion, but it can't stay this way.
Also, just ripping down and completely re-doing the entire mass of cards
every time a 16MB area of memory is added or removed seems like an
awfully big sledgehammer to me. I would *HATE* to see anybody else
using this driver as an example to work off of? Can't you just keep
track of which areas the driver is actually *USING* and only worry about
changing mappings if that intersects with an area having hotplug done on
it?
Can you please give it some CodingStyle love and make it so that it
doesn't indent so much? Something like this:
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index c051c7e..72c5652 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2638,38 +2638,40 @@ static void ehea_rereg_mrs(struct work_struct *work)
down(&dlpar_mem_lock);
ehea_info("LPAR memory enlarged - re-initializing driver");
- list_for_each_entry(adapter, &adapter_list, list)
- if (adapter->active_ports) {
- /* Shutdown all ports */
- for (i = 0; i < EHEA_MAX_PORTS; i++) {
- struct ehea_port *port = adapter->port[i];
-
- if (port) {
- struct net_device *dev = port->netdev;
-
- if (dev->flags & IFF_UP) {
- down(&port->port_lock);
- netif_stop_queue(dev);
- ret = ehea_stop_qps(dev);
- if (ret) {
- up(&port->port_lock);
- goto out;
- }
- port_napi_disable(port);
- up(&port->port_lock);
- }
- }
- }
-
- /* Unregister old memory region */
- ret = ehea_rem_mr(&adapter->mr);
+ list_for_each_entry(adapter, &adapter_list, list) {
+ if (!adapter->active_ports)
+ continue;
+ /* Shutdown all ports */
+ for (i = 0; i < EHEA_MAX_PORTS; i++) {
+ struct ehea_port *port = adapter->port[i];
+ struct net_device *dev;
+ if (!port)
+ continue;
+
+ dev = port->netdev;
+ if (!(dev->flags & IFF_UP))
+ continue;
+
+ down(&port->port_lock);
+ netif_stop_queue(dev);
+ ret = ehea_stop_qps(dev);
if (ret) {
- ehea_error("unregister MR failed - driver"
- " inoperable!");
+ up(&port->port_lock);
goto out;
}
+ port_napi_disable(port);
+ up(&port->port_lock);
}
+ /* Unregister old memory region */
+ ret = ehea_rem_mr(&adapter->mr);
+ if (ret) {
+ ehea_error("unregister MR failed - driver"
+ " inoperable!");
+ goto out;
+ }
+ }
+
ehea_destroy_busmap();
ret = ehea_create_busmap();
if (ret) {
-- Dave
^ permalink raw reply related
* Re: [PATCH] drivers/base: export gpl (un)register_memory_notifier
From: Dave Hansen @ 2008-02-11 16:50 UTC (permalink / raw)
To: Jan-Bernd Themann
Cc: Themann, Jan-Bernd, netdev, linux-kernel, Thomas Klein, linux-ppc,
Christoph Raisch, Greg KH
In-Reply-To: <200802111724.12416.ossthema@de.ibm.com>
On Mon, 2008-02-11 at 17:24 +0100, Jan-Bernd Themann wrote:
> Drivers like eHEA need memory notifiers in order to
> update their internal DMA memory map when memory is added
> to or removed from the system.
>
> Patch for eHEA memory hotplug support that uses these functions:
> http://www.spinics.net/lists/netdev/msg54484.html
>
> Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
How about you fix up the driver, first? Then, this can go in.
-- Dave
^ permalink raw reply
* Re: Could the DTS experts look at this?
From: Timur Tabi @ 2008-02-11 17:57 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200802100647.56590.arnd@arndb.de>
Arnd Bergmann wrote:
> Maybe we can introduce a more generic way of having conditional
> device nodes in the tree that get knocked out in the boot wrapper.
I've been thinking about doing just this for quite some time now. I've had a
few informal discussions without people about.
One idea is to allow attaching simple conditional expressions (like X is <, =,
or > than Y) to a node. It is the responsibility of the code that parses the
device tree to assign values to X and Y. For instance, they could be the names
of U-Boot environment variables. If the expression is false, then the node is
removed (or ignored) from the device tree. If it's true, then it's kept in.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* [PATCH] Xilinx: hwicap: cleanup
From: Stephen Neuendorffer @ 2008-02-11 18:24 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, git-dev, jirislaby, linux.kernel
In-Reply-To: <1202437061-12691-1-git-send-email-stephen.neuendorffer@xilinx.com>
Fix some missing __user tags and incorrect section tags.
Convert semaphores to mutexes.
Make probed_devices re-entrancy and error condition safe.
Fix some backwards memcpys.
Some other minor cleanups.
Use kerneldoc format.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
Grant, Since it appears that the driver will stay in as-is, here are
the updates against mainline, based on Jiri's comments.
---
drivers/char/xilinx_hwicap/buffer_icap.c | 80 ++++++++++----------
drivers/char/xilinx_hwicap/fifo_icap.c | 60 +++++++-------
drivers/char/xilinx_hwicap/xilinx_hwicap.c | 113 ++++++++++++++++------------
drivers/char/xilinx_hwicap/xilinx_hwicap.h | 24 +++---
4 files changed, 148 insertions(+), 129 deletions(-)
diff --git a/drivers/char/xilinx_hwicap/buffer_icap.c b/drivers/char/xilinx_hwicap/buffer_icap.c
index dfea2bd..2c5d17d 100644
--- a/drivers/char/xilinx_hwicap/buffer_icap.c
+++ b/drivers/char/xilinx_hwicap/buffer_icap.c
@@ -73,8 +73,8 @@
#define XHI_BUFFER_START 0
/**
- * buffer_icap_get_status: Get the contents of the status register.
- * @parameter base_address: is the base address of the device
+ * buffer_icap_get_status - Get the contents of the status register.
+ * @base_address: is the base address of the device
*
* The status register contains the ICAP status and the done bit.
*
@@ -94,9 +94,9 @@ static inline u32 buffer_icap_get_status(void __iomem *base_address)
}
/**
- * buffer_icap_get_bram: Reads data from the storage buffer bram.
- * @parameter base_address: contains the base address of the component.
- * @parameter offset: The word offset from which the data should be read.
+ * buffer_icap_get_bram - Reads data from the storage buffer bram.
+ * @base_address: contains the base address of the component.
+ * @offset: The word offset from which the data should be read.
*
* A bram is used as a configuration memory cache. One frame of data can
* be stored in this "storage buffer".
@@ -108,8 +108,8 @@ static inline u32 buffer_icap_get_bram(void __iomem *base_address,
}
/**
- * buffer_icap_busy: Return true if the icap device is busy
- * @parameter base_address: is the base address of the device
+ * buffer_icap_busy - Return true if the icap device is busy
+ * @base_address: is the base address of the device
*
* The queries the low order bit of the status register, which
* indicates whether the current configuration or readback operation
@@ -121,8 +121,8 @@ static inline bool buffer_icap_busy(void __iomem *base_address)
}
/**
- * buffer_icap_busy: Return true if the icap device is not busy
- * @parameter base_address: is the base address of the device
+ * buffer_icap_busy - Return true if the icap device is not busy
+ * @base_address: is the base address of the device
*
* The queries the low order bit of the status register, which
* indicates whether the current configuration or readback operation
@@ -134,9 +134,9 @@ static inline bool buffer_icap_done(void __iomem *base_address)
}
/**
- * buffer_icap_set_size: Set the size register.
- * @parameter base_address: is the base address of the device
- * @parameter data: The size in bytes.
+ * buffer_icap_set_size - Set the size register.
+ * @base_address: is the base address of the device
+ * @data: The size in bytes.
*
* The size register holds the number of 8 bit bytes to transfer between
* bram and the icap (or icap to bram).
@@ -148,9 +148,9 @@ static inline void buffer_icap_set_size(void __iomem *base_address,
}
/**
- * buffer_icap_mSetoffsetReg: Set the bram offset register.
- * @parameter base_address: contains the base address of the device.
- * @parameter data: is the value to be written to the data register.
+ * buffer_icap_mSetoffsetReg - Set the bram offset register.
+ * @base_address: contains the base address of the device.
+ * @data: is the value to be written to the data register.
*
* The bram offset register holds the starting bram address to transfer
* data from during configuration or write data to during readback.
@@ -162,9 +162,9 @@ static inline void buffer_icap_set_offset(void __iomem *base_address,
}
/**
- * buffer_icap_set_rnc: Set the RNC (Readback not Configure) register.
- * @parameter base_address: contains the base address of the device.
- * @parameter data: is the value to be written to the data register.
+ * buffer_icap_set_rnc - Set the RNC (Readback not Configure) register.
+ * @base_address: contains the base address of the device.
+ * @data: is the value to be written to the data register.
*
* The RNC register determines the direction of the data transfer. It
* controls whether a configuration or readback take place. Writing to
@@ -178,10 +178,10 @@ static inline void buffer_icap_set_rnc(void __iomem *base_address,
}
/**
- * buffer_icap_set_bram: Write data to the storage buffer bram.
- * @parameter base_address: contains the base address of the component.
- * @parameter offset: The word offset at which the data should be written.
- * @parameter data: The value to be written to the bram offset.
+ * buffer_icap_set_bram - Write data to the storage buffer bram.
+ * @base_address: contains the base address of the component.
+ * @offset: The word offset at which the data should be written.
+ * @data: The value to be written to the bram offset.
*
* A bram is used as a configuration memory cache. One frame of data can
* be stored in this "storage buffer".
@@ -193,10 +193,10 @@ static inline void buffer_icap_set_bram(void __iomem *base_address,
}
/**
- * buffer_icap_device_read: Transfer bytes from ICAP to the storage buffer.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter offset: The storage buffer start address.
- * @parameter count: The number of words (32 bit) to read from the
+ * buffer_icap_device_read - Transfer bytes from ICAP to the storage buffer.
+ * @drvdata: a pointer to the drvdata.
+ * @offset: The storage buffer start address.
+ * @count: The number of words (32 bit) to read from the
* device (ICAP).
**/
static int buffer_icap_device_read(struct hwicap_drvdata *drvdata,
@@ -227,10 +227,10 @@ static int buffer_icap_device_read(struct hwicap_drvdata *drvdata,
};
/**
- * buffer_icap_device_write: Transfer bytes from ICAP to the storage buffer.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter offset: The storage buffer start address.
- * @parameter count: The number of words (32 bit) to read from the
+ * buffer_icap_device_write - Transfer bytes from ICAP to the storage buffer.
+ * @drvdata: a pointer to the drvdata.
+ * @offset: The storage buffer start address.
+ * @count: The number of words (32 bit) to read from the
* device (ICAP).
**/
static int buffer_icap_device_write(struct hwicap_drvdata *drvdata,
@@ -261,8 +261,8 @@ static int buffer_icap_device_write(struct hwicap_drvdata *drvdata,
};
/**
- * buffer_icap_reset: Reset the logic of the icap device.
- * @parameter drvdata: a pointer to the drvdata.
+ * buffer_icap_reset - Reset the logic of the icap device.
+ * @drvdata: a pointer to the drvdata.
*
* Writing to the status register resets the ICAP logic in an internal
* version of the core. For the version of the core published in EDK,
@@ -274,10 +274,10 @@ void buffer_icap_reset(struct hwicap_drvdata *drvdata)
}
/**
- * buffer_icap_set_configuration: Load a partial bitstream from system memory.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter data: Kernel address of the partial bitstream.
- * @parameter size: the size of the partial bitstream in 32 bit words.
+ * buffer_icap_set_configuration - Load a partial bitstream from system memory.
+ * @drvdata: a pointer to the drvdata.
+ * @data: Kernel address of the partial bitstream.
+ * @size: the size of the partial bitstream in 32 bit words.
**/
int buffer_icap_set_configuration(struct hwicap_drvdata *drvdata, u32 *data,
u32 size)
@@ -333,10 +333,10 @@ int buffer_icap_set_configuration(struct hwicap_drvdata *drvdata, u32 *data,
};
/**
- * buffer_icap_get_configuration: Read configuration data from the device.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter data: Address of the data representing the partial bitstream
- * @parameter size: the size of the partial bitstream in 32 bit words.
+ * buffer_icap_get_configuration - Read configuration data from the device.
+ * @drvdata: a pointer to the drvdata.
+ * @data: Address of the data representing the partial bitstream
+ * @size: the size of the partial bitstream in 32 bit words.
**/
int buffer_icap_get_configuration(struct hwicap_drvdata *drvdata, u32 *data,
u32 size)
diff --git a/drivers/char/xilinx_hwicap/fifo_icap.c b/drivers/char/xilinx_hwicap/fifo_icap.c
index 0988314..6f45dbd 100644
--- a/drivers/char/xilinx_hwicap/fifo_icap.c
+++ b/drivers/char/xilinx_hwicap/fifo_icap.c
@@ -94,9 +94,9 @@
/**
- * fifo_icap_fifo_write: Write data to the write FIFO.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter data: the 32-bit value to be written to the FIFO.
+ * fifo_icap_fifo_write - Write data to the write FIFO.
+ * @drvdata: a pointer to the drvdata.
+ * @data: the 32-bit value to be written to the FIFO.
*
* This function will silently fail if the fifo is full.
**/
@@ -108,8 +108,8 @@ static inline void fifo_icap_fifo_write(struct hwicap_drvdata *drvdata,
}
/**
- * fifo_icap_fifo_read: Read data from the Read FIFO.
- * @parameter drvdata: a pointer to the drvdata.
+ * fifo_icap_fifo_read - Read data from the Read FIFO.
+ * @drvdata: a pointer to the drvdata.
*
* This function will silently fail if the fifo is empty.
**/
@@ -121,9 +121,9 @@ static inline u32 fifo_icap_fifo_read(struct hwicap_drvdata *drvdata)
}
/**
- * fifo_icap_set_read_size: Set the the size register.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter data: the size of the following read transaction, in words.
+ * fifo_icap_set_read_size - Set the the size register.
+ * @drvdata: a pointer to the drvdata.
+ * @data: the size of the following read transaction, in words.
**/
static inline void fifo_icap_set_read_size(struct hwicap_drvdata *drvdata,
u32 data)
@@ -132,8 +132,8 @@ static inline void fifo_icap_set_read_size(struct hwicap_drvdata *drvdata,
}
/**
- * fifo_icap_start_config: Initiate a configuration (write) to the device.
- * @parameter drvdata: a pointer to the drvdata.
+ * fifo_icap_start_config - Initiate a configuration (write) to the device.
+ * @drvdata: a pointer to the drvdata.
**/
static inline void fifo_icap_start_config(struct hwicap_drvdata *drvdata)
{
@@ -142,8 +142,8 @@ static inline void fifo_icap_start_config(struct hwicap_drvdata *drvdata)
}
/**
- * fifo_icap_start_readback: Initiate a readback from the device.
- * @parameter drvdata: a pointer to the drvdata.
+ * fifo_icap_start_readback - Initiate a readback from the device.
+ * @drvdata: a pointer to the drvdata.
**/
static inline void fifo_icap_start_readback(struct hwicap_drvdata *drvdata)
{
@@ -152,8 +152,8 @@ static inline void fifo_icap_start_readback(struct hwicap_drvdata *drvdata)
}
/**
- * fifo_icap_busy: Return true if the ICAP is still processing a transaction.
- * @parameter drvdata: a pointer to the drvdata.
+ * fifo_icap_busy - Return true if the ICAP is still processing a transaction.
+ * @drvdata: a pointer to the drvdata.
**/
static inline u32 fifo_icap_busy(struct hwicap_drvdata *drvdata)
{
@@ -163,8 +163,8 @@ static inline u32 fifo_icap_busy(struct hwicap_drvdata *drvdata)
}
/**
- * fifo_icap_write_fifo_vacancy: Query the write fifo available space.
- * @parameter drvdata: a pointer to the drvdata.
+ * fifo_icap_write_fifo_vacancy - Query the write fifo available space.
+ * @drvdata: a pointer to the drvdata.
*
* Return the number of words that can be safely pushed into the write fifo.
**/
@@ -175,8 +175,8 @@ static inline u32 fifo_icap_write_fifo_vacancy(
}
/**
- * fifo_icap_read_fifo_occupancy: Query the read fifo available data.
- * @parameter drvdata: a pointer to the drvdata.
+ * fifo_icap_read_fifo_occupancy - Query the read fifo available data.
+ * @drvdata: a pointer to the drvdata.
*
* Return the number of words that can be safely read from the read fifo.
**/
@@ -187,11 +187,11 @@ static inline u32 fifo_icap_read_fifo_occupancy(
}
/**
- * fifo_icap_set_configuration: Send configuration data to the ICAP.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter frame_buffer: a pointer to the data to be written to the
+ * fifo_icap_set_configuration - Send configuration data to the ICAP.
+ * @drvdata: a pointer to the drvdata.
+ * @frame_buffer: a pointer to the data to be written to the
* ICAP device.
- * @parameter num_words: the number of words (32 bit) to write to the ICAP
+ * @num_words: the number of words (32 bit) to write to the ICAP
* device.
* This function writes the given user data to the Write FIFO in
@@ -266,10 +266,10 @@ int fifo_icap_set_configuration(struct hwicap_drvdata *drvdata,
}
/**
- * fifo_icap_get_configuration: Read configuration data from the device.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter data: Address of the data representing the partial bitstream
- * @parameter size: the size of the partial bitstream in 32 bit words.
+ * fifo_icap_get_configuration - Read configuration data from the device.
+ * @drvdata: a pointer to the drvdata.
+ * @data: Address of the data representing the partial bitstream
+ * @size: the size of the partial bitstream in 32 bit words.
*
* This function reads the specified number of words from the ICAP device in
* the polled mode.
@@ -335,8 +335,8 @@ int fifo_icap_get_configuration(struct hwicap_drvdata *drvdata,
}
/**
- * buffer_icap_reset: Reset the logic of the icap device.
- * @parameter drvdata: a pointer to the drvdata.
+ * buffer_icap_reset - Reset the logic of the icap device.
+ * @drvdata: a pointer to the drvdata.
*
* This function forces the software reset of the complete HWICAP device.
* All the registers will return to the default value and the FIFO is also
@@ -360,8 +360,8 @@ void fifo_icap_reset(struct hwicap_drvdata *drvdata)
}
/**
- * fifo_icap_flush_fifo: This function flushes the FIFOs in the device.
- * @parameter drvdata: a pointer to the drvdata.
+ * fifo_icap_flush_fifo - This function flushes the FIFOs in the device.
+ * @drvdata: a pointer to the drvdata.
*/
void fifo_icap_flush_fifo(struct hwicap_drvdata *drvdata)
{
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index 24f6aef..eddaa26 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -84,7 +84,7 @@
#include <linux/init.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
#include <linux/sysctl.h>
#include <linux/version.h>
#include <linux/fs.h>
@@ -119,6 +119,7 @@ module_param(xhwicap_minor, int, S_IRUGO);
/* An array, which is set to true when the device is registered. */
static bool probed_devices[HWICAP_DEVICES];
+static struct mutex icap_sem;
static struct class *icap_class;
@@ -199,14 +200,14 @@ static const struct config_registers v5_config_registers = {
};
/**
- * hwicap_command_desync: Send a DESYNC command to the ICAP port.
- * @parameter drvdata: a pointer to the drvdata.
+ * hwicap_command_desync - Send a DESYNC command to the ICAP port.
+ * @drvdata: a pointer to the drvdata.
*
* This command desynchronizes the ICAP After this command, a
* bitstream containing a NULL packet, followed by a SYNCH packet is
* required before the ICAP will recognize commands.
*/
-int hwicap_command_desync(struct hwicap_drvdata *drvdata)
+static int hwicap_command_desync(struct hwicap_drvdata *drvdata)
{
u32 buffer[4];
u32 index = 0;
@@ -228,14 +229,14 @@ int hwicap_command_desync(struct hwicap_drvdata *drvdata)
}
/**
- * hwicap_command_capture: Send a CAPTURE command to the ICAP port.
- * @parameter drvdata: a pointer to the drvdata.
+ * hwicap_command_capture - Send a CAPTURE command to the ICAP port.
+ * @drvdata: a pointer to the drvdata.
*
* This command captures all of the flip flop states so they will be
* available during readback. One can use this command instead of
* enabling the CAPTURE block in the design.
*/
-int hwicap_command_capture(struct hwicap_drvdata *drvdata)
+static int hwicap_command_capture(struct hwicap_drvdata *drvdata)
{
u32 buffer[7];
u32 index = 0;
@@ -252,7 +253,7 @@ int hwicap_command_capture(struct hwicap_drvdata *drvdata)
buffer[index++] = XHI_DUMMY_PACKET;
/*
- * Write the data to the FIFO and intiate the transfer of data
+ * Write the data to the FIFO and initiate the transfer of data
* present in the FIFO to the ICAP device.
*/
return drvdata->config->set_configuration(drvdata,
@@ -261,18 +262,18 @@ int hwicap_command_capture(struct hwicap_drvdata *drvdata)
}
/**
- * hwicap_get_configuration_register: Query a configuration register.
- * @parameter drvdata: a pointer to the drvdata.
- * @parameter reg: a constant which represents the configuration
+ * hwicap_get_configuration_register - Query a configuration register.
+ * @drvdata: a pointer to the drvdata.
+ * @reg: a constant which represents the configuration
* register value to be returned.
* Examples: XHI_IDCODE, XHI_FLR.
- * @parameter RegData: returns the value of the register.
+ * @reg_data: returns the value of the register.
*
* Sends a query packet to the ICAP and then receives the response.
* The icap is left in Synched state.
*/
-int hwicap_get_configuration_register(struct hwicap_drvdata *drvdata,
- u32 reg, u32 *RegData)
+static int hwicap_get_configuration_register(struct hwicap_drvdata *drvdata,
+ u32 reg, u32 *reg_data)
{
int status;
u32 buffer[6];
@@ -300,14 +301,14 @@ int hwicap_get_configuration_register(struct hwicap_drvdata *drvdata,
/*
* Read the configuration register
*/
- status = drvdata->config->get_configuration(drvdata, RegData, 1);
+ status = drvdata->config->get_configuration(drvdata, reg_data, 1);
if (status)
return status;
return 0;
}
-int hwicap_initialize_hwicap(struct hwicap_drvdata *drvdata)
+static int hwicap_initialize_hwicap(struct hwicap_drvdata *drvdata)
{
int status;
u32 idcode;
@@ -344,7 +345,7 @@ int hwicap_initialize_hwicap(struct hwicap_drvdata *drvdata)
}
static ssize_t
-hwicap_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+hwicap_read(struct file *file, __user char *buf, size_t count, loff_t *ppos)
{
struct hwicap_drvdata *drvdata = file->private_data;
ssize_t bytes_to_read = 0;
@@ -353,8 +354,9 @@ hwicap_read(struct file *file, char *buf, size_t count, loff_t *ppos)
u32 bytes_remaining;
int status;
- if (down_interruptible(&drvdata->sem))
- return -ERESTARTSYS;
+ status = mutex_lock_interruptible(&drvdata->sem);
+ if (status)
+ return status;
if (drvdata->read_buffer_in_use) {
/* If there are leftover bytes in the buffer, just */
@@ -370,8 +372,9 @@ hwicap_read(struct file *file, char *buf, size_t count, loff_t *ppos)
goto error;
}
drvdata->read_buffer_in_use -= bytes_to_read;
- memcpy(drvdata->read_buffer + bytes_to_read,
- drvdata->read_buffer, 4 - bytes_to_read);
+ memmove(drvdata->read_buffer,
+ drvdata->read_buffer + bytes_to_read,
+ 4 - bytes_to_read);
} else {
/* Get new data from the ICAP, and return was was requested. */
kbuf = (u32 *) get_zeroed_page(GFP_KERNEL);
@@ -414,18 +417,20 @@ hwicap_read(struct file *file, char *buf, size_t count, loff_t *ppos)
status = -EFAULT;
goto error;
}
- memcpy(kbuf, drvdata->read_buffer, bytes_remaining);
+ memcpy(drvdata->read_buffer,
+ kbuf,
+ bytes_remaining);
drvdata->read_buffer_in_use = bytes_remaining;
free_page((unsigned long)kbuf);
}
status = bytes_to_read;
error:
- up(&drvdata->sem);
+ mutex_unlock(&drvdata->sem);
return status;
}
static ssize_t
-hwicap_write(struct file *file, const char *buf,
+hwicap_write(struct file *file, const __user char *buf,
size_t count, loff_t *ppos)
{
struct hwicap_drvdata *drvdata = file->private_data;
@@ -435,8 +440,9 @@ hwicap_write(struct file *file, const char *buf,
ssize_t len;
ssize_t status;
- if (down_interruptible(&drvdata->sem))
- return -ERESTARTSYS;
+ status = mutex_lock_interruptible(&drvdata->sem);
+ if (status)
+ return status;
left += drvdata->write_buffer_in_use;
@@ -465,7 +471,7 @@ hwicap_write(struct file *file, const char *buf,
memcpy(kbuf, drvdata->write_buffer,
drvdata->write_buffer_in_use);
if (copy_from_user(
- (((char *)kbuf) + (drvdata->write_buffer_in_use)),
+ (((char *)kbuf) + drvdata->write_buffer_in_use),
buf + written,
len - (drvdata->write_buffer_in_use))) {
free_page((unsigned long)kbuf);
@@ -508,7 +514,7 @@ hwicap_write(struct file *file, const char *buf,
free_page((unsigned long)kbuf);
status = written;
error:
- up(&drvdata->sem);
+ mutex_unlock(&drvdata->sem);
return status;
}
@@ -519,8 +525,9 @@ static int hwicap_open(struct inode *inode, struct file *file)
drvdata = container_of(inode->i_cdev, struct hwicap_drvdata, cdev);
- if (down_interruptible(&drvdata->sem))
- return -ERESTARTSYS;
+ status = mutex_lock_interruptible(&drvdata->sem);
+ if (status)
+ return status;
if (drvdata->is_open) {
status = -EBUSY;
@@ -539,7 +546,7 @@ static int hwicap_open(struct inode *inode, struct file *file)
drvdata->is_open = 1;
error:
- up(&drvdata->sem);
+ mutex_unlock(&drvdata->sem);
return status;
}
@@ -549,8 +556,7 @@ static int hwicap_release(struct inode *inode, struct file *file)
int i;
int status = 0;
- if (down_interruptible(&drvdata->sem))
- return -ERESTARTSYS;
+ mutex_lock(&drvdata->sem);
if (drvdata->write_buffer_in_use) {
/* Flush write buffer. */
@@ -569,7 +575,7 @@ static int hwicap_release(struct inode *inode, struct file *file)
error:
drvdata->is_open = 0;
- up(&drvdata->sem);
+ mutex_unlock(&drvdata->sem);
return status;
}
@@ -592,31 +598,36 @@ static int __devinit hwicap_setup(struct device *dev, int id,
dev_info(dev, "Xilinx icap port driver\n");
+ mutex_lock(&icap_sem);
+
if (id < 0) {
for (id = 0; id < HWICAP_DEVICES; id++)
if (!probed_devices[id])
break;
}
if (id < 0 || id >= HWICAP_DEVICES) {
+ mutex_unlock(&icap_sem);
dev_err(dev, "%s%i too large\n", DRIVER_NAME, id);
return -EINVAL;
}
if (probed_devices[id]) {
+ mutex_unlock(&icap_sem);
dev_err(dev, "cannot assign to %s%i; it is already in use\n",
DRIVER_NAME, id);
return -EBUSY;
}
probed_devices[id] = 1;
+ mutex_unlock(&icap_sem);
devt = MKDEV(xhwicap_major, xhwicap_minor + id);
- drvdata = kmalloc(sizeof(struct hwicap_drvdata), GFP_KERNEL);
+ drvdata = kzalloc(sizeof(struct hwicap_drvdata), GFP_KERNEL);
if (!drvdata) {
dev_err(dev, "Couldn't allocate device private record\n");
- return -ENOMEM;
+ retval = -ENOMEM;
+ goto failed0;
}
- memset((void *)drvdata, 0, sizeof(struct hwicap_drvdata));
dev_set_drvdata(dev, (void *)drvdata);
if (!regs_res) {
@@ -648,7 +659,7 @@ static int __devinit hwicap_setup(struct device *dev, int id,
drvdata->config = config;
drvdata->config_regs = config_regs;
- init_MUTEX(&drvdata->sem);
+ mutex_init(&drvdata->sem);
drvdata->is_open = 0;
dev_info(dev, "ioremap %lx to %p with size %x\n",
@@ -663,7 +674,7 @@ static int __devinit hwicap_setup(struct device *dev, int id,
goto failed3;
}
/* devfs_mk_cdev(devt, S_IFCHR|S_IRUGO|S_IWUGO, DRIVER_NAME); */
- class_device_create(icap_class, NULL, devt, NULL, DRIVER_NAME);
+ device_create(icap_class, dev, devt, "%s%d", DRIVER_NAME, id);
return 0; /* success */
failed3:
@@ -675,6 +686,11 @@ static int __devinit hwicap_setup(struct device *dev, int id,
failed1:
kfree(drvdata);
+ failed0:
+ mutex_lock(&icap_sem);
+ probed_devices[id] = 0;
+ mutex_unlock(&icap_sem);
+
return retval;
}
@@ -699,14 +715,16 @@ static int __devexit hwicap_remove(struct device *dev)
if (!drvdata)
return 0;
- class_device_destroy(icap_class, drvdata->devt);
+ device_destroy(icap_class, drvdata->devt);
cdev_del(&drvdata->cdev);
iounmap(drvdata->base_address);
release_mem_region(drvdata->mem_start, drvdata->mem_size);
kfree(drvdata);
dev_set_drvdata(dev, NULL);
- probed_devices[MINOR(dev->devt)-xhwicap_minor] = 0;
+ mutex_lock(&icap_sem);
+ probed_devices[MINOR(dev->devt)-xhwicap_minor] = 0;
+ mutex_unlock(&icap_sem);
return 0; /* success */
}
@@ -821,28 +839,29 @@ static struct of_platform_driver hwicap_of_driver = {
};
/* Registration helpers to keep the number of #ifdefs to a minimum */
-static inline int __devinit hwicap_of_register(void)
+static inline int __init hwicap_of_register(void)
{
pr_debug("hwicap: calling of_register_platform_driver()\n");
return of_register_platform_driver(&hwicap_of_driver);
}
-static inline void __devexit hwicap_of_unregister(void)
+static inline void __exit hwicap_of_unregister(void)
{
of_unregister_platform_driver(&hwicap_of_driver);
}
#else /* CONFIG_OF */
/* CONFIG_OF not enabled; do nothing helpers */
-static inline int __devinit hwicap_of_register(void) { return 0; }
-static inline void __devexit hwicap_of_unregister(void) { }
+static inline int __init hwicap_of_register(void) { return 0; }
+static inline void __exit hwicap_of_unregister(void) { }
#endif /* CONFIG_OF */
-static int __devinit hwicap_module_init(void)
+static int __init hwicap_module_init(void)
{
dev_t devt;
int retval;
icap_class = class_create(THIS_MODULE, "xilinx_config");
+ mutex_init(&icap_sem);
if (xhwicap_major) {
devt = MKDEV(xhwicap_major, xhwicap_minor);
@@ -883,7 +902,7 @@ static int __devinit hwicap_module_init(void)
return retval;
}
-static void __devexit hwicap_module_cleanup(void)
+static void __exit hwicap_module_cleanup(void)
{
dev_t devt = MKDEV(xhwicap_major, xhwicap_minor);
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.h b/drivers/char/xilinx_hwicap/xilinx_hwicap.h
index ae771ca..eb8a827 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.h
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.h
@@ -48,9 +48,9 @@ struct hwicap_drvdata {
u8 write_buffer[4];
u32 read_buffer_in_use; /* Always in [0,3] */
u8 read_buffer[4];
- u32 mem_start; /* phys. address of the control registers */
- u32 mem_end; /* phys. address of the control registers */
- u32 mem_size;
+ resource_size_t mem_start;/* phys. address of the control registers */
+ resource_size_t mem_end; /* phys. address of the control registers */
+ resource_size_t mem_size;
void __iomem *base_address;/* virt. address of the control registers */
struct device *dev;
@@ -61,7 +61,7 @@ struct hwicap_drvdata {
const struct config_registers *config_regs;
void *private_data;
bool is_open;
- struct semaphore sem;
+ struct mutex sem;
};
struct hwicap_driver_config {
@@ -164,29 +164,29 @@ struct config_registers {
#define XHI_DISABLED_AUTO_CRC 0x0000DEFCUL
/**
- * hwicap_type_1_read: Generates a Type 1 read packet header.
- * @parameter: Register is the address of the register to be read back.
+ * hwicap_type_1_read - Generates a Type 1 read packet header.
+ * @register: is the address of the register to be read back.
*
* Generates a Type 1 read packet header, which is used to indirectly
* read registers in the configuration logic. This packet must then
* be sent through the icap device, and a return packet received with
* the information.
**/
-static inline u32 hwicap_type_1_read(u32 Register)
+static inline u32 hwicap_type_1_read(u32 register)
{
return (XHI_TYPE_1 << XHI_TYPE_SHIFT) |
- (Register << XHI_REGISTER_SHIFT) |
+ (register << XHI_REGISTER_SHIFT) |
(XHI_OP_READ << XHI_OP_SHIFT);
}
/**
- * hwicap_type_1_write: Generates a Type 1 write packet header
- * @parameter: Register is the address of the register to be read back.
+ * hwicap_type_1_write - Generates a Type 1 write packet header
+ * @register: is the address of the register to be read back.
**/
-static inline u32 hwicap_type_1_write(u32 Register)
+static inline u32 hwicap_type_1_write(u32 register)
{
return (XHI_TYPE_1 << XHI_TYPE_SHIFT) |
- (Register << XHI_REGISTER_SHIFT) |
+ (register << XHI_REGISTER_SHIFT) |
(XHI_OP_WRITE << XHI_OP_SHIFT);
}
--
1.5.3.4-dirty
^ permalink raw reply related
* Re: [PATCH 2/8] pseries: phyp dump: reserve-release proof-of-concept
From: Manish Ahuja @ 2008-02-11 18:29 UTC (permalink / raw)
To: Paul Mackerras
Cc: Manish Ahuja, ppc-dev, linasvepstas, Larry Kessler,
Michael Strosaker
In-Reply-To: <18346.21469.512910.93325@cargo.ozlabs.ibm.com>
Sorry,
I think i sent the wrong patch file, it shouldn't have my printk statement in there. Let me re-send
the correct file and let me test it once more to make sure it does the right thing.
-Manish
Paul Mackerras wrote:
> Manish Ahuja writes:
>
>> Initial patch for reserving memory in early boot, and freeing it later.
>> If the previous boot had ended with a crash, the reserved memory would contain
>> a copy of the crashed kernel data.
>
> [snip]
>
>> +static void __init reserve_crashed_mem(void)
>> +{
>> + unsigned long base, size;
>> +
>> + if (phyp_dump_info->phyp_dump_is_active) {
>> + /* Reserve *everything* above RMR. We'll free this real soon.*/
>> + base = PHYP_DUMP_RMR_END;
>> + size = lmb_end_of_DRAM() - base;
>> +
>> + /* XXX crashed_ram_end is wrong, since it may be beyond
>> + * the memory_limit, it will need to be adjusted. */
>> + lmb_reserve(base, size);
>> +
>> + phyp_dump_info->init_reserve_start = base;
>> + phyp_dump_info->init_reserve_size = size;
>> + }
>> + else {
>> + size = phyp_dump_info->cpu_state_size +
>> + phyp_dump_info->hpte_region_size +
>> + PHYP_DUMP_RMR_END;
>> + base = lmb_end_of_DRAM() - size;
>> + printk(KERN_ERR "Manish reserve regular kernel space is %ld %ld\n", base, size);
>> + lmb_reserve(base, size);
>
> This is still reserving memory even on systems that aren't running on
> pHyp at all. Please rework this so that no memory is reserved if the
> system doesn't support phyp-assisted dump.
>
> Paul.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox