Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp465869pxb; Tue, 12 Apr 2022 06:07:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJMGuoQICZz0FY2mUxQMBxdgMBmESGBb2TWM3Hy8GrNXcwyZ/0SUVsy7YZhOQ02ny12o8w X-Received: by 2002:a17:90b:1e43:b0:1c7:46bf:ba29 with SMTP id pi3-20020a17090b1e4300b001c746bfba29mr4965651pjb.100.1649768821769; Tue, 12 Apr 2022 06:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649768821; cv=none; d=google.com; s=arc-20160816; b=hPe9xQNiH8AsHtaczW+laChupHkLwyhqcxb67gK10cK7jTMR3YdioiJL26OfciW+TC hcBfV/Mk5EOI4sy+pQxz03zT1X67S6/o7nh+gkCBWfc00lktlK4YiqTYnTc64z90835m +GJhboej2YOEmiGlKB0J7FVPbAEKYiAUi+CnlljGdVeiGIXfJNZL/XtNUBo+i2lWTz7c hcU6MtbvFJUFfr4a1JmKT/Q/yIQeCyInHO/PoB6Wzl36JpyFfd88ehBA85L5f73VhF2T 2PBfpfwE2OBu7t84o3lMdlaO1FNlrbJuvZArb7Ieywjn3Hl40VVAIDQqGFVikKlWDlcq FGjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=2hqdJe2z5thDY+V/BIGSxpcl+9YoCnMAkDESTCF9xJQ=; b=E+/AJgAr43G701P16u0MG54GbGDx9B6NcrPccBVxVzO2BGTMPH2MfMNBF1XSFR+872 xxmRMljCShOdaTgI2sihkCwKfc8IzBp+31KZ5tKjOaPJdHE6ZD77ddT+Wm7+T+mu8nw2 Oi0wlZnDdaYKMcQfohcQIuniHbuFUksz8+p7DJ78qtYUKE4/Sd//v6S2KrmuwhchoZsY oERb8LRzJcydlIZDi6gZXhHEvTA+afoz0G3UylMYNwOsIb9NQaQuVuv86u8HEB2+psLp LmN0eroELHV4RAIsJ0mJDdEu3o4HJAUtrdCKJ9hJUQuIHIR+XqbsqOhtOzWkT/ea/I8l INXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=gmBaCO43; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a056a0023c200b004fa3a8e002asi12515492pfc.225.2022.04.12.06.06.33; Tue, 12 Apr 2022 06:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=gmBaCO43; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245451AbiDKH6P (ORCPT + 99 others); Mon, 11 Apr 2022 03:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343556AbiDKH6K (ORCPT ); Mon, 11 Apr 2022 03:58:10 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5CB1D13D0D; Mon, 11 Apr 2022 00:55:56 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1127) id EF7EA205657E; Mon, 11 Apr 2022 00:55:55 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com EF7EA205657E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1649663755; bh=2hqdJe2z5thDY+V/BIGSxpcl+9YoCnMAkDESTCF9xJQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gmBaCO43MEeaINcc6CWCMzgY6Zvh99f+2wobY/cTP0Z2sMzuBVznCAZDOddmQkzjp GoZgLolr4cwFzP82BmphuKjEsvSG5Vy/2JwLep3CXHr9WKDpUEiiAgukhv0wnBKc7F sTxi9iNizaNafkdNfYw4zMfiHrZMSuyxunKP5IMI= Date: Mon, 11 Apr 2022 00:55:55 -0700 From: Saurabh Singh Sengar To: Dexuan Cui Cc: Saurabh Singh Sengar , "drawat.floss@gmail.com" , "airlied@linux.ie" , "daniel@ffwll.ch" , "linux-hyperv@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "Michael Kelley (LINUX)" Subject: Re: [PATCH v3] drm/hyperv: Added error message for fb size greater than allocated Message-ID: <20220411075555.GA15355@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1649650437-17977-1-git-send-email-ssengar@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 11, 2022 at 06:40:38AM +0000, Dexuan Cui wrote: > > Subject: [PATCH v3] drm/hyperv: Added error message for fb size greater than > > allocated > > > > Added error message when the size of requested framebuffer is more than > > the allocated size by vmbus mmio region for framebuffer > > "Added" --> "Add"? My impression is that we don't use past tense in the Ok. > Subject and the commit message. See > "git log drivers/gpu/drm/hyperv/hyperv_drm_modeset.c". > > > --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c > > +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c > > @@ -123,8 +123,11 @@ static int hyperv_pipe_check(struct > > drm_simple_display_pipe *pipe, > > if (fb->format->format != DRM_FORMAT_XRGB8888) > > return -EINVAL; > > > > - if (fb->pitches[0] * fb->height > hv->fb_size) > > + if (fb->pitches[0] * fb->height > hv->fb_size) { > > + drm_err(&hv->dev, "hv->hdev, fb size requested by process %s > > for %d X %d (pitch %d) is greater than allocated size %ld\n", > Should we use drm_err_ratelimited() instead of drm_err()? The error is not produced in good cases, for every resolution change which is violating this error should print once. I suggest having it print every time some application tries to violate the policy set at boot time. If we use ratelimit many resolutions error change will be suppressed. Please let me know your thoughts. > > The line exceeds 80 chars. At first I tried braking the line to respect 80 character boundary, but checkpatch.pl reported it as a problem. And these new lines are suggested by checkpatch.pl itself. Looks the recent rule realted to 80 charachters are changed. Ref : https://www.theregister.com/2020/06/01/linux_5_7/#:~:text=Linux%20kernel%20overlord%20Linus%20Torvalds,the%20topic%20of%20line%20lengths. > > > + current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size); > > return -EINVAL; > > + } > > Maybe we can use the below: > drm_err_ratelimited(&hv->dev, "%s: requested %dX%d (pitch %d) " > "exceeds fb_size %ld\n", > current->comm, fb->width, fb->height, > fb->pitches[0], hv->fb_size); > > Note: the first chars of last 3 lines should align with the "&" in the > same column. Please run "scripts/checkpatch.pl" against the patch. I have tested checkpatch.pl before sending, for the current patch there is no problem from checkpatch.pl