From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Yingliang Date: Thu, 22 Oct 2015 10:56:29 +0000 Subject: Re: [RFC PATCH v6 3/3] arm: fix a migrating irq bug when hotplug cpu Message-Id: <5628C0DD.50900@huawei.com> List-Id: References: <1443087135-17044-1-git-send-email-yangyingliang@huawei.com> <1443087135-17044-4-git-send-email-yangyingliang@huawei.com> <20151021202907.GN32532@n2100.arm.linux.org.uk> <20151022092629.GQ32532@n2100.arm.linux.org.uk> In-Reply-To: <20151022092629.GQ32532@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org On 2015/10/22 17:26, Russell King - ARM Linux wrote: > On Wed, Oct 21, 2015 at 09:29:08PM +0100, Russell King - ARM Linux wrote: >> On Wed, Oct 21, 2015 at 01:47:49PM +0200, Geert Uytterhoeven wrote: >>> On Thu, Sep 24, 2015 at 11:32 AM, Yang Yingliang >>> wrote: >>>> When cpu is disabled, all irqs will be migratged to another cpu. >>>> In some cases, a new affinity is different, the old affinity need >>>> to be updated and if irq_set_affinity's return value is IRQ_SET_MASK_OK_DONE, >>>> the old affinity can not be updated. Fix it by using irq_do_set_affinity. >>>> >>>> And migrating interrupts is a core code matter, so use the generic >>>> function irq_migrate_all_off_this_cpu() to migrate interrupts in >>>> kernel/irq/migration.c. >>>> >>>> Cc: Jiang Liu >>>> Cc: Thomas Gleixner >>>> Cc: Marc Zyngier >>>> Cc: Mark Rutland >>>> Cc: Will Deacon >>>> Cc: Russell King - ARM Linux >>>> Cc: Hanjun Guo >>>> Signed-off-by: Yang Yingliang >>>> --- >>>> arch/arm/Kconfig | 1 + >>>> arch/arm/include/asm/irq.h | 1 - >>>> arch/arm/kernel/irq.c | 62 ---------------------------------------------- >>>> arch/arm/kernel/smp.c | 2 +- >>>> 4 files changed, 2 insertions(+), 64 deletions(-) >>>> >>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig >>>> index 72ad724..bffba78 100644 >>>> --- a/arch/arm/Kconfig >>>> +++ b/arch/arm/Kconfig >>>> @@ -1492,6 +1492,7 @@ config NR_CPUS >>>> config HOTPLUG_CPU >>>> bool "Support for hot-pluggable CPUs" >>>> depends on SMP >>>> + select GENERIC_IRQ_MIGRATION >>> >>> This causes the following warnings during s2ram on r8a7791/koelsch >>> (dual-core CA15): >> >> Thanks for the report. I'll see what tonight's boot run says for my >> platforms. Hopefully, the author of these changes can help debug >> this. > > What's happened is that: > > - c = irq_data_get_irq_chip(d); > - if (!c->irq_set_affinity) > - pr_debug("IRQ%u: unable to set affinity\n", d->irq); > > has become: > > + c = irq_data_get_irq_chip(d); > + if (!c->irq_set_affinity) { > + pr_warn_ratelimited("IRQ%u: unable to set affinity\n", d->irq); > > which makes things more noisy. > > This is a change that was not described in the commit message for the > patch Thomas merged. I described it in v2 cover letter and kept the change history in v6 cover letter. There is no comment on the change when patch the was reviewing in v2, so I thought it's ok and I kept the change in the next versions. Need I send a patch to the Thomas branch to revert the change ? Thanks, Yang From mboxrd@z Thu Jan 1 00:00:00 1970 From: yangyingliang@huawei.com (Yang Yingliang) Date: Thu, 22 Oct 2015 18:56:29 +0800 Subject: [RFC PATCH v6 3/3] arm: fix a migrating irq bug when hotplug cpu In-Reply-To: <20151022092629.GQ32532@n2100.arm.linux.org.uk> References: <1443087135-17044-1-git-send-email-yangyingliang@huawei.com> <1443087135-17044-4-git-send-email-yangyingliang@huawei.com> <20151021202907.GN32532@n2100.arm.linux.org.uk> <20151022092629.GQ32532@n2100.arm.linux.org.uk> Message-ID: <5628C0DD.50900@huawei.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 2015/10/22 17:26, Russell King - ARM Linux wrote: > On Wed, Oct 21, 2015 at 09:29:08PM +0100, Russell King - ARM Linux wrote: >> On Wed, Oct 21, 2015 at 01:47:49PM +0200, Geert Uytterhoeven wrote: >>> On Thu, Sep 24, 2015 at 11:32 AM, Yang Yingliang >>> wrote: >>>> When cpu is disabled, all irqs will be migratged to another cpu. >>>> In some cases, a new affinity is different, the old affinity need >>>> to be updated and if irq_set_affinity's return value is IRQ_SET_MASK_OK_DONE, >>>> the old affinity can not be updated. Fix it by using irq_do_set_affinity. >>>> >>>> And migrating interrupts is a core code matter, so use the generic >>>> function irq_migrate_all_off_this_cpu() to migrate interrupts in >>>> kernel/irq/migration.c. >>>> >>>> Cc: Jiang Liu >>>> Cc: Thomas Gleixner >>>> Cc: Marc Zyngier >>>> Cc: Mark Rutland >>>> Cc: Will Deacon >>>> Cc: Russell King - ARM Linux >>>> Cc: Hanjun Guo >>>> Signed-off-by: Yang Yingliang >>>> --- >>>> arch/arm/Kconfig | 1 + >>>> arch/arm/include/asm/irq.h | 1 - >>>> arch/arm/kernel/irq.c | 62 ---------------------------------------------- >>>> arch/arm/kernel/smp.c | 2 +- >>>> 4 files changed, 2 insertions(+), 64 deletions(-) >>>> >>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig >>>> index 72ad724..bffba78 100644 >>>> --- a/arch/arm/Kconfig >>>> +++ b/arch/arm/Kconfig >>>> @@ -1492,6 +1492,7 @@ config NR_CPUS >>>> config HOTPLUG_CPU >>>> bool "Support for hot-pluggable CPUs" >>>> depends on SMP >>>> + select GENERIC_IRQ_MIGRATION >>> >>> This causes the following warnings during s2ram on r8a7791/koelsch >>> (dual-core CA15): >> >> Thanks for the report. I'll see what tonight's boot run says for my >> platforms. Hopefully, the author of these changes can help debug >> this. > > What's happened is that: > > - c = irq_data_get_irq_chip(d); > - if (!c->irq_set_affinity) > - pr_debug("IRQ%u: unable to set affinity\n", d->irq); > > has become: > > + c = irq_data_get_irq_chip(d); > + if (!c->irq_set_affinity) { > + pr_warn_ratelimited("IRQ%u: unable to set affinity\n", d->irq); > > which makes things more noisy. > > This is a change that was not described in the commit message for the > patch Thomas merged. I described it in v2 cover letter and kept the change history in v6 cover letter. There is no comment on the change when patch the was reviewing in v2, so I thought it's ok and I kept the change in the next versions. Need I send a patch to the Thomas branch to revert the change ? Thanks, Yang From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757219AbbJVK4v (ORCPT ); Thu, 22 Oct 2015 06:56:51 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:31735 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756763AbbJVK4s (ORCPT ); Thu, 22 Oct 2015 06:56:48 -0400 Subject: Re: [RFC PATCH v6 3/3] arm: fix a migrating irq bug when hotplug cpu To: Russell King - ARM Linux , Geert Uytterhoeven , Thomas Gleixner References: <1443087135-17044-1-git-send-email-yangyingliang@huawei.com> <1443087135-17044-4-git-send-email-yangyingliang@huawei.com> <20151021202907.GN32532@n2100.arm.linux.org.uk> <20151022092629.GQ32532@n2100.arm.linux.org.uk> CC: Mark Rutland , Linux-sh list , Marc Zyngier , Will Deacon , "linux-kernel@vger.kernel.org" , Hanjun Guo , Jiang Liu , "linux-arm-kernel@lists.infradead.org" From: Yang Yingliang Message-ID: <5628C0DD.50900@huawei.com> Date: Thu, 22 Oct 2015 18:56:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151022092629.GQ32532@n2100.arm.linux.org.uk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.219] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/10/22 17:26, Russell King - ARM Linux wrote: > On Wed, Oct 21, 2015 at 09:29:08PM +0100, Russell King - ARM Linux wrote: >> On Wed, Oct 21, 2015 at 01:47:49PM +0200, Geert Uytterhoeven wrote: >>> On Thu, Sep 24, 2015 at 11:32 AM, Yang Yingliang >>> wrote: >>>> When cpu is disabled, all irqs will be migratged to another cpu. >>>> In some cases, a new affinity is different, the old affinity need >>>> to be updated and if irq_set_affinity's return value is IRQ_SET_MASK_OK_DONE, >>>> the old affinity can not be updated. Fix it by using irq_do_set_affinity. >>>> >>>> And migrating interrupts is a core code matter, so use the generic >>>> function irq_migrate_all_off_this_cpu() to migrate interrupts in >>>> kernel/irq/migration.c. >>>> >>>> Cc: Jiang Liu >>>> Cc: Thomas Gleixner >>>> Cc: Marc Zyngier >>>> Cc: Mark Rutland >>>> Cc: Will Deacon >>>> Cc: Russell King - ARM Linux >>>> Cc: Hanjun Guo >>>> Signed-off-by: Yang Yingliang >>>> --- >>>> arch/arm/Kconfig | 1 + >>>> arch/arm/include/asm/irq.h | 1 - >>>> arch/arm/kernel/irq.c | 62 ---------------------------------------------- >>>> arch/arm/kernel/smp.c | 2 +- >>>> 4 files changed, 2 insertions(+), 64 deletions(-) >>>> >>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig >>>> index 72ad724..bffba78 100644 >>>> --- a/arch/arm/Kconfig >>>> +++ b/arch/arm/Kconfig >>>> @@ -1492,6 +1492,7 @@ config NR_CPUS >>>> config HOTPLUG_CPU >>>> bool "Support for hot-pluggable CPUs" >>>> depends on SMP >>>> + select GENERIC_IRQ_MIGRATION >>> >>> This causes the following warnings during s2ram on r8a7791/koelsch >>> (dual-core CA15): >> >> Thanks for the report. I'll see what tonight's boot run says for my >> platforms. Hopefully, the author of these changes can help debug >> this. > > What's happened is that: > > - c = irq_data_get_irq_chip(d); > - if (!c->irq_set_affinity) > - pr_debug("IRQ%u: unable to set affinity\n", d->irq); > > has become: > > + c = irq_data_get_irq_chip(d); > + if (!c->irq_set_affinity) { > + pr_warn_ratelimited("IRQ%u: unable to set affinity\n", d->irq); > > which makes things more noisy. > > This is a change that was not described in the commit message for the > patch Thomas merged. I described it in v2 cover letter and kept the change history in v6 cover letter. There is no comment on the change when patch the was reviewing in v2, so I thought it's ok and I kept the change in the next versions. Need I send a patch to the Thomas branch to revert the change ? Thanks, Yang