Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp428309ybk; Fri, 15 May 2020 04:34:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxeWYpXXouNCvEli2V9VUyivWA225IUiYs5XuZ74PClx/JFaDEm9UdBdQ+Vzq5UgDUwHm6 X-Received: by 2002:a05:6402:1a21:: with SMTP id be1mr2192387edb.211.1589542482323; Fri, 15 May 2020 04:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589542482; cv=none; d=google.com; s=arc-20160816; b=oTBM0+JhLtaU6SFODZTGiI4gefGnQEl2h7xeMZG+JW7fZ3SUrz4ZTj7bylEnAoH7KN 5zy+bvBYCdsyOeLjlS7bTn/rOHpUiaeRiNlqIOOkegmv6n7xAk4af/hKndGBoK08UgnK zef7jaKMxDvtjqZcqVH/gkArz1XREd4tfpdwncIhdbDJvEl2kP+pC6Lo7j1N9YuVbFbi CyXMdn7ir1HURbHhtwuN1MQibxuXivZMNZLFEN0BoeWB8kBZob95qoG81PHXQOMMieBk EHW9e+1bM0zuDUnMHuiigZHmHaZuxc+GdUaELb4quX8cgViks/86lJPUEpgWlw9IOLJ3 wBpA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=FBPM0tfxUgFMucOY7ciuW2TKyNmhw7Ptun8SfEM32Yc=; b=MzFktna/i19BODPfWgmTYH6Ni4KgeLuyBlYWW0BsczFxPPqWo5s3YjCBGRzh590Svd NN/x6eeKsqCZa5ykE/XSlCUBg+N3EZc2lLcio0XEOne+hABqMmLYB/0j+FHnKRLcY+Fv EptglLyTgLR4adkTDG9KF3GIPLRe3yNVW+e2QEypiEa2fFEjz7ITb3U5SJCaQFBB2Y8W ty8xKnhqLfk9MdmzPPsGmw9zNF8pniHhAQo0Bfa5b+1WyN7mJn25RKEgA+QhJWcptb2u SHReGNyEsm96gIQhBNcD1HYMpFJW3YRHCUvk1YVhQZaVSm+affukvPEQWbV8tJacu5OH t1Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yOpRlpg1; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si951801edz.400.2020.05.15.04.34.18; Fri, 15 May 2020 04:34:42 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yOpRlpg1; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726163AbgEOLcd (ORCPT + 99 others); Fri, 15 May 2020 07:32:33 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:56060 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbgEOLcd (ORCPT ); Fri, 15 May 2020 07:32:33 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 04FBWJTN029039; Fri, 15 May 2020 06:32:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1589542339; bh=FBPM0tfxUgFMucOY7ciuW2TKyNmhw7Ptun8SfEM32Yc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=yOpRlpg1yqyCCA+cY2AyJMwySObitQn8jVweWkNL4ELVevQBhMk8yXp/XUTZdVJXL 1pEoHYIA+A3PyqX1kjhRpvTVUxqbShngkBwiGdgzvVvUmzdtyIQ34AMHMdHYQUnzMa 2TuHg8XxGflf6y7R2u+1bJ7FtvmGiPt40HRv+y6M= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04FBWJBP121748; Fri, 15 May 2020 06:32:19 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 15 May 2020 06:32:18 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 15 May 2020 06:32:19 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04FBWGIv063336; Fri, 15 May 2020 06:32:17 -0500 Subject: Re: linux-next: manual merge of the drm-misc tree with the drm-misc-fixes tree To: Stephen Rothwell CC: Dave Airlie , Daniel Vetter , Intel Graphics , DRI , Linux Next Mailing List , Linux Kernel Mailing List , Thomas Zimmermann References: <20200421115241.704f2fbf@canb.auug.org.au> <20200423131727.1e0f2d9f@canb.auug.org.au> From: Tomi Valkeinen Message-ID: <4b46d98a-e8ca-0140-b082-3af88e1bc1fc@ti.com> Date: Fri, 15 May 2020 14:32:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200423131727.1e0f2d9f@canb.auug.org.au> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, On 23/04/2020 06:17, Stephen Rothwell wrote: > Hi all, > > On Tue, 21 Apr 2020 09:10:25 +0300 Tomi Valkeinen wrote: >> >> On 21/04/2020 04:52, Stephen Rothwell wrote: >>> >>> Today's linux-next merge of the drm-misc tree got a conflict in:he drm-misc tree with the drm-misc-fixes tree >>> >>> drivers/gpu/drm/tidss/tidss_encoder.c >>> >>> between commit: >>> >>> 9da67433f64e ("drm/tidss: fix crash related to accessing freed memory") >>> >>> from the drm-misc-fixes tree and commit: >>> >>> b28ad7deb2f2 ("drm/tidss: Use simple encoder") >>> >>> from the drm-misc tree. >>> >>> I fixed it up (I just used the latter version of this file) and can >> >> We need to use "drm/tidss: fix crash related to accessing freed memory" version. >> >>> carry the fix as necessary. This is now fixed as far as linux-next is >>> concerned, but any non trivial conflicts should be mentioned to your >>> upstream maintainer when your tree is submitted for merging. You may >>> also want to consider cooperating with the maintainer of the conflicting >>> tree to minimise any particularly complex conflicts. >> >> I have fixed this with drm-misc's dim tool, so I presume the conflict goes away when drm-misc-fixes >> is merged to drm-fixes, and drm-fixes is then at some point merged to drm-misc-next. >> >> It was a bit bad timing with the "drm/tidss: Use simple encoder", which removes the plumbing I >> needed to implement the fix. So I effectively revert the "drm/tidss: Use simple encoder". >> >> Tomi >> > > This is now a conflict between the drm and drm-misc-fixes trees. The fix ("drm/tidss: fix crash related to accessing freed memory") is in v5.7-rc3, and the conflicting change ("drm/tidss: Use simple encoder") in drm-next. The conflict resolution in linux-next drops the fix and take the change from drm-next, which causes crash on module removal. Here's the diff I made on top of linux-next to fix it. Essentially dropping the simple-encoder change, and reapplying the fix. This should be fixed in drm-next when Dave next time pulls in Linus' branch. diff --git a/drivers/gpu/drm/tidss/tidss_encoder.c b/drivers/gpu/drm/tidss/tidss_encoder.c index 4c0558286f5e..e624cdcbb567 100644 --- a/drivers/gpu/drm/tidss/tidss_encoder.c +++ b/drivers/gpu/drm/tidss/tidss_encoder.c @@ -56,25 +56,38 @@ static int tidss_encoder_atomic_check(struct drm_encoder *encoder, return 0; } +static void tidss_encoder_destroy(struct drm_encoder *encoder) +{ + drm_encoder_cleanup(encoder); + kfree(encoder); +} + static const struct drm_encoder_helper_funcs encoder_helper_funcs = { .atomic_check = tidss_encoder_atomic_check, }; +static const struct drm_encoder_funcs encoder_funcs = { + .destroy = tidss_encoder_destroy, +}; + struct drm_encoder *tidss_encoder_create(struct tidss_device *tidss, u32 encoder_type, u32 possible_crtcs) { struct drm_encoder *enc; int ret; - enc = devm_kzalloc(tidss->dev, sizeof(*enc), GFP_KERNEL); + enc = kzalloc(sizeof(*enc), GFP_KERNEL); if (!enc) return ERR_PTR(-ENOMEM); enc->possible_crtcs = possible_crtcs; - ret = drm_simple_encoder_init(&tidss->ddev, enc, encoder_type); - if (ret < 0) + ret = drm_encoder_init(&tidss->ddev, enc, &encoder_funcs, + encoder_type, NULL); + if (ret < 0) { + kfree(enc); return ERR_PTR(ret); + } drm_encoder_helper_add(enc, &encoder_helper_funcs); Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki