Received: by 10.192.165.148 with SMTP id m20csp3510599imm; Mon, 7 May 2018 13:37:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrMIfmm3UmUvqtr6OE7yPiyCTxFJrglWASxLNbdcb0H32Od/6SRbjRuUIeGYnO2fw4vQFEE X-Received: by 2002:a6b:8bc8:: with SMTP id n191-v6mr44099926iod.145.1525725466661; Mon, 07 May 2018 13:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525725466; cv=none; d=google.com; s=arc-20160816; b=HPkANcdz1cnZRzbRB/xw/sfQo0s/HY9SOB0Efam8g7yvmJ6D/TmvGjksvR4X4gedE/ gleOPu5hE8udLnpelOE6c3pq9SsBoBn3w560olf0sdG+48s5X90/uty64TW6YPyHuZNn c79Pe1gqxWqxNifougg7Eb0OCUAzrma0RIXBUiy1ycmPgh7WFo+YAoVfyZbx3fQ67pBn uHQHv2Y4FiGfbtZl1FhH74H7DZoOuXY4O7ZbY7401xRFCh3DXeald0S/QoiNLCp0ol1A Sl0z9AdnpBU9Qx7X2qsTDg40uDonkPzi91LXUSvmfYoJFnUnGSlSgPXpJzPDeQqWKITD S98Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=5QZUFv9JFfRp285h90EY/WSDYIqWrDteA7btyFFokH8=; b=LNbW8FMlkrBg4WF9F1FvzgzsKSE/2wfaPYEziNauq3UIx/k2ujfRiTGRZRtZkIWNS6 Q/8Aa1sfnRPnBDmYk/pWXYskM0W8BVAzFGla5mjL6h4qKwWioV25Hkk4klNwT5rZz49/ 1A3VTjSSHf5lthirLq/CSS8UzQkbe7eKOzNLQ5WN74Rp7ZUVZyohaAbOUMLUqI1CIF1f 0vY8F09dmexY2hhb6jOKrSpP8yUkOASXvicdSL/P85HPLtTZts8XUuC67clpjvXqbxGl bO4snYULlG7tBD40ZY7SNJcDI0AogzP3wKcK1syljdJBuoYbVU+8PLEuB5KoteRBSs/p hdnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ECKMuDTx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n75-v6si20205370ion.1.2018.05.07.13.37.30; Mon, 07 May 2018 13:37:46 -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=fail header.i=@gmail.com header.s=20161025 header.b=ECKMuDTx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753081AbeEGUhA (ORCPT + 99 others); Mon, 7 May 2018 16:37:00 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:32888 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753027AbeEGUgr (ORCPT ); Mon, 7 May 2018 16:36:47 -0400 Received: by mail-qt0-f196.google.com with SMTP id e8-v6so33300954qth.0; Mon, 07 May 2018 13:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5QZUFv9JFfRp285h90EY/WSDYIqWrDteA7btyFFokH8=; b=ECKMuDTxyvmG+l8wN/tZjqQ5NSCkj8QuB2dMLQcy36Xt/ZnqflmuHyrHVOrjODjxXQ ZrhT5bxpnPURB2GuHJq4Ba1uC2HmWCsxeh1FHMs3e7FAppkKsk19qoKnJfvlsjcEIwOx 7+a1TcG4XhrWD+KlYpqn6BuuWQTlpj+HJ4OWy94hd3OQS7kzbVD1K086QvVouz0O3bHX M3yNdcOtgvcKx8QwWNz+oKKlmzi7+UzgjA8MuivF71gOiCKZRmie4K8YTJpZN2VruzKc BT7WjbUPLQqwHPDvDx3I7b71FqXB3rJ6nS/+7qEE8oQI1xVQLQFXFRxcOEuCggWyU08j 7WYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=5QZUFv9JFfRp285h90EY/WSDYIqWrDteA7btyFFokH8=; b=QiaenMCoQeMBk1aAwKuDet6eM29cjqYTzvSWy6Q+qmyWivrtja27wB7J+WGmYXOXkm 01PXZMMi41eGUnzWFtZTMmNsGU12TI72fqEutNjr2yXU8h0lWtkkV9QWavybXogiYZoQ 1BtWSVMjx+ADfnXhAJY0MRGnt/4MsX7oyXYns45mfeUWzKGW7T19D4Brve5IoKATO/XN n0Qy63KbuOq0qLkb5G4d+wyowZHnjM7dDz1q3bX3ferbsMoZLgxWzahm/ykBmxGyT4VA epEWdDfGcc6Xgl2bl/rH6HcfXE/ZSDQpze6om2wuFo91dT9xm/VNd6KAJRmnP7zodFYI At2w== X-Gm-Message-State: ALQs6tAYLNKQMXNRqthCuKsSwt4PAay3EY4NetkxRbvwRGnR1iunnRT9 4+UZMqHXn1L4VmgVy4emfm7rrD6oR2AQ1gb40so= X-Received: by 2002:ac8:1c12:: with SMTP id a18-v6mr35816397qtk.280.1525725406052; Mon, 07 May 2018 13:36:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.3 with HTTP; Mon, 7 May 2018 13:36:45 -0700 (PDT) In-Reply-To: <20180507131906.rdvcmvim5gvi5odk@valkosipuli.retiisi.org.uk> References: <20180425213044.1535393-1-arnd@arndb.de> <2922276.lKgGZtlCEW@avalon> <20180507131906.rdvcmvim5gvi5odk@valkosipuli.retiisi.org.uk> From: Arnd Bergmann Date: Mon, 7 May 2018 16:36:45 -0400 X-Google-Sender-Auth: Pf5QjQCjdf1PGhIYsNXZWYFg-c0 Message-ID: Subject: Re: [PATCH] [RESEND] [media] omap3isp: support 64-bit version of omap3isp_stat_data To: Sakari Ailus Cc: Laurent Pinchart , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 7, 2018 at 9:19 AM, Sakari Ailus wrote: > On Mon, May 07, 2018 at 04:17:32PM +0300, Laurent Pinchart wrote: >> On Thursday, 26 April 2018 00:30:10 EEST Arnd Bergmann wrote: >> > +int omap3isp_stat_request_statistics_time32(struct ispstat *stat, >> > + struct omap3isp_stat_data_time32 *data) >> > +{ >> > + struct omap3isp_stat_data data64; >> > + int ret; >> > + >> > + ret = omap3isp_stat_request_statistics(stat, &data64); >> > + >> > + data->ts.tv_sec = data64.ts.tv_sec; >> > + data->ts.tv_usec = data64.ts.tv_usec; >> > + memcpy(&data->buf, &data64.buf, sizeof(*data) - sizeof(data->ts)); >> > + >> > + return ret; >> >> We could return immediately after omap3isp_stat_request_statistics() if the >> function fails, but that's no big deal, the error path is clearly a cold path. I looked at it again and briefly thought that it would leak kernel stack data in my version and changing it would be required to avoid that, but I do see now that the absence of the INFO_FL_ALWAYS_COPY flag makes it safe after all. I agree that returning early here would be nicer here, I'll leave it up to Sakari to fold in that change if he likes. >> > @@ -165,7 +167,14 @@ struct omap3isp_h3a_aewb_config { >> > * @config_counter: Number of the configuration associated with the data. >> > */ >> > struct omap3isp_stat_data { >> > +#ifdef __KERNEL__ >> > + struct { >> > + __s64 tv_sec; >> > + __s64 tv_usec; >> > + } ts; >> >> I share Sakari's comment about this method implying a little-endian system, >> but as the SoCs that integrate this device are all little-endian, that's not a >> problem in practice. To clarify: the version I have here does *not* imply a little-endian system, it is supposed to work on both little-endian and big-endian builds, and endianess is not a property of the SoC either -- you should be able to build a big-endian kernel and run it on OMAP3 (aside from bugs in other drivers). Using 'long' here instead of __s64 would however make this interface broken on big-endian builds since the glibc definition of timeval does include extra padding on big-endian machines to make the structure compatible between 32-bit and 64-bit ABIs. >> Reviewed-by: Laurent Pinchart >> >> If you agree with the small comment about header ordering, let's get this >> patch finally merged. > > I can make the change locally in my tree, no need to resend. > > Thanks. Thanks a lot!