Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1663003ybv; Fri, 21 Feb 2020 01:14:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzKT7vMNVsl0lVWfgxXdFiPpXYO5vj1aEpCULuxD3AstsFE2qbftJtr9agfclyGNCaYJXQD X-Received: by 2002:a9d:4e93:: with SMTP id v19mr25234240otk.200.1582276474858; Fri, 21 Feb 2020 01:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582276474; cv=none; d=google.com; s=arc-20160816; b=ObDK7AbVKhlm5KrTiKbWKcxq1StqZOrxhcpdthXHsLyxV424N0HZ/Q8FRt1JHf6zVt Ul5BxXGLu4drRhQCZPsIEXNvoHMos+oTF6Z/CKSyOgEIEWAZkuYOjJvMEtN2SJoDUp5U 6/GIxBMtHSdyeKUT7hif+fkeu86Swrj9ZpJhebsZMMapE6ZmwdtBzELodGTrX4g5E59E v9k6leVkiRyOtj10PWxC6qcyIGI0li+H46Xxuf8bepCDr39Z9ZnCg2wI5EKLwySiLcf2 cqdypD0bZXoT3JIFYIqKgKiLdJIyKAInmGc+OGuRvctDRRi4NBLmGbQ6udZbAGYLf5xw VXvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=7J/H2F6WLFHVXglBqOK98N74y1baye9CZf2E/YrEQ+M=; b=ezRfnjZkT2fJwXAdw1OhW+/owy4EwWL2nH2dm3BiemD6LOMudKsbHnW1e0rjsedNh8 HeJ9rURhyJ1797C3BuOGMlAtUlSKj067rkC3Bdss7NjBYAj6T1EfvUNRrtO4AuZ3amtb xZVh+Jvc/onwoZBvUf5tq1IFYqp7HMnRA5mP4eCCOEcwRv0Ya4DfGuno/5Mt+TwZBCq8 197muJ1ilhMGPBiLj5R66sRgw5wXC+PZpwks0CpBDWNxQfSo3fh5MNrOrWfIwMjAwnhV +RYEc/dI5PR6VIHHkasfC/7Wj2KfOp+3OwY3WncqVJy30r1pp24SRB8D2JpCWnZ1xSS9 i/DQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si480656oic.188.2020.02.21.01.14.23; Fri, 21 Feb 2020 01:14:34 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727167AbgBUI4Z (ORCPT + 99 others); Fri, 21 Feb 2020 03:56:25 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:10661 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727670AbgBUI4Y (ORCPT ); Fri, 21 Feb 2020 03:56:24 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A9C6B24B492927AD0DB8; Fri, 21 Feb 2020 16:56:13 +0800 (CST) Received: from [127.0.0.1] (10.57.60.129) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Fri, 21 Feb 2020 16:56:05 +0800 Subject: Re: [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API To: Thomas Zimmermann , Xinliang Liu , Tian Tao CC: , , Daniel Vetter , , , , , , References: <1582264523-61170-1-git-send-email-tiantao6@hisilicon.com> From: "tiantao (H)" Message-ID: <4a8ba960-34c5-d044-900d-5cd0e9ec310e@huawei.com> Date: Fri, 21 Feb 2020 16:56:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.57.60.129] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry,my mistake. I sent the wrong patch, please ignore the patch below 在 2020/2/21 16:52, Thomas Zimmermann 写道: > Hi > > Am 21.02.20 um 08:06 schrieb Xinliang Liu: >> Hi tao, >> Are you sending a wrong patch? >> Function hibmc_remove_framebuffers is added by your prior reviewing patch. >> Please send patch based on drm-misc-next branch[1] or linux-next. > > There's drm_fb_helper_remove_conflicting_pci_framebuffers() which > already implements the functionality. I asked to try using it instead of > creating an own implementation. > > Best regards > Thomas > >> >> Thanks, >> -Xinliang >> >> [1] https://anongit.freedesktop.org/git/drm-misc.git >> >> On Fri, 21 Feb 2020 at 13:56, Tian Tao > > wrote: >> >> the kernel provide the drm_fb_helper_remove_conflicting_pci_framebuffer >> to remvoe the pcie resource conflict,there is no need to driver it >> again. >> >> Signed-off-by: Tian Tao > > >> --- >>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 >> +++++----------------- >>  1 file changed, 5 insertions(+), 17 deletions(-) >> >> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> index 7ebe831..0f7dba7 100644 >> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> @@ -47,22 +47,6 @@ static irqreturn_t hibmc_drm_interrupt(int irq, >> void *arg) >>         return IRQ_HANDLED; >>  } >> >> -static void hibmc_remove_framebuffers(struct pci_dev *pdev) >> -{ >> -       struct apertures_struct *ap; >> - >> -       ap = alloc_apertures(1); >> -       if (!ap) >> -               return; >> - >> -       ap->ranges[0].base = pci_resource_start(pdev, 0); >> -       ap->ranges[0].size = pci_resource_len(pdev, 0); >> - >> -       drm_fb_helper_remove_conflicting_framebuffers(ap, >> "hibmcdrmfb", false); >> - >> -       kfree(ap); >> -} >> - >>  static struct drm_driver hibmc_driver = { >>         .driver_features        = DRIVER_GEM | DRIVER_MODESET | >> DRIVER_ATOMIC, >>         .fops                   = &hibmc_fops, >> @@ -343,7 +327,11 @@ static int hibmc_pci_probe(struct pci_dev *pdev, >>         struct drm_device *dev; >>         int ret; >> >> -       hibmc_remove_framebuffers(pdev); >> +       ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, >> + >>  "hibmcdrmfb"); >> +       if (ret) >> +               return ret; >> + >> >>         dev = drm_dev_alloc(&hibmc_driver, &pdev->dev); >>         if (IS_ERR(dev)) { >> -- >> 2.7.4 >> >