All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Implementing branch attributes in git config
From: Martin Langhoff @ 2006-05-10  7:19 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: sean, junkio, Johannes.Schindelin, git
In-Reply-To: <Pine.LNX.4.64.0605091854380.3718@g5.osdl.org>

On 5/10/06, Linus Torvalds <torvalds@osdl.org> wrote:
> You _can_ be user-friendly and machine-parseable at the same time!

Good one. I'm following this thread with interest, but it feels we've
been attacked by the 'bike shed bug' in the act of redesigning
Windows.ini.

As an end-user, I have personally stayed away from the increasingly
complex scheme for remotes waiting for it to settle, and stuck with
the old-styled .git/branches stuff which is slam-dunk simple and it
just works.

The normal non-branch config options don't need any of this fancy
stuff. And I think the branches is reasonably well managed as files as
is done in .git/remotes which is trivial to work on with standard
shell commands. What I mean is that I can grep them trivially to ask
"how many remotes pull from server X" or from repo Y. Or via rsync.

Also -- repo config is tricky in the sense of scope. I want all my
"dev" repos of different projects on my laptop to have mostly the same
config but radically different remotes listings.

So... call me old-styled... but I'm happy with one-file-per-remote.
Was it broken to start with? Should we restart the track renames
flameway instead?

cheers,



martin

^ permalink raw reply

* Re: [PATCH] alloc_memory_early() routines
From: Pekka J Enberg @ 2006-05-10  7:16 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Mike Kravetz, Andrew Morton, Dave Hansen, Andy Whitcroft,
	linux-kernel
In-Reply-To: <Pine.LNX.4.64.0605100011090.3040@schroedinger.engr.sgi.com>

On Wed, 10 May 2006, Pekka Enberg wrote:
> > > +void * __init alloc_memory_early_node(size_t size, gfp_t flags, int node)
> > > +{
> > > +       if (g_cpucache_up == FULL)
> > > +               return kmalloc_node(size, flags, node);
> > > +       else
> > > +               return alloc_bootmem_node(NODE_DATA(node), size);
> > > +}
> > 
> > I'd prefer you put this in mm/bootmem.c and added a
> > 
> > int slab_is_available(void)
> > {
> >       return g_cpucache_up == FULL;
> > }
> > 
> > to mm/slab.c instead.

On Wed, 10 May 2006, Christoph Lameter wrote:
> Does slab not available mean that bootmem can be used? 

Yes.

					Pekka

^ permalink raw reply

* Re: sparc: cannot load any modules with 2.6.17-rc3
From: Jurij Smakov @ 2006-05-10  7:15 UTC (permalink / raw)
  To: sparclinux
In-Reply-To: <20060505113514.GA28863@palantir8>

On Tue, 9 May 2006, David S. Miller wrote:

> From: Martin Habets <errandir_news@mph.eclipse.co.uk>
> Date: Tue, 9 May 2006 22:27:22 +0100
>
>> Sadly, no. I can try to do some of the easier things, but fixing
>> something like the esp driver without the esp&dma datasheets is
>> beyond me I'm afraid :).
>
> http://en.wikipedia.org/wiki/NCR_53C9x
>
> The DMA programming manual is really not that necessary to
> understand the chip.

I've poked at this issue a little bit, without diving too deep. I've 
looked at the changes of the esp.c in the git kernel tree. There is one 
fairly recent change on 2006-02-22 [0], earlier changes are at least a 
year old. The diff for that commit is the following:

--- a/drivers/scsi/esp.c
+++ b/drivers/scsi/esp.c
@@ -2068,14 +2068,12 @@ static int esp_reset(struct scsi_cmnd *S
  {
  	struct esp *esp = (struct esp *) SCptr->device->host->hostdata;

+	spin_lock_irq(esp->ehost->host_lock);
  	(void) esp_do_resetbus(esp);
-
  	spin_unlock_irq(esp->ehost->host_lock);

  	wait_event(esp->reset_queue, (esp->resetting_bus = 0));

-	spin_lock_irq(esp->ehost->host_lock);
-
  	return SUCCESS;
  }

I have not nearly enough knowledge to tell whether that is correct, but 
the fact that in the previous version the function is left with the lock 
held and in the new one - without it, struck me as suspicious. I've tried 
reverting this change and the 2.6.16 kernel started working much more 
reliably for me, I haven't seen a DMA error with it yet. Unfortunately, 
other people who tested it (including Martin) reported that reverting this 
patch (or including it, if it was not present in the kernel) had little or 
no effect. Dave, it would be great that if you could confirm that this 
patch actually does what it's supposed to do, that would be a significant 
indication that the problem is not in esp.c.

I've recently built 2.6.16 and 2.6.17-rc3 kernels with Debian's gcc 
4.0.3-2, and they boot. Modules load fine. There is some kind of issue 
with the network, loading sunlance on my SS20 does not work every time. I 
haven't had a chance to investigate it in detail yet. Martin, you can 
fetch the "most stable for me" 2.6.16 kernel from [1].

[0] http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h¦ceda7457b2303dcb07d3c472b25d52bbdb5a29
[1] http://www.wooyd.org/debian/kernels

Best regards,

Jurij Smakov                                        jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/                   KeyID: C99E03CC

^ permalink raw reply

* [ALSA - driver 0002051]: USB control failure
From: bugtrack @ 2006-05-10  7:14 UTC (permalink / raw)
  To: alsa-devel


A NOTE has been added to this issue.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=2051> 
======================================================================
Reported By:                xatt
Assigned To:                
======================================================================
Project:                    ALSA - driver
Issue ID:                   2051
Category:                   USB - usb-audio
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Distribution:               
Kernel Version:             2.6.15
======================================================================
Date Submitted:             04-21-2006 14:55 CEST
Last Modified:              05-10-2006 09:14 CEST
======================================================================
Summary:                    USB control failure
Description: 
  Hi!
  I have Audigy 2 NX USB sound card and was trying to install it on my
Fedora Core5. The version of my kernel is 2.6.15. Recompiled it hundred
times :). All work with sound card ends up with message from kernel:

ALSA /root/ALSA/alsa-driver-1.0.11/usb/usbaudio.c:1330: 2:1:3:
usb_set_interface failed

  I thought that it was some other module blocking the USB control and
turned off all unnecessary options in kernel, but that doesn't seem to
help.
  I checked 'aplay -l' and /proc/asound, 

[root@ghostchaser ~]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NX [SB Audigy 2 NX], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

   Soundcard also detected in /proc/asound.

   I'm stumped around this problem and submit some additional
files.(kernel config, modprobe.conf, asound.conf)
======================================================================

----------------------------------------------------------------------
 xatt - 05-10-06 09:05 
----------------------------------------------------------------------
Sorry for too late answer, was training and just couldn't get to my working
place.
  File /proc/asound/card0/stream0   does not exist
  
  /proc/asound/card0 exists and has some info on sound card, but file
  /proc/asound/card0/audigy2nx has the following contents:

SB Audigy 2 NX jacks

dig in : ?
line in: ?
spk out: ?
hph out: ?

Tried:
[root@ghostchaser ~]# aplay -D plughw:0 /mnt/winD/mp3/cc/i_am.wav
Playing WAVE '/mnt/winD/mp3/cc/i_am.wav' : Signed 16 bit Little Endian,
Rate 22050 Hz, Mono
aplay: set_params:961: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 22050
PERIOD_TIME: 125000
PERIOD_SIZE: (2756 2757)
PERIOD_BYTES: (5512 5514)
PERIODS: (3 5)
BUFFER_TIME: 500000
BUFFER_SIZE: 11025
BUFFER_BYTES: 22050
TICK_TIME: 4000

----------------------------------------------------------------------
 xatt - 05-10-06 09:14 
----------------------------------------------------------------------
I put error return in usbaudio.c

        int my_res;
        /* set interface */
        if (subs->interface != fmt->iface || subs->format !=
fmt->altset_idx) {
                if ((my_res = usb_set_interface(dev, fmt->iface,
fmt->altsetting)) < 0) {
                        snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface
failed,err = %d\n",
                                   dev->devnum, fmt->iface,
fmt->altsetting,my_res);



This returns -71, now trying to identify error

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-21-06 14:55 xatt           New Issue                                    
04-21-06 14:55 xatt           File Added: config                           
04-21-06 14:55 xatt           Kernel Version            => 2.6.15          
04-21-06 15:17 xatt           Note Added: 0009412                          
04-21-06 17:09 Clemens LadischCategory                 CORE - control => USB -
usb-audio
04-21-06 17:13 Clemens LadischNote Added: 0009419                          
05-10-06 09:05 xatt           Note Added: 0009703                          
05-10-06 09:14 xatt           Note Added: 0009704                          
======================================================================




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply

* Re: analyze for the P1 bug 593(xensource bug tracker)
From: Keir Fraser @ 2006-05-10  7:13 UTC (permalink / raw)
  To: Han, Zhu; +Cc: Helix-vmm, xen-devel, Yu, Ke
In-Reply-To: <0EBFB99D260C5B40AC33E0F807B1AD660E08E2@pdsmsx411.ccr.corp.intel.com>


On 10 May 2006, at 07:26, Han, Zhu wrote:

> My question is:
> 1) Does this possible race condition exist?

It certainly sounds plausible to me!

> 2) Why does the code closing the loop device been put to another out of
> code workitem instead of finishing all work directly in
> blkback_remove()? Any operation in free_blkif() could be blocked? Which
> one?

Several are unsafe in interrupt context, for example:
  * unbind_from_irqhandler calls free_irq which can do procfs work
  * vbd_free calls blkdev_put which takes a semaphore and probably does 
a whole load of blocking operations
  * free_vm_area calls remove_vm_area which acquires a rw spinlock which 
is not interrupt safe

Correctness dictates that we should be withholding the upcall to user 
space until the deferred operations are complete. Perhaps you could try 
doing a wait_for_completion() in blkback_remove, immediately after the 
blkif_put(). This would then block until kicked by free_blkif().

I may try to put some code together myself if I have time. I suspect 
netback has a similar issue also (although of course the remove 
operation tends to be non-critical for net devices, so it won't usually 
matter!).

  -- Keir

^ permalink raw reply

* Re: [PATCH] alloc_memory_early() routines
From: Christoph Lameter @ 2006-05-10  7:11 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: Mike Kravetz, Andrew Morton, Dave Hansen, Andy Whitcroft,
	linux-kernel
In-Reply-To: <84144f020605100009i74824233ie6feaf6fd2d9055f@mail.gmail.com>

On Wed, 10 May 2006, Pekka Enberg wrote:

> > +void * __init alloc_memory_early_node(size_t size, gfp_t flags, int node)
> > +{
> > +       if (g_cpucache_up == FULL)
> > +               return kmalloc_node(size, flags, node);
> > +       else
> > +               return alloc_bootmem_node(NODE_DATA(node), size);
> > +}
> 
> I'd prefer you put this in mm/bootmem.c and added a
> 
> int slab_is_available(void)
> {
>       return g_cpucache_up == FULL;
> }
> 
> to mm/slab.c instead.

Does slab not available mean that bootmem can be used? 


^ permalink raw reply

* Re: [PATCH] alloc_memory_early() routines
From: Pekka Enberg @ 2006-05-10  7:09 UTC (permalink / raw)
  To: Mike Kravetz
  Cc: Andrew Morton, Dave Hansen, Christoph Lameter, Andy Whitcroft,
	linux-kernel
In-Reply-To: <20060509210722.GD3168@w-mikek2.ibm.com>

Hi Mike,

On 5/10/06, Mike Kravetz <kravetz@us.ibm.com> wrote:
> diff -Naupr linux-2.6.17-rc3-mm1/mm/slab.c linux-2.6.17-rc3-mm1.work3/mm/slab.c
> --- linux-2.6.17-rc3-mm1/mm/slab.c      2006-05-03 22:19:16.000000000 +0000
> +++ linux-2.6.17-rc3-mm1.work3/mm/slab.c        2006-05-09 21:38:23.000000000 +0000

[snip]

> +void * __init alloc_memory_early_node(size_t size, gfp_t flags, int node)
> +{
> +       if (g_cpucache_up == FULL)
> +               return kmalloc_node(size, flags, node);
> +       else
> +               return alloc_bootmem_node(NODE_DATA(node), size);
> +}

I'd prefer you put this in mm/bootmem.c and added a

int slab_is_available(void)
{
       return g_cpucache_up == FULL;
}

to mm/slab.c instead.

                                               Pekka

^ permalink raw reply

* Re: [PATCH] Define __raw_get_cpu_var and use it
From: Ingo Molnar @ 2006-05-10  7:09 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: akpm, linux-kernel, linux-arch
In-Reply-To: <17505.24133.491523.358882@cargo.ozlabs.ibm.com>


* Paul Mackerras <paulus@samba.org> wrote:

> There are several instances of per_cpu(foo, raw_smp_processor_id()), 
> which is semantically equivalent to __get_cpu_var(foo) but without the 
> warning that smp_processor_id() can give if CONFIG_DEBUG_PREEMPT is 
> enabled.  For those architectures with optimized per-cpu 
> implementations, namely ia64, powerpc, s390, sparc64 and x86_64, 
> per_cpu() turns into more and slower code than __get_cpu_var(), so it 
> would be preferable to use __get_cpu_var on those platforms.
> 
> This defines a __raw_get_cpu_var(x) macro which turns into per_cpu(x, 
> raw_smp_processor_id()) on architectures that use the generic per-cpu 
> implementation, and turns into __get_cpu_var(x) on the architectures 
> that have an optimized per-cpu implementation.
>     
> Signed-off-by: Paul Mackerras <paulus@samba.org>

i made the original raw_smp_processor_id() changes and i never liked the 
per_cpu() open-coding it introduced. Your patch solves this problem 
nicely.

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

^ permalink raw reply

* Re: [PATCH 7/8] aic94xx: remove queue implementation comment
From: Luben Tuikov @ 2006-05-10  7:09 UTC (permalink / raw)
  To: Alexis Bruemmer, linux-scsi
In-Reply-To: <1147210782.11847.65.camel@localhost.localdomain>

--- Alexis Bruemmer <alexisb@us.ibm.com> wrote:

> Remove the long queue implementation comment from sas_event.c that is no
> longer valid
> 
> Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>
> Signed-off-by: Mike Anderson <andmike@us.ibm.com>

Are you only removing this comment and leaving the rest of
the file as is, as the patch indicates?

Or has the rest of the file's contents changed?  Where is it?

 
> ---
>  drivers/scsi/sas/sas_event.c |   40 ----------------------------------------
>  1 files changed, 40 deletions(-)
> 
> Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_event.c
> ===================================================================
> --- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_event.c
> +++ aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_event.c
> @@ -22,46 +22,6 @@
>   *
>   */
>  
> -/**
> - * Implementation Of Priority Queue Without Duplication
> - * Luben Tuikov 2005/07/11
> - *
> - * The SAS class implements priority queue without duplication for
> - * handling ha/port/phy/discover events.  That is, we want to process
> - * the last N unique/non-duplicating events, in the order they arrived.
> - *
> - * The requirement is that insertion is O(1), and ordered removal is O(1).
> - *
> - * Suppose events are identified by integers.  Then what is required
> - * is that for a given sequence of any random integers R, to find a
> - * sorted sequence E, where
> - *     a) |E| <= |R|.  If the number of types of events is bounded,
> - *        then E is also bounded by that number, from b).
> - *     b) For all i and k, E[i] != E[k], except when i == k,
> - *        this gives us uniqueness/non duplication.
> - *     c) For all i < k, Order(E[i]) < Order(E[k]), this gives us
> - *        ordering.
> - *     d) If T(R) = E, then O(T) <= |R|, this ensures that insertion
> - *        is O(1), and ordered removal is O(1) trivially, since we
> - *        remove at the head of E.
> - *
> - * Example:
> - * If R = {4, 5, 1, 2, 5, 3, 3, 4, 4, 3, 1}, then
> - *    E = {2, 5, 4, 3, 1}.
> - *
> - * The algorithm, T, makes use of an array of list elements, indexed
> - * by event type, and an event list head which is a linked list of the
> - * elements of the array.  When the next event arrives, we index the
> - * array by the event, and add that event to the tail of the event
> - * list head, deleting it from its previous list position (if it had
> - * one).
> - *
> - * Clearly insertion is O(1).
> - *
> - * E is given by the elements of the event list, traversed from head
> - * to tail.
> - */
> -
>  #include <scsi/scsi_host.h>
>  #include "sas_internal.h"
>  #include "sas_dump.h"
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply

* Re: init (busybox) problem on OSK5912
From: Chetan Kapoor @ 2006-05-10  7:08 UTC (permalink / raw)
  To: linux-omap-open-source; +Cc: egallofin



^ permalink raw reply

* Re: [PATCH]x86_64 debug_stack nested patch
From: Jan Beulich @ 2006-05-10  7:08 UTC (permalink / raw)
  To: mao bibo; +Cc: Anil S Keshavamurthy, akpm, Andi Kleen, linux-kernel
In-Reply-To: <44618C0D.6020604@intel.com>

Would you mind explaining why you
- needed to replace the handling of the DEBUG_STKSZ > EXCEPTION_STKSZ in in_exception_stack()?
- used a hard coded 1 instead of (EXCEPTION_STACK_ORDER + 1) for defining DEBUG_STACK_ORDER?

Thanks, Jan

>>> "bibo,mao" <bibo.mao@intel.com> 10.05.06 08:45 >>>
hi,
In x86_64 platform, INT1 and INT3 trap stack is IST stack called 
DEBUG_STACK, when INT1/INT3 trap happens, system will switch to 
DEBUG_STACK by hardware. Current DEBUG_STACK size is 4K, when int1/int3 
trap happens, kernel will minus current DEBUG_STACK IST value by 4k. But 
if int3/int1 trap is nested, it will destroy other vector's IST stack.
This patch modifies this, it sets DEBUG_STACK size as 8K and allows two 
level of nested int1/int3 trap.
Kprobe DEBUG_STACK may be nested, because kprobe hanlder may be probed 
by other kprobes. This patch is against 2.6.17-rc3.

Signed-Off-By: bibo, mao <bibo.mao@intel.com>

Thanks
bibo,mao

^ permalink raw reply

* Re: [PATCH 6/8] aic94xx: move list_each_entry_reverse_safe from sas_discover.h to list.h
From: Luben Tuikov @ 2006-05-10  7:07 UTC (permalink / raw)
  To: Alexis Bruemmer, linux-scsi
In-Reply-To: <1147210621.11847.60.camel@localhost.localdomain>

Oh, BTW, the kernel already has that macro but the last two
words are swapped.  It is called:

list_for_each_entry_safe_reverse()

Your lk-2.6 base is too old.




--- Alexis Bruemmer <alexisb@us.ibm.com> wrote:

> Move list_each_entry_reverse_safe from sas_discover.h to the more
> appropriate file list.h
> 
> Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>
> Signed-off-by: Mike Anderson <andmike@us.ibm.com>
> 
> ---
>  include/linux/list.h            |    6 ++++++
>  include/scsi/sas/sas_discover.h |    7 -------
>  2 files changed, 6 insertions(+), 7 deletions(-)
> 
> Index: aic94xx-sas-2.6-patched/include/scsi/sas/sas_discover.h
> ===================================================================
> --- aic94xx-sas-2.6-patched.orig/include/scsi/sas/sas_discover.h
> +++ aic94xx-sas-2.6-patched/include/scsi/sas/sas_discover.h
> @@ -115,13 +115,6 @@ struct domain_device {
>  	void *lldd_dev;
>  };
>  
> -#define list_for_each_entry_reverse_safe(pos, n, head, member)		\
> -	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
> -		n = list_entry(pos->member.prev, typeof(*pos), member);	\
> -	     &pos->member != (head); 					\
> -	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
> -
> -
>  
>  void sas_init_disc(struct sas_discovery *disc, struct sas_port *port);
>  int  sas_discover_event(struct sas_port *sas_port, enum discover_event ev);
> Index: aic94xx-sas-2.6-patched/include/linux/list.h
> ===================================================================
> --- aic94xx-sas-2.6-patched.orig/include/linux/list.h
> +++ aic94xx-sas-2.6-patched/include/linux/list.h
> @@ -542,6 +542,12 @@ static inline void list_splice_init(stru
>  		prefetch(rcu_dereference((pos))->next), (pos) != (head); \
>          	(pos) = (pos)->next)
>  
> +#define list_for_each_entry_reverse_safe(pos, n, head, member)          \
> +	for (pos = list_entry((head)->prev, typeof(*pos), member),      \
> +		n = list_entry(pos->member.prev, typeof(*pos), member); \
> +		&pos->member != (head);                                    \
> +		pos = n, n = list_entry(n->member.prev, typeof(*n), member))
> +
>  /*
>   * Double linked lists with a single pointer list head.
>   * Mostly useful for hash tables where the two pointer list head is
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply

* Re: [PATCH] Fix console utf8 composing
From: Jan Engelhardt @ 2006-05-10  7:05 UTC (permalink / raw)
  To: Ingo Oeser; +Cc: Alexander E. Patrakov, LKML
In-Reply-To: <200605100131.02692.ioe-lkml@rameria.de>

>Just for the archive...
>
>On Tuesday, 9. May 2006 09:49, Alexander E. Patrakov wrote:
>> Both the current situation and my patch share the defect that an accent 
>> cannot be put on top of a multibyte character, such as Greek letter alpha.

With 80x25, that [almost] would not be possible either because of the 256 
character limit. Of course the concern is totally valid for fbterm.


Jan Engelhardt
-- 

^ permalink raw reply

* [ALSA - driver 0002051]: USB control failure
From: bugtrack @ 2006-05-10  7:05 UTC (permalink / raw)
  To: alsa-devel


A NOTE has been added to this issue.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=2051> 
======================================================================
Reported By:                xatt
Assigned To:                
======================================================================
Project:                    ALSA - driver
Issue ID:                   2051
Category:                   USB - usb-audio
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Distribution:               
Kernel Version:             2.6.15
======================================================================
Date Submitted:             04-21-2006 14:55 CEST
Last Modified:              05-10-2006 09:05 CEST
======================================================================
Summary:                    USB control failure
Description: 
  Hi!
  I have Audigy 2 NX USB sound card and was trying to install it on my
Fedora Core5. The version of my kernel is 2.6.15. Recompiled it hundred
times :). All work with sound card ends up with message from kernel:

ALSA /root/ALSA/alsa-driver-1.0.11/usb/usbaudio.c:1330: 2:1:3:
usb_set_interface failed

  I thought that it was some other module blocking the USB control and
turned off all unnecessary options in kernel, but that doesn't seem to
help.
  I checked 'aplay -l' and /proc/asound, 

[root@ghostchaser ~]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NX [SB Audigy 2 NX], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

   Soundcard also detected in /proc/asound.

   I'm stumped around this problem and submit some additional
files.(kernel config, modprobe.conf, asound.conf)
======================================================================

----------------------------------------------------------------------
 Clemens Ladisch - 04-21-06 17:13 
----------------------------------------------------------------------
What are the contents of /proc/asound/card0/stream0?

Does "aplay -D plughw:0 something.wav" work?

----------------------------------------------------------------------
 xatt - 05-10-06 09:05 
----------------------------------------------------------------------
Sorry for too late answer, was training and just couldn't get to my working
place.
  File /proc/asound/card0/stream0   does not exist
  
  /proc/asound/card0 exists and has some info on sound card, but file
  /proc/asound/card0/audigy2nx has the following contents:

SB Audigy 2 NX jacks

dig in : ?
line in: ?
spk out: ?
hph out: ?

Tried:
[root@ghostchaser ~]# aplay -D plughw:0 /mnt/winD/mp3/cc/i_am.wav
Playing WAVE '/mnt/winD/mp3/cc/i_am.wav' : Signed 16 bit Little Endian,
Rate 22050 Hz, Mono
aplay: set_params:961: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 22050
PERIOD_TIME: 125000
PERIOD_SIZE: (2756 2757)
PERIOD_BYTES: (5512 5514)
PERIODS: (3 5)
BUFFER_TIME: 500000
BUFFER_SIZE: 11025
BUFFER_BYTES: 22050
TICK_TIME: 4000

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-21-06 14:55 xatt           New Issue                                    
04-21-06 14:55 xatt           File Added: config                           
04-21-06 14:55 xatt           Kernel Version            => 2.6.15          
04-21-06 15:17 xatt           Note Added: 0009412                          
04-21-06 17:09 Clemens LadischCategory                 CORE - control => USB -
usb-audio
04-21-06 17:13 Clemens LadischNote Added: 0009419                          
05-10-06 09:05 xatt           Note Added: 0009703                          
======================================================================




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply

* Urgent Reply Needed
From: Mrs.Kudarat Moosa @ 2006-05-10  7:01 UTC (permalink / raw)
  To: linux-raid

From:Mrs Kudarat Moosa. 
Attn:The Managing Director 
Before I proceed, may I humbly introduce myself to your goodself, My Name is Mrs. Kudarat Moosa, an Iraqi refugee ,my husband was until recently, one of the personal aid to the president of Iraq who was formerly overthrown out of power by American Government . 
Prior to this last serious crisis that is still ravaging in my country,which recently led to misfortune of our government and my late husband position as the personal aid to the president, ,We inherited the sum of US$16 million.The funds were originally gotten from my late husband proceeds. My late husband was able to safe guard the fund with a very good diplomatic contact from my Country and deposited it in thailand. . 
I have decided to contact you because I am interested in investing in your country which is investment friendly. Please kindly guide and assist me in making the right investment since I am also interested in buying a residential property as I will be moving with my only son Abdullah Moosa, in over there as soon as every thing regarding technical and logictics details is worked out and ascertained to our respective satisfaction. 
In view of your participation,I am ready to give you a good negotiable percentage for your assistance,or better still commit it into viable Joint venture projects with you.,be assured that you stand no risk of any kind as the funds belong to me and my only survived son Abdullah. As soon as I get your consent, we will quickly move this fund to your country for investment . 
However, upon your acceptance to work as my partner, you can contact me with my private e-mail for more details. 
, I strongly believe that associating with you to embark on this and other business ventures will derive a huge success here after, please include you private contact telephone number and private e-mail when replying.pls contact me in my private email at ..... 
Yours Sincerely. 
Mrs.Kudarat Moosa



^ permalink raw reply

* Re: [PATCH 6/8] aic94xx: move list_each_entry_reverse_safe from sas_discover.h to list.h
From: Luben Tuikov @ 2006-05-10  7:01 UTC (permalink / raw)
  To: Alexis Bruemmer, linux-scsi
In-Reply-To: <1147210621.11847.60.camel@localhost.localdomain>

--- Alexis Bruemmer <alexisb@us.ibm.com> wrote:

> Move list_each_entry_reverse_safe from sas_discover.h to the more
> appropriate file list.h
> 
> Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>
> Signed-off-by: Mike Anderson <andmike@us.ibm.com>

This isn't used anymore and will cause a bug in certain
circumstances as is evident from the rest of the code.

> 
> ---
>  include/linux/list.h            |    6 ++++++
>  include/scsi/sas/sas_discover.h |    7 -------
>  2 files changed, 6 insertions(+), 7 deletions(-)
> 
> Index: aic94xx-sas-2.6-patched/include/scsi/sas/sas_discover.h
> ===================================================================
> --- aic94xx-sas-2.6-patched.orig/include/scsi/sas/sas_discover.h
> +++ aic94xx-sas-2.6-patched/include/scsi/sas/sas_discover.h
> @@ -115,13 +115,6 @@ struct domain_device {
>  	void *lldd_dev;
>  };
>  
> -#define list_for_each_entry_reverse_safe(pos, n, head, member)		\
> -	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
> -		n = list_entry(pos->member.prev, typeof(*pos), member);	\
> -	     &pos->member != (head); 					\
> -	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
> -
> -
>  
>  void sas_init_disc(struct sas_discovery *disc, struct sas_port *port);
>  int  sas_discover_event(struct sas_port *sas_port, enum discover_event ev);
> Index: aic94xx-sas-2.6-patched/include/linux/list.h
> ===================================================================
> --- aic94xx-sas-2.6-patched.orig/include/linux/list.h
> +++ aic94xx-sas-2.6-patched/include/linux/list.h
> @@ -542,6 +542,12 @@ static inline void list_splice_init(stru
>  		prefetch(rcu_dereference((pos))->next), (pos) != (head); \
>          	(pos) = (pos)->next)
>  
> +#define list_for_each_entry_reverse_safe(pos, n, head, member)          \
> +	for (pos = list_entry((head)->prev, typeof(*pos), member),      \
> +		n = list_entry(pos->member.prev, typeof(*pos), member); \
> +		&pos->member != (head);                                    \
> +		pos = n, n = list_entry(n->member.prev, typeof(*n), member))
> +
>  /*
>   * Double linked lists with a single pointer list head.
>   * Mostly useful for hash tables where the two pointer list head is
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply

* Re: [PATCH 4/8] aic94xx:  remove expander_conf.c
From: Luben Tuikov @ 2006-05-10  6:56 UTC (permalink / raw)
  To: Alexis Bruemmer, linux-scsi
In-Reply-To: <1147210267.11847.51.camel@localhost.localdomain>

--- Alexis Bruemmer <alexisb@us.ibm.com> wrote:

> Remove expander_conf.c from the kernel tree
> 
> Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>
> Signed-off-by: Mike Anderson <andmike@us.ibm.com>

It is easy to delete files.  It is not easy to write them.

What is the immediate replacement for "expander_conf.c"?
I.e. what is the immediate replacement for a utility
which can address any expander on the domain and issue
SMP functions to it?

   Luben

> 
> ---
>  drivers/scsi/sas/expander_conf.c |  463 ---------------------------------------
>  drivers/scsi/sas/Makefile        |    2 
>  2 files changed, 465 deletions(-)
> 
> Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/Makefile
> ===================================================================
> --- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/Makefile
> +++ aic94xx-sas-2.6-patched/drivers/scsi/sas/Makefile
> @@ -26,8 +26,6 @@ ifeq ($(CONFIG_SCSI_SAS_DOMAIN_DEBUG),y)
>  	EXTRA_CFLAGS += -DSAS_DEBUG -g
>  endif
>  
> -clean-files += expander_conf
> -
>  obj-$(CONFIG_SCSI_SAS_DOMAIN_ATTRS) += scsi_transport_sas_domain.o
>  scsi_transport_sas_domain-y +=  sas_init.o     \
>  		sas_phy.o      \
> Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/expander_conf.c
> ===================================================================
> --- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/expander_conf.c
> +++ /dev/null
> @@ -1,463 +0,0 @@
> -/*
> - * Serial Attached SCSI (SAS) Expander communication user space program
> - *
> - * Copyright (C) 2005 Adaptec, Inc.  All rights reserved.
> - * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com>
> - *
> - * This file is licensed under GPLv2.
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License as
> - * published by the Free Software Foundation; either version 2 of the
> - * License, or (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful, but
> - * WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> - * General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> - *
> - * $Id: //depot/sas-class/expander_conf.c#7 $
> - */
> -
> -/* This is a simple program to show how to communicate with
> - * expander devices in a SAS domain.
> - *
> - * The process is simple:
> - * 1. Build the SMP frame you want to send. The format and layout
> - *    is described in the SAS spec.  Leave the CRC field equal 0.
> - * 2. Open the expander's SMP portal sysfs file in RW mode.
> - * 3. Write the frame you built in 1.
> - * 4. Read the amount of data you expect to receive for the frame you built.
> - *    If you receive different amount of data you expected to receive,
> - *    then there was some kind of error.
> - * All this process is shown in detail in the function do_smp_func()
> - * and its callers, below.
> - */
> -
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <unistd.h>
> -#include <stdio.h>
> -#include <string.h>
> -#include <string.h>
> -#include <errno.h>
> -#include <endian.h>
> -#include <byteswap.h>
> -#include <stdint.h>
> -#include <stdlib.h>
> -
> -#define LEFT_FIELD_SIZE 25
> -
> -#ifdef __LITTLE_ENDIAN
> -#define be64_to_cpu(_x)  __bswap_64(*(uint64_t *)(&(_x)))
> -#define be32_to_cpu(_x)  __bswap_32(*(uint32_t *)(&(_x)))
> -#define be16_to_cpu(_x)  __bswap_16(*(uint16_t *)(&(_x)))
> -#define cpu_to_be64(_x)  __bswap_64(*(uint64_t *)(&(_x)))
> -#define cpu_to_be32(_x)  __bswap_32(*(uint32_t *)(&(_x)))
> -#define cpu_to_be16(_x)  __bswap_16(*(uint16_t *)(&(_x)))
> -#else
> -#define be64_to_cpu(_x)  (_x)
> -#define be32_to_cpu(_x)  (_x)
> -#define be16_to_cpu(_x)  (_x)
> -#define cpu_to_be64(_x)  (_x)
> -#define cpu_to_be32(_x)  (_x)
> -#define cpu_to_be16(_x)  (_x)
> -#endif
> -
> -#define SAS_ADDR(_x) ((unsigned long long) be64_to_cpu(*(uint64_t *)(_x)))
> -#define SAS_ADDR_SIZE 8
> -
> -const char *prog;
> -
> -struct route_table_entry {
> -	int      disabled;
> -	uint8_t  routed_sas_addr[SAS_ADDR_SIZE];
> -};
> -
> -struct expander {
> -	int     num_phys;
> -	uint8_t *phy_attr;
> -	int     route_indexes;
> -};
> -
> -static int do_smp_func(char *smp_portal_name, void *smp_req, int smp_req_size,
> -		       void *smp_resp, int smp_resp_size)
> -{
> -	int fd;
> -	ssize_t res;
> -
> -	fd = open(smp_portal_name, O_RDWR);
> -	if (fd == -1) {
> -		printf("%s: opening %s: %s(%d)\n", prog, smp_portal_name,
> -		       strerror(errno), errno);
> -		return fd;
> -	}
> -
> -	res = write(fd, smp_req, smp_req_size);
> -	if (!res) {
> -		printf("%s: nothing could be written to %s\n", prog,
> -		       smp_portal_name);
> -		goto out_err;
> -	} else if (res == -1) {
> -		printf("%s: writing to %s: %s(%d)\n", prog, smp_portal_name,
> -		       strerror(errno), errno);
> -		goto out_err;
> -	}
> -
> -	res = read(fd, smp_resp, smp_resp_size);
> -	if (!res) {
> -		printf("%s: nothing could be read from %s\n", prog,
> -		       smp_portal_name);
> -		goto out_err;
> -	} else if (res == -1) {
> -		printf("%s: reading from %s: %s(%d)\n", prog, smp_portal_name,
> -		       strerror(errno), errno);
> -		goto out_err;
> -	}
> -	close(fd);
> -	return res;
> - out_err:
> -	close(fd);
> -	return -1;
> -}
> -
> -#define MI_REQ_SIZE   8
> -#define MI_RESP_SIZE 64
> -
> -static unsigned char mi_req[MI_REQ_SIZE] = { 0x40, 1, 0, };
> -static unsigned char mi_resp[MI_RESP_SIZE];
> -
> -#define MI_FIELD_SIZE 20
> -#define MI_PRINTS(a, b) printf("%*s %*s\n",LEFT_FIELD_SIZE,a,MI_FIELD_SIZE,b)
> -#define MI_PRINTD(a, b) printf("%*s %*u\n",LEFT_FIELD_SIZE,a,MI_FIELD_SIZE,b)
> -#define MI_PRINTA(a, b) printf("%*s %0*llx\n",LEFT_FIELD_SIZE,a,MI_FIELD_SIZE,b)
> -
> -static int mi_expander(char *smp_portal_name, struct expander *ex)
> -{
> -	int res;
> -
> -	res = do_smp_func(smp_portal_name, mi_req, MI_REQ_SIZE,
> -			  mi_resp, MI_RESP_SIZE);
> -	if (res == MI_RESP_SIZE && mi_resp[2] == 0) {
> -		char buf[20];
> -
> -		memcpy(buf, mi_resp+12, 8);
> -		buf[8] = 0;
> -		MI_PRINTS("Vendor:", buf);
> -
> -		memcpy(buf, mi_resp+20, 16);
> -		buf[16] = 0;
> -		MI_PRINTS("Product:", buf);
> -
> -		memcpy(buf, mi_resp+36, 4);
> -		buf[4] = 0;
> -		MI_PRINTS("Revision:", buf);
> -
> -		if (!(mi_resp[8] & 1))
> -			return 0;
> -
> -		memcpy(buf, mi_resp+40, 8);
> -		buf[8] = 0;
> -		MI_PRINTS("Component:", buf);
> -
> -		MI_PRINTD("Component ID:", be16_to_cpu(mi_resp[48]));
> -		MI_PRINTD("Component revision:", mi_resp[50]);
> -	}
> -	return 0;
> -}
> -
> -#define RG_REQ_SIZE   8
> -#define RG_RESP_SIZE 32
> -
> -static unsigned char rg_req[RG_REQ_SIZE] = { 0x40, 0, };
> -static unsigned char rg_resp[RG_RESP_SIZE];
> -
> -static int rg_expander(char *smp_portal_name, struct expander *ex)
> -{
> -	int res;
> -
> -	res = do_smp_func(smp_portal_name, rg_req, RG_REQ_SIZE, rg_resp,
> -			  RG_RESP_SIZE);
> -
> -	if (res == RG_RESP_SIZE && rg_resp[2] == 0) {
> -		MI_PRINTD("Expander Change Count:", be16_to_cpu(rg_resp[4]));
> -		MI_PRINTD("Expander Route Indexes:", be16_to_cpu(rg_resp[6]));
> -		ex->route_indexes = be16_to_cpu(rg_resp[6]);
> -		MI_PRINTD("Number of phys:", rg_resp[9]);
> -		ex->num_phys = rg_resp[9];
> -		MI_PRINTS("Configuring:", (rg_resp[10] & 2) ? "Yes" : "No");
> -		MI_PRINTS("Configurable route table:",
> -			  (rg_resp[10] & 1) ? "Yes" : "No");
> -		MI_PRINTA("Enclosure Logical Identifier:",
> -			  SAS_ADDR(rg_resp+12));
> -		ex->phy_attr = malloc(ex->num_phys * sizeof(*ex->phy_attr));
> -	}
> -	return 0;
> -}
> -
> -#define DISCOVER_REQ_SIZE  16
> -#define DISCOVER_RESP_SIZE 56
> -
> -static unsigned char disc_req[DISCOVER_REQ_SIZE] = {0x40, 0x10, 0, };
> -static unsigned char disc_resp[DISCOVER_RESP_SIZE];
> -
> -#define PHY_EEXIST 0x10
> -#define PHY_VACANT 0x16
> -
> -static const char *attached_dev_type[8] = {
> -	[0] = "none",
> -	[1] = "end device",
> -	[2] = "edge expander",
> -	[3] = "fanout expander",
> -	[4 ... 7] = "unknown",
> -};
> -
> -static const char *phy_link_rate[16] = {
> -	[0] = "unknown",
> -	[1] = "disabled",
> -	[2] = "phy reset problem",
> -	[3] = "spinup hold",
> -	[4] = "port selector",
> -	[5 ... 7] = "unknown",
> -	[8] = "G1 (1,5 Gb/s)",
> -	[9] = "G2 (3 GB/s)",
> -	[10 ... 15] = "Unknown",
> -};
> -
> -static const char *proto_table[8] = {
> -	"",
> -	"SMP", "STP", "STP|SMP", "SSP",
> -	"SSP|SMP", "SSP|STP", "SSP|STP|SMP",
> -};
> -
> -#define DIRECT_ROUTING      0
> -#define SUBTRACTIVE_ROUTING 1
> -#define TABLE_ROUTING       2
> -
> -static const char *routing_attr[8] = {
> -	[DIRECT_ROUTING] = "D",
> -	[SUBTRACTIVE_ROUTING] = "S",
> -	[TABLE_ROUTING] = "T",
> -	[3 ... 7] = "x",
> -};
> -
> -static const char *conn_type[0x80] = {
> -	[0] = "No information",
> -	[1] = "SAS external receptacle (i.e., SFF-8470)(see SAS-1.1)",
> -	[2] = "SAS external compact receptacle (i.e., SFF-8088)(see SAS-1.1)",
> -	[3 ... 0x0f ] = "External connector",
> -	[0x10] = "SAS internal wide plug (i.e., SFF-8484)(see SAS-1.1)",
> -	[0x11] = "SAS internal compact wide plug (i.e., SFF-8087)(see SAS-1.1)",
> -	[0x12 ... 0x1f] = "Internal wide connector",
> -	[0x20] = "SAS backplane receptacle (i.e., SFF-8482)(see SAS-1.1)",
> -	[0x21] = "SATA-style host plug (i.e., ATA/ATAPI-7 V3)(see SAS-1.1)",
> -	[0x22] = "SAS plug (i.e., SFF-8482)(see SAS-1.1)",
> -	[0x23] = "SATA device plug (i.e., ATA/ATAPI-7 V3)(see SAS-1.1)",
> -	[0x24 ... 0x2f] = "Internal connector to end device",
> -	[0x30 ... 0x6f] = "Unknown\n",
> -	[0x70 ... 0x7f] = "Vendor specific",
> -};
> -
> -static int discover_phy(char *smp_portal_name, int phy_id, struct expander *ex)
> -{
> -	int res;
> -	const char *dev_str;
> -
> -	disc_req[9] = phy_id;
> -
> -	res = do_smp_func(smp_portal_name, disc_req, DISCOVER_REQ_SIZE,
> -			  disc_resp, DISCOVER_RESP_SIZE);
> -
> -	if (res != DISCOVER_RESP_SIZE) {
> -		printf("%s: error disovering phy %d\n", prog, phy_id);
> -		goto out;
> -	}
> -	switch (disc_resp[2]) {
> -	case PHY_VACANT:
> -		printf("phy%02d: vacant\n", phy_id);
> -		goto out; break;
> -	case PHY_EEXIST:
> -		printf("phy%02d doesn't exist\n", phy_id);
> -		goto out; break;
> -	case 0:
> -		break;
> -	default:
> -		printf("phy%02d SMP function result: 0x%x\n",
> -		       phy_id, disc_resp[2]);
> -		goto out;
> -	}
> -
> -	printf("Phy%02d:%s    attached: %016llx:%02d    chg count:%02d\n",
> -	       phy_id, routing_attr[disc_resp[44] & 0x0F],
> -	       SAS_ADDR(disc_resp+24), disc_resp[32], disc_resp[42]);
> -
> -	if (ex->phy_attr)
> -		ex->phy_attr[phy_id] = disc_resp[44] & 0x0F;
> -
> -	if (disc_resp[14] & 1)
> -		dev_str = "SATA Host";
> -	else if (disc_resp[15] & 0x80)
> -		dev_str = "SATA Port Selector";
> -	else if (disc_resp[15] & 1)
> -		dev_str = "SATA device";
> -	else
> -		dev_str = attached_dev_type[(disc_resp[12] & 0x70) >> 4];
> -	printf(" Attached device: %15s    Link rate: %15s\n",
> -	       dev_str, phy_link_rate[disc_resp[13] & 0xf]);
> -
> -	printf(" Tproto: %15s    Iproto: %15s\n",
> -	       proto_table[(disc_resp[15] & 0xe) >> 1],
> -	       proto_table[(disc_resp[14] & 0xe) >> 1]);
> -
> -	printf(" Programmed MIN-MAX linkrate: %s - %s\n",
> -	       phy_link_rate[(disc_resp[40] & 0xF0)>>4],
> -	       phy_link_rate[(disc_resp[41] & 0xF0)>>4]);
> -
> -	printf(" Hardware   MIN-MAX linkrate: %s - %s\n",
> -	       phy_link_rate[(disc_resp[40] & 0x0F)],
> -	       phy_link_rate[(disc_resp[41] & 0x0F)]);
> -
> -	printf(" %s phy\n", (disc_resp[43] & 0x80) ? "Virtual" : "Physical");
> -	printf(" Partial pathway timeout value: %d microseconds\n",
> -	       disc_resp[43] & 0x0F);
> -
> -	printf(" Connector type: %s\n", conn_type[disc_resp[45] & 0x7F]);
> -	printf(" Connector element index: %d\n", disc_resp[46]);
> -	printf(" Connector physical link: %d\n", disc_resp[47]);
> -out:
> -	return 0;
> -}
> -
> -#define RPEL_REQ_SIZE  16
> -#define RPEL_RESP_SIZE 32
> -
> -static unsigned char rpel_req[RPEL_REQ_SIZE] = { 0x40, 0x11, 0, };
> -static unsigned char rpel_resp[RPEL_RESP_SIZE];
> -
> -static int report_phy_error_log(char *smp_portal_name, int phy_id)
> -{
> -	int res;
> -
> -	rpel_req[9] = phy_id;
> -
> -	res = do_smp_func(smp_portal_name, rpel_req, RPEL_REQ_SIZE,
> -			  rpel_resp, RPEL_RESP_SIZE);
> -	if (res != RPEL_RESP_SIZE) {
> -		printf("%s: error reading error log for phy %d (%d)\n",
> -		       prog, phy_id, res);
> -		goto out;
> -	}
> -	MI_PRINTD(" Invalid DW count:", be32_to_cpu(rpel_resp[12]));
> -	MI_PRINTD(" RD error count:", be32_to_cpu(rpel_resp[16]));
> -	MI_PRINTD(" DW sync loss count:", be32_to_cpu(rpel_resp[20]));
> -	MI_PRINTD(" Reset problem count:", be32_to_cpu(rpel_resp[24]));
> -out:
> -	return 0;
> -}
> -
> -#define RRI_REQ_SIZE  16
> -#define RRI_RESP_SIZE 44
> -
> -static unsigned char rri_req[RRI_REQ_SIZE] = { 0x40, 0x13, 0, };
> -static unsigned char rri_resp[RRI_RESP_SIZE];
> -
> -static int show_routing_table(char *smp_portal_name, int phy_id,
> -			      struct expander *ex)
> -{
> -	struct route_table_entry *rt;
> -	int res, i, last_non_zero = -1;
> -
> -	if (!ex->phy_attr || ex->phy_attr[phy_id] != TABLE_ROUTING)
> -		return 0;
> -
> -	rt = malloc(sizeof(struct route_table_entry)*ex->route_indexes);
> -	if (!rt)
> -		return 0;
> -
> -	rri_req[9] = phy_id;
> -
> -	for (i = 0; i < ex->route_indexes; i++) {
> -		*(uint16_t *)(rri_req+6) = cpu_to_be16(i);
> -		res = do_smp_func(smp_portal_name, rri_req, RRI_REQ_SIZE,
> -				  rri_resp, RRI_RESP_SIZE);
> -		if (res != RRI_RESP_SIZE) {
> -			printf("Error getting phy %d route index %d (%d)\n",
> -			       phy_id, i, res);
> -			goto out;
> -		}
> -		if (rri_resp[2] != 0)
> -			break;
> -		if (be16_to_cpu(rri_resp[6]) != i) {
> -			printf("Expander FW error for phy %d index %d\n",
> -			       phy_id, i);
> -			goto out;
> -		}
> -		rt[i].disabled = rri_resp[12] & 0x80 ? 1 : 0;
> -		memcpy(rt[i].routed_sas_addr, rri_resp+16, SAS_ADDR_SIZE);
> -		if (rt[i].routed_sas_addr[0])
> -			last_non_zero = i;
> -	}
> -	printf(" Routing Table\n");
> -	if (last_non_zero == -1)
> -		printf("  Empty (all zero)\n");
> -	else {
> -		for (i = 0; i <= last_non_zero; i++)
> -			printf("  %02d %8s %016llx\n",
> -			       i, rt[i].disabled ? "disabled" : "enabled",
> -			       SAS_ADDR(rt[i].routed_sas_addr));
> -	}
> -out:
> -	free(rt);
> -	return 0;
> -}
> -
> -static int discover_expander(char *smp_portal_name, struct expander *ex)
> -{
> -	int i;
> -
> -	for (i = 0; i < ex->num_phys; i++) {
> -		printf("\n");
> -		discover_phy(smp_portal_name, i, ex);
> -		report_phy_error_log(smp_portal_name, i);
> -		show_routing_table(smp_portal_name, i, ex);
> -	}
> -
> -	return 0;
> -}
> -
> -static void print_info(void)
> -{
> -	printf("%s <smp portal file>\n", prog);
> -	printf("\tWhere <smp portal file> is the binary attribute file of the"
> -	       "\n\texpander device in sysfs.\n");
> -}
> -
> -int main(int argc, char *argv[])
> -{
> -	prog = strrchr(argv[0], '/');
> -	if (prog)
> -		prog++;
> -	else
> -		prog = argv[0];
> -
> -	if (argc < 2) {
> -		print_info();
> -		return 0;
> -	} else {
> -		struct expander ex;
> -
> -		memset(&ex, 0, sizeof(ex));
> -
> -		mi_expander(argv[1], &ex);
> -		rg_expander(argv[1], &ex);
> -		discover_expander(argv[1], &ex);
> -		if (ex.phy_attr)
> -			free(ex.phy_attr);
> -	}
> -	return 0;
> -}
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply

* commit of [PATCH] Fix file lookup without ref
From: Suzanne Wood @ 2006-05-10  6:53 UTC (permalink / raw)
  To: dipankar; +Cc: linux-kernel, paulmck

Hello,
In studying proc_readfd() of fs/proc/base.c, I'd looked back
at the linux-2.5.60 version which was prior to the conversion
to RCU and noticed that rather than straight spin_lock() as 
introduced in this patch, proc_fd_link() and proc_lookupfd() 
used read_lock(&files->file_lock).  Similarly, for __do_SAK() 
in drivers/char/tty_io.c

Just thought it might be something to consider after seeing 
http://www.ussg.iu.edu/hypermail/linux/kernel/9801.0/0095.html

Thanks.
Suzanne

 > List:       git-commits-head
 > Subject:    [PATCH] Fix file lookup without ref
 > From:       Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
 > Date:       2006-04-19 17:00:12
 > 
 > commit ca99c1da080345e227cfb083c330a184d42e27f3
 > tree e417b4c456ae31dc1dde8027b6be44a1a9f19395
 > parent fb30d64568fd8f6a21afef987f11852a109723da
 > author Dipankar Sarma <dipankar@in.ibm.com> Wed, 19 Apr 2006 12:21:46 -0700
 > committer Linus Torvalds <torvalds@g5.osdl.org> Wed, 19 Apr 2006 23:13:51 -0700
 > 
 > [PATCH] Fix file lookup without ref
 > 
 > There are places in the kernel where we look up files in fd tables and
 > access the file structure without holding refereces to the file.  So, we
 > need special care to avoid the race between looking up files in the fd
 > table and tearing down of the file in another CPU.  Otherwise, one might
 > see a NULL f_dentry or such torn down version of the file.  This patch
 > fixes those special places where such a race may happen.
 > 
 > Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com>
 > Acked-by: "Paul E. McKenney" <paulmck@us.ibm.com>
 > Signed-off-by: Andrew Morton <akpm@osdl.org>
 > Signed-off-by: Linus Torvalds <torvalds@osdl.org>
 > 
 >  drivers/char/tty_io.c |    8 ++++++--
 >  fs/locks.c            |    9 +++++++--
 >  fs/proc/base.c        |   21 +++++++++++++++------
 >  3 files changed, 28 insertions(+), 10 deletions(-)
 > 
 > diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
 > index 841f0bd..f07637a 100644
 > --- a/drivers/char/tty_io.c
 > +++ b/drivers/char/tty_io.c
 > @@ -2723,7 +2723,11 @@ static void __do_SAK(void *arg)
 >  		}
 >  		task_lock(p);
 >  		if (p->files) {
 > -			rcu_read_lock();
 > +			/*
 > +			 * We don't take a ref to the file, so we must
 > +			 * hold ->file_lock instead.
 > +			 */
 > +			spin_lock(&p->files->file_lock);
 >  			fdt = files_fdtable(p->files);
 >  			for (i=0; i < fdt->max_fds; i++) {
 >  				filp = fcheck_files(p->files, i);
 > @@ -2738,7 +2742,7 @@ static void __do_SAK(void *arg)
 >  					break;
 >  				}
 >  			}
 > -			rcu_read_unlock();
 > +			spin_unlock(&p->files->file_lock);
 >  		}
 >  		task_unlock(p);
 >  	} while_each_thread(g, p);
 > diff --git a/fs/locks.c b/fs/locks.c
 > index dda83d6..efad798 100644
 > --- a/fs/locks.c
 > +++ b/fs/locks.c
 > @@ -2230,7 +2230,12 @@ void steal_locks(fl_owner_t from)
 >  
 >  	lock_kernel();
 >  	j = 0;
 > -	rcu_read_lock();
 > +
 > +	/*
 > +	 * We are not taking a ref to the file structures, so
 > +	 * we need to acquire ->file_lock.
 > +	 */
 > +	spin_lock(&files->file_lock);
 >  	fdt = files_fdtable(files);
 >  	for (;;) {
 >  		unsigned long set;
 > @@ -2248,7 +2253,7 @@ void steal_locks(fl_owner_t from)
 >  			set >>= 1;
 >  		}
 >  	}
 > -	rcu_read_unlock();
 > +	spin_unlock(&files->file_lock);
 >  	unlock_kernel();
 >  }
 >  EXPORT_SYMBOL(steal_locks);
 > diff --git a/fs/proc/base.c b/fs/proc/base.c
 > index a3a3eec..6cc77dc 100644
 > --- a/fs/proc/base.c
 > +++ b/fs/proc/base.c
 > @@ -297,16 +297,20 @@ static int proc_fd_link(struct inode *in
 >  
 >  	files = get_files_struct(task);
 >  	if (files) {
 > -		rcu_read_lock();
 > +		/*
 > +		 * We are not taking a ref to the file structure, so we must
 > +		 * hold ->file_lock.
 > +		 */
 > +		spin_lock(&files->file_lock);
 >  		file = fcheck_files(files, fd);
 >  		if (file) {
 >  			*mnt = mntget(file->f_vfsmnt);
 >  			*dentry = dget(file->f_dentry);
 > -			rcu_read_unlock();
 > +			spin_unlock(&files->file_lock);
 >  			put_files_struct(files);
 >  			return 0;
 >  		}
 > -		rcu_read_unlock();
 > +		spin_unlock(&files->file_lock);
 >  		put_files_struct(files);
 >  	}
 >  	return -ENOENT;
 > @@ -1523,7 +1527,12 @@ static struct dentry *proc_lookupfd(stru
 >  	if (!files)
 >  		goto out_unlock;
 >  	inode->i_mode = S_IFLNK;
 > -	rcu_read_lock();
 > +
 > +	/*
 > +	 * We are not taking a ref to the file structure, so we must
 > +	 * hold ->file_lock.
 > +	 */
 > +	spin_lock(&files->file_lock);
 >  	file = fcheck_files(files, fd);
 >  	if (!file)
 >  		goto out_unlock2;
 > @@ -1531,7 +1540,7 @@ static struct dentry *proc_lookupfd(stru
 >  		inode->i_mode |= S_IRUSR | S_IXUSR;
 >  	if (file->f_mode & 2)
 >  		inode->i_mode |= S_IWUSR | S_IXUSR;
 > -	rcu_read_unlock();
 > +	spin_unlock(&files->file_lock);
 >  	put_files_struct(files);
 >  	inode->i_op = &proc_pid_link_inode_operations;
 >  	inode->i_size = 64;
 > @@ -1541,7 +1550,7 @@ static struct dentry *proc_lookupfd(stru
 >  	return NULL;
 >  
 >  out_unlock2:
 > -	rcu_read_unlock();
 > +	spin_unlock(&files->file_lock);
 >  	put_files_struct(files);
 >  out_unlock:
 >  	iput(inode);
 > -

^ permalink raw reply

* Re: [PATCH 0/8] aic94xx: sas code clean-up
From: Luben Tuikov @ 2006-05-10  6:53 UTC (permalink / raw)
  To: Alexis Bruemmer, linux-scsi
In-Reply-To: <1147209211.11847.33.camel@localhost.localdomain>

--- Alexis Bruemmer <alexisb@us.ibm.com> wrote:
> These patches were created in response to the comments from this earlier
> email: 
> http://marc.theaimsgroup.com/?l=linux-scsi&m=114624643916659&w=2
> 
> First off, thank you Christoph for your comments.  I am working to
> address them, starting with the ones that are easiest to implement.
> Follows is a set of patches that address the following concerns:
> 
> 1) Move the sas readme to the Documents dir-- this still needs to be
> written so that it 'matches reality', but I want to merge the sas*.h

Which "reality" is this?  Christoph's?

Anyway, the SAS Stack has seen quite a lot of updates, more than I can
list here.  Some of them are
 - Error Recovery,
 - device lifetimes wholly dependent on kobject references,
 - SAS transport layer retries,
 - SAS 2.0 (as much as is available),
 - SAS domain consistency (pathways, port augmentation, route tables
   of augmented ports, etc, etc),
 - SAS versioning: the interconnect declares what SAS version it supports
   and this is what the SAS Stack drives.
 - etc, etc, etc.

The aic94xx driver has also seen changes:
 - versioning,
 - NCQ error handling,
 - bugfixes on recovery, TMFs, etc.

A SAT Layer (SATL) has also been added to the SAS Stack.  It conforms
to the SAT spec, and uses the SAS task infrastructure.  SATL supports
the interconnect SATA features: the interconnect declares the SATA features
it supports, SATL drives them and so configures SATA devices found on the
domain.  NCQ is naturally supported.  Other interesting features are
things like MODE SELECT and READ/WRITE LONG 10/16.  5 VPD pages.
Error recovery (NCQ as well).  All size-version of commands, i.e.
6/10/12/16 as are defined in the appropriate specs.

This is more or less an enterprise effort.

The version from which Bottomley started is old. In contrast it did
support hot-plugging as the announcement on lkml and lsml said.  Now
Bottomley is saying that "it [hotplug] still doesn't work".

I cannot imagine a customer wanting enterprise reliability,
quality and support (as well as technical know-how), to just use
the version you're pushing.

It just boggles my mind... seeing how much more complex storage
is becoming.

This is why I asked "which reality" in the beginning of this message.

Good luck to everyone,
       Luben

> files to libsas.h and sas.h first
> 2) Remove the sas_common.c file
> 3) Remove the //depot SCM comments
> 4) Remove the expander_conf.c from the kernel tree
> 5) Remove various inline functions
> 6) Move list_each_entry_reverse_safe from sas_discover.h to list.h
> 7) Remove the long queue implementation comment
> 8) Use bitops for setting and clearing bits
> 
> These patches are just a start and I will continue to address these
> issues.
> 
> Regards,
> 
> Alexis
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply

* Re: Re: [PATCH]: kexec: framework and i386
From: Kazuo Moriwaka @ 2006-05-10  6:50 UTC (permalink / raw)
  To: Ian Pratt
  Cc: Akio Takebe, Magnus Damm, xen-devel, Mark Williamson, horms-home
In-Reply-To: <b294a32a0605092349p7e17d043k68f3b4466407323@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1439 bytes --]

I forget attach the patch.

On 5/10/06, Kazuo Moriwaka <moriwaka@valinux.co.jp> wrote:
> Hi,
>
> I'll send a patch for dom0 image extract (from kdump) script.
>
> Update is..
> - get register values in dom0 context from kdump's ELF Core PT_NOTE header.
> - get cr3 register value in context info from vcpu.
> - now you can look vmlinux symbols from gdbserver-xen.
>
> Todo:
> - It support only single processor now.
> - ELF Core output.
>
> On 4/24/06, Kazuo Moriwaka <moriwaka@valinux.co.jp> wrote:
> > Hi,
> >
> > On 4/24/06, Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk> wrote:
> > > > When a panic occurs, Linux kexec jumps into the preloaded
> > > > kdump kernel (if any).  This kernel then reinitiases the
> > > > hardware, using its own device drivers and uses these to
> > > > write out the dump to disk.  ISTR that the dump format is
> > > > currently ELF, although I remember some talk on the Fastboot
> > > > ML about adding some extra headers to make OS debugging easier.
> > >
> > > Is Xen and the dom0 kernel dumped as as separate ELF cores?
> >
> > I'm working on clipping domain image from whole-machine dump for x86_32 now.
> > Now my prototype reads ELF core and write dom0 image.
> >
> > todo:
> > - Output format is not ELF core yet. Xen domain core image
> > format(works with gdbserverxen).
> > - register information is not work well.
>
> --
> Kazuo Moriwaka
>


--
Kazuo Moriwaka

[-- Attachment #2: dumpread.diff --]
[-- Type: text/x-patch, Size: 18944 bytes --]

diff -u -N dumpread.O/Arch.py dumpread/Arch.py
--- dumpread.O/Arch.py	2006-04-24 10:20:00.000000000 +0900
+++ dumpread/Arch.py	2006-05-10 15:15:12.000000000 +0900
@@ -1,11 +1,12 @@
 
 class Arch:
-    def __init__(self, name, page_shift, pt_format):
+    def __init__(self, name, page_shift=0, pt_format='', max_vcpu=0):
         self.name = name
         self.page_shift = page_shift
         self.page_size = 1 << page_shift
         self.pagemask = (1 << page_shift) - 1
         self.pt_format = pt_format
+        self.max_vcpu = max_vcpu
 
     def maddr_to_mfn(self, maddr):
         '''return mfn from maddr'''
@@ -25,9 +26,11 @@
 
 
 
-x86_32 = Arch('x86_32', 12, 'L')
-x86_64 = Arch('x86_64', 12, 'Q')
-ia64 = Arch('ia64', 14, 'Q')
+
+
+x86_32 = Arch('x86_32', page_shift=12, pt_format='L', max_vcpu=32)
+x86_64 = Arch('x86_64', page_shift=12, pt_format='Q', max_vcpu=32)
+ia64 = Arch('ia64', page_shift=14, pt_format='Q', max_vcpu=4)
 
 arch = {'x86_32': x86_32,
         'x86_64': x86_64,
diff -u -N dumpread.O/ElfCore.py dumpread/ElfCore.py
--- dumpread.O/ElfCore.py	2006-04-24 10:20:00.000000000 +0900
+++ dumpread/ElfCore.py	2006-05-10 15:15:12.000000000 +0900
@@ -1,6 +1,7 @@
 import os
 import re
 import CoreDump
+import Register
 
 command = 'LANG=C readelf -l %s' 
 
@@ -33,9 +34,10 @@
     def __init__(self, corefilename, arch):
         CoreDump.CoreDump.__init__(self, corefilename, arch)
         self.sections = self._read_sections()
+        self.filename = corefilename
         self.file = file(corefilename, 'r')
         if len(self.sections) == 0:
-            raise ValueError, 'section not found in ELF format'
+            raise ValueError, 'section isn\'t found'
     
     def _read_sections(self):
         '''
@@ -90,9 +92,16 @@
         
         pages = []
         for sec in self.sections:
-            start_mfn = self.arch.maddr_to_mfn(sec.maddr)
-            end_mfn = self.arch.maddr_to_mfn(sec.maddr + sec.memsize)
-            pages.append(range(start_mfn, end_mfn+1))
+            if sec.typename == 'LOAD':
+                start_mfn = self.arch.maddr_to_mfn(sec.maddr)
+                end_mfn = self.arch.maddr_to_mfn(sec.maddr + sec.memsize)
+                pages = pages + range(start_mfn, end_mfn+1)
         return pages
             
-            
+    def get_registers(self):
+        '''return Register'''
+        # XXX UniProcessor only
+        f = os.popen('LANG=C objdump -s -j .reg %s' % self.filename)
+        reg = Register.arch[self.arch.name]()
+        reg.fromElf(Register.read_objdump(f.read()))
+        return [reg]
diff -u -N dumpread.O/PageTable.py dumpread/PageTable.py
--- dumpread.O/PageTable.py	2006-04-24 10:20:00.000000000 +0900
+++ dumpread/PageTable.py	2006-05-10 15:15:12.000000000 +0900
@@ -20,8 +20,8 @@
         '''create new pagetable from addressed page mfn'''
         self.dump = dump        # CoreDump obj
         self.arch = dump.arch
-        self.pt = mfn           # mfn of l1 page table
-        self.l1 = self.read_l1(self.pt)
+        self.mfn = mfn           # mfn of l1 page table
+        self.l1 = self.read_l1(self.mfn)
         if self.arch.name != 'x86_32':
             raise NotImplementedError   # x86_32 only.
 
diff -u -N dumpread.O/Register.py dumpread/Register.py
--- dumpread.O/Register.py	1970-01-01 09:00:00.000000000 +0900
+++ dumpread/Register.py	2006-05-10 15:15:12.000000000 +0900
@@ -0,0 +1,211 @@
+#!/usr/bin/env python
+
+'''Convert register information between ELF and Xen '''
+import struct
+import re
+
+class Register(dict):
+    '''Register abstruction class'''
+
+    def __init__(self):
+        self.elffmt = ''
+        self.elfregs = ()
+        self.xenfmt = ''
+        self.xenregs = ()
+
+    def __repr__(self):
+        ret = ['{']
+        keys = self.keys()
+        keys.sort()
+        for key in keys:
+            ret.append(key)
+            ret.append(': %08x, ' % self[key])
+        ret.append('}')
+        return ''.join(ret)
+        
+    def fromString(self, fmt, names, regstring):
+        '''convert from string'''
+
+        regs = struct.unpack(fmt, regstring)
+        for key, val in zip(names, regs):
+            self[key] = val
+        return self
+
+    def fromElf(self, regstring):
+        '''convert from ELF context format'''
+        
+        return self.fromString(self.elffmt, self.elfregs, regstring)
+
+    def fromXen(self, regstring):
+        '''convert from Xen context format'''
+        
+        return self.fromString(self.xenfmt, self.xenregs, regstring)
+
+    def asString(self, fmt, names):
+        '''convert to string'''
+
+        regs = []
+        for regname in names:
+            if regname in self:
+                regs.append(self[regname])
+            else:
+                regs.append(0)
+        return struct.pack(fmt, *regs)
+
+    def asElf(self):
+        '''convert to ELF context format'''
+
+        return self.asString(self.elffmt, self.elfregs)
+        
+    def asXen(self):
+        '''convert to Xen context format'''
+
+        return self.asString(self.xenfmt, self.xenregs)
+
+
+
+class Register_x86_32(Register):
+    '''xs86_32 register info'''
+
+    def __init__(self):
+        Register.__init__(self)
+
+        # from: $(LINUX)/include/asm-i486/user.h
+        self.elffmt = 'LLLLLLLHHHHHHHHLLHHLLHH'
+        self.elfregs = ('ebx', 'ecx', 'edx', 'esi', 'edi', 'ebp', 'eax',
+                        'ds', '__ds', 'es', '__es',
+                        'fs', '__fs', 'gs', '__gs',
+                        'orig_eax', 'eip',
+                        'cs', '__cs',
+                        'eflags', 'esp',
+                        'ss', '__ss') 
+
+        # from: $(XEN)/xen/include/public/arch-x86_32.h
+        self.xenfmt = 'LLLLLLLHHLHBBLLHHHHHHHHHH'
+        self.xenregs = (
+            'ebx', 'ecx', 'edx', 'esi', 'edi', 'ebp', 'eax',
+            'error_code', 'entry_vector', 'eip', 'cs',
+            'saved_upcall_mask', '_pad0',
+            'eflags',
+            'esp',
+            'ss', '_pad1', 'es', '_pad2',
+            'ds', '_pad3', 'fs', '_pad4',
+            'gs', '_pad5',
+            )
+
+
+class Register_x86_64(Register):
+    '''xs86_64 register info'''
+    # XXX not used or tested yet
+
+    def __init__(self):
+        Register.__init__(self)
+
+        # from: $(LINUX)/include/asm-x86_64/user.h
+        self.elffmt = 'QQQQQQQQQQQQQQQQQQQQQQQQQQQ'
+        self.elfregs = (
+            'r15', 'r14', 'r13', 'r12', 
+            'rbp', 'rbx', 'r11', 'r10', 
+            'r9', 'r8', 'rax', 'rcx', 
+            'rdx', 'rsi', 'rdi', 'orig_rax', 
+            'rip', 'cs', 'eflags', 
+            'rsp', 'ss', 
+            'fs_base', 'gs_base', 
+            'ds', 'es', 'fs', 'gs') 
+
+        # from: $(XEN)/xen/include/public/arch-x86_32.h
+        self.xenfmt = 'QQQQQQQQQQQQQQQQQQQLLQHHBBBBQQHHHHHHHHHHHHHHHHHHHH'
+        self.xenregs = (
+            'r15', 'r14', 'r13', 'r12',
+            'rbp', 'rbx', 'r11', 'r10',
+            'r9', 'r8', 'rax', 'rcx',
+            'rdx', 'rsi', 'rdi',
+            'error_code',
+            'entry_vector',
+            'rip',
+            'cs', '_pad0',
+            'saved_upcall_mask', '_pad10', '_pad11', '_pad12',
+            'rflags',
+            'rsp',
+            'ss', '_pad20', '_pad21', '_pad22',
+            'es', '_pad30', '_pad31', '_pad32',
+            'ds', '_pad40', '_pad41', '_pad42',
+            'fs', '_pad50', '_pad51', '_pad52',
+            'gs', '_pad60', '_pad61', '_pad62',
+            )
+
+class Register_ia64(Register):
+    '''IA64 register info'''
+    
+    # XXX not used or tested yet
+    def __init__(self):
+        Register.__init__(self)
+
+        # from: $(LINUX)/include/asm-ia64/ptrace.h
+        self.elffmt = '44Q6Q'
+        self.elfregs = (
+            'b6', 'b7', 'ar_csd', 'ar_ssd',
+            'r8', 'r9', 'r10', 'r11', 
+            'cr_ipsr', 'cr_iip', 'cr_ifs',
+            'ar_unat', 'ar_pfs', 'ar_rsc', 'ar_rnat', 'ar_bspstore',
+            'pr', 'b0', 'loadrs',
+            'r1', 'r12',            
+            'r13', 'ar_fpsr', 'r15', 'r14', 'r2', 'r3', 'r16', 'r17', 'r18', 'r19', 'r20', 'r21', 'r22', 'r23',
+            'r24', 'r25', 'r26', 'r27',
+            'r28', 'r29', 'r30', 'r31', 'ar_ccv',
+            'f6a', 'f6b', 'f7a', 'f7b', 'f8a', 'f8b', 'f9a', 'f9b', 'f10a', 'f10b', 'f11a', 'f11b',
+            ) 
+
+        # from: $(XEN)/xen/include/public/arch-ia64.h
+        self.xenfmt = '44Q6Q6Q'
+        self.xenregs = self.elfregs + (
+            'r4',    'r5',    'r6',    'r7',    'eml_unat',    'rfi_pfs',
+            )
+
+
+
+def read_objdump(text):
+    '''read objdump -s output and return binary string'''
+
+    lines = text.split('\n')
+    dat = []
+    for line in lines:
+        m = re.search('^ [0-9a-f]+ (([0-9a-f]{8} ){1,4})', line)
+        if m:
+            nums = m.group(1)
+            for m in re.finditer('[0-9a-f][0-9a-f]', nums):
+                if m:
+                    c = chr(int(m.group(0), 16))
+                    dat.append(c)
+    return ''.join(dat)
+
+
+arch = {'x86_32': Register_x86_32,
+        'x86_64': Register_x86_64,
+        'ia64': Register_ia64,
+        }
+
+
+
+if __name__ == '__main__':
+    import pprint
+    # 'objdump -s -j .reg dumpfile'  output
+    instr = '''dump:     file format elf32-i386
+
+Contents of section .reg:
+ 0000 0022c8c0 00c0f4fb 01000000 00000000  ."..............
+ 0010 63000000 00000000 00000000 7b000000  c...........{...
+ 0020 7b000000 00000000 33000000 88ee5dc0  {.......3.....].
+ 0030 5af213c0 61000000 46020000 d8fed8c0  Z...a...F.......
+ 0040 69000000                             i...            
+'''
+    
+    regstring = read_objdump(instr)
+    reg = Register_x86_32()
+    reg.fromElf(regstring)
+    print 'ELF'
+    pprint.pprint(reg.asElf())
+    print 'Xen'
+    pprint.pprint(reg.asXen())
+    
+    pprint.pprint(reg)
diff -u -N dumpread.O/XenCore.py dumpread/XenCore.py
--- dumpread.O/XenCore.py	2006-04-24 10:20:00.000000000 +0900
+++ dumpread/XenCore.py	2006-05-10 15:15:12.000000000 +0900
@@ -4,7 +4,7 @@
 and their abstruct class XenCore
 '''
 
-
+import StringIO as StringIO
 import CoreDump
 import struct
 import array
@@ -12,6 +12,60 @@
 CORE_MAGIC = 0xF00FEBEDL
 HEADER_FORMAT = "LLLLLL"
 
+
+class XenContext:
+    def __init__(self, tree, context=''):
+        self.tree = tree
+        self.ctxt_size = tree.get_struct_size('vcpu_guest_context')
+        self.reg_offset = tree.calc_struct_member_offset('vcpu_guest_context', 'user_regs') 
+        self.reg_size =  tree.get_struct_size('cpu_user_regs') 
+        self.ctrlreg_offset = tree.calc_struct_member_offset('vcpu_guest_context', 'ctrlreg')
+        self.ctrlreg_size = struct.calcsize('L')
+        self.max_ctrlreg = 7            # 0-7
+
+        if context:
+            self.context = context
+        else:
+            self.context = "\x00" * self.ctxt_size
+
+        self.ctxtf = StringIO.StringIO(self.context)
+
+    def __str__(self):
+        return self.ctxtf.getvalue()
+
+    def clone(self):
+        return XenContext(self.tree, self.ctxtf.getvalue())
+        
+    def set_register(self, reg):
+        regstr = reg.asXen()
+
+        self.ctxtf.seek(self.reg_offset)
+        self.ctxtf.write(regstr)
+
+    def get_register(self, reg):
+        self.ctxtf.seek(self.reg_offset)
+        regstr = self.ctxtf.read(self.reg_size)
+        reg = Register.Register()
+        reg.fromXen(regstr)
+        return reg
+
+    def set_ctrlreg(self, num, val):
+        if num > self.max_ctrlreg or num < 0:
+            raise IndexError
+
+        regstr = struct.pack('L', val)
+        self.ctxtf.seek(self.ctrlreg_offset + self.ctrlreg_size * num)
+        self.ctxtf.write(regstr)
+        
+    def get_ctrlreg(self, num):
+        if num > self.max_ctrlreg or num < 0:
+            raise IndexError
+        
+        self.ctxtf.seek(self.ctrlreg_offset + self.ctrlreg_size * num)
+        regstr = self.ctxtf.read(regstr, self.ctrlreg_size)
+        return struct.unpack('L', regstr)
+
+        
 class XenCore(CoreDump.CoreDump):
     '''xen dump file abstract class'''
     def __init__(self, corefilename, arch):
@@ -24,7 +78,7 @@
         self.xch_index_offset = None    # pfn index offset
         self.xch_pages_offset = None    # page data offset
 
-        self.ctxt = ''                  # CPU contexts(as string)
+        self.ctxts = []                  # CPU contexts(as list of context obj)
         self.pages = []               # pfn index (as list of numbers)
         self.pageoffsetmap = {}         # mfn -> file offset hash
         self.file = None                # dump file itself
@@ -93,7 +147,7 @@
             raise ValueError, 'magic number is not valid in Xen core image format'
 
         self.file.seek(self.xch_ctxt_offset)
-        self.ctxt = self.file.read(self.xch_index_offset-self.xch_ctxt_offset)
+        self.ctxts = self.file.read(self.xch_index_offset-self.xch_ctxt_offset)
 
         pt_format = self.arch.pt_format * self.xch_nr_pages
         self.file.seek(self.xch_index_offset)
@@ -110,12 +164,23 @@
         XenCore.__init__(self, corefilename, arch)
         self.file = file(corefilename, 'r+')
 
-    def set_context(self, nr_vcpus, ctxt):
+    def set_context(self, nr_vcpus, ctxts):
         '''set CPU(s) num and contexts'''
         self.xch_nr_vcpus = nr_vcpus
-        self.ctxt = ''.join(ctxt)       # XXX may be align problem
+        self.ctxts = ctxts
         self.update_offsets()
 
+    def set_registers(self, regs):
+        '''set user registers'''
+
+        for i, reg in enumerate(regs):
+            self.ctxts[i].set_register(reg)
+            
+    def set_ctrlreg(self, num, val):
+        '''set all ctrlreg[num] as val'''
+        for ctxt in self.ctxts:
+            ctxt.set_ctrlreg(num, val)
+
     def set_nr_pages(self, nr_pages):
         '''set number of pages'''
 
@@ -126,7 +191,7 @@
         '''recalc header offset data.'''
 
         self.xch_ctxt_offset = struct.calcsize(HEADER_FORMAT)
-        self.xch_index_offset = (struct.calcsize(HEADER_FORMAT) + len("".join(self.ctxt)))
+        self.xch_index_offset = (struct.calcsize(HEADER_FORMAT) + len(''.join([str(ctxt) for ctxt in self.ctxts])))
         self.xch_pages_offset = self.arch.round_pgup(
             self.xch_index_offset + self.xch_nr_pages * struct.calcsize('L'))
         self._build_pageoffsetmap()
@@ -167,7 +232,7 @@
         self.file.write(header)
 
         self.file.seek(self.xch_ctxt_offset)
-        self.file.write(self.ctxt)
+        self.file.write(''.join([str(ctxt) for ctxt in self.ctxts]))
 
         self.file.seek(self.xch_index_offset)
         pageindex = array.array('L')
diff -u -N dumpread.O/dom0cut_x86_32.py dumpread/dom0cut_x86_32.py
--- dumpread.O/dom0cut_x86_32.py	2006-04-24 10:20:00.000000000 +0900
+++ dumpread/dom0cut_x86_32.py	2006-05-10 15:15:12.000000000 +0900
@@ -9,6 +9,7 @@
 import debug_info
 import os.path
 import array
+import struct
 from optparse import OptionParser
 import XenCore
 import ElfCore
@@ -55,6 +56,7 @@
         table_offset = self.tree.calc_struct_member_offset('vcpu', 'arch')
         table_offset += self.tree.calc_struct_member_offset('arch_vcpu', 'guest_table')
 
+
         # domain->vcpu[0]->arch.guest_table
         domain_vcpu = self.dump.read_struct(self.pt.v2m(domainp + vcpu_offset), 'L')[0]
         domain_pt_mfn = self.dump.read_struct(self.pt.v2m(domain_vcpu + table_offset), 'L')[0]
@@ -64,18 +66,26 @@
 
     def get_domain_context(self, domainp):
         '''get domain context informations'''
-        
-        # XXX UniProcessor only!! need SMP
+
         # domain->vcpu[0]
         vcpu_offset = self.tree.calc_struct_member_offset('domain', 'vcpu') # vcpu[0]
-        domain_vcpu = self.dump.read_struct(self.pt.v2m(domainp + vcpu_offset), 'L')[0]
+        domain_vcpus = [
+            self.dump.read_struct(self.pt.v2m(domainp +
+                                              vcpu_offset +
+                                              struct.calcsize(self.dump.arch.pt_format) * i),
+                                  'L')[0]
+            for i in range(self.dump.arch.max_vcpu)]
 
         # vcpu->arch.vcpu_guest_context
-        context_offset = self.tree.calc_struct_member_offset('vcpu', 'arch')
-        context_offset += self.tree.calc_struct_member_offset('arch_vcpu', 'guest_context')
-        context_size = self.tree.get_struct_size('vcpu_guest_context')
+        ctxt_offset = self.tree.calc_struct_member_offset('vcpu', 'arch')
+        ctxt_domain_offset = self.tree.calc_struct_member_offset('vcpu', 'domain')
+        ctxt_offset += self.tree.calc_struct_member_offset('arch_vcpu', 'guest_context')
+        ctxt_size = self.tree.get_struct_size('vcpu_guest_context')
 
-        return self.pt.load_data(domain_vcpu + context_offset, context_size)
+        ctxts = [XenCore.XenContext(self.tree, context=self.pt.load_data(vcpu + ctxt_offset, ctxt_size))
+                 for vcpu in domain_vcpus if vcpu != 0]
+        
+        return ctxts
 
 
 class DomainImage:
@@ -133,18 +143,22 @@
 
     xenimg = XenImage(dump, xensyms)
 
-    # get dom0 info
+    # get dom0 info from xen
     dom0p = xenimg.get_dom0p()
     dom0_pt = xenimg.get_domain_pt(dom0p)
     dom0context = xenimg.get_domain_context(dom0p)
 
-    # get dom0 image
+    # make dom0 image
     dom0img = DomainImage(dump, vmlinux, dom0_pt)
-    
+
     # set header info
-    outdump.set_context(1, dom0context)
-    outdump.set_nr_pages(dom0img.nr_pages)
+    outdump.set_context(len(dom0context), dom0context)
 
+    dom0regs = dump.get_registers()
+    outdump.set_registers(dom0regs)
+    outdump.set_ctrlreg(3, dom0img.pt.mfn * outdump.arch.page_size)
+
+    outdump.set_nr_pages(dom0img.nr_pages)
     pages = dom0img.need_pages()
     outdump.fetch_pages(dump, pages)
 
diff -u -N dumpread.O/dumpread.py dumpread/dumpread.py
--- dumpread.O/dumpread.py	2006-04-24 10:20:00.000000000 +0900
+++ dumpread/dumpread.py	2006-05-10 15:15:12.000000000 +0900
@@ -17,9 +17,32 @@
     'elf': ElfCore.ElfCoreReader,
     }
 
+def list2range(lst):
+    '''make iterator of ranges of contiguous numbers from a list of integers'''
+
+    tmplst = lst[:]
+    tmplst.sort()
+    ranges = []
+    start = tmplst[0]
+
+    currentrange = [start, start + 1]
+
+    for item in tmplst[1:]:
+        if currentrange[1] == item:
+            # contiguous
+            currentrange[1] += 1
+        else:
+            # new range start
+            yield tuple(currentrange)
+            currentrange = [item, item + 1]
+
+    # last range
+    yield tuple(currentrange)
+
 def print_range(dump):
     '''print page frame numbers'''
-    sys.stdout.write(str(dump.pages))
+    sys.stdout.write(str(list(list2range(dump.get_pagelist()))))
+    sys.stdout.write('\n')
 
 def print_page(dump, mfn):
     '''output raw page data'''

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply

* Re: Re: [PATCH]: kexec: framework and i386
From: Kazuo Moriwaka @ 2006-05-10  6:49 UTC (permalink / raw)
  To: Ian Pratt
  Cc: Akio Takebe, Magnus Damm, xen-devel, Mark Williamson, horms-home
In-Reply-To: <b294a32a0604231816i1be50586k9c788bf134f50b59@mail.gmail.com>

Hi,

I'll send a patch for dom0 image extract (from kdump) script.

Update is..
- get register values in dom0 context from kdump's ELF Core PT_NOTE header.
- get cr3 register value in context info from vcpu.
- now you can look vmlinux symbols from gdbserver-xen.

Todo:
- It support only single processor now.
- ELF Core output.

On 4/24/06, Kazuo Moriwaka <moriwaka@valinux.co.jp> wrote:
> Hi,
>
> On 4/24/06, Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk> wrote:
> > > When a panic occurs, Linux kexec jumps into the preloaded
> > > kdump kernel (if any).  This kernel then reinitiases the
> > > hardware, using its own device drivers and uses these to
> > > write out the dump to disk.  ISTR that the dump format is
> > > currently ELF, although I remember some talk on the Fastboot
> > > ML about adding some extra headers to make OS debugging easier.
> >
> > Is Xen and the dom0 kernel dumped as as separate ELF cores?
>
> I'm working on clipping domain image from whole-machine dump for x86_32 now.
> Now my prototype reads ELF core and write dom0 image.
>
> todo:
> - Output format is not ELF core yet. Xen domain core image
> format(works with gdbserverxen).
> - register information is not work well.

--
Kazuo Moriwaka

^ permalink raw reply

* Re: What's in git.git
From: Jakub Narebski @ 2006-05-10  6:48 UTC (permalink / raw)
  To: git
In-Reply-To: <7viroezi8s.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:

>   - built-in grep (me)
> 
>     I think this is also ready, even though it robs users from
>     having funky "grep" on their $PATH and invoke it.  Compared
>     to GNU grep, it lacks -P (pcre), -Z (NUL-terminated output),
>     -q (totally quiet), -z (NUL-terminated input), but all the
>     commonly used ones including -f (from file), -F (fixed), -w
>     (word regexp), -l/-L (files with/without match) and -n (line
>     number) are implemented.  The same "stop me or else" comment
>     applies.

If there would be possible to use external grep (like one can use external
diff), then lack of some options wouldn't matter.

-- 
Jakub Narebski
Warsaw, Poland

^ permalink raw reply

* nfs export from mount point with --bind ?
From: Steffen Kolbe @ 2006-05-10  6:47 UTC (permalink / raw)
  To: nfs

A server has mounted some luns (partitions) from a fc-storage to different
mount points in the system.
These are mounted for export via 'mount --bind' under an /export folder.
Is it possible to export only these /export folder via NFS or can I only 
export
every "sub mount point (= --bind) in /exports" with the NFS kernel server?

The user server can this, but he hangs some times (Debian AMD64). So I 
changed
to the kernel server whitch works stable. But he seems not to export 
folders
which are mounted via --bind under a "master export". If I mount these 
master
folder to a client, the folder is empty.

Is their a solutions or special option for this available?

Thanks
Steffen


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply

* [PATCH]x86_64 debug_stack nested patch
From: bibo,mao @ 2006-05-10  6:45 UTC (permalink / raw)
  To: akpm; +Cc: Andi Kleen, Jan Beulich, Keshavamurthy, Anil S, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 646 bytes --]

hi,
In x86_64 platform, INT1 and INT3 trap stack is IST stack called 
DEBUG_STACK, when INT1/INT3 trap happens, system will switch to 
DEBUG_STACK by hardware. Current DEBUG_STACK size is 4K, when int1/int3 
trap happens, kernel will minus current DEBUG_STACK IST value by 4k. But 
if int3/int1 trap is nested, it will destroy other vector's IST stack.
This patch modifies this, it sets DEBUG_STACK size as 8K and allows two 
level of nested int1/int3 trap.
Kprobe DEBUG_STACK may be nested, because kprobe hanlder may be probed 
by other kprobes. This patch is against 2.6.17-rc3.

Signed-Off-By: bibo, mao <bibo.mao@intel.com>

Thanks
bibo,mao

[-- Attachment #2: DEBUG_STACK_NEST.patch --]
[-- Type: text/x-patch, Size: 2213 bytes --]

diff -Nruap 2.6.17-rc3.org/arch/x86_64/kernel/traps.c 2.6.17-rc3/arch/x86_64/kernel/traps.c
--- 2.6.17-rc3.org/arch/x86_64/kernel/traps.c	2006-05-10 12:07:30.000000000 +0800
+++ 2.6.17-rc3/arch/x86_64/kernel/traps.c	2006-05-10 12:18:53.000000000 +0800
@@ -141,50 +141,24 @@ static unsigned long *in_exception_stack
 		[DOUBLEFAULT_STACK - 1] = "#DF",
 		[STACKFAULT_STACK - 1] = "#SS",
 		[MCE_STACK - 1] = "#MC",
-#if DEBUG_STKSZ > EXCEPTION_STKSZ
-		[N_EXCEPTION_STACKS ... N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]"
-#endif
 	};
-	unsigned k;
+	unsigned stack_size, end, k;
 
 	for (k = 0; k < N_EXCEPTION_STACKS; k++) {
-		unsigned long end;
-
-		switch (k + 1) {
-#if DEBUG_STKSZ > EXCEPTION_STKSZ
-		case DEBUG_STACK:
-			end = cpu_pda(cpu)->debugstack + DEBUG_STKSZ;
-			break;
-#endif
-		default:
-			end = per_cpu(init_tss, cpu).ist[k];
-			break;
-		}
+		end = per_cpu(init_tss, cpu).ist[k];
 		if (stack >= end)
 			continue;
-		if (stack >= end - EXCEPTION_STKSZ) {
+		if (k == (DEBUG_STACK - 1))
+			stack_size = DEBUG_STKSZ;
+		else stack_size = EXCEPTION_STKSZ;
+
+		if (stack >= end - stack_size) {
 			if (*usedp & (1U << k))
 				break;
 			*usedp |= 1U << k;
 			*idp = ids[k];
 			return (unsigned long *)end;
 		}
-#if DEBUG_STKSZ > EXCEPTION_STKSZ
-		if (k == DEBUG_STACK - 1 && stack >= end - DEBUG_STKSZ) {
-			unsigned j = N_EXCEPTION_STACKS - 1;
-
-			do {
-				++j;
-				end -= EXCEPTION_STKSZ;
-				ids[j][4] = '1' + (j - N_EXCEPTION_STACKS);
-			} while (stack < end - EXCEPTION_STKSZ);
-			if (*usedp & (1U << j))
-				break;
-			*usedp |= 1U << j;
-			*idp = ids[j];
-			return (unsigned long *)end;
-		}
-#endif
 	}
 	return NULL;
 }
diff -Nruap 2.6.17-rc3.org/include/asm-x86_64/page.h 2.6.17-rc3/include/asm-x86_64/page.h
--- 2.6.17-rc3.org/include/asm-x86_64/page.h	2006-05-10 12:07:18.000000000 +0800
+++ 2.6.17-rc3/include/asm-x86_64/page.h	2006-05-10 12:19:24.000000000 +0800
@@ -20,7 +20,7 @@
 #define EXCEPTION_STACK_ORDER 0
 #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
 
-#define DEBUG_STACK_ORDER EXCEPTION_STACK_ORDER
+#define DEBUG_STACK_ORDER 1
 #define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
 
 #define IRQSTACK_ORDER 2

^ permalink raw reply

* qahadi
From: Dr. David Frankson @ 2006-05-10  6:46 UTC (permalink / raw)
  To: sparclinux

Would you want prefilled drugs over the web ? http://www.bnwang.com/



^ permalink raw reply


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.