Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2781202pxb; Mon, 1 Nov 2021 01:31:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8QY7LUAuNKSXYKMZrerFp1rX5o8P7kH+u4JOPyqHIKbfpVV87HXDldFsNzNaJVjOIC3x+ X-Received: by 2002:a17:906:5384:: with SMTP id g4mr34122782ejo.27.1635755459829; Mon, 01 Nov 2021 01:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635755459; cv=none; d=google.com; s=arc-20160816; b=oXJ5GNiQg6NSAcgQqvpW4yAkDRvcjTdOvRGYnBqBneR8P/796bblPlC/Bdm1utnMP3 ZhKZe2nGalAfNQpiipxHZk8jPJMthSRUWLk8RRAugApJH2HYxzlbI2/7uSP0R3U+Gphl RX8CW7ia6aT60vVtirFy2d2X6Ac1OzDwM4Zqqqrghcls+TY4SGoy+zcJvHm2Zlo0e8TZ dMKCPfaIKk5z6X61RqwJXqDCC0RdWR6FATqxfMKx3dsZA07oXHpgJW8mnDxIdGbEDM30 9bI4KvPAehEd2CZg7DopemL2pCM9/YEgGQtqo5s2G3ZuAf0wlY+Uz7hV7nXCbA9GUX42 vzCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=rLYc2G7l568846X07TdBmjzCwDIDOvIn7X7PVv2nopc=; b=TBbABPHT+Bw1gDxJDhTs3TzDEvrTG6b8/5PlXJVGZJWeb18sgdjq/3ShOa0J25V7Vh GOWD+AJx0xfSYQUND8f08Sjef/5aq77CDWTU5zNndaddPc616r6X2PkvuugbQiRjyZI+ DDR68qjaffK6LfzB5NJ6r54jFvHv9NJv2+CMPvYEc+GuTxrOsa6Mt/hV25lSfbDm3baw 8rOIn3PagjR1+uzStStwxKKNueptZ/O/IgQPpKQdCTPfJ1H6qXiEHXZ/CKQLCiHfGahC PMGM587YBrA5myQaH1a1Nw9bRaF0mQFj5m0itncm6tB+6HZ40cnlBg9VS15zmJrVhQRq 2wZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=GROQR8Ds; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq3si36293681ejc.142.2021.11.01.01.30.20; Mon, 01 Nov 2021 01:30:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=GROQR8Ds; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231320AbhKAIcH (ORCPT + 99 others); Mon, 1 Nov 2021 04:32:07 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:24659 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhKAIcH (ORCPT ); Mon, 1 Nov 2021 04:32:07 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1635755374; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=rLYc2G7l568846X07TdBmjzCwDIDOvIn7X7PVv2nopc=; b=GROQR8DshcBVM7xLROPuUFa7+zUFLhx/riAcSqBvwFy+vDlv6HCkFht56eAEEGtQn2SywF9/ tiaDuyfbp0yk63iF9xHxMzRXXCo1Y1j7HRvOpUJAXpqYrumEAP1OnIMwG7OW90LyILix8TIS 5u3W58G8mgg6H8532c4lJGNUCvg= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI2MTA3ZSIsICJsaW51eC1ibHVldG9vdGhAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 617fa55b648aeeca5cd66511 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 01 Nov 2021 08:29:15 GMT Sender: zijuhu=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 3C5A4C4360D; Mon, 1 Nov 2021 08:29:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [10.231.195.33] (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zijuhu) by smtp.codeaurora.org (Postfix) with ESMTPSA id B1F04C4338F; Mon, 1 Nov 2021 08:29:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org B1F04C4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org Subject: Re: [PATCH v1] serdev: Add interface serdev_device_ioctl To: Greg KH Cc: robh@kernel.org, jirislaby@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, Zijun Hu References: <1635753048-5289-1-git-send-email-zijuhu@codeaurora.org> From: Zijun Hu Message-ID: Date: Mon, 1 Nov 2021 16:29:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On 11/1/2021 3:59 PM, Greg KH wrote: > On Mon, Nov 01, 2021 at 03:50:48PM +0800, Zijun Hu wrote: >> From: Zijun Hu >> >> For serdev_device which is mounted at virtual tty port, tty ioctl() >> maybe be used to make serdev_device ready to talk with tty port, so >> add interface serdev_device_ioctl(). >> >> Signed-off-by: Zijun Hu >> --- >> drivers/tty/serdev/core.c | 11 +++++++++++ >> drivers/tty/serdev/serdev-ttyport.c | 12 ++++++++++++ >> include/linux/serdev.h | 9 +++++++++ >> 3 files changed, 32 insertions(+) >> >> diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c >> index f1324fe99378..c0f6cd64716b 100644 >> --- a/drivers/tty/serdev/core.c >> +++ b/drivers/tty/serdev/core.c >> @@ -405,6 +405,17 @@ int serdev_device_set_tiocm(struct serdev_device *serdev, int set, int clear) >> } >> EXPORT_SYMBOL_GPL(serdev_device_set_tiocm); >> >> +int serdev_device_ioctl(struct serdev_device *serdev, unsigned int cmd, unsigned long arg) >> +{ >> + struct serdev_controller *ctrl = serdev->ctrl; >> + >> + if (!ctrl || !ctrl->ops->ioctl) >> + return -EOPNOTSUPP; > > Wrong error for returning that an ioctl is not handled :( checkpatch.pl always reports below WARNING when i use ENOTSUPP as present interfaces do. so i change error code to EOPNOTSUPP. #28: FILE: drivers/tty/serdev/core.c:412: + return -ENOTSUPP; WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP > > Anyway, what in-tree driver needs this functionality? Why does serdev > need any ioctl commands? > i am developing driver for a special bluetooth controller which is integrated within SOC, and it does not connect with the BT HOST with UART as normal controller do, but it has very similar features as the BT controller with UART I/F. it is mounted on a virtual serial port driven by a tty driver developed. but it need to call tty ioctl to make the special BT controller ready to talk with tty port. so i add this interface. as you known, the main purpose of ioctl is to achieve MISC and irregular control. so it is useful for these irregular devices. thanks > thanks, > > greg k-h >