Received: by 10.192.165.156 with SMTP id m28csp1752531imm; Thu, 12 Apr 2018 02:57:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx48EmHKnj/zZP8H69JK7vNQg3lUdd4Bpj04Aj+tpnGaaGEbeMDvUKLPedhYZWlDRxMZ/obGd X-Received: by 10.99.119.78 with SMTP id s75mr198055pgc.238.1523527056426; Thu, 12 Apr 2018 02:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523527056; cv=none; d=google.com; s=arc-20160816; b=gzdHQbbVaGezD+SwSX1tA5OdoiPPBzM2uCKhRCCP/iXhPqL7jTyesAql5LgbJSbI2t e8LJEngDRxwIc1KnvDaWpRdKOyu2zlcFwaxUAzg6NavSiq+jVpcXYMBzi9Nj2sh9Lu5p DdqFTXOqbpc4uYm/touhyB2sy/HgHuHsdrJnXLmapOZB/FJq2Geve1NpPD4Cp8NuwC1s o6D9aHfv/6ah0EulQVl7cCfz+ENV/MpQc0sbvpuL0qkN9GcgfQX2YQ8qj9CJnA4FeYxa OsHGWD6ucxwZcBj9VVDUkg9fp+8FUitld7opjaVQh4khYQxaRxNrCZci1RBrbH55MGQ4 7D5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter :arc-authentication-results; bh=RlpCnkIUyxmKGjqm7h07aEDiMKePzru2ZWIsPXWft3I=; b=IZPUuV3Z/AN8vIFjIJjmEKANZjonssP0cnY3PXBBFAPNkq5wNxpa+Hep42BEUWNHWC sK8MsFSU/KKJB9d0wdzpaqXUB7Fp02nkXcyDjxgxImPjlmrURa8v6z4likxpK79qeB6l TQrkwh/y9K+RVe6YwOkYVwkSKhvx7rDyXBlez1ov1L0VJtg2o0CMig0qbQENhpFRJ/c2 gHkF0LaJxgRWmBcHR1U/uoXq4GJd+MHYliqNXgH2c1sSFMJDzI0VXVcb/m9yJc5cfYqt ktYfTT7bO14ZgoiDJTfATBAXoGBfWY0FuPjxH5U9rx+dZOxBcfITx4si9gYBR38jRHIV mt6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Kvtf48P+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4-v6si2977147plb.522.2018.04.12.02.56.58; Thu, 12 Apr 2018 02:57:36 -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=pass header.i=@samsung.com header.s=mail20170921 header.b=Kvtf48P+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbeDLJyL (ORCPT + 99 others); Thu, 12 Apr 2018 05:54:11 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:44031 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbeDLJyI (ORCPT ); Thu, 12 Apr 2018 05:54:08 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180412095405euoutp019a6f8ffb98dc24bafa0dd3cb3aede870~kp5gTLEe40980009800euoutp01F; Thu, 12 Apr 2018 09:54:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180412095405euoutp019a6f8ffb98dc24bafa0dd3cb3aede870~kp5gTLEe40980009800euoutp01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1523526845; bh=RlpCnkIUyxmKGjqm7h07aEDiMKePzru2ZWIsPXWft3I=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Kvtf48P+PNNCqtp/L6OtlnhjtLXU0oqrA7XJHNmsCMmuTXK86pEp9x1IMqT/pJDEb gpdfDdOTP+fq0Iv2Ap4s6djUpnEWnM68fB8XmyuOZtV+Y63RXPZE3LkT/8Ciq6pFTO lWF3OqX5stMgM708tDDj5tyWspGU0jaqLi7h+4Xc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180412095404eucas1p28a8f8890f6b14715db610d1f348364bf~kp5fCHAt30348803488eucas1p2G; Thu, 12 Apr 2018 09:54:04 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id F9.AD.17380.BBC2FCA5; Thu, 12 Apr 2018 10:54:03 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180412095403eucas1p13590fbd8850951e84f44908785cb7284~kp5eFNZmv0356603566eucas1p1b; Thu, 12 Apr 2018 09:54:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180412095402eusmtrp15da6f9913e7f48f916860ef5d9e23945~kp5d0tcjk0842408424eusmtrp1l; Thu, 12 Apr 2018 09:54:02 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-15-5acf2cbbaaed Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 00.1E.04183.ABC2FCA5; Thu, 12 Apr 2018 10:54:02 +0100 (BST) Received: from [106.120.43.17] (unknown [106.120.43.17]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180412095401eusmtip121a525985bdd48e1142afaa5f3f0d676~kp5clPEY_3256232562eusmtip1G; Thu, 12 Apr 2018 09:54:01 +0000 (GMT) Subject: Re: [PATCH v6 23/30] drm/rockchip: analogix_dp: Do not call Analogix code before bind To: Enric Balletbo i Serra , architt@codeaurora.org, inki.dae@samsung.com, thierry.reding@gmail.com, hjc@rock-chips.com, seanpaul@chromium.org, airlied@linux.ie, tfiga@chromium.org, heiko@sntech.de Cc: dri-devel@lists.freedesktop.org, dianders@chromium.org, ykk@rock-chips.com, kernel@collabora.com, m.szyprowski@samsung.com, linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com, rydberg@bitmath.org, krzk@kernel.org, linux-rockchip@lists.infradead.org, kgene@kernel.org, linux-input@vger.kernel.org, orjan.eide@arm.com, wxt@rock-chips.com, jeffy.chen@rock-chips.com, linux-arm-kernel@lists.infradead.org, mark.yao@rock-chips.com, wzz@rock-chips.com, hl@rock-chips.com, jingoohan1@gmail.com, sw0312.kim@samsung.com, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, Laurent.pinchart@ideasonboard.com, kuankuan.y@gmail.com, hshi@chromium.org From: Andrzej Hajda Message-ID: <2fde5d53-0e8d-6a15-7962-0e76532d0926@samsung.com> Date: Thu, 12 Apr 2018 11:54:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180405095000.9756-24-enric.balletbo@collabora.com> Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01SbUxTZxjde78hK7tUXJ85s42aRSAON1nmuwzd5kZ2F/3hD020PzYq3hQj FNMrOvdJIAN0gI5uU8oGJlDFrkTkQ7EQFdAVJW1tmHxIahGZA7oGQwElo3S0FzL+nfM858k5 J3k4UjnGrOEO6A+LBr02S81EU5f/mH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IaL03Ge2oj3r01uuRwdUlJip10SRZlH/Hldln7aOAwAA X-CMS-MailID: 20180412095403eucas1p13590fbd8850951e84f44908785cb7284 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-MTR: 20180412095403eucas1p13590fbd8850951e84f44908785cb7284 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180405095337epcas3p1a8750649c8032d844991db91595da8e5 X-RootMTR: 20180405095337epcas3p1a8750649c8032d844991db91595da8e5 References: <20180405095000.9756-1-enric.balletbo@collabora.com> <20180405095000.9756-24-enric.balletbo@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.04.2018 11:49, Enric Balletbo i Serra wrote: > From: Tomasz Figa > > Driver callbacks, such as system suspend or resume can be called any > time, specifically they can be called before the component bind > callback. Let's use dp->adp pointer as a safeguard and skip calling > Analogix entry points if it is an ERR_PTR(). From purity PoV I would store either 0 either valid pointer in dp->adp, but functionally it should be the same. Reviewed-by: Andrzej Hajda  -- Regards Andrzej > > Signed-off-by: Tomasz Figa > Signed-off-by: Thierry Escande > Signed-off-by: Enric Balletbo i Serra > Tested-by: Marek Szyprowski > --- > > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > index 23317a2269e1..6d45d62466b3 100644 > --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > @@ -368,6 +368,8 @@ static void rockchip_dp_unbind(struct device *dev, struct device *master, > analogix_dp_unbind(dp->adp); > rockchip_drm_psr_unregister(&dp->encoder); > dp->encoder.funcs->destroy(&dp->encoder); > + > + dp->adp = ERR_PTR(-ENODEV); > } > > static const struct component_ops rockchip_dp_component_ops = { > @@ -391,6 +393,7 @@ static int rockchip_dp_probe(struct platform_device *pdev) > return -ENOMEM; > > dp->dev = dev; > + dp->adp = ERR_PTR(-ENODEV); > dp->plat_data.panel = panel; > > ret = rockchip_dp_of_probe(dp); > @@ -414,6 +417,9 @@ static int rockchip_dp_suspend(struct device *dev) > { > struct rockchip_dp_device *dp = dev_get_drvdata(dev); > > + if (IS_ERR(dp->adp)) > + return 0; > + > return analogix_dp_suspend(dp->adp); > } > > @@ -421,6 +427,9 @@ static int rockchip_dp_resume(struct device *dev) > { > struct rockchip_dp_device *dp = dev_get_drvdata(dev); > > + if (IS_ERR(dp->adp)) > + return 0; > + > return analogix_dp_resume(dp->adp); > } > #endif