From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH] ahci: Unbreak bar registration (was: Re: [PATCH 05/10] ich/ahci: convert to pci_register_bar_simple())
Date: Sun, 08 May 2011 19:54:52 +0200 [thread overview]
Message-ID: <4DC6D8EC.9000605@web.de> (raw)
In-Reply-To: <1301930887-20705-6-git-send-email-avi@redhat.com>
On 2011-04-04 17:28, Avi Kivity wrote:
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
> hw/ide/ahci.c | 9 ---------
> hw/ide/ahci.h | 3 ---
> hw/ide/ich.c | 3 +--
> 3 files changed, 1 insertions(+), 14 deletions(-)
>
> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
> index 98bdf70..c6e0c77 100644
> --- a/hw/ide/ahci.c
> +++ b/hw/ide/ahci.c
> @@ -1129,15 +1129,6 @@ void ahci_uninit(AHCIState *s)
> qemu_free(s->dev);
> }
>
> -void ahci_pci_map(PCIDevice *pci_dev, int region_num,
> - pcibus_t addr, pcibus_t size, int type)
> -{
> - struct AHCIPCIState *d = (struct AHCIPCIState *)pci_dev;
> - AHCIState *s = &d->ahci;
> -
> - cpu_register_physical_memory(addr, size, s->mem);
> -}
> -
> void ahci_reset(void *opaque)
> {
> struct AHCIPCIState *d = opaque;
> diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h
> index a4560c4..dc86951 100644
> --- a/hw/ide/ahci.h
> +++ b/hw/ide/ahci.h
> @@ -325,9 +325,6 @@ typedef struct NCQFrame {
> void ahci_init(AHCIState *s, DeviceState *qdev, int ports);
> void ahci_uninit(AHCIState *s);
>
> -void ahci_pci_map(PCIDevice *pci_dev, int region_num,
> - pcibus_t addr, pcibus_t size, int type);
> -
> void ahci_reset(void *opaque);
>
> #endif /* HW_IDE_AHCI_H */
> diff --git a/hw/ide/ich.c b/hw/ide/ich.c
> index f242d7a..eb00f03 100644
> --- a/hw/ide/ich.c
> +++ b/hw/ide/ich.c
> @@ -95,8 +95,7 @@ static int pci_ich9_ahci_init(PCIDevice *dev)
> qemu_register_reset(ahci_reset, d);
>
> /* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */
> - pci_register_bar(&d->card, 5, 0x1000, PCI_BASE_ADDRESS_SPACE_MEMORY,
> - ahci_pci_map);
> + pci_register_bar_simple(&d->card, 5, 0x1000, 0, d->ahci.mem);
>
> msi_init(dev, 0x50, 1, true, false);
>
This breaks AHCI as ahci.mem is not initialized at this point. Fix
below.
Did you check the rest of your series regarding such issues?
Jan
-----------8<----------
From: Jan Kiszka <jan.kiszka@siemens.com>
Fix regression of 667bb59: ahci_init initializes ahci.mem, so we have to
move bar registration after it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/ide/ich.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index e44339b..6150ce3 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -93,14 +93,14 @@ static int pci_ich9_ahci_init(PCIDevice *dev)
qemu_register_reset(ahci_reset, d);
- /* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */
- pci_register_bar_simple(&d->card, 5, 0x1000, 0, d->ahci.mem);
-
msi_init(dev, 0x50, 1, true, false);
ahci_init(&d->ahci, &dev->qdev, 6);
d->ahci.irq = d->card.irq[0];
+ /* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */
+ pci_register_bar_simple(&d->card, 5, 0x1000, 0, d->ahci.mem);
+
return 0;
}
next prev parent reply other threads:[~2011-05-08 17:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 15:27 [Qemu-devel] [PATCH 00/10] pci: pci_register_bar_simple Avi Kivity
2011-04-04 15:27 ` [Qemu-devel] [PATCH 01/10] pci: add pci_register_bar_simple() API Avi Kivity
2011-04-04 15:27 ` [Qemu-devel] [PATCH 02/10] rtl8139: convert to pci_register_bar_simple() Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 03/10] cirrus-vga: " Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 04/10] eepro100: " Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 05/10] ich/ahci: " Avi Kivity
2011-05-08 17:54 ` Jan Kiszka [this message]
2011-04-04 15:28 ` [Qemu-devel] [PATCH 06/10] hda-intel: " Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 07/10] hda-intel: convert to pci_register_bar_simple() (partial) Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 08/10] pcnet-pci: convert to pci_register_bar_simple() Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 09/10] usb-ohci: " Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 10/10] wdt_i6300esb: " Avi Kivity
2011-04-04 15:59 ` [Qemu-devel] Re: [PATCH 00/10] pci: pci_register_bar_simple Michael S. Tsirkin
2011-04-04 16:01 ` Avi Kivity
2011-04-04 16:22 ` Anthony Liguori
2011-04-04 16:35 ` Avi Kivity
2011-04-04 17:02 ` Blue Swirl
2011-04-04 19:44 ` Michael S. Tsirkin
2011-04-04 21:05 ` Blue Swirl
2011-04-04 21:26 ` Michael S. Tsirkin
2011-04-05 18:02 ` Blue Swirl
2011-04-06 11:11 ` Michael S. Tsirkin
2011-04-05 7:39 ` Avi Kivity
2011-04-05 18:06 ` Blue Swirl
2011-04-06 7:39 ` Avi Kivity
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=4DC6D8EC.9000605@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).