From: Manu Abraham <abraham.manu@gmail.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: Greg KH <greg@kroah.com>,
linux-pci@atrey.karlin.mff.cuni.cz,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: PCIE
Date: Thu, 24 May 2007 03:03:55 +0400 [thread overview]
Message-ID: <4654C85B.6060505@gmail.com> (raw)
In-Reply-To: <adazm3v89hv.fsf@cisco.com>
[-- Attachment #1: Type: text/plain, Size: 2734 bytes --]
Roland Dreier wrote:
> > If i uncomment the saa716x_read or write, what i get is a solid freeze
> > on module load. If i leave it commented out, the module loads fine.
>
> That sounds like a typical bug during driver development... you're
> probably wedging the hardware by doing the wrong access.
>
> I didn't see the source for saa716x_read or write in the code you
> posted, so it's hard to say if there's a problem with them.
>
Attaching saa716x_read/write in saa716x_priv.h
> Is your interrupt handler getting called? Is the device generating
> interrupts?
It looks so, from the logs. The only problem is i can't disable the
interrupts, if i write "0" to 0x500, the interrupt/enable register, it
gives me a solid freeze. If i read from the handler, commenting out the
disable interrupts in init, that read also gives me a solid freeze. This
lead me to think that there could be some problem with the MMIO block
access.
May 23 03:25:48 manu-04 kernel: [ 383.602737] saa716x_pci_init: found a
Twinhan VP-6090 device
May 23 03:25:48 manu-04 kernel: [ 383.602764] ACPI: PCI Interrupt
0000:06:00.0[A] -> GSI 16 (level, low) -> IRQ 16
May 23 03:25:48 manu-04 kernel: [ 383.603020] SAA7160/1/2 Rev 1
[1822:0027], irq: 16, latency: 0
May 23 03:25:48 manu-04 kernel: [ 383.603024] memory: 0x32200000,
mmio: 0xe046e000
May 23 03:25:48 manu-04 kernel: [ 383.610761] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.624056] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.637348] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.650650] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.663951] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.677253] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.690554] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.703858] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.717156] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.730459] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.743760] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.757064] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.770364] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.783665] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.796966] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.810269] === Interrupts[0010] [] ==
May 23 03:25:48 manu-04 kernel: [ 383.823569] === Interrupts[0010] [] ==
>
> > That part is then fine. Does MSI require any special tinkering ?
>
> Just pci_enable_msi() as usual.
Thanks
Regards,
Manu
[-- Attachment #2: saa716x_priv.h --]
[-- Type: text/plain, Size: 2652 bytes --]
#ifndef __SAA716x_PRIV_H
#define __SAA716x_PRIV_H
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/sched.h>
#include <linux/mutex.h>
#include "dvbdev.h"
#include "dvb_demux.h"
#include "dmxdev.h"
#include "dvb_frontend.h"
#include "dvb_net.h"
#define SAA716x_ERROR 0
#define SAA716x_NOTICE 1
#define SAA716x_INFO 2
#define SAA716x_DEBUG 3
#define dprintk(x, y, z, format, arg...) do { \
if (z) { \
if ((x > SAA716x_ERROR) && (x > y)) \
printk(KERN_ERR "%s (%d): " format "\n", __func__, saa716x->num, ##arg);\
else if ((x > SAA716x_NOTICE) && (x > y)) \
printk(KERN_ERR "%s (%d): " format "\n", __func__, saa716x->num, ##arg);\
else if ((x > SAA716x_INFO) && (x > y)) \
printk(KERN_ERR "%s (%d): " format "\n", __func__, saa716x->num, ##arg);\
else if ((x > SAA716x_DEBUG) && (x > y)) \
printk(KERN_ERR "%s (%d): " format "\n", __func__, saa716x->num, ##arg);\
} else { \
if (x > y) \
printk(format, ##arg); \
} \
} while (0);
#define MAKE_ENTRY(subven, subdev, configptr) { \
.vendor = 0x1131, \
.device = 0x7162, \
.subvendor = (subven), \
.subdevice = (subdev), \
.driver_data = (unsigned long) (configptr) \
}
#define saa716x_write(dat, addr) writel((dat), (saa716x->mmio)+(addr))
#define saa716x_read(addr) readl((saa716x->mmio)+(addr))
struct saa716x;
typedef int (*saa716x_load_config_t)(struct saa716x *saa716x);
struct saa716x_hwconfig {
char *model_name;
char *dev_type;
saa716x_load_config_t load_config;
};
struct saa716x_dma {
struct tasklet_struct dma_tasklet;
};
struct saa716x_dvb {
struct dvb_adapter adapter;
struct dvb_frontend *fe;
struct dvb_demux demux;
struct dmxdev dmxdev;
struct dmx_frontend fe_hw;
struct dmx_frontend fe_mem;
struct dvb_net dvbnet;
};
struct saa716x_i2c {
struct device *dev;
struct i2c_adapter adapter;
wait_queue_head_t i2c_queue;
};
struct saa716x {
/* dev priv */
unsigned int verbose;
unsigned int num;
struct saa716x_hwconfig *hwconfig;
/* PCI */
struct pci_dev *pdev;
void __iomem *mmio;
unsigned int irq;
/* I2C */
struct saa716x_i2c i2c_adapter_a;
struct saa716x_i2c i2c_adapter_b;
/* DMA */
struct saa716x_dma dma_device_a;
struct saa716x_dma dma_device_b;
/* DVB */
struct saa716x_dvb dvb_device_a;
struct saa716x_dvb dvb_device_b;
};
extern void saa716x_i2c_disable(struct saa716x *saa716x);
extern void saa716x_i2c_enable(struct saa716x *saa716x);
extern int saa716x_pcie_init(struct saa716x *saa716x);
extern void saa716x_pcie_exit(struct saa716x *saa716x);
#endif //__SAA716x_PRIV_H
next prev parent reply other threads:[~2007-05-23 23:04 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-23 12:15 PCIE Manu Abraham
2007-05-23 15:59 ` PCIE Greg KH
2007-05-23 20:59 ` PCIE Manu Abraham
2007-05-23 21:10 ` PCIE Roland Dreier
2007-05-23 22:11 ` PCIE Manu Abraham
2007-05-23 22:23 ` PCIE Roland Dreier
2007-05-23 23:03 ` Manu Abraham [this message]
2007-05-23 23:51 ` PCIE Roland Dreier
2007-05-24 0:07 ` PCIE Manu Abraham
2007-05-24 22:32 ` PCIE Manu Abraham
2007-05-25 3:25 ` PCIE Roland Dreier
2007-05-26 15:03 ` PCIE Manu Abraham
2007-05-26 18:28 ` PCIE Grant Grundler
2007-05-26 19:27 ` PCIE Manu Abraham
2007-05-28 1:15 ` PCIE Roland Dreier
2007-05-28 1:25 ` PCIE Manu Abraham
2007-05-28 2:04 ` PCIE Manu Abraham
2007-05-28 2:24 ` PCIE Roland Dreier
2007-05-28 2:47 ` PCIE Manu Abraham
2007-05-26 22:49 ` PCIE David Miller
2007-05-26 22:57 ` PCIE Manu Abraham
2007-05-26 23:55 ` PCIE Grant Grundler
2007-05-27 0:00 ` PCIE David Miller
2007-05-27 0:16 ` PCIE Grant Grundler
2007-05-27 0:30 ` PCIE David Miller
2007-05-27 1:01 ` PCIE Manu Abraham
2007-05-27 1:49 ` PCIE Grant Grundler
2007-05-27 20:28 ` PCIE Manu Abraham
2007-05-28 1:10 ` PCIE Roland Dreier
2007-05-27 2:34 ` PCIE H. Peter Anvin
2007-05-27 7:40 ` PCIE David Miller
2007-05-27 20:31 ` PCIE Manu Abraham
2007-05-28 1:05 ` PCIE Roland Dreier
2007-05-28 1:03 ` PCIE Roland Dreier
2007-05-28 2:54 ` PCIE David Miller
2007-05-28 4:18 ` PCIE Grant Grundler
2007-05-28 5:23 ` PCIE H. Peter Anvin
2007-05-28 5:22 ` PCIE H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4654C85B.6060505@gmail.com \
--to=abraham.manu@gmail.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=rdreier@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox