[PATCH] drivers: Outsmarted by compilers. IDE detection with latest compiler fails.

8 views
Skip to first unread message

hcha...@xvisor-x86.org

unread,
May 13, 2022, 11:37:19 AM5/13/22
to xvisor...@googlegroups.com, Himanshu Chauhan
From: Himanshu Chauhan <hcha...@xvisor-x86.org>

This patch fixes the detection failure of PIIX3 IDE controllers.

Signed-off-by: Himanshu Chauhan <hcha...@xvisor-x86.org>
---
drivers/ide/host/piix3_ide.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/ide/host/piix3_ide.c b/drivers/ide/host/piix3_ide.c
index e9544f4c..7ae17e59 100644
--- a/drivers/ide/host/piix3_ide.c
+++ b/drivers/ide/host/piix3_ide.c
@@ -77,12 +77,14 @@ static int piix3_ide_probe(struct vmm_device *dev)
struct ide_host_controller *controller;
struct ide_drive *drive;
int i, j;
+ volatile int config_val;

for (j = 0; j < array_size(piix3_ide_devices); j++) {
/* send the parameters */
outl((1 << 31) | PIIX3_BDF(piix3_ide_devices[j]) | 8, 0xCF8);
+ config_val = inl(0xCFC);
/* If device exists class won't be 0xFFFF */
- if ((inl(0xCFC) >> 16) != 0xFFFF) {
+ if ((config_val >> 16) != 0xFFFF) {
vmm_printf("PIIX3: Found PIIX3 IDE Controller.\n");
controller =
vmm_zalloc(sizeof(struct ide_host_controller));
--
2.25.1

Himanshu Chauhan

unread,
May 19, 2022, 12:34:58 AM5/19/22
to xvisor...@googlegroups.com
On Fri, May 13, 2022 at 04:18:26PM +0530, hcha...@xvisor-x86.org wrote:
> From: Himanshu Chauhan <hcha...@xvisor-x86.org>
>
> This patch fixes the detection failure of PIIX3 IDE controllers.
>
> Signed-off-by: Himanshu Chauhan <hcha...@xvisor-x86.org>
> ---
> drivers/ide/host/piix3_ide.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
Anup, are you going to merge this to xvisor-next directly or shall I merge
to x86-next and raise a pull request later? How do you want to go with this?

Regards,
Himanshu

Anup Patel

unread,
May 19, 2022, 1:56:08 AM5/19/22
to Xvisor Devel
Applied this patch to the xvisor-next repo. Sorry for the delay.

Thanks,
Anup

>
> Regards,
> Himanshu
>
> --
> You received this message because you are subscribed to the Google Groups "Xvisor Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to xvisor-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/xvisor-devel/20220519043451.hgvl64flvmyhzczz%40sonar.
Reply all
Reply to author
Forward
0 new messages