From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbbJMOlg (ORCPT ); Tue, 13 Oct 2015 10:41:36 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:6046 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752295AbbJMOle (ORCPT ); Tue, 13 Oct 2015 10:41:34 -0400 Subject: Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi To: Thomas Gleixner References: <1444731382-19313-1-git-send-email-qais.yousef@imgtec.com> <1444731382-19313-9-git-send-email-qais.yousef@imgtec.com> CC: , , , , , From: Qais Yousef Message-ID: <561D181C.8000801@imgtec.com> Date: Tue, 13 Oct 2015 15:41:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.154.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/13/2015 02:40 PM, Thomas Gleixner wrote: > On Tue, 13 Oct 2015, Qais Yousef wrote: > > Lacks kerneldoc > >> +int __irq_desc_send_ipi(struct irq_desc *desc, const struct ipi_mask *dest) >> +{ >> + struct irq_data *data = irq_desc_get_irq_data(desc); >> + struct irq_chip *chip = irq_data_get_irq_chip(data); >> + >> + if (!chip || !chip->irq_send_ipi) >> + return -EINVAL; >> + >> + /* >> + * Do not validate the mask for IPIs marked global. These are >> + * regular IPIs so we can avoid the operation as their target >> + * mask is the cpu_possible_mask. >> + */ >> + if (!dest->global) { >> + if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask, >> + dest->nbits)) >> + return -EINVAL; >> + } > This looks half thought out. You rely on the caller getting the global > bit right. There should be a sanity check for this versus > data->ipi_mask and also you need to validate nbits. Yes I might have rushed this part as I did it last. I'll improve it. > >> +EXPORT_SYMBOL(irq_send_ipi); > EXPORT_SYMBOL_GPL please > > OK. Thanks, Qais