* [Qemu-devel] [PATCH] sii3112: Remove unneeded exit function
@ 2018-03-06 23:15 BALATON Zoltan
2018-03-07 2:23 ` David Gibson
0 siblings, 1 reply; 3+ messages in thread
From: BALATON Zoltan @ 2018-03-06 23:15 UTC (permalink / raw)
To: qemu-devel, qemu-ppc; +Cc: David Gibson, John Snow, Thomas Huth
An exit function was mistakenly left here but it's not needed because
the PCI bars are organised differently in this device. Calling this
exit function during device_del was causing an abort with
memory_region_del_subregion: `Assertion subregion->container == mr' failed.
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/ide/sii3112.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c
index e3896c6..743a50e 100644
--- a/hw/ide/sii3112.c
+++ b/hw/ide/sii3112.c
@@ -327,17 +327,6 @@ static void sii3112_pci_realize(PCIDevice *dev, Error **errp)
qemu_register_reset(sii3112_reset, s);
}
-static void sii3112_pci_exitfn(PCIDevice *dev)
-{
- PCIIDEState *d = PCI_IDE(dev);
- int i;
-
- for (i = 0; i < 2; ++i) {
- memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io);
- memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_ioport);
- }
-}
-
static void sii3112_pci_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -348,7 +337,6 @@ static void sii3112_pci_class_init(ObjectClass *klass, void *data)
pd->class_id = PCI_CLASS_STORAGE_RAID;
pd->revision = 1;
pd->realize = sii3112_pci_realize;
- pd->exit = sii3112_pci_exitfn;
dc->desc = "SiI3112A SATA controller";
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
}
--
2.7.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] sii3112: Remove unneeded exit function
2018-03-06 23:15 [Qemu-devel] [PATCH] sii3112: Remove unneeded exit function BALATON Zoltan
@ 2018-03-07 2:23 ` David Gibson
2018-03-07 2:40 ` John Snow
0 siblings, 1 reply; 3+ messages in thread
From: David Gibson @ 2018-03-07 2:23 UTC (permalink / raw)
To: BALATON Zoltan; +Cc: qemu-devel, qemu-ppc, John Snow, Thomas Huth
[-- Attachment #1: Type: text/plain, Size: 1867 bytes --]
On Wed, Mar 07, 2018 at 12:15:15AM +0100, BALATON Zoltan wrote:
> An exit function was mistakenly left here but it's not needed because
> the PCI bars are organised differently in this device. Calling this
> exit function during device_del was causing an abort with
> memory_region_del_subregion: `Assertion subregion->container == mr' failed.
>
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Applied to ppc-for-2.12, thanks.
> ---
> hw/ide/sii3112.c | 12 ------------
> 1 file changed, 12 deletions(-)
>
> diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c
> index e3896c6..743a50e 100644
> --- a/hw/ide/sii3112.c
> +++ b/hw/ide/sii3112.c
> @@ -327,17 +327,6 @@ static void sii3112_pci_realize(PCIDevice *dev, Error **errp)
> qemu_register_reset(sii3112_reset, s);
> }
>
> -static void sii3112_pci_exitfn(PCIDevice *dev)
> -{
> - PCIIDEState *d = PCI_IDE(dev);
> - int i;
> -
> - for (i = 0; i < 2; ++i) {
> - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io);
> - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_ioport);
> - }
> -}
> -
> static void sii3112_pci_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> @@ -348,7 +337,6 @@ static void sii3112_pci_class_init(ObjectClass *klass, void *data)
> pd->class_id = PCI_CLASS_STORAGE_RAID;
> pd->revision = 1;
> pd->realize = sii3112_pci_realize;
> - pd->exit = sii3112_pci_exitfn;
> dc->desc = "SiI3112A SATA controller";
> set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
> }
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] sii3112: Remove unneeded exit function
2018-03-07 2:23 ` David Gibson
@ 2018-03-07 2:40 ` John Snow
0 siblings, 0 replies; 3+ messages in thread
From: John Snow @ 2018-03-07 2:40 UTC (permalink / raw)
To: David Gibson, BALATON Zoltan; +Cc: qemu-devel, qemu-ppc, Thomas Huth
On 03/06/2018 09:23 PM, David Gibson wrote:
> On Wed, Mar 07, 2018 at 12:15:15AM +0100, BALATON Zoltan wrote:
>> An exit function was mistakenly left here but it's not needed because
>> the PCI bars are organised differently in this device. Calling this
>> exit function during device_del was causing an abort with
>> memory_region_del_subregion: `Assertion subregion->container == mr' failed.
>>
>> Reported-by: Thomas Huth <thuth@redhat.com>
>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>
> Applied to ppc-for-2.12, thanks.
>
Beat me to it, thanks! I'm a little distracted right now.
>> ---
>> hw/ide/sii3112.c | 12 ------------
>> 1 file changed, 12 deletions(-)
>>
>> diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c
>> index e3896c6..743a50e 100644
>> --- a/hw/ide/sii3112.c
>> +++ b/hw/ide/sii3112.c
>> @@ -327,17 +327,6 @@ static void sii3112_pci_realize(PCIDevice *dev, Error **errp)
>> qemu_register_reset(sii3112_reset, s);
>> }
>>
>> -static void sii3112_pci_exitfn(PCIDevice *dev)
>> -{
>> - PCIIDEState *d = PCI_IDE(dev);
>> - int i;
>> -
>> - for (i = 0; i < 2; ++i) {
>> - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io);
>> - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_ioport);
>> - }
>> -}
>> -
>> static void sii3112_pci_class_init(ObjectClass *klass, void *data)
>> {
>> DeviceClass *dc = DEVICE_CLASS(klass);
>> @@ -348,7 +337,6 @@ static void sii3112_pci_class_init(ObjectClass *klass, void *data)
>> pd->class_id = PCI_CLASS_STORAGE_RAID;
>> pd->revision = 1;
>> pd->realize = sii3112_pci_realize;
>> - pd->exit = sii3112_pci_exitfn;
>> dc->desc = "SiI3112A SATA controller";
>> set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
>> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-07 2:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06 23:15 [Qemu-devel] [PATCH] sii3112: Remove unneeded exit function BALATON Zoltan
2018-03-07 2:23 ` David Gibson
2018-03-07 2:40 ` John Snow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).