* [linux-lvm] lvm2 pv failure
From: Uk1ah Sm1th @ 2006-04-05 23:26 UTC (permalink / raw)
To: linux-lvm
Hello-
I had one of the two drives in my LVM2 array fail. It was the first
drive. Is it possiable that any data on the second drive could be
recovered? Or have I lost all my data on both drives?
.Ukiah Smith
--
"Well done is better than well said."
- Benjamin Franklin (1706-1790)
^ permalink raw reply
* [PATCH] IrDA: Support for Sigmatel STIR421x chip
From: Samuel Ortiz @ 2006-04-05 23:21 UTC (permalink / raw)
To: ext David S. Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, IrDA users, Jean Tourrilhes
Hi David,
This patch enables support for the Sigmatel's STIR421x IrDA chip.
Once patched with Sigmatel's firmware, this chip "almost" follows the USB-IrDA spec. Thus this patch is against irda-usb.[ch].
The code has been tested by Nick Fedchik on an STIR4210 chipset based dongle.
Signed-off-by: Samuel Ortiz <samuel.ortiz-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
diff --git a/drivers/net/irda/irda-usb.h b/drivers/net/irda/irda-usb.h
index 4026af4..4e12217 100644
--- a/drivers/net/irda/irda-usb.h
+++ b/drivers/net/irda/irda-usb.h
@@ -1,7 +1,7 @@
/*****************************************************************************
*
* Filename: irda-usb.h
- * Version: 0.9b
+ * Version: 0.10
* Description: IrDA-USB Driver
* Status: Experimental
* Author: Dag Brattli <dag-1K3ejsF8QZHR7s880joybQ@public.gmane.org>
@@ -9,6 +9,9 @@
* Copyright (C) 2001, Roman Weissgaerber <weissg-TVDPYGuBT+ReoWH0uzbU5w@public.gmane.org>
* Copyright (C) 2000, Dag Brattli <dag-1K3ejsF8QZHR7s880joybQ@public.gmane.org>
* Copyright (C) 2001, Jean Tourrilhes <jt-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org>
+ * Copyright (C) 2004, SigmaTel, Inc. <irquality-0iljnS1bRDtWk0Htik3J/w@public.gmane.org>
+ * Copyright (C) 2005, Milan Beno <beno-Rm0zKEqwvD4@public.gmane.org>
+ * Copyright (C) 2006, Nick FEdchik <nick-UvdXiu2sajOKBXSJ/Qx0JQ@public.gmane.org>
*
* 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
@@ -31,6 +34,9 @@
#include <net/irda/irda.h>
#include <net/irda/irda_device.h> /* struct irlap_cb */
+#define PATCH_FILE_SIZE_MAX 65536
+#define PATCH_FILE_SIZE_MIN 80
+
#define RX_COPY_THRESHOLD 200
#define IRDA_USB_MAX_MTU 2051
#define IRDA_USB_SPEED_MTU 64 /* Weird, but work like this */
@@ -79,15 +85,16 @@
/* Inbound header */
#define MEDIA_BUSY 0x80
-#define SPEED_2400 0x01
-#define SPEED_9600 0x02
-#define SPEED_19200 0x03
-#define SPEED_38400 0x04
-#define SPEED_57600 0x05
-#define SPEED_115200 0x06
-#define SPEED_576000 0x07
-#define SPEED_1152000 0x08
-#define SPEED_4000000 0x09
+#define SPEED_2400 0x01
+#define SPEED_9600 0x02
+#define SPEED_19200 0x03
+#define SPEED_38400 0x04
+#define SPEED_57600 0x05
+#define SPEED_115200 0x06
+#define SPEED_576000 0x07
+#define SPEED_1152000 0x08
+#define SPEED_4000000 0x09
+#define SPEED_16000000 0x0a
/* Basic capabilities */
#define IUC_DEFAULT 0x00 /* Basic device compliant with 1.0 spec */
@@ -100,11 +107,14 @@
#define IUC_SMALL_PKT 0x10 /* Device doesn't behave with big Rx packets */
#define IUC_MAX_WINDOW 0x20 /* Device underestimate the Rx window */
#define IUC_MAX_XBOFS 0x40 /* Device need more xbofs than advertised */
+#define IUC_STIR_4210 0x80 /* SigmaTel 4210/4220/4116 VFIR */
/* USB class definitions */
-#define USB_IRDA_HEADER 0x01
-#define USB_CLASS_IRDA 0x02 /* USB_CLASS_APP_SPEC subclass */
-#define USB_DT_IRDA 0x21
+#define USB_IRDA_HEADER 0x01
+#define USB_CLASS_IRDA 0x02 /* USB_CLASS_APP_SPEC subclass */
+#define USB_DT_IRDA 0x21
+#define USB_IRDA_SIGMATEL_HEADER 0x03
+#define IU_SIGMATEL_MAX_RX_URBS (IU_MAX_ACTIVE_RX_URBS + USB_IRDA_SIGMATEL_HEADER)
struct irda_class_desc {
__u8 bLength;
@@ -123,6 +133,7 @@ struct irda_class_desc {
* (6.2.5, USB-IrDA class spec 1.0) */
#define IU_REQ_GET_CLASS_DESC 0x06
+#define STIR421X_MAX_PATCH_DOWNLOAD_SIZE 1023
struct irda_usb_cb {
struct irda_class_desc *irda_desc;
@@ -136,7 +147,8 @@ struct irda_usb_cb {
__u16 bulk_out_mtu; /* Max Tx packet size in bytes */
__u8 bulk_int_ep; /* Interrupt Endpoint assignments */
- struct urb *rx_urb[IU_MAX_RX_URBS]; /* URBs used to receive data frames */
+ __u8 max_rx_urb;
+ struct urb **rx_urb; /* URBs used to receive data frames */
struct urb *idle_rx_urb; /* Pointer to idle URB in Rx path */
struct urb *tx_urb; /* URB used to send data frames */
struct urb *speed_urb; /* URB used to send speed commands */
@@ -156,6 +168,9 @@ struct irda_usb_cb {
__s16 new_xbofs; /* xbofs we need to set */
__u32 speed; /* Current speed */
__s32 new_speed; /* speed we need to set */
+
+ __u8 header_length; /* USB-IrDA frame header size */
+ int needspatch; /* device needs firmware patch */
struct timer_list rx_defer_timer; /* Wait for Rx error to clear */
};
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 6e2ec56..390d23b 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1,7 +1,7 @@
/*****************************************************************************
*
* Filename: irda-usb.c
- * Version: 0.9b
+ * Version: 0.10
* Description: IrDA-USB Driver
* Status: Experimental
* Author: Dag Brattli <dag-1K3ejsF8QZHR7s880joybQ@public.gmane.org>
@@ -9,6 +9,9 @@
* Copyright (C) 2000, Roman Weissgaerber <weissg-TVDPYGuBT+ReoWH0uzbU5w@public.gmane.org>
* Copyright (C) 2001, Dag Brattli <dag-1K3ejsF8QZHR7s880joybQ@public.gmane.org>
* Copyright (C) 2001, Jean Tourrilhes <jt-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org>
+ * Copyright (C) 2004, SigmaTel, Inc. <irquality-0iljnS1bRDtWk0Htik3J/w@public.gmane.org>
+ * Copyright (C) 2005, Milan Beno <beno-Rm0zKEqwvD4@public.gmane.org>
+ * Copyright (C) 2006, Nick Fedchik <nick-UvdXiu2sajOKBXSJ/Qx0JQ@public.gmane.org>
*
* 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
@@ -61,6 +64,7 @@
#include <linux/slab.h>
#include <linux/rtnetlink.h>
#include <linux/usb.h>
+#include <linux/firmware.h>
#include "irda-usb.h"
@@ -78,8 +82,12 @@ static struct usb_device_id dongles[] =
{ USB_DEVICE(0x50f, 0x180), .driver_info = IUC_SPEED_BUG | IUC_NO_WINDOW },
/* Extended Systems, Inc., XTNDAccess IrDA USB (ESI-9685) */
{ USB_DEVICE(0x8e9, 0x100), .driver_info = IUC_SPEED_BUG | IUC_NO_WINDOW },
- { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
- USB_DEVICE_ID_MATCH_INT_SUBCLASS,
+ /* SigmaTel STIR4210/4220/4116 USB IrDA (VFIR) Bridge */
+ { USB_DEVICE(0x66f, 0x4210), .driver_info = IUC_STIR_4210 | IUC_SPEED_BUG },
+ { USB_DEVICE(0x66f, 0x4220), .driver_info = IUC_STIR_4210 | IUC_SPEED_BUG },
+ { USB_DEVICE(0x66f, 0x4116), .driver_info = IUC_STIR_4210 | IUC_SPEED_BUG },
+ { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
+ USB_DEVICE_ID_MATCH_INT_SUBCLASS,
.bInterfaceClass = USB_CLASS_APP_SPEC,
.bInterfaceSubClass = USB_CLASS_IRDA,
.driver_info = IUC_DEFAULT, },
@@ -99,6 +107,7 @@ MODULE_DEVICE_TABLE(usb, dongles);
/*------------------------------------------------------------------*/
+static void irda_usb_init_qos(struct irda_usb_cb *self) ;
static struct irda_class_desc *irda_usb_find_class_desc(struct usb_interface *intf);
static void irda_usb_disconnect(struct usb_interface *intf);
static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self);
@@ -141,7 +150,24 @@ static void irda_usb_build_header(struct
__u8 *header,
int force)
{
- /* Set the negotiated link speed */
+ /* Here we check if we have an STIR421x chip,
+ * and if either speed or xbofs (or both) needs
+ * to be changed.
+ */
+ if (self->capability & IUC_STIR_4210 &&
+ ((self->new_speed != -1) || (self->new_xbofs != -1))) {
+
+ /* With STIR421x, speed and xBOFs must be set at the same
+ * time, even if only one of them changes.
+ */
+ if (self->new_speed == -1)
+ self->new_speed = self->speed ;
+
+ if (self->new_xbofs == -1)
+ self->new_xbofs = self->xbofs ;
+ }
+
+ /* Set the link speed */
if (self->new_speed != -1) {
/* Hum... Ugly hack :-(
* Some device are not compliant with the spec and change
@@ -191,7 +217,11 @@ static void irda_usb_build_header(struct
*header = SPEED_4000000;
self->new_xbofs = 0;
break;
- }
+ case 16000000:
+ *header = SPEED_16000000;
+ self->new_xbofs = 0;
+ break;
+ }
} else
/* No change */
*header = 0;
@@ -235,6 +265,32 @@ static void irda_usb_build_header(struct
}
}
+/*
+* calculate turnaround time for SigmaTel header
+*/
+static __u8 get_turnaround_time(struct sk_buff *skb)
+{
+ int turnaround_time = irda_get_mtt(skb);
+
+ if ( turnaround_time == 0 )
+ return 0;
+ else if ( turnaround_time <= 10 )
+ return 1;
+ else if ( turnaround_time <= 50 )
+ return 2;
+ else if ( turnaround_time <= 100 )
+ return 3;
+ else if ( turnaround_time <= 500 )
+ return 4;
+ else if ( turnaround_time <= 1000 )
+ return 5;
+ else if ( turnaround_time <= 5000 )
+ return 6;
+ else
+ return 7;
+}
+
+
/*------------------------------------------------------------------*/
/*
* Send a command to change the speed of the dongle
@@ -262,12 +318,18 @@ static void irda_usb_change_speed_xbofs(
/* Set the new speed and xbofs in this fake frame */
irda_usb_build_header(self, frame, 1);
+ if ( self->capability & IUC_STIR_4210 ) {
+ if (frame[0] == 0) return ; // do nothing if no change
+ frame[1] = 0; // other parameters don't change here
+ frame[2] = 0;
+ }
+
/* Submit the 0 length IrDA frame to trigger new speed settings */
usb_fill_bulk_urb(urb, self->usbdev,
usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
frame, IRDA_USB_SPEED_MTU,
speed_bulk_callback, self);
- urb->transfer_buffer_length = USB_IRDA_HEADER;
+ urb->transfer_buffer_length = self->header_length;
urb->transfer_flags = 0;
/* Irq disabled -> GFP_ATOMIC */
@@ -383,16 +445,35 @@ static int irda_usb_hard_xmit(struct sk_
* allocation will be done lower in skb_push().
* Also, we don't use directly skb_cow(), because it require
* headroom >= 16, which force unnecessary copies - Jean II */
- if (skb_headroom(skb) < USB_IRDA_HEADER) {
+ if (skb_headroom(skb) < self->header_length) {
IRDA_DEBUG(0, "%s(), Insuficient skb headroom.\n", __FUNCTION__);
- if (skb_cow(skb, USB_IRDA_HEADER)) {
+ if (skb_cow(skb, self->header_length)) {
IRDA_WARNING("%s(), failed skb_cow() !!!\n", __FUNCTION__);
goto drop;
}
}
/* Change setting for next frame */
- irda_usb_build_header(self, skb_push(skb, USB_IRDA_HEADER), 0);
+
+ if ( self->capability & IUC_STIR_4210 ) {
+ __u8 turnaround_time;
+ __u8* frame;
+ turnaround_time = get_turnaround_time( skb );
+ frame= skb_push(skb, self->header_length);
+ irda_usb_build_header(self, frame, 0);
+ frame[2] = turnaround_time;
+ if ((skb->len != 0) &&
+ ((skb->len % 128) == 0) &&
+ ((skb->len % 512) != 0)) {
+ /* add extra byte for special SigmaTel feature */
+ frame[1] = 1;
+ skb_put(skb, 1);
+ } else {
+ frame[1] = 0;
+ }
+ } else {
+ irda_usb_build_header(self, skb_push(skb, self->header_length), 0);
+ }
/* FIXME: Make macro out of this one */
((struct irda_skb_cb *)skb->cb)->context = self;
@@ -795,7 +876,7 @@ static void irda_usb_receive(struct urb
}
/* Check for empty frames */
- if (urb->actual_length <= USB_IRDA_HEADER) {
+ if (urb->actual_length <= self->header_length) {
IRDA_WARNING("%s(), empty frame!\n", __FUNCTION__);
goto done;
}
@@ -815,8 +896,12 @@ static void irda_usb_receive(struct urb
* called Rx-copy-break). Jean II */
docopy = (urb->actual_length < IRDA_RX_COPY_THRESHOLD);
- /* Allocate a new skb */
- newskb = dev_alloc_skb(docopy ? urb->actual_length : IRDA_SKB_MAX_MTU);
+ /* Allocate a new skb */
+ if ( self->capability & IUC_STIR_4210 )
+ newskb = dev_alloc_skb(docopy ? urb->actual_length : IRDA_SKB_MAX_MTU + USB_IRDA_SIGMATEL_HEADER);
+ else
+ newskb = dev_alloc_skb(docopy ? urb->actual_length : IRDA_SKB_MAX_MTU);
+
if (!newskb) {
self->stats.rx_dropped++;
/* We could deliver the current skb, but this would stall
@@ -845,7 +930,7 @@ static void irda_usb_receive(struct urb
/* Set proper length on skb & remove USB-IrDA header */
skb_put(dataskb, urb->actual_length);
- skb_pull(dataskb, USB_IRDA_HEADER);
+ skb_pull(dataskb, self->header_length);
/* Ask the networking layer to queue the packet for the IrDA stack */
dataskb->dev = self->netdev;
@@ -937,6 +1022,191 @@ static int irda_usb_is_receiving(struct
return 0; /* For now */
}
+
+#define STIR421X_PATCH_PRODUCT_VERSION_STR "Product Version: "
+#define STIR421X_PATCH_COMPONENT_VERSION_STR "Component Version: "
+#define STIR421X_PATCH_DATA_TAG_STR "STMP"
+#define STIR421X_PATCH_FILE_VERSION_MAX_OFFSET 512 /* version info is before here */
+#define STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET 512 /* patch image starts before here */
+#define STIR421X_PATCH_FILE_END_OF_HEADER_TAG 0x1A /* marks end of patch file header (PC DOS text file EOF character) */
+
+/*
+ * Known firmware patches for STIR421x dongles
+ */
+static char * stir421x_patches[] = {
+ "42101001.sb",
+ "42101002.sb",
+};
+
+static int stir421x_get_patch_version(unsigned char * patch, const unsigned long patch_len)
+{
+ unsigned int version_offset;
+ unsigned long version_major, version_minor, version_build;
+ unsigned char * version_start;
+ int version_found = 0;
+
+ for (version_offset = 0;
+ version_offset < STIR421X_PATCH_FILE_END_OF_HEADER_TAG;
+ version_offset++) {
+ if (!memcmp(patch + version_offset,
+ STIR421X_PATCH_PRODUCT_VERSION_STR,
+ sizeof(STIR421X_PATCH_PRODUCT_VERSION_STR) - 1)) {
+ version_found = 1;
+ version_start = patch +
+ version_offset +
+ sizeof(STIR421X_PATCH_PRODUCT_VERSION_STR) - 1;
+ break;
+ }
+ }
+
+ /* We couldn't find a product version on this patch */
+ if (!version_found)
+ return -EINVAL;
+
+ /* Let's check if the product version is dotted */
+ if (version_start[3] != '.' ||
+ version_start[7] != '.')
+ return -EINVAL;
+
+ version_major = simple_strtoul(version_start, NULL, 10);
+ version_minor = simple_strtoul(version_start + 4, NULL, 10);
+ version_build = simple_strtoul(version_start + 8, NULL, 10);
+
+ IRDA_DEBUG(2, "%s(), Major: %ld Minor: %ld Build: %ld\n",
+ __FUNCTION__,
+ version_major, version_minor, version_build);
+
+ return (((version_major) << 12) +
+ ((version_minor) << 8) +
+ ((version_build / 10) << 4) +
+ (version_build % 10));
+
+}
+
+
+static int stir421x_upload_patch (struct irda_usb_cb *self,
+ unsigned char * patch,
+ const unsigned int patch_len)
+{
+ int retval = 0;
+ int actual_len;
+ unsigned int i = 0, download_amount = 0;
+ unsigned char * patch_chunk;
+
+ IRDA_DEBUG (2, "%s(), Uploading STIR421x Patch\n", __FUNCTION__);
+
+ patch_chunk = kzalloc(STIR421X_MAX_PATCH_DOWNLOAD_SIZE, GFP_KERNEL);
+ if (patch_chunk == NULL)
+ return -ENOMEM;
+
+ /* break up patch into 1023-byte sections */
+ for (i = 0; retval >= 0 && i < patch_len; i += download_amount) {
+ download_amount = patch_len - i;
+ if (download_amount > STIR421X_MAX_PATCH_DOWNLOAD_SIZE)
+ download_amount = STIR421X_MAX_PATCH_DOWNLOAD_SIZE;
+
+ /* download the patch section */
+ memcpy(patch_chunk, patch + i, download_amount);
+
+ retval = usb_bulk_msg (self->usbdev,
+ usb_sndbulkpipe (self->usbdev,
+ self->bulk_out_ep),
+ patch_chunk, download_amount,
+ &actual_len, msecs_to_jiffies (500));
+ IRDA_DEBUG (2, "%s(), Sent %u bytes\n", __FUNCTION__,
+ actual_len);
+ if (retval == 0)
+ mdelay(10);
+ }
+
+ kfree(patch_chunk);
+
+ if (i != patch_len) {
+ IRDA_ERROR ("%s(), Pushed %d bytes (!= patch_len (%d))\n",
+ __FUNCTION__, i, patch_len);
+ retval = -EIO;
+ }
+
+ if (retval < 0)
+ /* todo - mark device as not ready */
+ IRDA_ERROR ("%s(), STIR421x patch upload failed (%d)\n",
+ __FUNCTION__, retval);
+
+ return retval;
+}
+
+
+static int stir421x_patch_device(struct irda_usb_cb *self)
+{
+ unsigned int i, patch_found = 0, data_found = 0, data_offset;
+ int patch_version, ret = 0;
+ const struct firmware *fw_entry;
+
+ for (i = 0; i < ARRAY_SIZE(stir421x_patches); i++) {
+ if(request_firmware(&fw_entry, stir421x_patches[i], &self->usbdev->dev) != 0) {
+ IRDA_ERROR( "%s(), Patch %s is not available\n", __FUNCTION__, stir421x_patches[i]);
+ continue;
+ }
+
+ /* We found a patch from userspace */
+ patch_version = stir421x_get_patch_version (fw_entry->data, fw_entry->size);
+
+ if (patch_version < 0) {
+ /* Couldn't fetch a version, let's move on to the next file */
+ IRDA_ERROR("%s(), version parsing failed\n", __FUNCTION__);
+ ret = patch_version;
+ release_firmware(fw_entry);
+ continue;
+ }
+
+ if (patch_version != self->usbdev->descriptor.bcdDevice) {
+ /* Patch version and device don't match */
+ IRDA_ERROR ("%s(), wrong patch version (%d <-> %d)\n",
+ __FUNCTION__,
+ patch_version, self->usbdev->descriptor.bcdDevice);
+ ret = -EINVAL;
+ release_firmware(fw_entry);
+ continue;
+ }
+
+ /* If we're here, we've found a correct patch */
+ patch_found = 1;
+ break;
+
+ }
+
+ /* We couldn't find a valid firmware, let's leave */
+ if (!patch_found)
+ return ret;
+
+ /* The actual image starts after the "STMP" keyword */
+ for (data_offset = 0; data_offset < STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET; data_offset++) {
+ if (!memcmp(fw_entry->data + data_offset,
+ STIR421X_PATCH_DATA_TAG_STR,
+ sizeof(STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET))) {
+ IRDA_DEBUG(2, "%s(), found patch data for STIR421x at offset %d\n",
+ __FUNCTION__, data_offset);
+ data_found = 1;
+ break;
+ }
+ }
+
+ /* We couldn't find "STMP" from the header */
+ if (!data_found)
+ return -EINVAL;
+
+ /* Let's upload the patch to the target */
+ ret = stir421x_upload_patch(self,
+ &fw_entry->data[data_offset + sizeof(STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET)],
+ fw_entry->size - (data_offset + sizeof(STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET)));
+
+ release_firmware(fw_entry);
+
+ return ret;
+
+}
+
+
/********************** IRDA DEVICE CALLBACKS **********************/
/*
* Main calls from the IrDA/Network subsystem.
@@ -972,6 +1242,11 @@ static int irda_usb_net_open(struct net_
return -1;
}
+ if(self->needspatch) {
+ IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ;
+ return -EIO ;
+ }
+
/* Initialise default speed and xbofs value
* (IrLAP will change that soon) */
self->speed = -1;
@@ -1050,7 +1325,7 @@ static int irda_usb_net_close(struct net
del_timer(&self->rx_defer_timer);
/* Deallocate all the Rx path buffers (URBs and skb) */
- for (i = 0; i < IU_MAX_RX_URBS; i++) {
+ for (i = 0; i < self->max_rx_urb; i++) {
struct urb *urb = self->rx_urb[i];
struct sk_buff *skb = (struct sk_buff *) urb->context;
/* Cancel the receive command */
@@ -1426,8 +1701,22 @@ static int irda_usb_probe(struct usb_int
spin_lock_init(&self->lock);
init_timer(&self->rx_defer_timer);
+ self->capability = id->driver_info;
+ self->needspatch = ((self->capability & IUC_STIR_4210) != 0) ;
+
/* Create all of the needed urbs */
- for (i = 0; i < IU_MAX_RX_URBS; i++) {
+ if (self->capability & IUC_STIR_4210) {
+ self->max_rx_urb = IU_SIGMATEL_MAX_RX_URBS;
+ self->header_length = USB_IRDA_SIGMATEL_HEADER;
+ } else {
+ self->max_rx_urb = IU_MAX_RX_URBS;
+ self->header_length = USB_IRDA_HEADER;
+ }
+
+ self->rx_urb = kzalloc(self->max_rx_urb * sizeof(struct urb *),
+ GFP_KERNEL);
+
+ for (i = 0; i < self->max_rx_urb; i++) {
self->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
if (!self->rx_urb[i]) {
goto err_out_1;
@@ -1478,18 +1767,29 @@ static int irda_usb_probe(struct usb_int
ret = -EIO;
goto err_out_3;
}
+
+ self->usbdev = dev;
/* Find IrDA class descriptor */
irda_desc = irda_usb_find_class_desc(intf);
ret = -ENODEV;
if (irda_desc == NULL)
goto err_out_3;
+
+ if (self->needspatch) {
+ ret = usb_control_msg (self->usbdev, usb_sndctrlpipe (self->usbdev, 0),
+ 0x02, 0x40, 0, 0, 0, 0, msecs_to_jiffies(500));
+ if (ret < 0) {
+ IRDA_DEBUG (0, "usb_control_msg failed %d\n", ret);
+ goto err_out_3;
+ } else {
+ mdelay(10);
+ }
+ }
self->irda_desc = irda_desc;
self->present = 1;
self->netopen = 0;
- self->capability = id->driver_info;
- self->usbdev = dev;
self->usbintf = intf;
/* Allocate the buffer for speed changes */
@@ -1508,6 +1808,28 @@ static int irda_usb_probe(struct usb_int
IRDA_MESSAGE("IrDA: Registered device %s\n", net->name);
usb_set_intfdata(intf, self);
+
+ if (self->needspatch) {
+ /* Now we fetch and upload the firmware patch */
+ ret = stir421x_patch_device(self);
+ self->needspatch = (ret < 0);
+ if (ret < 0) {
+ printk("patch_device failed\n");
+ goto err_out_4;
+ }
+
+ /* replace IrDA class descriptor with what patched device is now reporting */
+ irda_desc = irda_usb_find_class_desc (self->usbintf);
+ if (irda_desc == NULL) {
+ ret = -ENODEV;
+ goto err_out_4;
+ }
+ if (self->irda_desc)
+ kfree (self->irda_desc);
+ self->irda_desc = irda_desc;
+ irda_usb_init_qos(self);
+ }
+
return 0;
err_out_4:
@@ -1518,7 +1840,7 @@ err_out_3:
err_out_2:
usb_free_urb(self->tx_urb);
err_out_1:
- for (i = 0; i < IU_MAX_RX_URBS; i++) {
+ for (i = 0; i < self->max_rx_urb; i++) {
if (self->rx_urb[i])
usb_free_urb(self->rx_urb[i]);
}
@@ -1571,7 +1893,7 @@ static void irda_usb_disconnect(struct u
/*netif_device_detach(self->netdev);*/
netif_stop_queue(self->netdev);
/* Stop all the receive URBs. Must be synchronous. */
- for (i = 0; i < IU_MAX_RX_URBS; i++)
+ for (i = 0; i < self->max_rx_urb; i++)
usb_kill_urb(self->rx_urb[i]);
/* Cancel Tx and speed URB.
* Make sure it's synchronous to avoid races. */
@@ -1586,8 +1908,9 @@ static void irda_usb_disconnect(struct u
self->usbintf = NULL;
/* Clean up our urbs */
- for (i = 0; i < IU_MAX_RX_URBS; i++)
+ for (i = 0; i < self->max_rx_urb; i++)
usb_free_urb(self->rx_urb[i]);
+ kfree(self->rx_urb);
/* Clean up Tx and speed URB */
usb_free_urb(self->tx_urb);
usb_free_urb(self->speed_urb);
@@ -1648,6 +1971,6 @@ module_exit(usb_irda_cleanup);
*/
module_param(qos_mtt_bits, int, 0);
MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time");
-MODULE_AUTHOR("Roman Weissgaerber <weissg-TVDPYGuBT+ReoWH0uzbU5w@public.gmane.org>, Dag Brattli <dag-1K3ejsF8QZHR7s880joybQ@public.gmane.org> and Jean Tourrilhes <jt-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org>");
-MODULE_DESCRIPTION("IrDA-USB Dongle Driver");
+MODULE_AUTHOR("Roman Weissgaerber <weissg-TVDPYGuBT+ReoWH0uzbU5w@public.gmane.org>, Dag Brattli <dag-1K3ejsF8QZHR7s880joybQ@public.gmane.org>, Jean Tourrilhes <jt-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org> and Nick Fedchik <nick-UvdXiu2sajOKBXSJ/Qx0JQ@public.gmane.org>");
+MODULE_DESCRIPTION("IrDA-USB Dongle Driver");
MODULE_LICENSE("GPL");
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply related
* [PATCH] IrDA: smcinit merged into smsc-ircc driver
From: Samuel Ortiz @ 2006-04-05 23:21 UTC (permalink / raw)
To: ext David S. Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, IrDA users, Jean Tourrilhes
Hi David,
This patch integrates the smcinit code into the smsc-ircc driver.
Some laptops have their smsc-ircc chip not properly configured by the BIOS and needs some preconfiguration. Currently, this can be done from userspace with smcinit, a utility that comes with the irda-utils package. It messes with ioports and PCI settings, from userspace.
Now with this patch, if we happen to be on one of the known to be faulty laptops, we preconfigure the chip from the driver.
Patch from Linus Walleij <triad-HEm3bjczhZmzQB+pC5nmwQ@public.gmane.org>
Signed-off-by: Samuel Ortiz <samuel.ortiz-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index ec94ecd..f6d98b4 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -11,6 +11,7 @@
* Copyright (c) 2002 Daniele Peri
* All Rights Reserved.
* Copyright (c) 2002 Jean Tourrilhes
+ * Copyright (c) 2006 Linus Walleij
*
*
* Based on smc-ircc.c:
@@ -61,6 +62,9 @@
#include <linux/spinlock.h>
#include <linux/pm.h>
+#ifdef CONFIG_PCI
+#include <linux/pci.h>
+#endif
#include <net/irda/wrapper.h>
#include <net/irda/irda.h>
@@ -100,6 +104,22 @@ MODULE_PARM_DESC(ircc_transceiver, "Tran
/* Types */
+#ifdef CONFIG_PCI
+struct smsc_ircc_subsystem_configuration {
+ unsigned short vendor; /* PCI vendor ID */
+ unsigned short device; /* PCI vendor ID */
+ unsigned short subvendor; /* PCI subsystem vendor ID */
+ unsigned short subdevice; /* PCI sybsystem device ID */
+ unsigned short sir_io; /* I/O port for SIR */
+ unsigned short fir_io; /* I/O port for FIR */
+ unsigned char fir_irq; /* FIR IRQ */
+ unsigned char fir_dma; /* FIR DMA */
+ unsigned short cfg_base; /* I/O port for chip configuration */
+ int (*preconfigure)(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); /* Preconfig function */
+ const char *name; /* name shown as info */
+};
+#endif
+
struct smsc_transceiver {
char *name;
void (*set_for_speed)(int fir_base, u32 speed);
@@ -202,6 +222,16 @@ static int __init smsc_superio_flat(cons
static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned short cfg_base, char *type);
static int __init smsc_superio_fdc(unsigned short cfg_base);
static int __init smsc_superio_lpc(unsigned short cfg_base);
+#ifdef CONFIG_PCI
+static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf);
+static int __init preconfigure_through_82801(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf);
+static int __init preconfigure_through_ali(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf);
+static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
+ unsigned short ircc_fir,
+ unsigned short ircc_sir,
+ unsigned char ircc_dma,
+ unsigned char ircc_irq);
+#endif
/* Transceivers specific functions */
@@ -353,6 +383,13 @@ static int __init smsc_ircc_init(void)
return ret;
}
+#ifdef CONFIG_PCI
+ if (smsc_ircc_preconfigure_subsystems(ircc_cfg, ircc_fir, ircc_sir, ircc_dma, ircc_irq) < 0) {
+ /* Ignore errors from preconfiguration */
+ IRDA_ERROR("%s, Preconfiguration failed !\n", driver_name);
+ }
+#endif
+
dev_count = 0;
if (ircc_fir > 0 && ircc_sir > 0) {
@@ -2285,6 +2322,280 @@ static int __init smsc_superio_lpc(unsig
return ret;
}
+/*
+ * Look for some specific subsystem setups that need
+ * pre-configuration not properly done by the BIOS (especially laptops)
+ * This code is based in part on smcinit.c, tosh1800-smcinit.c
+ * and tosh2450-smcinit.c. The table lists the device entries
+ * for ISA bridges with an LPC (Local Peripheral Configurator)
+ * that are in turn used to configure the SMSC device with default
+ * SIR and FIR I/O ports, DMA and IRQ.
+ */
+#ifdef CONFIG_PCI
+#define PCIID_VENDOR_INTEL 0x8086
+#define PCIID_VENDOR_ALI 0x10b9
+static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __devinitdata = {
+ {
+ .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DBM LPC bridge */
+ .device = 0x24cc,
+ .subvendor = 0x103c,
+ .subdevice = 0x088c,
+ .sir_io = 0x02f8, /* Quite certain these are the same for nc8000 as for nc6000 */
+ .fir_io = 0x0130,
+ .fir_irq = 0x09,
+ .fir_dma = 0x03,
+ .cfg_base = 0x004e,
+ .preconfigure = preconfigure_through_82801,
+ .name = "HP nc8000",
+ },
+ {
+ .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DBM LPC bridge */
+ .device = 0x24cc,
+ .subvendor = 0x103c,
+ .subdevice = 0x0890,
+ .sir_io = 0x02f8,
+ .fir_io = 0x0130,
+ .fir_irq = 0x09,
+ .fir_dma = 0x03,
+ .cfg_base = 0x004e,
+ .preconfigure = preconfigure_through_82801,
+ .name = "HP nc6000",
+ },
+ {
+ .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge */
+ .device = 0x24c0,
+ .subvendor = 0x1179,
+ .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */
+ .sir_io = 0x03f8,
+ .fir_io = 0x0130,
+ .fir_irq = 0x07,
+ .fir_dma = 0x01,
+ .cfg_base = 0x002e,
+ .preconfigure = preconfigure_through_82801,
+ .name = "Toshiba Satellite 2450",
+ },
+ {
+ .vendor = PCIID_VENDOR_INTEL, /* Intel 82801CAM ISA bridge */
+ .device = 0x248c, /* Some use 24cc? */
+ .subvendor = 0x1179,
+ .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */
+ .sir_io = 0x03f8,
+ .fir_io = 0x0130,
+ .fir_irq = 0x03,
+ .fir_dma = 0x03,
+ .cfg_base = 0x002e,
+ .preconfigure = preconfigure_through_82801,
+ .name = "Toshiba Satellite 5100/5200, Tecra 9100",
+ },
+ {
+ .vendor = PCIID_VENDOR_ALI, /* ALi M1533/M1535 PCI to ISA Bridge [Aladdin IV/V/V+] */
+ .device = 0x1533,
+ .subvendor = 0x1179,
+ .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */
+ .sir_io = 0x02e8,
+ .fir_io = 0x02f8,
+ .fir_irq = 0x07,
+ .fir_dma = 0x03,
+ .cfg_base = 0x002e,
+ .preconfigure = preconfigure_through_ali,
+ .name = "Toshiba Satellite 1800",
+ },
+ { } // Terminator
+};
+
+
+/*
+ * This sets up the basic SMSC parameters (FIR port, SIR port, FIR DMA, FIR IRQ)
+ * through the chip configuration port.
+ */
+static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf)
+{
+ unsigned short iobase = conf->cfg_base;
+ unsigned char tmpbyte;
+
+ outb(LPC47N227_CFGACCESSKEY, iobase); // enter configuration state
+ outb(SMSCSIOFLAT_DEVICEID_REG, iobase); // set for device ID
+ tmpbyte = inb(iobase +1); // Read device ID
+ IRDA_DEBUG(0, "Detected Chip id: 0x%02x, setting up registers...\n",tmpbyte);
+
+ /* Disable UART1 and set up SIR I/O port */
+ outb(0x24, iobase); // select CR24 - UART1 base addr
+ outb(0x00, iobase + 1); // disable UART1
+ outb(SMSCSIOFLAT_UART2BASEADDR_REG, iobase); // select CR25 - UART2 base addr
+ outb( (conf->sir_io >> 2), iobase + 1); // bits 2-9 of 0x3f8
+ tmpbyte = inb(iobase + 1);
+ if (tmpbyte != (conf->sir_io >> 2) ) {
+ IRDA_WARNING("ERROR: could not configure SIR ioport.\n");
+ return -ENXIO;
+ }
+
+ /* Set up FIR IRQ channel for UART2 */
+ outb(SMSCSIOFLAT_UARTIRQSELECT_REG, iobase); // select CR28 - UART1,2 IRQ select
+ tmpbyte = inb(iobase + 1);
+ tmpbyte &= SMSCSIOFLAT_UART1IRQSELECT_MASK; // Do not touch the UART1 portion
+ tmpbyte |= (conf->fir_irq & SMSCSIOFLAT_UART2IRQSELECT_MASK);
+ outb(tmpbyte, iobase + 1);
+ tmpbyte = inb(iobase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK;
+ if (tmpbyte != conf->fir_irq) {
+ IRDA_WARNING("ERROR: could not configure FIR IRQ channel.\n");
+ return -ENXIO;
+ }
+
+ /* Set up FIR I/O port */
+ outb(SMSCSIOFLAT_FIRBASEADDR_REG, iobase); // CR2B - SCE (FIR) base addr
+ outb((conf->fir_io >> 3), iobase + 1);
+ tmpbyte = inb(iobase + 1);
+ if (tmpbyte != (conf->fir_io >> 3) ) {
+ IRDA_WARNING("ERROR: could not configure FIR I/O port.\n");
+ return -ENXIO;
+ }
+
+ /* Set up FIR DMA channel */
+ outb(SMSCSIOFLAT_FIRDMASELECT_REG, iobase); // CR2C - SCE (FIR) DMA select
+ outb((conf->fir_dma & LPC47N227_FIRDMASELECT_MASK), iobase + 1); // DMA
+ tmpbyte = inb(iobase + 1) & LPC47N227_FIRDMASELECT_MASK;
+ if (tmpbyte != (conf->fir_dma & LPC47N227_FIRDMASELECT_MASK)) {
+ IRDA_WARNING("ERROR: could not configure FIR DMA channel.\n");
+ return -ENXIO;
+ }
+
+ outb(SMSCSIOFLAT_UARTMODE0C_REG, iobase); // CR0C - UART mode
+ tmpbyte = inb(iobase + 1);
+ tmpbyte &= ~SMSCSIOFLAT_UART2MODE_MASK | SMSCSIOFLAT_UART2MODE_VAL_IRDA;
+ outb(tmpbyte, iobase + 1); // enable IrDA (HPSIR) mode, high speed
+
+ outb(LPC47N227_APMBOOTDRIVE_REG, iobase); // CR07 - Auto Pwr Mgt/boot drive sel
+ tmpbyte = inb(iobase + 1);
+ outb(tmpbyte | LPC47N227_UART2AUTOPWRDOWN_MASK, iobase + 1); // enable UART2 autopower down
+
+ /* This one was not part of tosh1800 */
+ outb(0x0a, iobase); // CR0a - ecp fifo / ir mux
+ tmpbyte = inb(iobase + 1);
+ outb(tmpbyte | 0x40, iobase + 1); // send active device to ir port
+
+ outb(LPC47N227_UART12POWER_REG, iobase); // CR02 - UART 1,2 power
+ tmpbyte = inb(iobase + 1);
+ outb(tmpbyte | LPC47N227_UART2POWERDOWN_MASK, iobase + 1); // UART2 power up mode, UART1 power down
+
+ outb(LPC47N227_FDCPOWERVALIDCONF_REG, iobase); // CR00 - FDC Power/valid config cycle
+ tmpbyte = inb(iobase + 1);
+ outb(tmpbyte | LPC47N227_VALID_MASK, iobase + 1); // valid config cycle done
+
+ outb(LPC47N227_CFGEXITKEY, iobase); // Exit configuration
+
+ return 0;
+}
+
+/* 82801CAM registers */
+#define VID 0x00
+#define DID 0x02
+#define PIRQA_ROUT 0x60
+#define PCI_DMA_C 0x90
+#define COM_DEC 0xe0
+#define LPC_EN 0xe6
+#define GEN2_DEC 0xec
+/*
+ * Sets up the I/O range using the 82801CAM ISA bridge, 82801DBM LPC bridge or
+ * Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge. They all work the same way!
+ */
+static int __init preconfigure_through_82801(struct pci_dev *dev,
+ struct smsc_ircc_subsystem_configuration *conf)
+{
+ unsigned short tmpword;
+ int ret;
+
+ IRDA_MESSAGE("Setting up the SMSC device via the 82801 controller.\n");
+ pci_write_config_byte(dev, COM_DEC, 0x10);
+
+ /* Enable LPC */
+ pci_read_config_word(dev, LPC_EN, &tmpword); /* LPC_EN register */
+ tmpword &= 0xfffd; /* mask bit 1 */
+ tmpword |= 0x0001; /* set bit 0 : COMA addr range enable */
+ pci_write_config_word(dev, LPC_EN, tmpword);
+
+ /* Setup DMA */
+ pci_write_config_word(dev, PCI_DMA_C, 0xc0c0); /* LPC I/F DMA on, channel 3 -- rtm (?? PCI DMA ?) */
+ pci_write_config_word(dev, GEN2_DEC, 0x131); /* LPC I/F 2nd decode range */
+
+ /* Pre-configure chip */
+ ret = preconfigure_smsc_chip(conf);
+
+ /* Disable LPC */
+ pci_read_config_word(dev, LPC_EN, &tmpword); /* LPC_EN register */
+ tmpword &= 0xfffc; /* mask bit 1 and bit 0, COMA addr range disable */
+ pci_write_config_word(dev, LPC_EN, tmpword);
+ return ret;
+}
+
+static int __init preconfigure_through_ali(struct pci_dev *dev,
+ struct smsc_ircc_subsystem_configuration *conf)
+{
+ /* TODO: put in ALi 1533 configuration here. */
+ IRDA_MESSAGE("SORRY: %s has an unsupported bridge controller (ALi): not pre-configured.\n", conf->name);
+ return -ENODEV;
+}
+
+static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
+ unsigned short ircc_fir,
+ unsigned short ircc_sir,
+ unsigned char ircc_dma,
+ unsigned char ircc_irq)
+{
+ struct pci_dev *dev = NULL;
+ unsigned short ss_vendor = 0x0000;
+ unsigned short ss_device = 0x0000;
+ int ret = 0;
+
+ dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
+
+ while (dev != NULL) {
+ struct smsc_ircc_subsystem_configuration *conf;
+
+ /*
+ * Cache the subsystem vendor/device: some manufacturers fail to set
+ * this for all components, so we save it in case there is just
+ * 0x0000 0x0000 on the device we want to check.
+ */
+ if (dev->subsystem_vendor != 0x0000U) {
+ ss_vendor = dev->subsystem_vendor;
+ ss_device = dev->subsystem_device;
+ }
+ conf = subsystem_configurations;
+ for( ; conf->subvendor; conf++) {
+ if(conf->vendor == dev->vendor &&
+ conf->device == dev->device &&
+ conf->subvendor == ss_vendor && /* Sometimes these are cached values */
+ (conf->subdevice == ss_device || conf->subdevice == 0xffff)) {
+ struct smsc_ircc_subsystem_configuration tmpconf;
+
+ memcpy(&tmpconf, conf, sizeof(struct smsc_ircc_subsystem_configuration));
+
+ /* Override the default values with anything passed in as parameter */
+ if (ircc_cfg != 0)
+ tmpconf.cfg_base = ircc_cfg;
+ if (ircc_fir != 0)
+ tmpconf.fir_io = ircc_fir;
+ if (ircc_sir != 0)
+ tmpconf.sir_io = ircc_sir;
+ if (ircc_dma != 0xff)
+ tmpconf.fir_dma = ircc_dma;
+ if (ircc_irq != 0xff)
+ tmpconf.fir_irq = ircc_irq;
+
+ IRDA_MESSAGE("Detected unconfigured %s SMSC IrDA chip, pre-configuring device.\n", conf->name);
+ if (conf->preconfigure)
+ ret = conf->preconfigure(dev, &tmpconf);
+ else
+ ret = -ENODEV;
+ }
+ }
+ dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
+ }
+
+ return ret;
+}
+#endif // CONFIG_PCI
+
/************************************************
*
* Transceivers specific functions
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply related
* [PATCH] board-nokia-770.c: Add missing alsa platform driver code
From: lamikr @ 2006-04-05 23:20 UTC (permalink / raw)
To: OMAP-Linux
[-- Attachment #1: Type: text/plain, Size: 496 bytes --]
Hi it seems that 770 is also using aic23 alsa driver, original patches
added aic23 platform data driver code only to board-osk.c,
but this adds now a similar platform driver config also to board-nokia770.c.
I have only tested made a compile test for this one.Can somebody who is
building own kernels for 770 try to build, boot & "play it again sam"
with this?
The patch should apply on top of both to 2.6.16-omap2 branch and
linux-omap git head.
Signed off: Mika Laitio lamikr@cc.jyu.fi
Mika
[-- Attachment #2: board-nokia-770.c-Add-missing-alsa-platform-driver-code.patch --]
[-- Type: text/x-patch, Size: 2392 bytes --]
Subject: [PATCH] board-nokia-770.c: Add missing alsa platform driver code.
Signed-off-by: Mika Laitio <lamikr@cc.jyu.fi>
---
arch/arm/mach-omap1/board-nokia770.c | 39 ++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
4b0bfc38bfa33f82155b339709131e6dc3dfa0ab
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 02b980d..924c5bd 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -31,6 +31,8 @@
#include <asm/arch/dsp_common.h>
#include <asm/arch/aic23.h>
#include <asm/arch/gpio.h>
+#include <asm/arch/mcbsp.h>
+#include <asm/arch/omap-alsa.h>
static void __init omap_nokia770_init_irq(void)
{
@@ -86,8 +88,45 @@ static struct platform_device nokia770_k
.resource = nokia770_kp_resources,
};
+#define DEFAULT_BITPERSAMPLE 16
+
+static struct omap_mcbsp_reg_cfg mcbsp_regs = {
+ .spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
+ .spcr1 = RINTM(3) | RRST,
+ .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
+ RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0),
+ .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
+ .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
+ XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG,
+ .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
+ .srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1),
+ .srgr2 = GSYNC | CLKSP | FSGM | FPER(DEFAULT_BITPERSAMPLE * 2 - 1),
+ /*.pcr0 = FSXM | FSRM | CLKXM | CLKRM | CLKXP | CLKRP,*/ /* mcbsp: master */
+ .pcr0 = CLKXP | CLKRP, /* mcbsp: slave */
+};
+
+static struct omap_alsa_codec_config alsa_config = {
+ .name = "n770 AIC23",
+ .mcbsp_regs_alsa = &mcbsp_regs,
+ .codec_configure_dev = NULL, // aic23_configure,
+ .codec_set_samplerate = NULL, // aic23_set_samplerate,
+ .codec_clock_setup = NULL, // aic23_clock_setup,
+ .codec_clock_on = NULL, // aic23_clock_on,
+ .codec_clock_off = NULL, // aic23_clock_off,
+ .get_default_samplerate = NULL, // aic23_get_default_samplerate,
+};
+
+static struct platform_device nokia770_mcbsp1_device = {
+ .name = "omap_alsa_mcbsp",
+ .id = 1,
+ .dev = {
+ .platform_data = &alsa_config,
+ },
+};
+
static struct platform_device *nokia770_devices[] __initdata = {
&nokia770_kp_device,
+ &nokia770_mcbsp1_device,
};
static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
--
1.0.GIT
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply related
* Re: n770 alsa build broken
From: lamikr @ 2006-04-05 23:18 UTC (permalink / raw)
To: Komal Shah; +Cc: linux-omap-open-source
In-Reply-To: <20060404161825.67622.qmail@web32901.mail.mud.yahoo.com>
Komal Shah wrote:
>Please supply the patch.
>
>#make n770_defconfig
>#make
>
>sound/arm/omap/omap-alsa-dma.c: In function `omap_sound_dma_link_lch':
>sound/arm/omap/omap-alsa-dma.c:143: error: `FN_IN' undeclared (first
>use in this function)
>
>
In which kernel version you got this? I tried to use your method instead
of opening xconfig but I could not reproduce this neither with
2.6.16-omap2 or
with the linux-omap-git head. With the code in head I the build stopped
however already earlier to some MMC build problems. The 2.6.16-omap2
compiled just fine.
One thing I noticed however. As 770 uses also alsa driver, it needs alsa
platform driver initialization stuff. For that I will send a patch in a
separate mail.
Mika
^ permalink raw reply
* Re: [patch 2.6.16-mm2 10/9] sched throttle tree extract - kill interactive task feedback loop
From: Con Kolivas @ 2006-04-05 23:15 UTC (permalink / raw)
To: Mike Galbraith
Cc: Ingo Molnar, Andrew Morton, lkml, Peter Williams, Nick Piggin
In-Reply-To: <1144258731.7894.12.camel@homer>
On Thursday 06 April 2006 03:38, Mike Galbraith wrote:
> Greetings,
>
> The patch below stops interactive tasks from feeding off each other
> during round-robin.
>
> With this 10th patch in place, a busy server with _default_ throttle
> settings (ie tunables may now be mostly unneeded) looks like this:
> --- linux-2.6.16-mm2/kernel/sched.c-9.export_tunables 2006-03-31
> 13:37:09.000000000 +0200 +++ linux-2.6.16-mm2/kernel/sched.c 2006-04-05
> 19:22:01.000000000 +0200 @@ -3480,7 +3480,7 @@ go_idle:
> queue = array->queue + idx;
> next = list_entry(queue->next, task_t, run_list);
>
> - if (!rt_task(next) && interactive_sleep(next->sleep_type)) {
> + if (!TASK_INTERACTIVE(next) && interactive_sleep(next->sleep_type)) {
You can't remove that rt_task check from there can you? We shouldn't ever
requeue a rt task.
Cheers,
Con
^ permalink raw reply
* Re: freescale lite 5200 board and kernel 2.6
From: Sylvain Munaut @ 2006-04-05 23:14 UTC (permalink / raw)
To: linuxppc-embedded, idefix
In-Reply-To: <20060405212741.GC61331@server.idefix.loc>
Matthias Fechner wrote:
> Hello Domenico,
>
> * Domenico Andreoli <cavokz@gmail.com> [05-04-06 23:06]:
>
>> is there any patchset i can use for kernel 2.6? is it production-ready?
>> why isn't already in vanilla 2.6? has any sense to stay with kernel 2.4?
>>
>
> I'm not sure if this helps, but I was successfully in getting a kernel
> 2.6 running with the icecube board. I have written a short docu in my
> wiki (booting with tftp and rootnfs over NFS):
> http://wiki.idefix.fechner.net/index.php/IceCube#Writing_kernel_modules_for_2.6
>
> Maybe this will help.
> Please give me some feedback.
>
Nice !
It made me realize the git commands I gave on my website were kinda
wrong, I messed
up git fetch and git pull among other things ...
Sylvain
^ permalink raw reply
* [Xenomai-help] Doxygen fails to document rt_task_send() and friends
From: Vincent Levesque @ 2006-04-05 23:10 UTC (permalink / raw)
To: xenomai
Hi,
I just noticed that doxygen doesn't seem to document rt_task_send(),
rt_task_receive() and rt_task_reply() anymore (e.g.
http://www.xenomai.org/documentation/branches/v2.1.x/html/api/group__task.html).
The problem seems to be due to a "#ifdef CONFIG_XENO_OPT_NATIVE_MPS"
command in "/ksrc/skins/native/task.c". Sorry, no patch for now...
Vincent Levesque
vleves@domain.hid
^ permalink raw reply
* [PATCH] Fix searching for filenames in gitk
From: Pavel Roskin @ 2006-04-05 23:02 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
findcont should not accept any arguments.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
gitk | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitk b/gitk
index 26fa79a..e1848cd 100755
--- a/gitk
+++ b/gitk
@@ -2230,7 +2230,7 @@ proc donefilediff {} {
}
}
-proc findcont {id} {
+proc findcont {} {
global findid treediffs parentlist
global ffileline findstartline finddidsel
global displayorder numcommits matchinglines findinprogress
^ permalink raw reply related
* Re: Q on audit, audit-syscall
From: Herbert Rosmanith @ 2006-04-05 22:57 UTC (permalink / raw)
To: Chris Wright; +Cc: Valdis.Kletnieks, Kyle Moffett, Robin Holt, linux-kernel
In-Reply-To: <20060405225535.GO15997@sorel.sous-sol.org>
> There's a decent README with the audit (userspace) source. And the
> actual message format is documented in source code only AFAIK.
ok. thanks to all of you. I wasn't aware that netlink_audit is the
way to go and the others (/dev/audit, LAuS from IBM & SuSE) are obsolete.
and now, good night!
^ permalink raw reply
* PAE dom0 is broken with the default config
From: Kamble, Nitin A @ 2006-04-05 23:00 UTC (permalink / raw)
To: Keir.Fraser, Ian Pratt; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1939 bytes --]
Hi Keir, Ian,
I built PAE Xen with the default config, and it is not booting. Log is
bellow. If I replace the linux-defconfig_xen_x86_32 file with the
linux-defconfig_xen0_x86_32 before building then dom0 is able to boot
and see more than 4Gig memory. This looks like a dom0 kernel config
issue. Do you care PAE dom0 for 3.0.2 with the default config? Is
anybody working on this?
IP route cache hash table entries: 262144 (order: 8, 1048576 bytes)
TCP established hash table entries: 524288 (order: 10, 4194304 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 524288 bind 65536)
TCP reno registered
NET: Registered protocol family 8
NET: Registered protocol family 20
Using IPI No-Shortcut mode
Freeing unused kernel memory: 172k freed
scsi_mod: no version for "struct_module" found: kernel tainted.
SCSI subsystem initialized
ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 17
ata1: SATA max UDMA/133 cmd 0x0 ctl 0xC402 bmdma 0xBC00 irq 17
ata2: SATA max UDMA/133 cmd 0x0 ctl 0xC002 bmdma 0xBC08 irq 17
ata1: dev 0 ATA-6, max UDMA/133, 312581808 sectors: LBA48
ata1: dev 0 configured for UDMA/133
scsi0 : ata_piix
ATA: abnormal status 0x7F on port 0xC087
scsi1 : ata_piix
Vendor: ATA Model: ST3160023AS Rev: 3.00
Type: Direct-Access ANSI SCSI revision: 05
SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
sda: unknown partition table
sd 0:0:0:0: Attached scsi disk sda
Kernel panic - not syncing: Attempted to kill init!
(XEN) Domain 0 crashed: rebooting machine in 5 seconds.
[-- Attachment #1.2: Type: text/html, Size: 8518 bytes --]
[-- Attachment #2: 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: FIQ Handler
From: tony @ 2006-04-05 22:57 UTC (permalink / raw)
To: Matt Callow; +Cc: linux-omap-open-source
In-Reply-To: <44343500.1030306@tesco.net>
* Matt Callow <mc-lists@tesco.net> [060405 14:28]:
> Hi,
>
> I've been trying to install a FIQ handler for an omap 5910 board
> (actually the amstrad E3) but I seem to get a data abort exception as
> soon as I read the SIR_FIQ_CODE register.
> I note in the omap source (arch/arm/mach-omap1/irq.c) it says read the
> mailing list threads on FIQ handlers if you are planning to add a FIQ
> handler. So, I've looked through the archives but can only find a
> reference to http://lkml.org/lkml/2005/6/22/111
>
> Is there more information that I'm missing. If so, could someone point
> me in the right direction please.
Search linux-arm-kernel@lists.arm.linux.org.uk list for it. Also look at
the other FIQ handlers under arch/arm. It should not be hard to do.
Tony
^ permalink raw reply
* Re: Slab corruptions & Re: 2.6.17-rc1: Oops in sound applications
From: Ken Moffat @ 2006-04-05 21:19 UTC (permalink / raw)
To: Jan Niehusmann; +Cc: Takashi Iwai, Ken Moffat, linux-kernel, alsa-devel
In-Reply-To: <20060405121537.GA4807@knautsch.gondor.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 529 bytes --]
On Wed, 5 Apr 2006, Jan Niehusmann wrote:
> On Wed, Apr 05, 2006 at 01:14:54PM +0200, Takashi Iwai wrote:
> > Try the patch below. The change in pcm_native.c may be unnecessary,
> > but it's better so.
> > If it works, I'll submit the patches with a proper log.
>
> The patch (applied to 2.6.17-rc1) does fix the oops, but sound is still
> garbled with twinkle using /dev/dsp.
As a simple user of (only) playback, it fixes it. Thanks to you both.
Ken
--
das eine Mal als Tragödie, das andere Mal als Farce
^ permalink raw reply
* Re: [PATCH] Keys: Improve usage of memory barriers and remove IRQ disablement
From: David S. Miller @ 2006-04-05 22:51 UTC (permalink / raw)
To: nickpiggin; +Cc: dhowells, torvalds, akpm, keyrings, linux-kernel
In-Reply-To: <44338CAE.6060206@yahoo.com.au>
From: Nick Piggin <nickpiggin@yahoo.com.au>
Date: Wed, 05 Apr 2006 19:23:58 +1000
> David Howells wrote:
> > Nick Piggin <nickpiggin@yahoo.com.au> wrote:
>
> > | int atomic_inc_and_test(atomic_t *v);
> > | int atomic_dec_and_test(atomic_t *v);
> > |
> > | These two routines increment and decrement by 1, respectively, the
> > | given atomic counter. They return a boolean indicating whether the
> > | resulting counter value was zero or not.
> > |
> > | It requires explicit memory barrier semantics around the operation as
> > | above.
> >
> > Note the last paragraph. "It requires" should be "They require", but the
> > sense would seem to be obvious. However, it's not clear on a second reading
> > as to whether this is an instruction to the _caller_ or an instruction to the
> > arch _implementer_.
> >
>
> Yes, I remember Dave M clarified this sometime ago (on lkml I guess). It
> is a little confusing, but I think the wording is for the implementer's
> point of view. Dave will pull me up if I'm wrong...
Any routine which returns state must have the barriers in the arch
implementation. These two routines returns state.
^ permalink raw reply
* Re: [RFC/PATCH] date parsing: be friendlier to our European friends.
From: Junio C Hamano @ 2006-04-05 22:54 UTC (permalink / raw)
To: git
In-Reply-To: <7vlkujzly0.fsf_-_@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> This does three things, only applies to cases where the user
> manually tries to override the author/commit time by environment
> variables, with non-ISO, non-2822 format date-string:
>
> - Refuses to use the interpretation to put the date in the
> future; recent kernel history has a commit made with
> 10/03/2006 which is recorded as October 3rd.
>
> - Adds '.' as the possible year-month-date separator. We
> learned from our European friends on the #git channel that
> dd.mm.yyyy is the norm there.
>
> - When the separator is '.', we prefer dd.mm.yyyy over
> mm.dd.yyyy; otherwise mm/dd/yy[yy] takes precedence over
> dd/mm/yy[yy].
Before the list gets useless comments, the code prefer to accept
more sensible and/or unambiguous forms, such as ISO or RFC2822.
The issue this addresses is what to do when we get other forms.
^ permalink raw reply
* AD运用EXCEL改进财务管理和市场营销
From: 4月15-16上海/21-22深圳 @ 2006-04-05 22:54 UTC (permalink / raw)
To: nfs
[-- Attachment #1: Type: text/html, Size: 13602 bytes --]
^ permalink raw reply
* Re: Q on audit, audit-syscall
From: Chris Wright @ 2006-04-05 22:55 UTC (permalink / raw)
To: Herbert Rosmanith
Cc: Chris Wright, Valdis.Kletnieks, Kyle Moffett, Robin Holt,
linux-kernel
In-Reply-To: <200604052246.k35Mkl6L010288@wildsau.enemy.org>
* Herbert Rosmanith (kernel@wildsau.enemy.org) wrote:
> good point. I was reading netlink.c and libaudit.c. obviously the wrong
> place ;-)
There's a decent README with the audit (userspace) source. And the
actual message format is documented in source code only AFAIK.
^ permalink raw reply
* Re: [ANNOUNCE][RFC] PlugSched-6.3.1 for 2.6.16-rc5
From: Peter Williams @ 2006-04-05 22:53 UTC (permalink / raw)
To: Al Boldi; +Cc: linux-kernel
In-Reply-To: <200604051116.05270.a1426z@gawab.com>
Al Boldi wrote:
> Peter Williams wrote:
>> Al Boldi wrote:
>>> Peter Williams wrote:
>>>> Al Boldi wrote:
>>>>>>>> Control parameters for the scheduler can be read/set via files in:
>>>>>>>>
>>>>>>>> /sys/cpusched/<scheduler>/
>>>>> The default values for spa make it really easy to lock up the system.
>>>> Which one of the SPA schedulers and under what conditions? I've been
>>>> mucking around with these and may have broken something. If so I'd
>>>> like to fix it.
>>> spa_no_frills, with a malloc-hog less than timeslice. Setting
>>> promotion_floor to max unlocks the console.
>> OK, you could also try increasing the promotion interval.
>
> Seems that this will only delay the lock in spa_svr but not inhibit it.
OK. But turning the promotion mechanism off completely (which is what
setting the floor to the maximum) runs the risk of a runaway high
priority task locking the whole system up. IMHO the only SPA scheduler
where it's safe for the promotion floor to be greater than MAX_RT_PRIO
is spa_ebs. So a better solution is highly desirable.
I'd like to fix this problem but don't fully understand what it is.
What do you mean by a malloc-hog? Would it possible for you to give me
an example of how to reproduce the problem?
>
>> It should be noted that spa_no_frills isn't really expected to behave
>> very well as it's a pure round robin scheduler.
>
> It's a bare bone scheduler that allows to prioritize procs to the admins
> desire, instead of leaving the priority management to the scheduler, which
> may be undesirable for some but not all.
OK. But it's important to realize that "nice" does not (in general)
control the "amount of CPU" that tasks get with this scheduler. It
merely controls the order in which runnable tasks run i.e. it's a
"priority based" interpretation of "nice" not an "entitlement based"
interpretation. The difference is important.
If you want a "bare bones" scheduler with an "entitlement based"
interpretation of "nice" use spa_ebs with the maximum bonuses set to
zero. In that state spa_ebs is safe for promotion to be completely
disabled unless you also want to use cpu caps (in which case you'd need
to set the floor to about 137 to make sure that capped tasks don't get
completely starved).
>
>> It's intended purpose is as a basis for more sophisticated schedulers.
>
> And that's why the same problem exists in the child scheds, i.e. spa_ws,
> spa_svr, zaphod, but not spa_ebs.
OK.
>
>> I've been thinking
>> about removing it as a bootable scheduler and only making its children
>> available but I find it useful to compare benchmark and other test
>> results from it with that from the other schedulers to get an idea of
>> the extra costs involved.
Thanks,
Peter
--
Peter Williams pwil3058@bigpond.net.au
"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce
^ permalink raw reply
* Re: Q on audit, audit-syscall
From: Herbert Rosmanith @ 2006-04-05 22:46 UTC (permalink / raw)
To: Chris Wright; +Cc: Valdis.Kletnieks, Kyle Moffett, Robin Holt, linux-kernel
In-Reply-To: <20060405223052.GE14724@sorel.sous-sol.org>
> * Herbert Rosmanith (kernel@wildsau.enemy.org) wrote:
> > anyway, the manpage describes how auditd/libaudit works - not how it has been
> > implemented/how it communicates with the kernel.
> > I want to know how it works "under the hood", not just how to use it.
>
> Then grab the source, and read its READMEs.
good point. I was reading netlink.c and libaudit.c. obviously the wrong
place ;-)
> > LSM depends
> > on CONFIG_AUDIT* (this is correct, isn't it?)
>
> No.
>
^ permalink raw reply
* RE: 2.6.17-rc1-mm1
From: Luck, Tony @ 2006-04-05 22:50 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Zou, Nanhai, Andrew Morton, LKML, linux-ia64
> I think the VGA_MAP_MEM(vga_vram_end) is just bogus -- it's not
> that we need to map the memory starting at vga_vram_end. I think
> it would cleaner (though much more intrusive) to do something like
> the patch below, which basically just hard-codes (base, size)
> rather than (base, end).
This patch works for me on ia64/Tiger
-Tony
^ permalink raw reply
* RE: 2.6.17-rc1-mm1
From: Luck, Tony @ 2006-04-05 22:50 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Zou, Nanhai, Andrew Morton, LKML, linux-ia64
In-Reply-To: <20060404233851.GA6411@agluck-lia64.sc.intel.com>
> I think the VGA_MAP_MEM(vga_vram_end) is just bogus -- it's not
> that we need to map the memory starting at vga_vram_end. I think
> it would cleaner (though much more intrusive) to do something like
> the patch below, which basically just hard-codes (base, size)
> rather than (base, end).
This patch works for me on ia64/Tiger
-Tony
^ permalink raw reply
* Re: Bug in vga16fb?
From: Petr Vandrovec @ 2006-04-05 22:48 UTC (permalink / raw)
To: linux-fbdev-devel
In-Reply-To: <20060404204002.GB2251@localhost.localdomain>
Ondrej Zajicek wrote:
> Hello
>
> I tried vga16fb driver in 320x200x4 nonstd mode (on i386 - little endian). In
> this mode framebuffer reports PACKED PIXELS type. Drawing through framebuffer
> is OK, but console is broken - it looks like that even and odd columns are
> exchanged.
>
> Framebuffer structure of this mode is that even pixel is in high nibble and
> odd pixel is in low nibble.
>
> It looks like vga16fb use cfbimgblt.c/slow_imageblit in this mode for
> image-blit and this function in CFB4 writes even pixel in low nibble and
> odd pixel in high nibble.
>
> What is correct framebuffer structure for CFB4 mode?
Unfortunately there is no standard, as CFB4 itself is quite non-standard VGA
mode. Some videocards first output low nibble, followed by high, and some do
otherwise. I've experimented with this back in 2000, and I've found that Matrox
Millennium does exactly opposite than some ATI Mach64 card I had in another box
at that time.
So your only option is providing two CFB4 modes. Unfortunately I have no idea
how to autodetect what your hardware actually does without adding camera to the
system...
Petr Vandrovec
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply
* Re: [RFC/PATCH] date parsing: be friendlier to our European friends.
From: Sam Ravnborg @ 2006-04-05 22:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vlkujzly0.fsf_-_@assigned-by-dhcp.cox.net>
On Wed, Apr 05, 2006 at 03:39:35PM -0700, Junio C Hamano wrote:
> This does three things, only applies to cases where the user
> manually tries to override the author/commit time by environment
> variables, with non-ISO, non-2822 format date-string:
>
> - Refuses to use the interpretation to put the date in the
> future; recent kernel history has a commit made with
> 10/03/2006 which is recorded as October 3rd.
>
> - Adds '.' as the possible year-month-date separator. We
> learned from our European friends on the #git channel that
> dd.mm.yyyy is the norm there.
I my company we have always used yyyy-mm-dd - this is an ISO standard
IIRC. The company is European based.
mm/dd/yy has always made my head spin ;-)
Sam
^ permalink raw reply
* Re: Issues with symbol names
From: Kristis Makris @ 2006-04-05 22:26 UTC (permalink / raw)
To: Andreas Schwab; +Cc: linux-kernel
In-Reply-To: <jeirpn7k6i.fsf@sykes.suse.de>
On Thu, 2006-04-06 at 00:05 +0200, Andreas Schwab wrote:
> Kristis Makris <kristis.makris@asu.edu> writes:
>
> > My goal here is to use /proc/kallsyms to determine the size of a function
> > image at runtime.
>
> The size is also recorded in the symbol table.
Do you mean the vmlinux image ? That is not the case for modules that
were dynamically loaded.
This is when problems begin. If one loads a module that happens to be
placed in memory that originally belonged to the __init functions,
then /proc/kallsyms will still report them and throw off this logic. And
perhaps the original module file won't be around to try and get the
function sizes from it.
I suppose I'd rather rely on computing this size from runtime
information...
^ permalink raw reply
* Re: [PATCH] powerpc: Disable and EOI interrupts in machine_crash_shutdown()
From: Haren Myneni @ 2006-04-05 22:50 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Paul Mackerras, Milton Miller
In-Reply-To: <20060404114306.8DC0F679EF@ozlabs.org>
[-- Attachment #1: Type: text/plain, Size: 2775 bytes --]
linuxppc-dev-bounces+hbabu=us.ibm.com@ozlabs.org wrote on 04/04/2006
04:43:01 AM:
> We've seen several bugs caused by interrupt weirdness in the kdump
kernel.
> Panicking from an interrupt handler means we fail to EOI the interrupt,
and
> so the second kernel never gets that interrupt ever again. We also see
hangs
> on JS20 where we take interrupts in the second kernel early during boot.
>
> This patch fixes both those problems, and although it adds more code to
the
> crash path I think it is the best solution.
>
Michael,
Noticing the following issues when invoked kdump boot using
soft-reset. But the kdump boot is successful. Not a problem using sysrq-c
or Oops.
rtas_call retuned these error messages
"xics_disable_irq: irq=655360: ibm_set_xive(0xff) returned -3" for IRQ#
182
"xics_disable_irq: irq=589825: ibm_set_xive(0xff) returned -3" for IRQ#
216
cat /proc/interrupts
18: 2997 3401 1317 1442 XICS Edge IPI
134: 0 0 0 0 XICS Edge
ehci_hcd:usb1, ohci_hcd:usb2, ohci_hcd:usb3
167: 2169 0 0 0 XICS Edge ipr
182: 55 0 0 0 XICS Edge
hvc_console
216: 0 0 0 0 XICS Edge RAS_EPOW
BAD: 117
Thanks
Haren
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
>
> arch/powerpc/kernel/crash.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> Index: kdump/arch/powerpc/kernel/crash.c
> ===================================================================
> --- kdump.orig/arch/powerpc/kernel/crash.c
> +++ kdump/arch/powerpc/kernel/crash.c
> @@ -22,6 +22,7 @@
> #include <linux/elf.h>
> #include <linux/elfcore.h>
> #include <linux/init.h>
> +#include <linux/irq.h>
> #include <linux/types.h>
>
> #include <asm/processor.h>
> @@ -174,6 +175,8 @@ static void crash_kexec_prepare_cpus(voi
>
> void default_machine_crash_shutdown(struct pt_regs *regs)
> {
> + unsigned int irq;
> +
> /*
> * This function is only called after the system
> * has paniced or is otherwise in a critical state.
> @@ -186,6 +189,16 @@ void default_machine_crash_shutdown(stru
> */
> local_irq_disable();
>
> + for_each_irq(irq) {
> + struct irq_desc *desc = irq_descp(irq);
> +
> + if (desc->status & IRQ_INPROGRESS)
> + desc->handler->end(irq);
> +
> + if (!(desc->status & IRQ_DISABLED))
> + desc->handler->disable(irq);
> + }
> +
> if (ppc_md.kexec_cpu_down)
> ppc_md.kexec_cpu_down(1, 0);
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
[-- Attachment #2: Type: text/html, Size: 4485 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.