* [PATCH] [IA64] Removed "task_size" element from thread_struct - it is now constant
@ 2012-05-01 23:05 Tony Luck
2012-05-04 3:53 ` [PATCH] simscsi breakage in __scsi_alloc_queue() Al Viro
0 siblings, 1 reply; 3+ messages in thread
From: Tony Luck @ 2012-05-01 23:05 UTC (permalink / raw)
To: linux-ia64
When the 32-bit compat code was deleted, we should also have removed
the task_size element from the thread structure - threads can only
be 64-bit now, so no need to keep track of how much virtual address
space each task can have ... everyone gets 0xa000000000000000.
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
arch/ia64/include/asm/processor.h | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h
index 483f6c6..a1e7022 100644
--- a/arch/ia64/include/asm/processor.h
+++ b/arch/ia64/include/asm/processor.h
@@ -34,8 +34,7 @@
* each (assuming 8KB page size), for a total of 8TB of user virtual
* address space.
*/
-#define TASK_SIZE_OF(tsk) ((tsk)->thread.task_size)
-#define TASK_SIZE TASK_SIZE_OF(current)
+#define TASK_SIZE DEFAULT_TASK_SIZE
/*
* This decides where the kernel will search for a free chunk of vm
@@ -280,7 +279,6 @@ struct thread_struct {
__u8 pad[3];
__u64 ksp; /* kernel stack pointer */
__u64 map_base; /* base address for get_unmapped_area() */
- __u64 task_size; /* limit for task size */
__u64 rbs_bot; /* the base address for the RBS */
int last_fph_cpu; /* CPU that may hold the contents of f32-f127 */
@@ -303,7 +301,6 @@ struct thread_struct {
.ksp = 0, \
.map_base = DEFAULT_MAP_BASE, \
.rbs_bot = STACK_TOP - DEFAULT_USER_STACK_SIZE, \
- .task_size = DEFAULT_TASK_SIZE, \
.last_fph_cpu = -1, \
INIT_THREAD_PM \
.dbr = {0, }, \
--
1.7.9.rc2.1.g69204
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] simscsi breakage in __scsi_alloc_queue()
2012-05-01 23:05 [PATCH] [IA64] Removed "task_size" element from thread_struct - it is now constant Tony Luck
@ 2012-05-04 3:53 ` Al Viro
2012-05-04 9:40 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2012-05-04 3:53 UTC (permalink / raw)
To: Tony Luck; +Cc: linux-scsi, James Bottomley, Lin Ming
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@zeniv.linux.org.uk>
---
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);
if (error)
goto free_host;
scsi_scan_host(host);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] simscsi breakage in __scsi_alloc_queue()
2012-05-04 3:53 ` [PATCH] simscsi breakage in __scsi_alloc_queue() Al Viro
@ 2012-05-04 9:40 ` James Bottomley
0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2012-05-04 9:40 UTC (permalink / raw)
To: Al Viro; +Cc: Tony Luck, linux-scsi@vger.kernel.org, Lin Ming
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@zeniv.linux.org.uk>
> ---
> 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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-04 9:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-01 23:05 [PATCH] [IA64] Removed "task_size" element from thread_struct - it is now constant Tony Luck
2012-05-04 3:53 ` [PATCH] simscsi breakage in __scsi_alloc_queue() Al Viro
2012-05-04 9:40 ` James Bottomley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.