Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp299572ybz; Fri, 17 Apr 2020 01:10:36 -0700 (PDT) X-Google-Smtp-Source: APiQypJ0xZcNOVlEchp9w9qSg3ob23AXI2PjejsZ08LdaWSA8/6jf1Lbqe7leF5jJ4lvo17iT85D X-Received: by 2002:a17:906:4003:: with SMTP id v3mr1843858ejj.144.1587111036852; Fri, 17 Apr 2020 01:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587111036; cv=none; d=google.com; s=arc-20160816; b=cu/Fykiqa2ZpnpyrG8R4o3AVVb2qYs7DGnb1Gz/1DmvkHJ0iUn6A5yEHeESDPonLvF Bi9iueAhitXX6B5X2FnHJp7H1YHHkc7mWMw/ZWlmVs63abgHZIOz4KTwkrdJS8pVEWKM Bl1O7BLgXJW6QI+3eY11pxxU8CG2xidzNpAWncRvEKgkJrwn5zKg4WDGBvmSKUxP7TQ/ o+aY1DRkhUmFOLGYCCE4btKsuRulCyf7lbqksmo5LEBPWncrO8lMe7G3My6dh6rzfWxn u1YUs3eo9qgnSdL7LiqKd5rf0+NpMqGikqOEUL6w3Vg7jF41I0OL8gYZEakxYhVPvW7e m0oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=9rcUGJ89q1LkAaEBt4SqgBaXEYf65yYi2XQaOaNs9ec=; b=A5vKOtz1fduHpR054CMx85+LoUhKc4ws47AXSk4aTjec9r1L2J9xkb5IYyIn0elf0G BJMJ2GRL/B2hYvgHU8hlhenO/5SGPEg1ADwwPKDCtozRHtaCMuH12f77V1VVvnn6m+3y IlqfRosb8bkdsCUzbL4FtpuNFfhkbVB8CkeATd6JIn68iwPGw2TTl2TEl5xmt8RAmcLe OKBois3ujnJCTJ7nNIXXWjTKDzBnQ6XvwljYC79uhJuzskKfLxwJq3U21LT0hN4are0P BDm6E0M8jyWaSqfSJJCJ6ibSlgdHknhUY1ojaf8R0ZsykQWu+IHM6iX1EQcqmFRSRD0e hvZg== 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id va12si1856134ejb.227.2020.04.17.01.10.12; Fri, 17 Apr 2020 01:10:36 -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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729629AbgDQIGc (ORCPT + 99 others); Fri, 17 Apr 2020 04:06:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729495AbgDQIGc (ORCPT ); Fri, 17 Apr 2020 04:06:32 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA18EC061A0C; Fri, 17 Apr 2020 01:06:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 8AD6E2A2164 From: Adrian Ratiu To: Enric Balletbo Serra , Adrian Ratiu Cc: "devicetree@vger.kernel.org" , Jernej Skrabec , Adrian Pop , Jonas Karlman , linux-kernel , dri-devel , Andrzej Hajda , "open list:ARM/Rockchip SoC..." , Laurent Pinchart , Arnaud Ferraris , Collabora Kernel ML , Ezequiel Garcia , linux-stm32@st-md-mailman.stormreply.com, Linux ARM , linux-imx@nxp.com Subject: Re: [PATCH v6 1/8] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure In-Reply-To: References: <20200414151955.311949-1-adrian.ratiu@collabora.com> <20200414151955.311949-2-adrian.ratiu@collabora.com> <87lfmvjmt5.fsf@collabora.com> Date: Fri, 17 Apr 2020 11:07:37 +0300 Message-ID: <87imhyk01i.fsf@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Apr 2020, Enric Balletbo Serra wrote: > Hi Adrian, > > [snip] > >> >> >> >> +static void dw_mipi_dsi_get_hw_version(struct dw_mipi_dsi >> >> *dsi) +{ + regmap_read(dsi->regs, DSI_VERSION, >> >> &dsi->hw_version); + dsi->hw_version &= VERSION; + if >> >> (!dsi->hw_version) + dev_err(dsi->dev, "Failed >> >> to read DSI hw version register\n"); >> > >> > Is this an error that should be ignored? If you can't get the >> > HW version, probably, there is something wrong with your >> > hardware so, don't you need to return an error? >> > >> >> After thinking a bit more about it, that error should be a >> warning. >> >> I added it because in some cases (for eg. if the peripheral >> clock is disabled) the reads can return 0 which is obviously an >> invalid version and the bridge will error in the next step when >> not finding a layout. >> > > If you'll error anyway, why wait? IIUC at this point the clock > *must* be enabled, and if not, something is wrong with the > driver, I don't see any advantage on delay the error. do you > have a use case where this is called and peripheral clock > disabled? There should be no real use-case (maybe malfunctioning HW), and we could error out here to catch driver bugs ASAP, so I'll go this route then :) Thank you, much appreciated! > >> So I'll make this a warning in v7 and explicitely mention that >> reads version == 0 can be caused by a disabled pclk. >> > > -- Enric > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel