Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp733057imm; Fri, 11 May 2018 05:39:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpXuEeQJ3yHmM2kDudPAuSFPuF39vgNhCSlR/RkPe1EIBEwp2tGhHa98Y3hzbxJH/Gb5zb8 X-Received: by 2002:a63:6108:: with SMTP id v8-v6mr4326474pgb.245.1526042392294; Fri, 11 May 2018 05:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526042392; cv=none; d=google.com; s=arc-20160816; b=H+GYMLarMx6ob/YhfJ5FIHhOE5kDrStOOB+udXEw+h0CaLCdn7xiUBL+vllTOoLnPh tAhFXCdOzEpLEVRrvNsyzzTBA7jCe3se6LXe82uPeeLW6BpZLInG/eaXg1Rt5O1jQwDL rRTYg/PTj/hFr2i8fPJXvLE9yfYKFRVIMHGE2b2nayL4cliBT5c6mUZN66HGa9eB4Rfk tTtu7y+p16Oozog/bQCvk3PO8cW7McF2/rlbo5yFdnHeKm1eeK1dKe6TQoSSKTIqs3d6 Rp8lHyVt84DGpE6RqtHtcCXpErt5Ib+Ej32eAJ11NZeYVrNZtsjLif96n+1/YPe5SN4D NdHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=rmIENfTTa48R3t+sHLsA2zTpw5mXVH1bF18de0kmLPM=; b=Cgh52h6a9os0J4Y4u1UYYIbFaIVmmVVowq/ra8AJ6tlsl0HKmojn+ibdKx89vhLuOi qVROUinz8ijHRPr/wZ0aVfKPM60RKxyAnE2CqSWUtBWWku3XZ3xHJaA27ar1Htb7PvvP w9nA/H/nvwbspuX7oTjhoqocHQ9kmjzoWRMLXXZjF5DEEW1/r90m4fGpSk7UweYq3AZ/ mN50PSlq2apGbXXoO7UIzljnpIs4LBaXpd3jX0hJSPxuDP7ri3uYu3Z/s2TGY+ZKRrbO nrTmUsf4sAhD5q0E59OdGaF952ADmoVWe+wGtGPoh0Uq/2eil/uDoMDw5uohtSFVINpn i04A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=c7nl2F+b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u89-v6si3263299pfa.234.2018.05.11.05.39.37; Fri, 11 May 2018 05:39:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=c7nl2F+b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752563AbeEKMj2 (ORCPT + 99 others); Fri, 11 May 2018 08:39:28 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:45144 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbeEKMj1 (ORCPT ); Fri, 11 May 2018 08:39:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rmIENfTTa48R3t+sHLsA2zTpw5mXVH1bF18de0kmLPM=; b=c7nl2F+bG7ZArmQWmoaAeT8A9 TdqOP9UMcX+BJRJLLUgRzqT6Q7yWrtnjYHkUhwzatQcX9uosfpITHLY84oKafh7FSRQAi7zmUK27a TUXGqZ3f2lMtwTlfugavzC3lUoOEX7rJb77sXdLE30WN8Dr0+xE2Qwug6piRIGnGZEfXw=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:45243) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1fH7KU-0007bU-6O; Fri, 11 May 2018 13:39:22 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1fH7KQ-0007kc-Q6; Fri, 11 May 2018 13:39:19 +0100 Date: Fri, 11 May 2018 13:39:16 +0100 From: Russell King - ARM Linux To: Pintu Kumar Cc: open list , linux-arm-kernel@lists.infradead.org, kernelnewbies@kernelnewbies.org Subject: Re: Delivery Status Notification (Failure) Message-ID: <20180511123915.GC16141@n2100.armlinux.org.uk> References: <5af57fea.1c69fb81.885f0.2377.GMRIR@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 11, 2018 at 05:07:37PM +0530, Pintu Kumar wrote: > Hi, > > I need one help. > I am using i.MX7 Sabre board with kernel version 4.1.15 > > Let's say I am interested in GPIO number: 21 > I wanted to set CPU affinity for particular GPIO->IRQ number, so I > tried the below steps: > root@10:~# echo 21 > /sys/class/gpio/export > root@10:~# echo "rising" > /sys/class/gpio/gpio21/edge > root@10:~# cat /proc/interrupts | grep 21 > 47: 0 0 gpio-mxc 21 Edge gpiolib > root@10:~# cat /sys/class/gpio/gpio21/direction > in > root@10:~# cat /proc/irq/47/smp_affinity > 3 > root@10:~# echo 2 > /proc/irq/47/smp_affinity > -bash: echo: write error: Input/output error > > But I get input/output error. > When I debug further, found that irq_can_set_affinity is returning 0: > [ 0.000000] genirq: irq_can_set_affinity (0): balance: 1, > irq_data.chip: a81b7e48, irq_set_affinity: (null) > [ 0.000000] write_irq_affinity: FAIL > > I also tried first setting /proc/irq/default_smp_affinity to 2 (from 3). > This change is working, but the smp_affinity setting for the new IRQ > is not working. > > When I try to set smp_affinity for mmc0, then it works. > # cat /proc/interrupts | grep mmc > 295: 55 0 GPCV2 22 Edge mmc0 > 296: 0 0 GPCV2 23 Edge mmc1 > 297: 52 0 GPCV2 24 Edge mmc2 > > root@10:~# echo 2 > /proc/irq/295/smp_affinity > root@10:~# > > > So, I wanted to know what are the conditions for which setting > smp_affinity for an IRQ will work ? > > Is there any way by which I can set CPU affinity to a GPIO -> IRQ ? > Whether, irq_set_affinity_hint() will work in this case ? IRQ affinity is only supported where interrupts are _directly_ wired to the GIC. It's the GIC which does the interrupt steering to the CPU cores. Interrupts on downstream interrupt controllers (such as GPCV2) have no ability to be directed independently to other CPUs - the only possible way to change the mapping is to move _all_ interrupts on that controller, and any downstream chained interrupts at GIC level. Hence why Interrupt 295 has no irq_set_affinity function: there is no way for the interrupt controller itself to change the affinity of the input interrupt. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up