From patchwork Mon Dec 12 11:08:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marko Ristola X-Patchwork-Id: 8776 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Ra3um-0008Rq-QO; Mon, 12 Dec 2011 12:19:51 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp id 1Ra3um-0004JE-DF; Mon, 12 Dec 2011 12:19:24 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752052Ab1LLLTQ (ORCPT + 4 others); Mon, 12 Dec 2011 06:19:16 -0500 Received: from emh04.mail.saunalahti.fi ([62.142.5.110]:48484 "EHLO emh04.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752523Ab1LLLTM (ORCPT ); Mon, 12 Dec 2011 06:19:12 -0500 X-Greylist: delayed 621 seconds by postgrey-1.27 at vger.kernel.org; Mon, 12 Dec 2011 06:19:12 EST Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh04-2.mail.saunalahti.fi (Postfix) with SMTP id D3AFA13B47A; Mon, 12 Dec 2011 13:08:49 +0200 (EET) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A00D98CB412; Mon, 12 Dec 2011 13:08:49 +0200 Received: from koivu.koti (a88-112-16-221.elisa-laajakaista.fi [88.112.16.221]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id 9B4DEE51A5; Mon, 12 Dec 2011 13:08:47 +0200 (EET) Message-ID: <4EE5E0BE.4060300@kolumbus.fi> Date: Mon, 12 Dec 2011 13:08:46 +0200 From: Marko Ristola User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Ninja CC: linux-media Subject: Re: Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2) References: <4EC052CE.1080002@gmx.de> <4EE2A06D.7070901@gmx.de> In-Reply-To: <4EE2A06D.7070901@gmx.de> X-Antivirus: VAMS Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.12.111216 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MSGID_ADDED_BY_MTA 0.05, SUPERLONG_LINE 0.05, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' X-LSpam-Score: -6.9 (------) X-LSpam-Report: No, score=-6.9 required=5.0 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5 autolearn=ham On 12/10/2011 01:57 AM, Ninja wrote: > Hi, > > has anyone an idea how the SMP problems could be fixed? You could turn on Mantis Kernel module's debug messages. It could tell you the emitted interrupts. One risky thing with the Interrupt handler code is that MANTIS_GPIF_STATUS is cleared, even though IRQ0 isn't active yet. This could lead to a rare starvation of the wait queue you described. I supplied a patch below. Does it help? > I did some further investigation. When comparing the number of interrupts with all cores enabled and the interrupts with only one core enabled it seems like only the IRQ0 changed, the other IRQs and the total number stays quite the same: > > 4 Cores: > All IRQ/sec: 493 > Masked IRQ/sec: 400 > Unknown IRQ/sec: 0 > DMA/sec: 400 > IRQ-0/sec: 143 > IRQ-1/sec: 0 > OCERR/sec: 0 > PABRT/sec: 0 > RIPRR/sec: 0 > PPERR/sec: 0 > FTRGT/sec: 0 > RISCI/sec: 258 > RACK/sec: 0 > > 1 Core: > All IRQ/sec: 518 > Masked IRQ/sec: 504 > Unknown IRQ/sec: 0 > DMA/sec: 504 > IRQ-0/sec: 246 > IRQ-1/sec: 0 > OCERR/sec: 0 > PABRT/sec: 0 > RIPRR/sec: 0 > PPERR/sec: 0 > FTRGT/sec: 0 > RISCI/sec: 258 > RACK/sec: 0 > > So, where might be the problem? Turning on Mantis debug messages, might tell the difference between these interrupts. .... > I hope somebody can help, because I think we are very close to a fully functional CAM here. > I ran out of things to test to get closer to the solution :( > Btw: Is there any documentation available for the mantis PCI bridge? Not that I know. > > Manuel > > > > > > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Regards, Marko Ristola ----------------------- PATCH ------------------------------ Mantis/Hopper: Check and clear GPIF status bits only when IRQ0 bit is active. Signed-off-by: Marko Ristola --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/dvb/mantis/hopper_cards.c b/drivers/media/dvb/mantis/hopper_cards.c index 71622f6..c2084e9 100644 --- a/drivers/media/dvb/mantis/hopper_cards.c +++ b/drivers/media/dvb/mantis/hopper_cards.c @@ -84,15 +84,6 @@ static irqreturn_t hopper_irq_handler(int irq, void *dev_id) if (!(stat & mask)) return IRQ_NONE; - rst_mask = MANTIS_GPIF_WRACK | - MANTIS_GPIF_OTHERR | - MANTIS_SBUF_WSTO | - MANTIS_GPIF_EXTIRQ; - - rst_stat = mmread(MANTIS_GPIF_STATUS); - rst_stat &= rst_mask; - mmwrite(rst_stat, MANTIS_GPIF_STATUS); - mantis->mantis_int_stat = stat; mantis->mantis_int_mask = mask; dprintk(MANTIS_DEBUG, 0, "\n-- Stat=<%02x> Mask=<%02x> --", stat, mask); @@ -101,6 +92,16 @@ static irqreturn_t hopper_irq_handler(int irq, void *dev_id) } if (stat & MANTIS_INT_IRQ0) { dprintk(MANTIS_DEBUG, 0, "<%s>", label[1]); + + rst_mask = MANTIS_GPIF_WRACK | + MANTIS_GPIF_OTHERR | + MANTIS_SBUF_WSTO | + MANTIS_GPIF_EXTIRQ; + + rst_stat = mmread(MANTIS_GPIF_STATUS); + rst_stat &= rst_mask; + mmwrite(rst_stat, MANTIS_GPIF_STATUS); + mantis->gpif_status = rst_stat; wake_up(&ca->hif_write_wq); schedule_work(&ca->hif_evm_work); diff --git a/drivers/media/dvb/mantis/mantis_cards.c b/drivers/media/dvb/mantis/mantis_cards.c index c2bb90b..109a5fb 100644 --- a/drivers/media/dvb/mantis/mantis_cards.c +++ b/drivers/media/dvb/mantis/mantis_cards.c @@ -92,15 +92,6 @@ static irqreturn_t mantis_irq_handler(int irq, void *dev_id) if (!(stat & mask)) return IRQ_NONE; - rst_mask = MANTIS_GPIF_WRACK | - MANTIS_GPIF_OTHERR | - MANTIS_SBUF_WSTO | - MANTIS_GPIF_EXTIRQ; - - rst_stat = mmread(MANTIS_GPIF_STATUS); - rst_stat &= rst_mask; - mmwrite(rst_stat, MANTIS_GPIF_STATUS); - mantis->mantis_int_stat = stat; mantis->mantis_int_mask = mask; dprintk(MANTIS_DEBUG, 0, "\n-- Stat=<%02x> Mask=<%02x> --", stat, mask); @@ -109,6 +100,15 @@ static irqreturn_t mantis_irq_handler(int irq, void *dev_id) } if (stat & MANTIS_INT_IRQ0) { dprintk(MANTIS_DEBUG, 0, "<%s>", label[1]); + rst_mask = MANTIS_GPIF_WRACK | + MANTIS_GPIF_OTHERR | + MANTIS_SBUF_WSTO | + MANTIS_GPIF_EXTIRQ; + + rst_stat = mmread(MANTIS_GPIF_STATUS); + rst_stat &= rst_mask; + mmwrite(rst_stat, MANTIS_GPIF_STATUS); + mantis->gpif_status = rst_stat; wake_up(&ca->hif_write_wq); schedule_work(&ca->hif_evm_work);