Re: [RFC] [Patch] calgary iommu: Use the first kernel's tce tablesin kdump

From: Muli Ben-Yehuda
Date: Mon Jun 23 2008 - 15:29:44 EST


On Sat, Jun 21, 2008 at 05:41:43PM +0530, Chandru wrote:

> kdump kernel fails to boot with calgary iommu and aacraid driver on
> a x366 box. The ongoing dma's of aacraid from the first kernel
> continue to exist until the driver is loaded in the kdump
> kernel. Calgary is initialized prior to aacraid and creation of new
> tce tables causes wrong dma's to occur. Here we try to get the tce
> tables of the first kernel in kdump kernel and use them. While in
> the kdump kernel we do not allocate new tce tables but instead read
> the base address register contents of calgary iommu and use the
> tables that the registers point to. With these changes the kdump
> kernel and hence aacraid now boots normally.
>
> Signed-off-by: Chandru Siddalingappa <chandru@xxxxxxxxxx>

Hi Chandru,

I am not a big fan of this patch, but I guess it would do as a
stop-gap measure. However it is not appropriate for 2.6.26 and should
go in at the beginning of the 2.6.27 merge window. Also, minor
comments below.

> @@ -1206,9 +1213,14 @@ static int __init calgary_init(void)
> struct calgary_bus_info *info;
>
> ret = calgary_locate_bbars();
> +

unneeded whitespace

> @@ -1256,6 +1268,24 @@ error:
> return ret;
> }
>
> +
> +/*
> + * calgary_init_bitmap_from_tce_table():
> + * Funtion for kdump case. In the second/kdump kernel initialize
> + * the bitmap based on the tce table entries obtained from first kernel
> + */
> +static void calgary_init_bitmap_from_tce_table(struct iommu_table *tbl)
> +{
> + u64 *tp;
> + unsigned int index;
> + tp = ((u64 *)tbl->it_base);
> + for (index = 0 ; index < tbl->it_size; index++) {
> + if (*tp != 0x0)
> + set_bit(index, tbl->it_map);
> + tp++;
> + }

I think the code is correct, but the indentation is misleading. Please
fix.

> +}
> +
> static inline int __init determine_tce_table_size(u64 ram)
> {
> int ret;
> @@ -1318,6 +1348,8 @@ static int __init build_detail_arrays(vo
> return 0;
> }
>
> +
> +

unneeded whitespace.

Cheers,
Muli
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/