On Fri, 2012-05-04 at 04:53 +0100, Al Viro wrote:
> With the current mainline we end up oopsing in __scsi_alloc_queue(), since
> host->dma_dev is left NULL. I'm not sure if this is the right fix, but
> it gives the behaviour equivalent to what we used to have before
> commit 6f381fa344911d5a234b13574433cf23036f9467 ([SCSI] scsi_lib: use
> correct DMA device in __scsi_alloc_queue). And with that applied the
> damn thing appears to work correctly...
>
> Current mainline barfs on dma_set_seg_boundary(dev, shost->dma_boundary),
> since dev ends up being NULL. AFAICS, the same problem affects any
> driver that does scsi_add_host(host, NULL) and there are other such
> beasts as well, so they probably also need fixing...
>
> Again, I'm not sure that this is the right way to deal with that and I'd
> prefer to have it reviewed by SCSI folks before it goes into the tree.
>
> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> ---
> diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c
> index 331de72..fe2b4d0 100644
> --- a/arch/ia64/hp/sim/simscsi.c
> +++ b/arch/ia64/hp/sim/simscsi.c
> @@ -13,6 +13,7 @@
> #include <linux/interrupt.h>
> #include <linux/kernel.h>
> #include <linux/timer.h>
> +#include <linux/platform_device.h>
> #include <asm/irq.h>
> #include "hpsim_ssc.h"
>
> @@ -358,7 +359,7 @@ simscsi_init(void)
> if (!host)
> return -ENOMEM;
>
> - error = scsi_add_host(host, NULL);
> + error = scsi_add_host_with_dma(host, NULL, &platform_bus);
It's the right fix, but it's not general enough. This should make sure
none of the legacy bus devices oops:
James
---
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 351dc0b..a3a056a 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -218,6 +218,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
if (!shost->shost_gendev.parent)
shost->shost_gendev.parent = dev ? dev : &platform_bus;
+ if (!dma_dev)
+ dma_dev = shost->shost_gendev.parent;
+
shost->dma_dev = dma_dev;
error = device_add(&shost->shost_gendev);
��.n��������+%������w��{.n�����{������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f
[SCSI Target Devel]
[Linux SCSI Target Infrastructure]
[Kernel Newbies]
[Share Photos]
[IDE]
[Security]
[Git]
[Netfilter]
[Bugtraq]
[Photos]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Linux ATA RAID]
[Linux IIO]
[Samba]
[Video 4 Linux]
[Device Mapper]
[Linux Resources]