From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7EC48C4332F for ; Wed, 2 Nov 2022 10:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qgtQNupM3Y3n1oel9o2flyvxVgZuNawf5nc6To0QjCA=; b=fgdUka748z+Gp0 n6j8ngXly9NpI0psXsEnGdEcKEVkW7cEpHkTRHyJldq1UbKet/rVh2GeYkH0q7fTMfW4nZOKBFwHC RlJVeJxB5efyNeha/OyCCNUUUdD6pahuEVIIOcclK703xRh4A6snGobr9D5s7vGvhndnubPxjNvS/ sEDDoZYuf/V3ugY4Gv3E+a5zh/t0SPnkxK95nbwTRb7dR7Z3kOt0NfF3HU8b2w9YZaKvBOWgFvRng VciXekKE2LSG3aV5mXkmWBODX7o2hLJQdpCtioByw46QR8NNF/34F6SzKnUFrVESNXmIlRZHKGJ8y kViv5zUfdGR/nvmzlOgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqBGx-00Aa5K-6h; Wed, 02 Nov 2022 10:47:03 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqBGk-00AZxU-EM for linux-amlogic@lists.infradead.org; Wed, 02 Nov 2022 10:46:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667386009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iUJvEUx8gtjx3iaw6xY22YZZMkx+Fxj3A7QQSAUB80Y=; b=T87IqFJZSlOlifCgmebXXRAT5ue7io3bE5fewotsIP+V771gj8/acEcwEsyaiTmn9SzYak 0nJN8s2T7jSU3itL3bwQIk/wTplB6GR0e18xorCpPkyKcxKCOS7zSdtYrwj9dfHPFW4wPA 1kHkzukDAUfnBMskJU31qpjuWafEGkc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-36-zGxb9PKONyGYhrC3zwLWsA-1; Wed, 02 Nov 2022 06:46:46 -0400 X-MC-Unique: zGxb9PKONyGYhrC3zwLWsA-1 Received: by mail-wm1-f71.google.com with SMTP id c10-20020a7bc84a000000b003cf81c2d3efso335557wml.7 for ; Wed, 02 Nov 2022 03:46:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iUJvEUx8gtjx3iaw6xY22YZZMkx+Fxj3A7QQSAUB80Y=; b=s4tQ2i5oi0jyhlxsQcSmZ7b9iOlqdcXSs8AC89cwiSu0V+LfAagSpW6VuFTqIFnQzc LMu/Oa6awTdglS1nEPBVcbcKPgHJdP9hVDy/KUqvfl/RBVg83DNZGN9YixoOTL8aExSF kssy6yh4HOC5lyEdOjEQz1nfo/0MDBy7jcLm/ziPnQKWDFiBaziLIIuxXG292STW+emX EYjgFsU/7VwoDOvNl9m7t2/AXpM1G0WOkXCHgRKPduWKZEoXrAhvIgPyvjG7yDGUl9hT GJsSPFhd3sRYdj5OvSjS4wUIRyW9wGcdsJjNYya6Js2meAuFV3DkxfANS0ICdvRFYbeA GS0A== X-Gm-Message-State: ACrzQf0oG+HdSPdfuBBx1R9EuqDDUeYW0WNgC1gtoJODY/ii3TdDuO6p wmcwKU8ZCNzhTEvisdBRU1vShmz5iF1uduQn/uF/k2o4zsocR+mdxFPe+Hb8LNwTgT6EvMZxw4t xyogUo5yUqmFPwyZ0/B6HEB0dFHuGsFw= X-Received: by 2002:a05:600c:3556:b0:3ca:771d:701a with SMTP id i22-20020a05600c355600b003ca771d701amr14652033wmq.61.1667386004927; Wed, 02 Nov 2022 03:46:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jzv0egtLEIAVaxEN/tayyZgqvKvq+1qzahuWoTfzpPIfJE04AyAO6MvJnCllXJsp0I0J18w== X-Received: by 2002:a05:600c:3556:b0:3ca:771d:701a with SMTP id i22-20020a05600c355600b003ca771d701amr14651998wmq.61.1667386004691; Wed, 02 Nov 2022 03:46:44 -0700 (PDT) Received: from [192.168.1.130] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id c18-20020a05600c0a5200b003b3365b38f9sm1701531wmq.10.2022.11.02.03.46.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Nov 2022 03:46:44 -0700 (PDT) Message-ID: <5abf94d6-9a48-525e-c562-605529c5793a@redhat.com> Date: Wed, 2 Nov 2022 11:46:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v2 17/21] drm/fb-helper: Perform all fbdev I/O with the same implementation To: Thomas Zimmermann , daniel@ffwll.ch, airlied@gmail.com, sam@ravnborg.org, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, etnaviv@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-hyperv@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, xen-devel@lists.xenproject.org References: <20221024111953.24307-1-tzimmermann@suse.de> <20221024111953.24307-18-tzimmermann@suse.de> <3ab32fc3-f2aa-1b42-fd87-557482ab56d5@redhat.com> <0ca70b76-c24a-4fdb-cf0d-2647d37379df@suse.de> From: Javier Martinez Canillas In-Reply-To: <0ca70b76-c24a-4fdb-cf0d-2647d37379df@suse.de> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_034650_570339_A9EDFE0E X-CRM114-Status: GOOD ( 19.07 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On 11/2/22 11:33, Thomas Zimmermann wrote: [...] >> >>> +static ssize_t __drm_fb_helper_write(struct fb_info *info, const char __user *buf, size_t count, >>> + loff_t *ppos, drm_fb_helper_write_screen write_screen) >>> +{ >> >> [...] >> >>> + /* >>> + * Copy to framebuffer even if we already logged an error. Emulates >>> + * the behavior of the original fbdev implementation. >>> + */ >>> + ret = write_screen(info, buf, count, pos); >>> + if (ret < 0) >>> + return ret; /* return last error, if any */ >>> + else if (!ret) >>> + return err; /* return previous error, if any */ >>> + >>> + *ppos += ret; >>> + >> >> Should *ppos be incremented even if the previous error is returned? > > Yes. It emulates the original fbdev code at [1]. Further down in that > function, the position is being updated even if an error occured. We > only return the initial error if no bytes got written. > > It could happen that some userspace program hits to error, but still > relies on the output and position being updated. IIRC I even added > validation of this behavior to the IGT fbdev tests. I agree that this > is somewhat bogus behavior, but changing it would change long-standing > userspace semantics. > Thanks for the explanation, feel free then to also add to this patch: Reviewed-by: Javier Martinez Canillas -- Best regards, Javier Martinez Canillas Core Platforms Red Hat _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic