Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp8937rwj; Wed, 21 Dec 2022 22:05:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXsO4bU9070uVsBXQ3tyAJue/JxVK2ocFyr+AbyHx7Z6n3RcHDa0gizuHtjWhkiub9FsY6qG X-Received: by 2002:a05:6402:249e:b0:472:c7fe:475e with SMTP id q30-20020a056402249e00b00472c7fe475emr4463024eda.27.1671689149273; Wed, 21 Dec 2022 22:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671689149; cv=none; d=google.com; s=arc-20160816; b=yIavP6hJTeU6Tbb83DagYDuGUXLr3CUEimDcY8hxEfv7Xv8hkAyFipwzJaiAznYG0d SJUgWr5H3L94Cqqz7BbdqZDcbLMUCjLvDxvdx8cPBNeDGwucZN2Y9omFP6uk0wLTvE+C lXvBcRQhq2YWhwADOr/DEzDv8Q4W557rpWMPoZrFMXVLsHspLCuAR/t9MbUyNF/vJQYh zMgqEbtTXgJmCqKXH4DFcv8cnqZPxYwnpxjU6jPxY3NacWE69vHKaSPwHWnfyGq/RTWE iwKE4OTxeeKNpZxzGjSoNcVvqm7CBiwzjELOWEIekbvsl2A8+YEIIdIXY5bClovqa8JO pRKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IP0k3gZQGq7p8hs3zX62SdD97WF7/nzF7dRE1fzWg5E=; b=aW2Qb8tmcoqKjYYjrhiKzkMLhI94C4bCiHDXmy97/Ry16WeHVrwjfq1F37rPDe1qxB +OMlyayEolOc6SsITTI3ggq2L1OeA3nVsRwnCc7KyFkiLtzxnJ91w1tvETHYRixarUQZ f+ILBFhp02i9tPzJ/S0IuGn4u130LV5qXyLLA24WK03ejNRyU2QXECJ6pW8LNFQA65hF 6fdpuhGS4h2lHJUFuvPDnc1oNFSrrg4FItkgaJ+3SkC8VbgHOMReFIQmn2VMA4xdE3LU kAvhf7QWJCtvS2BGhaS9GQHJPI9tujiXw2+PsgFmGIUWwcm1qgQNivBdyfZwK5yLKTHh K08A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sxanfO0y; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t6-20020a50ab46000000b0046b13a6c40fsi15066857edc.54.2022.12.21.22.05.30; Wed, 21 Dec 2022 22:05:49 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=sxanfO0y; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229935AbiLVFtd (ORCPT + 68 others); Thu, 22 Dec 2022 00:49:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbiLVFtc (ORCPT ); Thu, 22 Dec 2022 00:49:32 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD1FA1903A; Wed, 21 Dec 2022 21:49:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7DEDE619A9; Thu, 22 Dec 2022 05:49:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2516AC433EF; Thu, 22 Dec 2022 05:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1671688168; bh=nmkK+b6rO2+px289TNdsGXRo/I0rx3JEOKY+uOPK8+o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sxanfO0yJjrscX73PpAiSWzPJ63Y41V/jiTGYv2Z9axMIeVIS0D7Y+XrGfsssXVyB pOmyOKGq4hGmpnWkBip6Pc/rU3k9wARlISEY8rDm6va6ieqwQQ5SlKhQHbooONTLT3 k/fw6veUUpU4CHQIT1qnW8PWnr2YHurhQw44HSy8= Date: Thu, 22 Dec 2022 06:49:25 +0100 From: Greg KH To: Viken Dadhaniya Cc: jirislaby@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, quic_msavaliy@quicinc.com, quic_vnivarth@quicinc.com, quic_vtanuku@quicinc.com, quic_arandive@quicinc.com Subject: Re: [PATCH V1 1/1] Serial: core: Add compat ioctl support Message-ID: References: <20221222044925.27846-1-quic_vdadhani@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221222044925.27846-1-quic_vdadhani@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Thu, Dec 22, 2022 at 10:19:25AM +0530, Viken Dadhaniya wrote: > Current serial core driver doesn't support compat_ioctl > due to which 32-bit application is not able to send > ioctls to driver on a 64-bit platform. Are you sure? > Added compat_ioctl support in serial core to handle > ioctls from 32-bit applications on a 64-bit platform. > > Signed-off-by: Viken Dadhaniya > --- > drivers/tty/serial/serial_core.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c > index b9fbbee598b8..5ffa0798db3b 100644 > --- a/drivers/tty/serial/serial_core.c > +++ b/drivers/tty/serial/serial_core.c > @@ -1601,6 +1601,22 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) > return ret; > } > > +/** > + * uart_compat_ioctl: uart compat IOCTL function. > + * @tty: pointer to tty structure. > + * @cmd: command code passed by user-space. > + * @arg: argument passed by user-space. > + * > + * This function will call normal uart IOCTL. > + * > + * Return: 0 for success, Negative number for error condition. Why create kernel doc for a static function? uart_ioctl() does not have this, right? > + */ > +static long > +uart_compat_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) > +{ > + return (long)uart_ioctl(tty, cmd, arg); > +}; Really? Why has this never shown up before as an issue? How was this tested? What is currently broken that now works properly (or the other way around?) This patch implies that _every_ driver with an ioctl must create a compat_ioctl() callback, are you sure that is the case? thanks, greg k-h