* Re: [dm-crypt] please HELP - can't acces encrypted LVM after linux reinstallation.
From: Aleksander Swirski @ 2011-10-30 19:03 UTC (permalink / raw)
To: dm-crypt
In-Reply-To: <1319876133.21316.3.camel@scapa>
[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]
This was always decrypted data. I was making tar archives of system
partitions, already decrypted and mounted. So I think, the header can't be
there?
Yves, looking at your e-mail - maybe you can advice me weather and how
should I send some info to debian team? I think some small warning or info
could make a big difference for other people who might try to reattach their
previously encrypted drive to a new debian install.
On 29 October 2011 10:15, Yves-Alexis Perez <corsac@debian.org> wrote:
> On sam., 2011-10-29 at 07:14 +1300, Aleksander Swirski wrote:
> > it's my largest drive, but I will put this one aside and use another
> > computer. i was tired, when i did that, didn't have clear mind. now I
> have
> > no idea, how possibly could I fix this, but it all happened because of
> some
> > mental pressure I felt. so I guess, now it's time to chill out. anyway, i
> > feel bit better because You People :) cared enough to inform me and tried
> to
> > help me. it's greatly appreciated.
>
> You said in the initial mail that you had some backup of the system but
> they were a bit old. Are those backup of encrypted or decrypted data? Is
> there a chance you may have the luks header somehwere in your backups?
>
> Regards,
> --
> Yves-Alexis
>
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
>
>
[-- Attachment #2: Type: text/html, Size: 1905 bytes --]
^ permalink raw reply
* [B.A.T.M.A.N.] [PATCH] batman-adv: generalise tt_local_reset_flags()
From: Antonio Quartulli @ 2011-10-30 19:09 UTC (permalink / raw)
To: b.a.t.m.a.n
The tt_local_reset_flags() is actually used for one use case only. It is not
generalised enough to be used indifferent situations. This patch make it general
enough in order to let other code use it whenever a flag flip is requested over
the whole hash table (passed as parameter).
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
This patch depends on:
batman-adv: create a common substructure for tt_global/local_entry
translation-table.c | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/translation-table.c b/translation-table.c
index 76134bc..5b60aba 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1695,19 +1695,20 @@ void tt_free(struct bat_priv *bat_priv)
kfree(bat_priv->tt_buff);
}
-/* This function will reset the specified flags from all the entries in
- * the given hash table and will increment num_local_tt for each involved
- * entry */
-static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
+/* This function will flip to new_value (if not already) the specified flags for
+ * all the entries in the given hash table and returns the number of modified
+ * entries */
+static uint16_t tt_flip_flags(struct hashtable_t *hash, uint16_t flags,
+ uint8_t new_value)
{
uint32_t i;
- struct hashtable_t *hash = bat_priv->tt_local_hash;
+ uint16_t changed_num = 0;
struct hlist_head *head;
struct hlist_node *node;
struct tt_common_entry *tt_common_entry;
if (!hash)
- return;
+ goto out;
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@ -1715,14 +1716,18 @@ static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
rcu_read_lock();
hlist_for_each_entry_rcu(tt_common_entry, node,
head, hash_entry) {
- if (!(tt_common_entry->flags & flags))
+ if ((tt_common_entry->flags & flags) != new_value)
continue;
- tt_common_entry->flags &= ~flags;
- atomic_inc(&bat_priv->num_local_tt);
+ /* depending on 'new_value', enable or disable the flags
+ * pointed by 'flags' */
+ tt_common_entry->flags &=
+ (~flags | (new_value ? flags : NO_FLAGS));
+ changed_num++;
}
rcu_read_unlock();
}
-
+out:
+ return changed_num;
}
/* Purge out all the tt local entries marked with TT_CLIENT_PENDING */
@@ -1766,7 +1771,11 @@ static void tt_local_purge_pending_clients(struct bat_priv *bat_priv)
void tt_commit_changes(struct bat_priv *bat_priv)
{
- tt_local_reset_flags(bat_priv, TT_CLIENT_NEW);
+ uint16_t changed_num = tt_flip_flags(bat_priv->tt_local_hash,
+ TT_CLIENT_NEW, 0);
+ /* all the reset entries have now to be effectively counted as local
+ * entries */
+ atomic_add(changed_num, &bat_priv->num_local_tt);
tt_local_purge_pending_clients(bat_priv);
/* Increment the TTVN only once per OGM interval */
--
1.7.3.4
^ permalink raw reply related
* [Bug 42373] Radeon HD 6450 (NI CAICOS) screen corruption on boot
From: bugzilla-daemon @ 2011-10-30 12:13 UTC (permalink / raw)
To: dri-devel
In-Reply-To: <bug-42373-502@http.bugs.freedesktop.org/>
https://bugs.freedesktop.org/show_bug.cgi?id=42373
Alex Deucher <agd5f@yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
--- Comment #3 from Alex Deucher <agd5f@yahoo.com> 2011-10-30 12:13:22 UTC ---
Should be fixed with this patch:
http://cgit.freedesktop.org/~airlied/linux/commit/?h=drm-fixes&id=12d5180bd7e683a4ae80830b82ba67e7b7fac7b2
*** This bug has been marked as a duplicate of bug 40103 ***
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
^ permalink raw reply
* [PATCH 1/5] drm/i915: kicking rings stuck on semaphores considered harmful
From: Daniel Vetter @ 2011-10-30 19:12 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter
If our semaphore logic gets confused and we have a ring stuck waiting
for one, there's a decent chance it'll just execute garbage when being
kicked. Also, kicking the ring obscures the place where the error
first occured, making error_state decoding much harder.
So drop this an let gpu reset handle this mess in a clean fashion.
In contrast, kicking rings stuck on MI_WAIT is rather harmless, at
worst there'll be a bit of screen-flickering. There's also old
broken userspace out there which needs this as a work-around.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@hchris-wilson.co.uk>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
---
drivers/gpu/drm/i915/i915_irq.c | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index b40004b..69d4044 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1649,13 +1649,6 @@ static bool kick_ring(struct intel_ring_buffer *ring)
I915_WRITE_CTL(ring, tmp);
return true;
}
- if (IS_GEN6(dev) &&
- (tmp & RING_WAIT_SEMAPHORE)) {
- DRM_ERROR("Kicking stuck semaphore on %s\n",
- ring->name);
- I915_WRITE_CTL(ring, tmp);
- return true;
- }
return false;
}
--
1.7.6.4
^ permalink raw reply related
* [PATCH 2/5] drm/i915: don't bail out of intel_wait_ring_buffer too early
From: Daniel Vetter @ 2011-10-30 19:12 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter
In-Reply-To: <1320001932-1846-1-git-send-email-daniel.vetter@ffwll.ch>
In the pre-gem days with non-existing hangcheck and gpu reset code,
this timeout of 3 seconds was pretty important to avoid stuck
processes.
But now we have the hangcheck code in gem that goes to great length
to ensure that the gpu is really dead before declaring it wedged.
So there's no need for this timeout anymore. Actually it's even harmful
because we can bail out too early (e.g. with xscreensaver slip)
when running giant batchbuffers. And our code isn't robust enough
to properly unroll any state-changes, we pretty much rely on the gpu
reset code cleaning up the mess (like cache tracking, fencing state,
active list/request tracking, ...).
With this change intel_begin_ring can only fail when the gpu is
wedged, and it will return -EAGAIN (like wait_request in case the
gpu reset is still outstanding).
v2: Chris Wilson noted that on resume timers aren't running and hence
we won't ever get kicked out of this loop by the hangcheck code. Use
an insanely large timeout instead for the HAS_GEM case to prevent
resume bugs from totally hanging the machine.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/intel_ringbuffer.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index ca70e2f..6e28301 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1119,7 +1119,16 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)
}
trace_i915_ring_wait_begin(ring);
- end = jiffies + 3 * HZ;
+ if (drm_core_check_feature(dev, DRIVER_GEM))
+ /* With GEM the hangcheck timer should kick us out of the loop,
+ * leaving it early runs the risk of corrupting GEM state (due
+ * to running on almost untested codepaths). But on resume
+ * timers don't work yet, so prevent a complete hang in that
+ * case by choosing an insanely large timeout. */
+ end = jiffies + 60 * HZ;
+ else
+ end = jiffies + 3 * HZ;
+
do {
ring->head = I915_READ_HEAD(ring);
ring->space = ring_space(ring);
--
1.7.6.4
^ permalink raw reply related
* [PATCH 3/5] drm/i915: switch ring->id to be a real id
From: Daniel Vetter @ 2011-10-30 19:12 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter
In-Reply-To: <1320001932-1846-1-git-send-email-daniel.vetter@ffwll.ch>
... and add a helpr function for the places where we want a flag.
This way we can use ring->id to index into arrays.
v2: Resurrect the missing beautification-space Chris Wilson noted.
I'm moving this space around because I'll reuse ring_str in the next
patch.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 9 +++++----
drivers/gpu/drm/i915/i915_gem_execbuffer.c | 4 ++--
drivers/gpu/drm/i915/i915_irq.c | 2 +-
drivers/gpu/drm/i915/intel_ringbuffer.c | 14 +++++++-------
drivers/gpu/drm/i915/intel_ringbuffer.h | 20 ++++++++++----------
5 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index f2e0207..9e6cd50 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -666,9 +666,9 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data)
static const char *ring_str(int ring)
{
switch (ring) {
- case RING_RENDER: return " render";
- case RING_BSD: return " bsd";
- case RING_BLT: return " blt";
+ case RCS: return "render";
+ case VCS: return "bsd";
+ case BCS: return "blt";
default: return "";
}
}
@@ -711,7 +711,7 @@ static void print_error_buffers(struct seq_file *m,
seq_printf(m, "%s [%d]:\n", name, count);
while (count--) {
- seq_printf(m, " %08x %8u %04x %04x %08x%s%s%s%s%s%s",
+ seq_printf(m, " %08x %8u %04x %04x %08x%s%s%s%s%s%s%s",
err->gtt_offset,
err->size,
err->read_domains,
@@ -721,6 +721,7 @@ static void print_error_buffers(struct seq_file *m,
tiling_flag(err->tiling),
dirty_flag(err->dirty),
purgeable_flag(err->purgeable),
+ err->ring != -1 ? " " : "",
ring_str(err->ring),
cache_level_str(err->cache_level));
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 3693e83..926ed48 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -202,9 +202,9 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj,
cd->invalidate_domains |= invalidate_domains;
cd->flush_domains |= flush_domains;
if (flush_domains & I915_GEM_GPU_DOMAINS)
- cd->flush_rings |= obj->ring->id;
+ cd->flush_rings |= intel_ring_flag(obj->ring);
if (invalidate_domains & I915_GEM_GPU_DOMAINS)
- cd->flush_rings |= ring->id;
+ cd->flush_rings |= intel_ring_flag(ring);
}
struct eb_objects {
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 69d4044..3cd85dd 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -804,7 +804,7 @@ static u32 capture_bo_list(struct drm_i915_error_buffer *err,
err->tiling = obj->tiling_mode;
err->dirty = obj->dirty;
err->purgeable = obj->madv != I915_MADV_WILLNEED;
- err->ring = obj->ring ? obj->ring->id : 0;
+ err->ring = obj->ring ? obj->ring->id : -1;
err->cache_level = obj->cache_level;
if (++i == count)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 6e28301..3c30dba 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -726,13 +726,13 @@ void intel_ring_setup_status_page(struct intel_ring_buffer *ring)
*/
if (IS_GEN7(dev)) {
switch (ring->id) {
- case RING_RENDER:
+ case RCS:
mmio = RENDER_HWS_PGA_GEN7;
break;
- case RING_BLT:
+ case BCS:
mmio = BLT_HWS_PGA_GEN7;
break;
- case RING_BSD:
+ case VCS:
mmio = BSD_HWS_PGA_GEN7;
break;
}
@@ -1185,7 +1185,7 @@ void intel_ring_advance(struct intel_ring_buffer *ring)
static const struct intel_ring_buffer render_ring = {
.name = "render ring",
- .id = RING_RENDER,
+ .id = RCS,
.mmio_base = RENDER_RING_BASE,
.size = 32 * PAGE_SIZE,
.init = init_render_ring,
@@ -1208,7 +1208,7 @@ static const struct intel_ring_buffer render_ring = {
static const struct intel_ring_buffer bsd_ring = {
.name = "bsd ring",
- .id = RING_BSD,
+ .id = VCS,
.mmio_base = BSD_RING_BASE,
.size = 32 * PAGE_SIZE,
.init = init_ring_common,
@@ -1318,7 +1318,7 @@ gen6_bsd_ring_put_irq(struct intel_ring_buffer *ring)
/* ring buffer for Video Codec for Gen6+ */
static const struct intel_ring_buffer gen6_bsd_ring = {
.name = "gen6 bsd ring",
- .id = RING_BSD,
+ .id = VCS,
.mmio_base = GEN6_BSD_RING_BASE,
.size = 32 * PAGE_SIZE,
.init = init_ring_common,
@@ -1453,7 +1453,7 @@ static void blt_ring_cleanup(struct intel_ring_buffer *ring)
static const struct intel_ring_buffer gen6_blt_ring = {
.name = "blt ring",
- .id = RING_BLT,
+ .id = BCS,
.mmio_base = BLT_RING_BASE,
.size = 32 * PAGE_SIZE,
.init = blt_ring_init,
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 68281c9..c8b9cc0 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -1,13 +1,6 @@
#ifndef _INTEL_RINGBUFFER_H_
#define _INTEL_RINGBUFFER_H_
-enum {
- RCS = 0x0,
- VCS,
- BCS,
- I915_NUM_RINGS,
-};
-
struct intel_hw_status_page {
u32 __iomem *page_addr;
unsigned int gfx_addr;
@@ -36,10 +29,11 @@ struct intel_hw_status_page {
struct intel_ring_buffer {
const char *name;
enum intel_ring_id {
- RING_RENDER = 0x1,
- RING_BSD = 0x2,
- RING_BLT = 0x4,
+ RCS = 0x0,
+ VCS,
+ BCS,
} id;
+#define I915_NUM_RINGS 3
u32 mmio_base;
void __iomem *virtual_start;
struct drm_device *dev;
@@ -119,6 +113,12 @@ struct intel_ring_buffer {
void *private;
};
+static inline unsigned
+intel_ring_flag(struct intel_ring_buffer *ring)
+{
+ return 1 << ring->id;
+}
+
static inline u32
intel_ring_sync_index(struct intel_ring_buffer *ring,
struct intel_ring_buffer *other)
--
1.7.6.4
^ permalink raw reply related
* [PATCH 4/5] drm/i915: refactor ring error state capture to use arrays
From: Daniel Vetter @ 2011-10-30 19:12 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter
In-Reply-To: <1320001932-1846-1-git-send-email-daniel.vetter@ffwll.ch>
The code already got unwindy and we want to dump more per-ring
registers.
Only functional change is that we now also capture the video
ring registers on ilk.
v2: fixup a refactor fumble spotted by Chris Wilson.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/i915/i915_debugfs.c | 55 ++++++++++++++-------------
drivers/gpu/drm/i915/i915_drv.h | 20 ++-------
drivers/gpu/drm/i915/i915_irq.c | 70 ++++++++++++++++++-----------------
drivers/gpu/drm/i915/i915_reg.h | 11 +----
4 files changed, 73 insertions(+), 83 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 9e6cd50..290aece 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -735,6 +735,26 @@ static void print_error_buffers(struct seq_file *m,
}
}
+static void i915_ring_error_state(struct seq_file *m,
+ struct drm_device *dev,
+ struct drm_i915_error_state *error,
+ unsigned ring)
+{
+ seq_printf(m, "%s command stream:\n", ring_str(ring));
+ seq_printf(m, " ACTHD: 0x%08x\n", error->acthd[ring]);
+ seq_printf(m, " IPEIR: 0x%08x\n", error->ipeir[ring]);
+ seq_printf(m, " IPEHR: 0x%08x\n", error->ipehr[ring]);
+ seq_printf(m, " INSTDONE: 0x%08x\n", error->instdone[ring]);
+ if (ring == RCS) {
+ if (INTEL_INFO(dev)->gen >= 4) {
+ seq_printf(m, " INSTDONE1: 0x%08x\n", error->instdone1);
+ seq_printf(m, " INSTPS: 0x%08x\n", error->instps);
+ }
+ seq_printf(m, " INSTPM: 0x%08x\n", error->instpm);
+ }
+ seq_printf(m, " seqno: 0x%08x\n", error->seqno[ring]);
+}
+
static int i915_error_state(struct seq_file *m, void *unused)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -757,36 +777,19 @@ static int i915_error_state(struct seq_file *m, void *unused)
seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device);
seq_printf(m, "EIR: 0x%08x\n", error->eir);
seq_printf(m, "PGTBL_ER: 0x%08x\n", error->pgtbl_er);
- if (INTEL_INFO(dev)->gen >= 6) {
- seq_printf(m, "ERROR: 0x%08x\n", error->error);
- seq_printf(m, "Blitter command stream:\n");
- seq_printf(m, " ACTHD: 0x%08x\n", error->bcs_acthd);
- seq_printf(m, " IPEIR: 0x%08x\n", error->bcs_ipeir);
- seq_printf(m, " IPEHR: 0x%08x\n", error->bcs_ipehr);
- seq_printf(m, " INSTDONE: 0x%08x\n", error->bcs_instdone);
- seq_printf(m, " seqno: 0x%08x\n", error->bcs_seqno);
- seq_printf(m, "Video (BSD) command stream:\n");
- seq_printf(m, " ACTHD: 0x%08x\n", error->vcs_acthd);
- seq_printf(m, " IPEIR: 0x%08x\n", error->vcs_ipeir);
- seq_printf(m, " IPEHR: 0x%08x\n", error->vcs_ipehr);
- seq_printf(m, " INSTDONE: 0x%08x\n", error->vcs_instdone);
- seq_printf(m, " seqno: 0x%08x\n", error->vcs_seqno);
- }
- seq_printf(m, "Render command stream:\n");
- seq_printf(m, " ACTHD: 0x%08x\n", error->acthd);
- seq_printf(m, " IPEIR: 0x%08x\n", error->ipeir);
- seq_printf(m, " IPEHR: 0x%08x\n", error->ipehr);
- seq_printf(m, " INSTDONE: 0x%08x\n", error->instdone);
- if (INTEL_INFO(dev)->gen >= 4) {
- seq_printf(m, " INSTDONE1: 0x%08x\n", error->instdone1);
- seq_printf(m, " INSTPS: 0x%08x\n", error->instps);
- }
- seq_printf(m, " INSTPM: 0x%08x\n", error->instpm);
- seq_printf(m, " seqno: 0x%08x\n", error->seqno);
for (i = 0; i < dev_priv->num_fence_regs; i++)
seq_printf(m, " fence[%d] = %08llx\n", i, error->fence[i]);
+ if (INTEL_INFO(dev)->gen >= 6)
+ seq_printf(m, "ERROR: 0x%08x\n", error->error);
+
+ i915_ring_error_state(m, dev, error, RCS);
+ if (HAS_BLT(dev))
+ i915_ring_error_state(m, dev, error, BCS);
+ if (HAS_BSD(dev))
+ i915_ring_error_state(m, dev, error, VCS);
+
if (error->active_bo)
print_error_buffers(m, "Active",
error->active_bo,
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d2da91f..17617c1 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -151,25 +151,15 @@ struct drm_i915_error_state {
u32 eir;
u32 pgtbl_er;
u32 pipestat[I915_MAX_PIPES];
- u32 ipeir;
- u32 ipehr;
- u32 instdone;
- u32 acthd;
+ u32 ipeir[I915_NUM_RINGS];
+ u32 ipehr[I915_NUM_RINGS];
+ u32 instdone[I915_NUM_RINGS];
+ u32 acthd[I915_NUM_RINGS];
u32 error; /* gen6+ */
- u32 bcs_acthd; /* gen6+ blt engine */
- u32 bcs_ipehr;
- u32 bcs_ipeir;
- u32 bcs_instdone;
- u32 bcs_seqno;
- u32 vcs_acthd; /* gen6+ bsd engine */
- u32 vcs_ipehr;
- u32 vcs_ipeir;
- u32 vcs_instdone;
- u32 vcs_seqno;
u32 instpm;
u32 instps;
u32 instdone1;
- u32 seqno;
+ u32 seqno[I915_NUM_RINGS];
u64 bbaddr;
u64 fence[I915_MAX_NUM_FENCES];
struct timeval time;
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 3cd85dd..70e67f1 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -876,6 +876,32 @@ i915_error_first_batchbuffer(struct drm_i915_private *dev_priv,
return NULL;
}
+static void i915_record_ring_state(struct drm_device *dev,
+ struct drm_i915_error_state *error,
+ struct intel_ring_buffer *ring)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+
+ if (INTEL_INFO(dev)->gen >= 4) {
+ error->ipeir[ring->id] = I915_READ(RING_IPEIR(ring->mmio_base));
+ error->ipehr[ring->id] = I915_READ(RING_IPEHR(ring->mmio_base));
+ error->instdone[ring->id] = I915_READ(RING_INSTDONE(ring->mmio_base));
+ if (ring->id == RCS) {
+ error->instps = I915_READ(INSTPS);
+ error->instdone1 = I915_READ(INSTDONE1);
+ error->bbaddr = I915_READ64(BB_ADDR);
+ }
+ } else {
+ error->ipeir[ring->id] = I915_READ(IPEIR);
+ error->ipehr[ring->id] = I915_READ(IPEHR);
+ error->instdone[ring->id] = I915_READ(INSTDONE);
+ error->bbaddr = 0;
+ }
+
+ error->seqno[ring->id] = ring->get_seqno(ring);
+ error->acthd[ring->id] = intel_ring_get_active_head(ring);
+}
+
/**
* i915_capture_error_state - capture an error record for later analysis
* @dev: drm device
@@ -909,47 +935,23 @@ static void i915_capture_error_state(struct drm_device *dev)
DRM_INFO("capturing error event; look for more information in /debug/dri/%d/i915_error_state\n",
dev->primary->index);
- error->seqno = dev_priv->ring[RCS].get_seqno(&dev_priv->ring[RCS]);
error->eir = I915_READ(EIR);
error->pgtbl_er = I915_READ(PGTBL_ER);
for_each_pipe(pipe)
error->pipestat[pipe] = I915_READ(PIPESTAT(pipe));
error->instpm = I915_READ(INSTPM);
- error->error = 0;
- if (INTEL_INFO(dev)->gen >= 6) {
+
+ if (INTEL_INFO(dev)->gen >= 6)
error->error = I915_READ(ERROR_GEN6);
+ else
+ error->error = 0;
+
+ i915_record_ring_state(dev, error, &dev_priv->ring[RCS]);
+ if (HAS_BLT(dev))
+ i915_record_ring_state(dev, error, &dev_priv->ring[BCS]);
+ if (HAS_BSD(dev))
+ i915_record_ring_state(dev, error, &dev_priv->ring[VCS]);
- error->bcs_acthd = I915_READ(BCS_ACTHD);
- error->bcs_ipehr = I915_READ(BCS_IPEHR);
- error->bcs_ipeir = I915_READ(BCS_IPEIR);
- error->bcs_instdone = I915_READ(BCS_INSTDONE);
- error->bcs_seqno = 0;
- if (dev_priv->ring[BCS].get_seqno)
- error->bcs_seqno = dev_priv->ring[BCS].get_seqno(&dev_priv->ring[BCS]);
-
- error->vcs_acthd = I915_READ(VCS_ACTHD);
- error->vcs_ipehr = I915_READ(VCS_IPEHR);
- error->vcs_ipeir = I915_READ(VCS_IPEIR);
- error->vcs_instdone = I915_READ(VCS_INSTDONE);
- error->vcs_seqno = 0;
- if (dev_priv->ring[VCS].get_seqno)
- error->vcs_seqno = dev_priv->ring[VCS].get_seqno(&dev_priv->ring[VCS]);
- }
- if (INTEL_INFO(dev)->gen >= 4) {
- error->ipeir = I915_READ(IPEIR_I965);
- error->ipehr = I915_READ(IPEHR_I965);
- error->instdone = I915_READ(INSTDONE_I965);
- error->instps = I915_READ(INSTPS);
- error->instdone1 = I915_READ(INSTDONE1);
- error->acthd = I915_READ(ACTHD_I965);
- error->bbaddr = I915_READ64(BB_ADDR);
- } else {
- error->ipeir = I915_READ(IPEIR);
- error->ipehr = I915_READ(IPEHR);
- error->instdone = I915_READ(INSTDONE);
- error->acthd = I915_READ(ACTHD);
- error->bbaddr = 0;
- }
i915_gem_record_fences(dev, error);
/* Record the active batch and ring buffers */
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 5a09416..c292957 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -352,6 +352,9 @@
#define IPEIR_I965 0x02064
#define IPEHR_I965 0x02068
#define INSTDONE_I965 0x0206c
+#define RING_IPEIR(base) ((base)+0x64)
+#define RING_IPEHR(base) ((base)+0x68)
+#define RING_INSTDONE(base) ((base)+0x6c)
#define INSTPS 0x02070 /* 965+ only */
#define INSTDONE1 0x0207c /* 965+ only */
#define ACTHD_I965 0x02074
@@ -365,14 +368,6 @@
#define INSTDONE 0x02090
#define NOPID 0x02094
#define HWSTAM 0x02098
-#define VCS_INSTDONE 0x1206C
-#define VCS_IPEIR 0x12064
-#define VCS_IPEHR 0x12068
-#define VCS_ACTHD 0x12074
-#define BCS_INSTDONE 0x2206C
-#define BCS_IPEIR 0x22064
-#define BCS_IPEHR 0x22068
-#define BCS_ACTHD 0x22074
#define ERROR_GEN6 0x040a0
--
1.7.6.4
^ permalink raw reply related
* [PATCH 5/5] drm/i915: collect more per ring error state
From: Daniel Vetter @ 2011-10-30 19:12 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter
In-Reply-To: <1320001932-1846-1-git-send-email-daniel.vetter@ffwll.ch>
Based on a patch by Ben Widawsky, but with different colors
for the bikeshed.
In contrast to Ben's patch this one doesn't add the fault regs.
Afaics they're for the optional page fault support which
- we're not enabling
- and which seems to be unsupported by the hw team. Recent bspec
lacks tons of information about this that the public docs released
half a year back still contain.
Also dump ring HEAD/TAIL registers - I've recently seen a few
error_state where just guessing these is not good enough.
v2: Also dump INSTPM for every ring.
v3: Fix a few really silly goof-ups spotted by Chris Wilson.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 16 ++++++++++------
drivers/gpu/drm/i915/i915_drv.h | 7 +++++--
drivers/gpu/drm/i915/i915_irq.c | 9 +++++++--
drivers/gpu/drm/i915/i915_reg.h | 3 +++
4 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 290aece..5ba63ad 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -741,17 +741,21 @@ static void i915_ring_error_state(struct seq_file *m,
unsigned ring)
{
seq_printf(m, "%s command stream:\n", ring_str(ring));
+ seq_printf(m, " HEAD: 0x%08x\n", error->head[ring]);
+ seq_printf(m, " TAIL: 0x%08x\n", error->tail[ring]);
seq_printf(m, " ACTHD: 0x%08x\n", error->acthd[ring]);
seq_printf(m, " IPEIR: 0x%08x\n", error->ipeir[ring]);
seq_printf(m, " IPEHR: 0x%08x\n", error->ipehr[ring]);
seq_printf(m, " INSTDONE: 0x%08x\n", error->instdone[ring]);
- if (ring == RCS) {
- if (INTEL_INFO(dev)->gen >= 4) {
- seq_printf(m, " INSTDONE1: 0x%08x\n", error->instdone1);
- seq_printf(m, " INSTPS: 0x%08x\n", error->instps);
- }
- seq_printf(m, " INSTPM: 0x%08x\n", error->instpm);
+ if (ring == RCS && INTEL_INFO(dev)->gen >= 4) {
+ seq_printf(m, " INSTDONE1: 0x%08x\n", error->instdone1);
+ seq_printf(m, " BBADDR: 0x%08llx\n", error->bbaddr);
}
+ if (INTEL_INFO(dev)->gen >= 4)
+ seq_printf(m, " INSTPS: 0x%08x\n", error->instps[ring]);
+ seq_printf(m, " INSTPM: 0x%08x\n", error->instpm[ring]);
+ if (INTEL_INFO(dev)->gen >= 6)
+ seq_printf(m, " FADDR: 0x%08x\n", error->faddr[ring]);
seq_printf(m, " seqno: 0x%08x\n", error->seqno[ring]);
}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 17617c1..bd98fb3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -151,16 +151,19 @@ struct drm_i915_error_state {
u32 eir;
u32 pgtbl_er;
u32 pipestat[I915_MAX_PIPES];
+ u32 tail[I915_NUM_RINGS];
+ u32 head[I915_NUM_RINGS];
u32 ipeir[I915_NUM_RINGS];
u32 ipehr[I915_NUM_RINGS];
u32 instdone[I915_NUM_RINGS];
u32 acthd[I915_NUM_RINGS];
u32 error; /* gen6+ */
- u32 instpm;
- u32 instps;
+ u32 instpm[I915_NUM_RINGS];
+ u32 instps[I915_NUM_RINGS];
u32 instdone1;
u32 seqno[I915_NUM_RINGS];
u64 bbaddr;
+ u32 faddr[I915_NUM_RINGS];
u64 fence[I915_MAX_NUM_FENCES];
struct timeval time;
struct drm_i915_error_object {
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 70e67f1..a04d606 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -882,12 +882,15 @@ static void i915_record_ring_state(struct drm_device *dev,
{
struct drm_i915_private *dev_priv = dev->dev_private;
+ if (INTEL_INFO(dev)->gen >= 6)
+ error->faddr[ring->id] = I915_READ(RING_DMA_FADD(ring->mmio_base));
+
if (INTEL_INFO(dev)->gen >= 4) {
error->ipeir[ring->id] = I915_READ(RING_IPEIR(ring->mmio_base));
error->ipehr[ring->id] = I915_READ(RING_IPEHR(ring->mmio_base));
error->instdone[ring->id] = I915_READ(RING_INSTDONE(ring->mmio_base));
+ error->instps[ring->id] = I915_READ(RING_INSTPS(ring->mmio_base));
if (ring->id == RCS) {
- error->instps = I915_READ(INSTPS);
error->instdone1 = I915_READ(INSTDONE1);
error->bbaddr = I915_READ64(BB_ADDR);
}
@@ -898,8 +901,11 @@ static void i915_record_ring_state(struct drm_device *dev,
error->bbaddr = 0;
}
+ error->instpm[ring->id] = I915_READ(RING_INSTPM(ring->mmio_base));
error->seqno[ring->id] = ring->get_seqno(ring);
error->acthd[ring->id] = intel_ring_get_active_head(ring);
+ error->head[ring->id] = I915_READ_HEAD(ring);
+ error->tail[ring->id] = I915_READ_TAIL(ring);
}
/**
@@ -939,7 +945,6 @@ static void i915_capture_error_state(struct drm_device *dev)
error->pgtbl_er = I915_READ(PGTBL_ER);
for_each_pipe(pipe)
error->pipestat[pipe] = I915_READ(PIPESTAT(pipe));
- error->instpm = I915_READ(INSTPM);
if (INTEL_INFO(dev)->gen >= 6)
error->error = I915_READ(ERROR_GEN6);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index c292957..cbf5f9f 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -355,6 +355,9 @@
#define RING_IPEIR(base) ((base)+0x64)
#define RING_IPEHR(base) ((base)+0x68)
#define RING_INSTDONE(base) ((base)+0x6c)
+#define RING_INSTPS(base) ((base)+0x70)
+#define RING_DMA_FADD(base) ((base)+0x78)
+#define RING_INSTPM(base) ((base)+0xc0)
#define INSTPS 0x02070 /* 965+ only */
#define INSTDONE1 0x0207c /* 965+ only */
#define ACTHD_I965 0x02074
--
1.7.6.4
^ permalink raw reply related
* Re: console-image: No login prompt
From: Ulf Samuelsson @ 2011-10-30 19:07 UTC (permalink / raw)
To: openembedded-devel
In-Reply-To: <4EAC86BD.9040903@telia.com>
2011-10-30 01:05, Ulf Samuelsson skrev:
> 2011-10-30 00:41, Ulf Samuelsson skrev:
>> 2011-10-30 00:36, Ulf Samuelsson skrev:
>>> Have build console-image and I am running it on an AT91SAM9G20EK.
>>> The boot process freezes, and I have managed to verify that this
>>> happens after the init process has executed "finished.sh".
>>> (Put some print statements in this, and I see them)
>>>
>>> Then nothing...
>>> Normally I would get a login prompt
>>
>> Is this somehow redirected to the non-existant screen?
>
> A little futher.
> If I enable SULOGIN and from SULOGIN do:
>
> $ init 2
>
> I get the login prompt,
> but SULOGIN uses the same serial line, so things get mixed up.
>
> It definitely looks like the system never leaves level 1 - why?
Tried with a different kernel.
2.6.30 has problems.
2.6.39 I get the login prompt.
Any clue why?
>>
>>>
>>> Have been searching for people with similar problems,
>>> and I found one that claimed that /etc/rcS.d/S03udev
>>> needs to run after /etc/rcS.d/S10checkout.
>>>
>>> I tried this but this does not make any difference.
>>> Is there some configuration item that enables/disables the console
>>> after init.
>>>
>>> finish.sh is linked from rcS.d/S99/finish.sh
>>>
>>> Is the problem, that the kernel stays in level 1 for some reason?
>>> Default run level is 5 (id:5:initdefault:) which I assume
>>>
>>> Does that make sense for a console-image?
>>>
>>> Should not level 3 be more appropriate if
>>> you do not have any graphics?
>>>
>>> Any reason why console I/O is redirected?
>>>
>>> ------------------------------------------------------------------------------------
>>>
>>> # /etc/inittab: init(8) configuration.
>>> # $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
>>>
>>> # The default runlevel.
>>> id:5:initdefault:
>>>
>>> # Boot-time system configuration/initialization script.
>>> # This is run first except when booting in emergency (-b) mode.
>>> si::sysinit:/etc/init.d/rcS
>>>
>>> # What to do in single-user mode.
>>> ~~:S:wait:/sbin/sulogin
>>>
>>> # /etc/init.d executes the S and K scripts upon change
>>> # of runlevel.
>>> #
>>> # Runlevel 0 is halt.
>>> # Runlevel 1 is single-user.
>>> # Runlevels 2-5 are multi-user.
>>> # Runlevel 6 is reboot.
>>>
>>> l0:0:wait:/etc/init.d/rc 0
>>> l1:1:wait:/etc/init.d/rc 1
>>> l2:2:wait:/etc/init.d/rc 2
>>> l3:3:wait:/etc/init.d/rc 3
>>> l4:4:wait:/etc/init.d/rc 4
>>> l5:5:wait:/etc/init.d/rc 5
>>> l6:6:wait:/etc/init.d/rc 6
>>> # Normally not reached, but fallthrough in case of emergency.
>>> z6:6:respawn:/sbin/sulogin
>>> S:2345:respawn:/sbin/getty 115200 ttyS0
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
--
Best Regards
Ulf Samuelsson
^ permalink raw reply
* Re: [PATCH v2] usb: ehci: report Data Buffer Error in debug mode
From: Alan Stern @ 2011-10-30 19:14 UTC (permalink / raw)
To: Vikram Pandita; +Cc: linux-usb, linux-omap
In-Reply-To: <1319932425-10404-1-git-send-email-vikram.pandita@ti.com>
On Sat, 29 Oct 2011, Vikram Pandita wrote:
> From: Vikram Pandita <vikram.pandita@ti.com>
>
> Data Buffer Error as per spec section 4.15.1.1.2
> results when there is Underrun or Overrun condition.
>
> This error is considered non-fatal and never gets reported.
> Its a very good indication on things going wrong at system level,
> like running memory at much slower speed.
>
> This is a good error to flag allowing system level corrections.
>
> An issue was found with OMAP4460 board where DDR had to be run
> at full speed and this logging helped.
>
> Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
> ---
> v1: original patch
>
> v2: fix review comments from Alan Stern<stern@rowland.harvard.edu>
I'm sorry, there was one more thing that I forgot to mention last time.
> drivers/usb/host/ehci-q.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
> index 4e4066c..f81c6de 100644
> --- a/drivers/usb/host/ehci-q.c
> +++ b/drivers/usb/host/ehci-q.c
> @@ -373,6 +373,16 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
> retry_xacterr:
> if ((token & QTD_STS_ACTIVE) == 0) {
>
> + /* Report Data Buffer Error: non-fatal but useful */
> + if (token & QTD_STS_DBE) {
> + ehci_dbg(ehci,
> + "detected DataBufferErr for urb %p ep%d%s len %d, qtd %p [qh %p]\n",
> + urb, usb_endpoint_num(urb->ep),
> + usb_endpoint_dir_in(urb->ep) ? "in" : "out",
> + urb->transfer_buffer_length,
> + qtd, urb->ep->hcpriv);
Don't use urb->ep->hcpriv; use qh instead. Also, the continuation
lines should be indented relative to the start of the statement.
Alan Stern
^ permalink raw reply
* [PATCH 0/5] ath6kl: cut power when interface is down
From: Kalle Valo @ 2011-10-30 19:15 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
The following series changes interface handling so that power is
cut from the chip whenever interface is down compared to the current
situation when the harware is powered all the time since module
is loaded.
I'm not really sure if this is going be the final implementation
but I'll send this for review anyway. I structured the code so that
it's easy to go back to the old functionality if we so desire.
Also I need to solve support for multivif. Currently these patches
work as there's only one vif.
---
Kalle Valo (5):
ath6kl: create ath6kl_hif_stop()
ath6kl: power down hardware when interface is down
ath6kl: fix WLAN_ENABLE usage in ath6kl_close()
ath6kl: print firmware crashes always
ath6kl: print seqno in htc debug logs
drivers/net/wireless/ath/ath6kl/bmi.c | 5 ++
drivers/net/wireless/ath/ath6kl/bmi.h | 2 +
drivers/net/wireless/ath/ath6kl/core.h | 5 +-
drivers/net/wireless/ath/ath6kl/hif-ops.h | 7 ++
drivers/net/wireless/ath/ath6kl/hif.c | 69 ++++++++++++++++++++--
drivers/net/wireless/ath/ath6kl/hif.h | 1
drivers/net/wireless/ath/ath6kl/htc.c | 14 +++--
drivers/net/wireless/ath/ath6kl/init.c | 90 ++++++++++-------------------
drivers/net/wireless/ath/ath6kl/main.c | 25 ++++++--
drivers/net/wireless/ath/ath6kl/sdio.c | 45 +++++++++++++++
10 files changed, 187 insertions(+), 76 deletions(-)
^ permalink raw reply
* [PATCH 1/5] ath6kl: create ath6kl_hif_stop()
From: Kalle Valo @ 2011-10-30 19:15 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111030190922.20466.299.stgit@localhost6.localdomain6>
This is to reset hif layer for powering down hw.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/hif-ops.h | 7 +++++
drivers/net/wireless/ath/ath6kl/hif.h | 1 +
drivers/net/wireless/ath/ath6kl/sdio.c | 45 +++++++++++++++++++++++++++++
3 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/hif-ops.h b/drivers/net/wireless/ath/ath6kl/hif-ops.h
index 34adc77..50fd3e9 100644
--- a/drivers/net/wireless/ath/ath6kl/hif-ops.h
+++ b/drivers/net/wireless/ath/ath6kl/hif-ops.h
@@ -111,4 +111,11 @@ static inline int ath6kl_hif_power_off(struct ath6kl *ar)
return ar->hif_ops->power_off(ar);
}
+static inline void ath6kl_hif_stop(struct ath6kl *ar)
+{
+ ath6kl_dbg(ATH6KL_DBG_HIF, "hif stop\n");
+
+ ar->hif_ops->stop(ar);
+}
+
#endif
diff --git a/drivers/net/wireless/ath/ath6kl/hif.h b/drivers/net/wireless/ath/ath6kl/hif.h
index 78a6c79..814386d 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.h
+++ b/drivers/net/wireless/ath/ath6kl/hif.h
@@ -246,6 +246,7 @@ struct ath6kl_hif_ops {
int (*resume)(struct ath6kl *ar);
int (*power_on)(struct ath6kl *ar);
int (*power_off)(struct ath6kl *ar);
+ void (*stop)(struct ath6kl *ar);
};
int ath6kl_hif_setup(struct ath6kl_device *dev);
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 682c47c..c61c512 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -45,6 +45,8 @@ struct ath6kl_sdio {
struct list_head scat_req;
spinlock_t scat_lock;
+ bool scatter_enabled;
+
bool is_disabled;
atomic_t irq_handling;
const struct sdio_device_id *id;
@@ -651,6 +653,11 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar)
list_del(&s_req->list);
spin_unlock_bh(&ar_sdio->scat_lock);
+ /*
+ * FIXME: should we also call completion handler with
+ * ath6kl_hif_rw_comp_handler() with status -ECANCELED so
+ * that the packet is properly freed?
+ */
if (s_req->busrequest)
ath6kl_sdio_free_bus_req(ar_sdio, s_req->busrequest);
kfree(s_req->virt_dma_buf);
@@ -670,6 +677,11 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)
int ret;
bool virt_scat = false;
+ if (ar_sdio->scatter_enabled)
+ return 0;
+
+ ar_sdio->scatter_enabled = true;
+
/* check if host supports scatter and it meets our requirements */
if (ar_sdio->func->card->host->max_segs < MAX_SCATTER_ENTRIES_PER_REQ) {
ath6kl_err("host only supports scatter of :%d entries, need: %d\n",
@@ -762,6 +774,38 @@ static int ath6kl_sdio_resume(struct ath6kl *ar)
return 0;
}
+static void ath6kl_sdio_stop(struct ath6kl *ar)
+{
+ struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
+ struct bus_request *req, *tmp_req;
+ void *context;
+
+ /* FIXME: make sure that wq is not queued again */
+
+ cancel_work_sync(&ar_sdio->wr_async_work);
+
+ spin_lock_bh(&ar_sdio->wr_async_lock);
+
+ list_for_each_entry_safe(req, tmp_req, &ar_sdio->wr_asyncq, list) {
+ list_del(&req->list);
+
+ if (req->scat_req) {
+ /* this is a scatter gather request */
+ req->scat_req->status = -ECANCELED;
+ req->scat_req->complete(ar_sdio->ar->htc_target,
+ req->scat_req);
+ } else {
+ context = req->packet;
+ ath6kl_sdio_free_bus_req(ar_sdio, req);
+ ath6kl_hif_rw_comp_handler(context, -ECANCELED);
+ }
+ }
+
+ spin_unlock_bh(&ar_sdio->wr_async_lock);
+
+ WARN_ON(get_queue_depth(&ar_sdio->scat_req) != 4);
+}
+
static const struct ath6kl_hif_ops ath6kl_sdio_ops = {
.read_write_sync = ath6kl_sdio_read_write_sync,
.write_async = ath6kl_sdio_write_async,
@@ -776,6 +820,7 @@ static const struct ath6kl_hif_ops ath6kl_sdio_ops = {
.resume = ath6kl_sdio_resume,
.power_on = ath6kl_sdio_power_on,
.power_off = ath6kl_sdio_power_off,
+ .stop = ath6kl_sdio_stop,
};
static int ath6kl_sdio_probe(struct sdio_func *func,
^ permalink raw reply related
* [PATCH 2/5] ath6kl: power down hardware when interface is down
From: Kalle Valo @ 2011-10-30 19:16 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111030190922.20466.299.stgit@localhost6.localdomain6>
The benefit from this is that user space can control hardware's power state
by putting interface up and down. This is handy if firmware gets to some
weird state.
The downside will be that putting interface up takes a bit longer,
I was measuring ~500 ms during interface up.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/bmi.c | 5 +++++
drivers/net/wireless/ath/ath6kl/bmi.h | 2 ++
drivers/net/wireless/ath/ath6kl/core.h | 4 ++++
drivers/net/wireless/ath/ath6kl/htc.c | 3 +++
drivers/net/wireless/ath/ath6kl/init.c | 35 +++++++++++++++++++++++++++++---
drivers/net/wireless/ath/ath6kl/main.c | 22 ++++++++++++++++----
6 files changed, 64 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c
index 5a4c24d..a962fe4 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.c
+++ b/drivers/net/wireless/ath/ath6kl/bmi.c
@@ -670,6 +670,11 @@ int ath6kl_bmi_fast_download(struct ath6kl *ar, u32 addr, u8 *buf, u32 len)
return ret;
}
+void ath6kl_bmi_reset(struct ath6kl *ar)
+{
+ ar->bmi.done_sent = false;
+}
+
int ath6kl_bmi_init(struct ath6kl *ar)
{
ar->bmi.cmd_buf = kzalloc(MAX_BMI_CMDBUF_SZ, GFP_ATOMIC);
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h
index 96851d5..009e8f6 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.h
+++ b/drivers/net/wireless/ath/ath6kl/bmi.h
@@ -230,6 +230,8 @@ struct ath6kl_bmi_target_info {
int ath6kl_bmi_init(struct ath6kl *ar);
void ath6kl_bmi_cleanup(struct ath6kl *ar);
+void ath6kl_bmi_reset(struct ath6kl *ar);
+
int ath6kl_bmi_done(struct ath6kl *ar);
int ath6kl_bmi_get_target_info(struct ath6kl *ar,
struct ath6kl_bmi_target_info *targ_info);
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 5ac415e..1ac0dd1 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -447,6 +447,7 @@ enum ath6kl_dev_state {
DESTROY_IN_PROGRESS,
SKIP_SCAN,
ROAM_TBL_PEND,
+ FIRST_BOOT,
};
struct ath6kl {
@@ -662,4 +663,7 @@ void ath6kl_deinit_if_data(struct ath6kl_vif *vif);
void ath6kl_core_free(struct ath6kl *ar);
struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar);
void ath6kl_cleanup_vif(struct ath6kl_vif *vif, bool wmi_ready);
+int ath6kl_init_hw_start(struct ath6kl *ar);
+int ath6kl_init_hw_stop(struct ath6kl *ar);
+
#endif /* CORE_H */
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 04b4070..99220d4 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -2622,6 +2622,9 @@ int ath6kl_htc_start(struct htc_target *target)
struct htc_packet *packet;
int status;
+ memset(&target->dev->irq_proc_reg, 0,
+ sizeof(target->dev->irq_proc_reg));
+
/* Disable interrupts at the chip level */
ath6kl_hif_disable_intrs(target->dev);
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index a0b81c3..c197e4c 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1421,11 +1421,13 @@ static int ath6kl_init_hw_params(struct ath6kl *ar)
return 0;
}
-static int ath6kl_hw_start(struct ath6kl *ar)
+int ath6kl_init_hw_start(struct ath6kl *ar)
{
long timeleft;
int ret, i;
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "hw start\n");
+
ret = ath6kl_hif_power_on(ar);
if (ret)
return ret;
@@ -1517,6 +1519,25 @@ err_power_off:
return ret;
}
+int ath6kl_init_hw_stop(struct ath6kl *ar)
+{
+ int ret;
+
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "hw stop\n");
+
+ ath6kl_htc_stop(ar->htc_target);
+
+ ath6kl_hif_stop(ar);
+
+ ath6kl_bmi_reset(ar);
+
+ ret = ath6kl_hif_power_off(ar);
+ if (ret)
+ ath6kl_warn("failed to power off hif: %d\n", ret);
+
+ return 0;
+}
+
int ath6kl_core_init(struct ath6kl *ar)
{
struct ath6kl_bmi_target_info targ_info;
@@ -1628,9 +1649,11 @@ int ath6kl_core_init(struct ath6kl *ar)
ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM;
- ret = ath6kl_hw_start(ar);
+ set_bit(FIRST_BOOT, &ar->flag);
+
+ ret = ath6kl_init_hw_start(ar);
if (ret) {
- ath6kl_err("Failed to boot hardware: %d\n", ret);
+ ath6kl_err("Failed to start hardware: %d\n", ret);
goto err_rxbuf_cleanup;
}
@@ -1640,6 +1663,12 @@ int ath6kl_core_init(struct ath6kl *ar)
*/
memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
+ ret = ath6kl_init_hw_stop(ar);
+ if (ret) {
+ ath6kl_err("Failed to stop hardware: %d\n", ret);
+ goto err_htc_cleanup;
+ }
+
return ret;
err_rxbuf_cleanup:
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 3b2a7e8..717ed22 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -673,10 +673,12 @@ void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver)
set_bit(WMI_READY, &ar->flag);
wake_up(&ar->event_wq);
- ath6kl_info("hw %s fw %s%s\n",
- get_hw_id_string(ar->wiphy->hw_version),
- ar->wiphy->fw_version,
- test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
+ if (test_and_clear_bit(FIRST_BOOT, &ar->flag)) {
+ ath6kl_info("hw %s fw %s%s\n",
+ get_hw_id_string(ar->wiphy->hw_version),
+ ar->wiphy->fw_version,
+ test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
+ }
}
void ath6kl_scan_complete_evt(struct ath6kl_vif *vif, int status)
@@ -1112,6 +1114,12 @@ struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar)
static int ath6kl_open(struct net_device *dev)
{
struct ath6kl_vif *vif = netdev_priv(dev);
+ int ret;
+
+ /* FIXME: how to handle multi vif support? */
+ ret = ath6kl_init_hw_start(vif->ar);
+ if (ret)
+ return ret;
set_bit(WLAN_ENABLED, &vif->flags);
@@ -1128,6 +1136,7 @@ static int ath6kl_close(struct net_device *dev)
{
struct ath6kl *ar = ath6kl_priv(dev);
struct ath6kl_vif *vif = netdev_priv(dev);
+ int ret;
netif_stop_queue(dev);
@@ -1143,6 +1152,11 @@ static int ath6kl_close(struct net_device *dev)
ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
+ /* FIXME: how to handle multi vif support? */
+ ret = ath6kl_init_hw_stop(ar);
+ if (ret)
+ return ret;
+
return 0;
}
^ permalink raw reply related
* Re: [PATCH] ahci_platform: add suspend & resume support
From: Sergei Shtylyov @ 2011-10-30 19:16 UTC (permalink / raw)
To: JiSheng Zhang; +Cc: jgarzik, linux-ide, avorontsov, linux-kernel
In-Reply-To: <20111030142122.560216e2@ustc>
Hello.
On 30.10.2011 8:21, JiSheng Zhang wrote:
> Signed-off-by: JiSheng Zhang<jszhang3@gmail.com>
> ---
> drivers/ata/ahci_platform.c | 54 +++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 54 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> index c03277d..60ff9eb 100644
> --- a/drivers/ata/ahci_platform.c
> +++ b/drivers/ata/ahci_platform.c
> @@ -202,12 +202,66 @@ static int __devexit ahci_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM
> +static int ahci_suspend(struct platform_device *pdev, pm_message_t mesg)
> +{
> + struct ata_host *host = dev_get_drvdata(&pdev->dev);
You can also call platform_get_drvdata(pdev).
> +static int ahci_resume(struct platform_device *pdev)
> +{
> + struct device *dev =&pdev->dev;
> + struct ahci_platform_data *pdata = dev->platform_data;
There's dev_get_platdata().
WBR, Sergei
^ permalink raw reply
* [PATCH 3/5] ath6kl: fix WLAN_ENABLE usage in ath6kl_close()
From: Kalle Valo @ 2011-10-30 19:16 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111030190922.20466.299.stgit@localhost6.localdomain6>
If ath6kl_init_hw_stop() failed with an error WLAN_ENABLED would not
be cleared. Found during code review and just a theoretical issue.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/main.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 717ed22..def0b7f 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -1147,7 +1147,6 @@ static int ath6kl_close(struct net_device *dev)
0, 0, 0, 0, 0, 0, 0, 0, 0))
return -EIO;
- clear_bit(WLAN_ENABLED, &vif->flags);
}
ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
@@ -1157,6 +1156,8 @@ static int ath6kl_close(struct net_device *dev)
if (ret)
return ret;
+ clear_bit(WLAN_ENABLED, &vif->flags);
+
return 0;
}
^ permalink raw reply related
* [PATCH 4/5] ath6kl: print firmware crashes always
From: Kalle Valo @ 2011-10-30 19:16 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111030190922.20466.299.stgit@localhost6.localdomain6>
Currently firmware crash dump is printed only if debug is enabled.
Change it so that the crash dump is always printed.
Also move the code from init.c to hif.c.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/core.h | 1
drivers/net/wireless/ath/ath6kl/hif.c | 69 ++++++++++++++++++++++++++++----
drivers/net/wireless/ath/ath6kl/init.c | 55 --------------------------
3 files changed, 61 insertions(+), 64 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 1ac0dd1..95aed7d 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -654,7 +654,6 @@ void aggr_recv_delba_req_evt(struct ath6kl_vif *vif, u8 tid);
void aggr_recv_addba_req_evt(struct ath6kl_vif *vif, u8 tid, u16 seq_no,
u8 win_sz);
void ath6kl_wakeup_event(void *dev);
-void ath6kl_target_failure(struct ath6kl *ar);
void ath6kl_reset_device(struct ath6kl *ar, u32 target_type,
bool wait_fot_compltn, bool cold_reset);
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index 309be98..e57da35 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -59,26 +59,79 @@ int ath6kl_hif_rw_comp_handler(void *context, int status)
return 0;
}
+#define REG_DUMP_COUNT_AR6003 60
+#define REGISTER_DUMP_LEN_MAX 60
+
+static void ath6kl_hif_dump_fw_crash(struct ath6kl *ar)
+{
+ __le32 regdump_val[REGISTER_DUMP_LEN_MAX];
+ u32 i, address, regdump_addr = 0;
+ int ret;
+
+ if (ar->target_type != TARGET_TYPE_AR6003)
+ return;
+
+ /* the reg dump pointer is copied to the host interest area */
+ address = ath6kl_get_hi_item_addr(ar, HI_ITEM(hi_failure_state));
+ address = TARG_VTOP(ar->target_type, address);
+
+ /* read RAM location through diagnostic window */
+ ret = ath6kl_diag_read32(ar, address, ®dump_addr);
+
+ if (ret || !regdump_addr) {
+ ath6kl_warn("failed to get ptr to register dump area: %d\n",
+ ret);
+ return;
+ }
+
+ ath6kl_dbg(ATH6KL_DBG_IRQ, "register dump data address 0x%x\n",
+ regdump_addr);
+ regdump_addr = TARG_VTOP(ar->target_type, regdump_addr);
+
+ /* fetch register dump data */
+ ret = ath6kl_diag_read(ar, regdump_addr, (u8 *)®dump_val[0],
+ REG_DUMP_COUNT_AR6003 * (sizeof(u32)));
+ if (ret) {
+ ath6kl_warn("failed to get register dump: %d\n", ret);
+ return;
+ }
+
+ ath6kl_info("crash dump:\n");
+ ath6kl_info("hw 0x%x fw %s\n", ar->wiphy->hw_version,
+ ar->wiphy->fw_version);
+
+ BUILD_BUG_ON(REG_DUMP_COUNT_AR6003 % 4);
+
+ for (i = 0; i < REG_DUMP_COUNT_AR6003 / 4; i++) {
+ ath6kl_info("%d: 0x%8.8x 0x%8.8x 0x%8.8x 0x%8.8x\n",
+ 4 * i,
+ le32_to_cpu(regdump_val[i]),
+ le32_to_cpu(regdump_val[i + 1]),
+ le32_to_cpu(regdump_val[i + 2]),
+ le32_to_cpu(regdump_val[i + 3]));
+ }
+
+}
static int ath6kl_hif_proc_dbg_intr(struct ath6kl_device *dev)
{
u32 dummy;
- int status;
+ int ret;
- ath6kl_err("target debug interrupt\n");
-
- ath6kl_target_failure(dev->ar);
+ ath6kl_warn("firmware crashed\n");
/*
* read counter to clear the interrupt, the debug error interrupt is
* counter 0.
*/
- status = hif_read_write_sync(dev->ar, COUNT_DEC_ADDRESS,
+ ret = hif_read_write_sync(dev->ar, COUNT_DEC_ADDRESS,
(u8 *)&dummy, 4, HIF_RD_SYNC_BYTE_INC);
- if (status)
- WARN_ON(1);
+ if (ret)
+ ath6kl_warn("Failed to clear debug interrupt: %d\n", ret);
- return status;
+ ath6kl_hif_dump_fw_crash(dev->ar);
+
+ return ret;
}
/* mailbox recv message polling */
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index c197e4c..06e5cea 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -298,61 +298,6 @@ out:
return status;
}
-#define REG_DUMP_COUNT_AR6003 60
-#define REGISTER_DUMP_LEN_MAX 60
-
-static void ath6kl_dump_target_assert_info(struct ath6kl *ar)
-{
- u32 address;
- u32 regdump_loc = 0;
- int status;
- u32 regdump_val[REGISTER_DUMP_LEN_MAX];
- u32 i;
-
- if (ar->target_type != TARGET_TYPE_AR6003)
- return;
-
- /* the reg dump pointer is copied to the host interest area */
- address = ath6kl_get_hi_item_addr(ar, HI_ITEM(hi_failure_state));
- address = TARG_VTOP(ar->target_type, address);
-
- /* read RAM location through diagnostic window */
- status = ath6kl_diag_read32(ar, address, ®dump_loc);
-
- if (status || !regdump_loc) {
- ath6kl_err("failed to get ptr to register dump area\n");
- return;
- }
-
- ath6kl_dbg(ATH6KL_DBG_TRC, "location of register dump data: 0x%X\n",
- regdump_loc);
- regdump_loc = TARG_VTOP(ar->target_type, regdump_loc);
-
- /* fetch register dump data */
- status = ath6kl_diag_read(ar, regdump_loc, (u8 *)®dump_val[0],
- REG_DUMP_COUNT_AR6003 * (sizeof(u32)));
-
- if (status) {
- ath6kl_err("failed to get register dump\n");
- return;
- }
- ath6kl_dbg(ATH6KL_DBG_TRC, "Register Dump:\n");
-
- for (i = 0; i < REG_DUMP_COUNT_AR6003; i++)
- ath6kl_dbg(ATH6KL_DBG_TRC, " %d : 0x%8.8X\n",
- i, regdump_val[i]);
-
-}
-
-void ath6kl_target_failure(struct ath6kl *ar)
-{
- ath6kl_err("target asserted\n");
-
- /* try dumping target assertion information (if any) */
- ath6kl_dump_target_assert_info(ar);
-
-}
-
static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
{
int status = 0;
^ permalink raw reply related
* [PATCH 5/5] ath6kl: print seqno in htc debug logs
From: Kalle Valo @ 2011-10-30 19:16 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111030190922.20466.299.stgit@localhost6.localdomain6>
Makes it easier to debug where frames are going.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/htc.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 99220d4..f3b63ca 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -439,6 +439,9 @@ static void htc_tx_comp_handler(struct htc_target *target,
struct htc_endpoint *endpoint = &target->endpoint[packet->endpoint];
struct list_head container;
+ ath6kl_dbg(ATH6KL_DBG_HTC, "htc tx complete seqno %d\n",
+ packet->info.tx.seqno);
+
htc_tx_comp_update(target, endpoint, packet);
INIT_LIST_HEAD(&container);
list_add_tail(&packet->list, &container);
@@ -501,8 +504,8 @@ static int ath6kl_htc_tx_issue(struct htc_target *target,
padded_len = CALC_TXRX_PADDED_LEN(target, send_len);
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc tx issue len %d padded_len %d mbox 0x%X %s\n",
- send_len, padded_len,
+ "htc tx issue len %d seqno %d padded_len %d mbox 0x%X %s\n",
+ send_len, packet->info.tx.seqno, padded_len,
target->dev->ar->mbox_info.htc_addr,
sync ? "sync" : "async");
@@ -705,8 +708,8 @@ static int ath6kl_htc_tx_setup_scat_list(struct htc_target *target,
scat_req->len += len;
scat_req->scat_entries++;
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc tx adding (%d) pkt 0x%p len %d remaining %d\n",
- i, packet, len, rem_scat);
+ "htc tx adding (%d) pkt 0x%p seqno %d len %d remaining %d\n",
+ i, packet, packet->info.tx.seqno, len, rem_scat);
}
/* Roll back scatter setup in case of any failure */
^ permalink raw reply related
* kernel panic on device removal when using a workqueue and delayed_work
From: Frank Schäfer @ 2011-10-30 19:19 UTC (permalink / raw)
To: linux-kernel
Hi,
with the following simple kernel module, I have a good chance to get a
kernel panic when I unplug the device:
#include <linux/workqueue.h>
#include <linux/usb.h>
#include <linux/module.h>
MODULE_AUTHOR("Nobody");
MODULE_DESCRIPTION("example driver for causing kernel panic");
MODULE_LICENSE("GPL");
static struct delayed_work poll_work;
static void poll(struct work_struct *work)
{
schedule_delayed_work(&poll_work,
msecs_to_jiffies(100));
}
static int test_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
INIT_DELAYED_WORK(&poll_work, poll);
schedule_delayed_work(&poll_work,
msecs_to_jiffies(100));
return 0;
}
static void test_disconnect(struct usb_interface *intf)
{
cancel_delayed_work_sync(&poll_work);
}
static const struct usb_device_id device_table[] = {
{USB_DEVICE(0x1234, 0x5678)},
{}
};
MODULE_DEVICE_TABLE(usb, device_table);
static struct usb_driver test_driver = {
.name = "test",
.id_table = device_table,
.probe = test_probe,
.disconnect = test_disconnect,
};
static int __init test_mod_init(void)
{
return usb_register(&test_driver);
}
static void __exit test_mod_exit(void)
{
usb_deregister(&test_driver);
}
module_init(test_mod_init);
module_exit(test_mod_exit);
A picture of the backtrace (the machine immediately turns off without
saving a backtrace) can be found at
http://imageshack.us/photo/my-images/823/img075gv.jpg
Kernel version is 3.1.0.
This is the first time I'm using a workqueue, so there is a good chance
that I missed something...
Or is this a kernel bug ?
Regards,
Frank Schaefer
^ permalink raw reply
* RE: [GIT PULL] mm: frontswap (for 3.2 window)
From: Dan Magenheimer @ 2011-10-30 19:18 UTC (permalink / raw)
To: John Stoffel
Cc: Johannes Weiner, Pekka Enberg, Cyclonus J, Sasha Levin,
Christoph Hellwig, David Rientjes, Linus Torvalds, linux-mm, LKML,
Andrew Morton, Konrad Wilk, Jeremy Fitzhardinge, Seth Jennings,
ngupta, Chris Mason, JBeulich, Dave Hansen, Jonathan Corbet
In-Reply-To: <20139.5644.583790.903531@quad.stoffel.home>
> From: John Stoffel [mailto:john@stoffel.org]
> Dan> Thanks for taking the time to read the LWN article and sending
> Dan> some feedback. I admit that, after being immersed in the topic
> Dan> for three years, it's difficult to see it from the perspective of
> Dan> a new reader, so I apologize if I may have left out important
> Dan> stuff. I hope you'll take the time to read this long reply.
>
> Will do. But I'm not the person you need to convince here about the
> usefulness of this code and approach, it's the core VM developers,
True, but you are the one providing useful suggestions while
the core VM developers are mostly silent (except for saying things
like "don't like it much"). So thank you for your feedback
and for taking the time to provide it and for indulging my replies.
I/we will need to act on your suggestions, but I need to
answer a couple of points/questions you've raised.
> since they're the ones who will have to understand this stuff and know
> how to maintain it. And keeping this maintainable is a key goal.
Absolutely agree. Count the number of frontswap lines that affect
the current VM core code and note also how they are very clearly
identified. It really is a very VERY small impact to the core VM
code (e.g. in the files swapfile.c and page_io.c).
(And it's worth noting, and I'm not arguing that it is conclusive,
just relevant, that my company has stood up and claimed responsibility
to maintain it.)
> Ok, so why not just a targetted swap compression function instead?
> Why is your method superior?
The designer/implementor of zram (which is the closest thing to
"targetted swap compression" in the kernel today) has stated
elsewhere on this thread that frontswap has advantages
over his own zram code.
And the frontswap patchset (did I mention how small the impact is?)
provides a lot more than just a foundation for compression (zcache).
> But that's besides the point. How much overhead does TMEM incur when
> it's not being used, but when it's avaiable?
This is answered in frontswap.txt in the patchset, but:
ZERO overhead if CONFIG_FRONTSWAP=n. All the hooks compile into no-ops.
If CONFIG_FRONTSWAP=y and no "tmem backend" registers to use it at
runtime, the overhead is one "compare pointer against NULL" for
every page actually swapped in or out, which is about as close to ZERO
overhead as any code can be.
If CONFIG_FRONTSWAP=y AND a "tmem backend" does register, the
answer depends on which tmem backend and what it is doing (and
yes I agree more numbers are needed), but the overhead is
incurred only in the case where a page would otherwise have
actually been swapped in or out and can replace the horrible
cost of swapping pages.
> Dan> Frontswap is the last missing piece. Why so much resistance?
>
> Because you haven't sold it well with numbers to show how much
> overhead it has?
>
> I'm being negative because I see no reason to use it. And because I
> think you can do a better job of selling it and showing the benefits
> with real numbers.
In your environment where RAM is essentially infinite, and swapping
never occurs, I agree there would be no reason for you to enable it.
In which case there is no overhead to you.
Received loud and clear on the "need more real numbers" though
personally I don't have any machines with more than 4GB RAM so
I won't personally be testing any EDA environments with 144GB :-}
So, in the context of "costs nothing if you don't need it and has
very VERY small core code impact", and given that various kernel
developers and real users and real distros and real products say
on this thread that they DO need it, and given that there
are "some" real numbers (for one user, Xen, and agree that some
are needed for zcache)... and assuming that the core VM developers
bother to read the documentation already provided that addresses
the above, let me ask again...
Why so much resistance?
Thanks,
Dan
Oops, one more (but I have to use the X-word)...
> Load up a XEN box, have a VM spike it's memory usage and show how TMEM
> helps. Compare it to a non-TMEM setup with the same load.
Yep, that's what the presentation URL I provided (for Xen) measures.
Overcommitment (more VMs than otherwise could fit in the physical
RAM) AND about a 8% performance improvement on all VMs doing
a kernel compile simultaneously. Pretty impressive.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* RE: [GIT PULL] mm: frontswap (for 3.2 window)
From: Dan Magenheimer @ 2011-10-30 19:18 UTC (permalink / raw)
To: John Stoffel
Cc: Johannes Weiner, Pekka Enberg, Cyclonus J, Sasha Levin,
Christoph Hellwig, David Rientjes, Linus Torvalds, linux-mm, LKML,
Andrew Morton, Konrad Wilk, Jeremy Fitzhardinge, Seth Jennings,
ngupta, Chris Mason, JBeulich, Dave Hansen, Jonathan Corbet
In-Reply-To: <20139.5644.583790.903531@quad.stoffel.home>
> From: John Stoffel [mailto:john@stoffel.org]
> Dan> Thanks for taking the time to read the LWN article and sending
> Dan> some feedback. I admit that, after being immersed in the topic
> Dan> for three years, it's difficult to see it from the perspective of
> Dan> a new reader, so I apologize if I may have left out important
> Dan> stuff. I hope you'll take the time to read this long reply.
>
> Will do. But I'm not the person you need to convince here about the
> usefulness of this code and approach, it's the core VM developers,
True, but you are the one providing useful suggestions while
the core VM developers are mostly silent (except for saying things
like "don't like it much"). So thank you for your feedback
and for taking the time to provide it and for indulging my replies.
I/we will need to act on your suggestions, but I need to
answer a couple of points/questions you've raised.
> since they're the ones who will have to understand this stuff and know
> how to maintain it. And keeping this maintainable is a key goal.
Absolutely agree. Count the number of frontswap lines that affect
the current VM core code and note also how they are very clearly
identified. It really is a very VERY small impact to the core VM
code (e.g. in the files swapfile.c and page_io.c).
(And it's worth noting, and I'm not arguing that it is conclusive,
just relevant, that my company has stood up and claimed responsibility
to maintain it.)
> Ok, so why not just a targetted swap compression function instead?
> Why is your method superior?
The designer/implementor of zram (which is the closest thing to
"targetted swap compression" in the kernel today) has stated
elsewhere on this thread that frontswap has advantages
over his own zram code.
And the frontswap patchset (did I mention how small the impact is?)
provides a lot more than just a foundation for compression (zcache).
> But that's besides the point. How much overhead does TMEM incur when
> it's not being used, but when it's avaiable?
This is answered in frontswap.txt in the patchset, but:
ZERO overhead if CONFIG_FRONTSWAP=n. All the hooks compile into no-ops.
If CONFIG_FRONTSWAP=y and no "tmem backend" registers to use it at
runtime, the overhead is one "compare pointer against NULL" for
every page actually swapped in or out, which is about as close to ZERO
overhead as any code can be.
If CONFIG_FRONTSWAP=y AND a "tmem backend" does register, the
answer depends on which tmem backend and what it is doing (and
yes I agree more numbers are needed), but the overhead is
incurred only in the case where a page would otherwise have
actually been swapped in or out and can replace the horrible
cost of swapping pages.
> Dan> Frontswap is the last missing piece. Why so much resistance?
>
> Because you haven't sold it well with numbers to show how much
> overhead it has?
>
> I'm being negative because I see no reason to use it. And because I
> think you can do a better job of selling it and showing the benefits
> with real numbers.
In your environment where RAM is essentially infinite, and swapping
never occurs, I agree there would be no reason for you to enable it.
In which case there is no overhead to you.
Received loud and clear on the "need more real numbers" though
personally I don't have any machines with more than 4GB RAM so
I won't personally be testing any EDA environments with 144GB :-}
So, in the context of "costs nothing if you don't need it and has
very VERY small core code impact", and given that various kernel
developers and real users and real distros and real products say
on this thread that they DO need it, and given that there
are "some" real numbers (for one user, Xen, and agree that some
are needed for zcache)... and assuming that the core VM developers
bother to read the documentation already provided that addresses
the above, let me ask again...
Why so much resistance?
Thanks,
Dan
Oops, one more (but I have to use the X-word)...
> Load up a XEN box, have a VM spike it's memory usage and show how TMEM
> helps. Compare it to a non-TMEM setup with the same load.
Yep, that's what the presentation URL I provided (for Xen) measures.
Overcommitment (more VMs than otherwise could fit in the physical
RAM) AND about a 8% performance improvement on all VMs doing
a kernel compile simultaneously. Pretty impressive.
^ permalink raw reply
* [GIT PULL] ARM: CSR: l2x0 init cleanup for 3.2
From: Arnd Bergmann @ 2011-10-30 19:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAGsJ_4xu_m7umoohrKSdL2v8reHi9ZdkU7RWo+6a_fCA33e9Eg@mail.gmail.com>
On Monday 24 October 2011, Barry Song wrote:
> The following changes since commit 1e11bec9b09a28f81dd3173fec6b1c6c56b5e299:
> Barry Song (1):
> Merge branch 'l2x0' of rmk tree into prima2-l2x0
>
> are available in the git repository at:
>
> git://gitorious.org/sirfprima2-kernel/sirfprima2-kernel.git prima2-l2x0
>
I've now pulled it into the next/pm branch that had your previous pm
changes.
Thanks,
Arnd
^ permalink raw reply
* [Buildroot] PKG_CONFIG_PATH question
From: Łukasz Pułka @ 2011-10-30 19:27 UTC (permalink / raw)
To: buildroot
Hi all,
My name is Luke and I am new here.
After two encouraging sessions about buildroot on ELCE, I decided to
give it a try.
I am usually using OpenEmbedded but just for fun I decided to build
similar image with buildroot, I downloaded buildroot-2011.08.
Compiled my own toolchain with crostool-ng (btw, all new CodeSourcery
arm toolchains have ICE when iwmmxt optimization is enabled). And.. i
get stuck for the while.
For the build system I use quite ancient host machine (slackware),
maybe it causes some problems.
I could not compile libxcb, getting error from configure that
xcb-proto version is less than 1.5 (buildroot is looking for
xcb-proto.pc file (during configure) inside " /usr/lib/pkgconfig/" -
on my build system) is that nomal ?
I could move forward by setting environment variable PKC_CONFIG_PATH
to the STAGING_DIR/usr/lib/pkgconfig/, butI do not like this solution.
Best regards,
Luke Pulka
^ permalink raw reply
* [PATCHv4] virtio-blk: use ida to allocate disk index
From: Michael S. Tsirkin @ 2011-10-30 19:29 UTC (permalink / raw)
To: Jens Axboe
Cc: Rusty Russell, Tejun Heo, virtualization, kvm, linux-kernel,
Greg Kroah-Hartman
Based on a patch by Mark Wu <dwu@redhat.com>
Current index allocation in virtio-blk is based on a monotonically
increasing variable "index". This means we'll run out of numbers
after a while. It also could cause confusion about the disk
name in the case of hot-plugging disks.
Change virtio-blk to use ida to allocate index, instead.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
Changes from Mark's versions:
use the new ida_simple_get
error handling cleanup
fix user after free
Works fine for me.
Jens, could you merge this for 3.2?
That is, unless Rusty complains shortly ...
drivers/block/virtio_blk.c | 30 ++++++++++++++++++++++++------
1 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 079c088..e7a5750 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -8,10 +8,13 @@
#include <linux/scatterlist.h>
#include <linux/string_helpers.h>
#include <scsi/scsi_cmnd.h>
+#include <linux/idr.h>
#define PART_BITS 4
-static int major, index;
+static int major;
+static DEFINE_IDA(vd_index_ida);
+
struct workqueue_struct *virtblk_wq;
struct virtio_blk
@@ -35,6 +38,9 @@ struct virtio_blk
/* What host tells us, plus 2 for header & tailer. */
unsigned int sg_elems;
+ /* Ida index - used to track minor number allocations. */
+ int index;
+
/* Scatterlist: can be too big for stack. */
struct scatterlist sg[/*sg_elems*/];
};
@@ -276,6 +282,11 @@ static int index_to_minor(int index)
return index << PART_BITS;
}
+static int minor_to_index(int minor)
+{
+ return minor >> PART_BITS;
+}
+
static ssize_t virtblk_serial_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -341,14 +352,17 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
struct request_queue *q;
- int err;
+ int err, index;
u64 cap;
u32 v, blk_size, sg_elems, opt_io_size;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -ENOSPC;
+ err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
+ GFP_KERNEL);
+ if (err < 0)
+ goto out;
+ index = err;
/* We need to know how many segments before we allocate. */
err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
@@ -365,7 +379,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
sizeof(vblk->sg[0]) * sg_elems, GFP_KERNEL);
if (!vblk) {
err = -ENOMEM;
- goto out;
+ goto out_free_index;
}
INIT_LIST_HEAD(&vblk->reqs);
@@ -421,7 +435,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
vblk->disk->private_data = vblk;
vblk->disk->fops = &virtblk_fops;
vblk->disk->driverfs_dev = &vdev->dev;
- index++;
+ vblk->index = index;
/* configure queue flush support */
if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH))
@@ -516,6 +530,8 @@ out_free_vq:
vdev->config->del_vqs(vdev);
out_free_vblk:
kfree(vblk);
+out_free_index:
+ ida_simple_remove(&vd_index_ida, index);
out:
return err;
}
@@ -523,6 +539,7 @@ out:
static void __devexit virtblk_remove(struct virtio_device *vdev)
{
struct virtio_blk *vblk = vdev->priv;
+ int index = vblk->index;
flush_work(&vblk->config_work);
@@ -538,6 +555,7 @@ static void __devexit virtblk_remove(struct virtio_device *vdev)
mempool_destroy(vblk->pool);
vdev->config->del_vqs(vdev);
kfree(vblk);
+ ida_simple_remove(&vd_index_ida, index);
}
static const struct virtio_device_id id_table[] = {
--
1.7.5.53.gc233e
^ permalink raw reply related
* [PATCHv4] virtio-blk: use ida to allocate disk index
From: Michael S. Tsirkin @ 2011-10-30 19:29 UTC (permalink / raw)
To: Jens Axboe
Cc: kvm, Greg Kroah-Hartman, linux-kernel, virtualization, Tejun Heo
Based on a patch by Mark Wu <dwu@redhat.com>
Current index allocation in virtio-blk is based on a monotonically
increasing variable "index". This means we'll run out of numbers
after a while. It also could cause confusion about the disk
name in the case of hot-plugging disks.
Change virtio-blk to use ida to allocate index, instead.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
Changes from Mark's versions:
use the new ida_simple_get
error handling cleanup
fix user after free
Works fine for me.
Jens, could you merge this for 3.2?
That is, unless Rusty complains shortly ...
drivers/block/virtio_blk.c | 30 ++++++++++++++++++++++++------
1 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 079c088..e7a5750 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -8,10 +8,13 @@
#include <linux/scatterlist.h>
#include <linux/string_helpers.h>
#include <scsi/scsi_cmnd.h>
+#include <linux/idr.h>
#define PART_BITS 4
-static int major, index;
+static int major;
+static DEFINE_IDA(vd_index_ida);
+
struct workqueue_struct *virtblk_wq;
struct virtio_blk
@@ -35,6 +38,9 @@ struct virtio_blk
/* What host tells us, plus 2 for header & tailer. */
unsigned int sg_elems;
+ /* Ida index - used to track minor number allocations. */
+ int index;
+
/* Scatterlist: can be too big for stack. */
struct scatterlist sg[/*sg_elems*/];
};
@@ -276,6 +282,11 @@ static int index_to_minor(int index)
return index << PART_BITS;
}
+static int minor_to_index(int minor)
+{
+ return minor >> PART_BITS;
+}
+
static ssize_t virtblk_serial_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -341,14 +352,17 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
struct request_queue *q;
- int err;
+ int err, index;
u64 cap;
u32 v, blk_size, sg_elems, opt_io_size;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -ENOSPC;
+ err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
+ GFP_KERNEL);
+ if (err < 0)
+ goto out;
+ index = err;
/* We need to know how many segments before we allocate. */
err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
@@ -365,7 +379,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
sizeof(vblk->sg[0]) * sg_elems, GFP_KERNEL);
if (!vblk) {
err = -ENOMEM;
- goto out;
+ goto out_free_index;
}
INIT_LIST_HEAD(&vblk->reqs);
@@ -421,7 +435,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
vblk->disk->private_data = vblk;
vblk->disk->fops = &virtblk_fops;
vblk->disk->driverfs_dev = &vdev->dev;
- index++;
+ vblk->index = index;
/* configure queue flush support */
if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH))
@@ -516,6 +530,8 @@ out_free_vq:
vdev->config->del_vqs(vdev);
out_free_vblk:
kfree(vblk);
+out_free_index:
+ ida_simple_remove(&vd_index_ida, index);
out:
return err;
}
@@ -523,6 +539,7 @@ out:
static void __devexit virtblk_remove(struct virtio_device *vdev)
{
struct virtio_blk *vblk = vdev->priv;
+ int index = vblk->index;
flush_work(&vblk->config_work);
@@ -538,6 +555,7 @@ static void __devexit virtblk_remove(struct virtio_device *vdev)
mempool_destroy(vblk->pool);
vdev->config->del_vqs(vdev);
kfree(vblk);
+ ida_simple_remove(&vd_index_ida, index);
}
static const struct virtio_device_id id_table[] = {
--
1.7.5.53.gc233e
^ permalink raw reply related
* Re: [PATCH 4/5] drm/i915: refactor ring error state capture to use arrays
From: Chris Wilson @ 2011-10-30 19:32 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter
In-Reply-To: <1320001932-1846-4-git-send-email-daniel.vetter@ffwll.ch>
On Sun, 30 Oct 2011 20:12:11 +0100, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> The code already got unwindy and we want to dump more per-ring
> registers.
So this patch is to cook the spaghetti then? Not sure if unwindy
conjures the right imagery, I still think you mean unwieldly. ;)
> Only functional change is that we now also capture the video
> ring registers on ilk.
>
> v2: fixup a refactor fumble spotted by Chris Wilson.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
--
Chris Wilson, Intel Open Source Technology Centre
^ 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.