Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp540339pxb; Wed, 25 Aug 2021 09:02:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEXhiLh/JuUKstP3B3I2APZ2ZRQAsJ1oSzQW/cv8C8yhFHmSOLd4e0aCRka3khOn++rtuR X-Received: by 2002:a17:906:84a:: with SMTP id f10mr45213021ejd.386.1629907335804; Wed, 25 Aug 2021 09:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629907335; cv=none; d=google.com; s=arc-20160816; b=iTRqTg1yCUhtTTRbfacpouLVzTT4NX6YlkN2ul4wJGLXqPaqwG2wZOM5wdQsIk7jzB tr/xwgcEPCT53PLYblsuSozitRqt3231qpx4XocO0UbExP9jw1mDaZxBnVkn9rFIH66P qD/w4hAnQxPwknB20Gn1QlAEFOtpqVdo9E2rNUVZ+Kp5uDXHOZFw70oWsTAU3VhkZ+MZ XWlcz3zjkggoAzzZfB3wTg8pr9hiWz3zngXREuV74ciq2x7oED4wrbQAItiMAMHER2gt cYTe8qAkIeVGcBgWPR7+3tNLvlZsYICJE2n3s9N4NjoND29dHS5L7lRXgkgQqD3e+3Gs 0j/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=JnFOd5P+lfKmXBDsvAYWDnWDf9NlNEZFICrNBTm6b/k=; b=fBg1dESuNltLLUkJBXZ/CtWl6aSFfR77tmWtEGRaTLYGoKMy8SZhD5fBQWvX1GsLlU +htgPqqmZ+uztKyDznscyh1/yO48Qe+QHZ8sB3DBYMJA/Qo/pkmrzzs7X9JnsOou+6YY d2YGjnXEA7mD44bnRKDalwaenBL3DaeHKNX8cCdZ8gXDeNS1wFBdKXtBk8PCEDxGqP2L PPUmp+Rt1b/AKcUMtRvKh3TBNKCg8cH24bEpLlR9Q2UfOg7E+fOi4xix66lC63RxuPCq L8z2k7a6VBVwcj8KVd9Ay4tmRn4mFj5VoR/XYFZMvL/A08ReJk0B7E0y9xA1gME3tKrI e7wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kl2si231821ejc.742.2021.08.25.09.01.48; Wed, 25 Aug 2021 09:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234594AbhHYOmQ (ORCPT + 99 others); Wed, 25 Aug 2021 10:42:16 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:8774 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhHYOmG (ORCPT ); Wed, 25 Aug 2021 10:42:06 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GvpYl0PgdzYrGg; Wed, 25 Aug 2021 22:40:43 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 25 Aug 2021 22:41:16 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 25 Aug 2021 22:41:16 +0800 Subject: Re: [PATCH 3/3] amba: Properly handle device probe without IRQ domain To: Rob Herring CC: Saravana Kannan , "linux-kernel@vger.kernel.org" , Frank Rowand , , Russell King , "Linus Walleij" , linux-arm-kernel , Ruizhe Lin References: <20210816074619.177383-1-wangkefeng.wang@huawei.com> <20210816074619.177383-4-wangkefeng.wang@huawei.com> From: Kefeng Wang Message-ID: Date: Wed, 25 Aug 2021 22:41:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/8/25 20:33, Rob Herring wrote: > On Tue, Aug 24, 2021 at 11:05 PM Kefeng Wang wrote: ... >>> Similar to other resources the AMBA bus "gets" for the device, I think >>> this should be moved into amba_probe() and not here. There's no reason >>> to delay the addition of the device (and loading its module) because >>> the IRQ isn't ready yet. >> The following code in the amba_device_try_add() will be called, it uses irq[0] >> and irq[1], so I put of_amba_device_decode_irq() into amba_device_try_add(). >> >> 470 if (dev->irq[0]) >> 471 ret = device_create_file(&dev->dev, &dev_attr_irq0); >> 472 if (ret == 0 && dev->irq[1]) >> 473 ret = device_create_file(&dev->dev, &dev_attr_irq1); >> 474 if (ret == 0) >> 475 return ret; > I wonder if we could just remove these. Why does userspace need them > in the first place? It's only an ABI if someone notices. Looking at > the history, AMBA bus was added in 2003 with just 'irq' and then > changed (ABI break) in 2004 to 'irq0' and 'irq1'. > > Rob Ok, I will kill all irq parts, diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 962041148482..c08e8b30e02c 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -20,8 +20,6 @@  #include  #include -#include -  #define to_amba_driver(d)      container_of(d, struct amba_driver, drv)  /* called on periphid match and class 0x9 coresight device. */ @@ -135,8 +133,6 @@ static ssize_t name##_show(struct device *_dev,                             \  static DEVICE_ATTR_RO(name)  amba_attr_func(id, "%08x\n", dev->periphid); -amba_attr_func(irq0, "%u\n", dev->irq[0]); -amba_attr_func(irq1, "%u\n", dev->irq[1]);  amba_attr_func(resource, "\t%016llx\t%016llx\t%016lx\n",          (unsigned long long)dev->res.start, (unsigned long long)dev->res.end,          dev->res.flags); @@ -467,10 +463,6 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)         if (ret)                 goto err_release; -       if (dev->irq[0]) -               ret = device_create_file(&dev->dev, &dev_attr_irq0); -       if (ret == 0 && dev->irq[1]) -               ret = device_create_file(&dev->dev, &dev_attr_irq1); and do some cleanup about error handling in the next version. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/log/arch/arm/common/amba.c > . >