From owner-freebsd-ppc@FreeBSD.ORG Sat Jun 2 16:06:37 2012 Return-Path: Delivered-To: powerpc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B9C01065672; Sat, 2 Jun 2012 16:06:37 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 059738FC15; Sat, 2 Jun 2012 16:06:37 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 6154AC384F; Sat, 2 Jun 2012 18:06:19 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id kaqVWD7Mm3nm; Sat, 2 Jun 2012 18:06:18 +0200 (CEST) Received: from [10.0.2.117] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id 8BE25C3842; Sat, 2 Jun 2012 18:06:18 +0200 (CEST) Message-ID: <4FCA3A04.3010702@semihalf.com> Date: Sat, 02 Jun 2012 18:06:28 +0200 From: Zbyszek Bodek User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20 MIME-Version: 1.0 To: Nathan Whitehorn References: <0362C399-CB54-451E-A879-E836EF13CE72@semihalf.com> <4FC74BDC.4050806@freebsd.org> In-Reply-To: <4FC74BDC.4050806@freebsd.org> Content-Type: multipart/mixed; boundary="------------040405080709010608060704" Cc: powerpc@freebsd.org, =?UTF-8?B?UGlvdHIgWmnEmWNpaw==?= Subject: Re: RFC: OpenPIC IPI patch X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2012 16:06:37 -0000 This is a multi-part message in MIME format. --------------040405080709010608060704 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 31.05.2012 12:45, Nathan Whitehorn wrote: > On 05/30/12 22:13, Rafal Jaworowski wrote: >> Can you please have a look at this patch and let us know about any >> comments / objections? We identified a problem with IPI on the recent >> FSL eOpenPIC, description in the patch: >> >> http://people.freebsd.org/~raj/patches/powerpc/openpic.diff >> >> >> Rafal >> > Hello. As Rafal noticed, when we've changed pic_ipi method, ps3pic_ipi() ought to be adjusted too. @@ -203,12 +204,17 @@ ps3pic_eoi(device_t dev, u_int irq) } static void -ps3pic_ipi(device_t dev, u_int cpu) +ps3pic_ipi(device_t dev, cpuset_t cpumask) { struct ps3pic_softc *sc; + u_int cpu; + sc = device_get_softc(dev); - lv1_send_event_locally(sc->sc_ipi_outlet[cpu]); + for (cpu = 0; cpu < 2; cpu++) { + if (CPU_ISSET(cpu, &cpumask)) + lv1_send_event_locally(sc->sc_ipi_outlet[cpu]); + } } I've made a modification but it requires some overview. I have used a hard-coded value of 2 to sweep the mask of CPUs because sc_ipi_outlet has two fields anyway. Don't know if that approach isn't too "far-reaching" or should I use mp_ncpus instead. The patch is available in the email's attachment. Please send your comments. Best regards Zbyszek Bodek --------------040405080709010608060704 Content-Type: text/x-patch; name="ps3pic_ipi.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ps3pic_ipi.patch" diff --git a/sys/powerpc/ps3/ps3pic.c b/sys/powerpc/ps3/ps3pic.c index 8022cf8..b803f64 100644 --- a/sys/powerpc/ps3/ps3pic.c +++ b/sys/powerpc/ps3/ps3pic.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -51,7 +52,7 @@ static int ps3pic_attach(device_t); static void ps3pic_dispatch(device_t, struct trapframe *); static void ps3pic_enable(device_t, u_int, u_int); static void ps3pic_eoi(device_t, u_int); -static void ps3pic_ipi(device_t, u_int); +static void ps3pic_ipi(device_t, cpuset_t); static void ps3pic_mask(device_t, u_int); static void ps3pic_unmask(device_t, u_int); @@ -203,12 +204,17 @@ ps3pic_eoi(device_t dev, u_int irq) } static void -ps3pic_ipi(device_t dev, u_int cpu) +ps3pic_ipi(device_t dev, cpuset_t cpumask) { struct ps3pic_softc *sc; + u_int cpu; + sc = device_get_softc(dev); - lv1_send_event_locally(sc->sc_ipi_outlet[cpu]); + for (cpu = 0; cpu < 2; cpu++) { + if (CPU_ISSET(cpu, &cpumask)) + lv1_send_event_locally(sc->sc_ipi_outlet[cpu]); + } } static void --------------040405080709010608060704--