Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp11436717rwr; Sat, 13 May 2023 03:38:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5LeZcitg08PnWk1aw1NOQXz6uYZH4cDo+VyX81lTUTUHLKBovUoUeFNduzWmDa3W9tdZb6 X-Received: by 2002:a05:6a00:2d9a:b0:641:d9b:a458 with SMTP id fb26-20020a056a002d9a00b006410d9ba458mr36362030pfb.18.1683974331030; Sat, 13 May 2023 03:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683974331; cv=none; d=google.com; s=arc-20160816; b=j6OQhTqHRI/ZXbMtb8uNUZ6ksjagRQze7FrrrfANryTLGh2fJJEdPlSiTSPRX3pdpo jVh2WhwSD4fjad5r7WbuMs4Ldwx5s4aiVrwxuwUGrNzpcI0BwZcjtkMGjRVR0fW05cOl OssSoT7VfidTSZ05D+cmK6hch1PwjixJOwmtALgAcVVXLIAb2CtLQUonQUPRiGunITqr 34p/Om23BC9/EEksCJuhY7AmPYNY5tvu70PrIcZLyzdvFBEBz0wQQgjQLP7ujtqVGHLn raKGNj2+mb1ZBu68zt0WwsFn5T7+ssPcveh79RJNsGruOzh7RsW2gZGqMrXM3GEx7Rfx xHYA== 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=+c1E8RADDgyXsQrQS4UezdDMJ3RSztVkf+Xwc7JJ6EY=; b=LDxJNmaTEPU4ek1ynwdtrcCNtp2Hs1vHh4Zuye0Me2d9f08o11SAEPHW/dPA5tM22R 4XAW5TqirtSvLZ7nYx0NKQyoLuItBkNeYM5+0HB3px5tbFXm+EN2+9m2gVNlb9ZHciYf 2Wg7HGVy/kPebpPmQy/lYMZMnp+lfSfZUCwW2jHO5s9FWySytP4wI2xu2N5NFjD3kvUV RMOmkjqrJBOC31Cf4pF06cz6+9YXoi37AK3c0CnXQlfHl5ml+ZjHO4SAD/cjOVThSZIZ f0FUpa3IeS1K8yvTX3SyNwYlL8aYM6PDxiTTnJETQJllo6J1iDSpl1jQXaR6lutfaC54 o+rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v0jjWKo1; 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 j20-20020a633c14000000b0051f8817a307si12061334pga.869.2023.05.13.03.38.38; Sat, 13 May 2023 03:38:51 -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=@linuxfoundation.org header.s=korg header.b=v0jjWKo1; 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 S237517AbjEMKbU (ORCPT + 99 others); Sat, 13 May 2023 06:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjEMKbR (ORCPT ); Sat, 13 May 2023 06:31:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A553C2707; Sat, 13 May 2023 03:31:16 -0700 (PDT) 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 3C79860DC1; Sat, 13 May 2023 10:31:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F78EC433EF; Sat, 13 May 2023 10:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683973875; bh=5NN3vTvtA3k7NEEN2qxhzaq6KiSZLMr+MGh82yJ/Gh8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v0jjWKo1+3GZCdJ3KjIyvX16eX9tVdbZfjAF4e3JGaJej2iSZ6hPfFrqapXPTDKQN tLzrMP/rRv9YFpF3x/Qqdw55ah9nsdlZuK2l9oxgNxmibyVXvfiVMkljwMMBRbKf95 W8hmsYoeRfZoi1OE5gCCshO5y07cnwVrF8BG9fPI= Date: Sat, 13 May 2023 19:22:26 +0900 From: Greg KH To: "D. Starke" Cc: linux-serial@vger.kernel.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/8] tty: n_gsm: add restart flag to DLC specific ioctl config Message-ID: <2023051316-flatly-spookily-5a0a@gregkh> References: <20230426080315.7595-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230426080315.7595-1-daniel.starke@siemens.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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Wed, Apr 26, 2023 at 10:03:08AM +0200, D. Starke wrote: > From: Daniel Starke > > Currently, changing the parameters of a DLCI gives no direct control to the > user whether this should trigger a channel reset or not. The decision is > solely made by the driver based on the assumption which parameter changes > are compatible or not. Therefore, the user has no means to perform an > automatic channel reset after parameter configuration for non-conflicting > changes. > > Add the parameter 'flags' to 'gsm_dlci_config' to force a channel reset > after ioctl setting regardless of whether the changes made require this or > not by setting this to 'GSM_FL_RESTART'. > > Note that 'GSM_FL_RESTART' is currently the only allow flag to allow > additions here. > > Signed-off-by: Daniel Starke > --- > drivers/tty/n_gsm.c | 4 ++++ > include/uapi/linux/gsmmux.h | 13 ++++++++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) > > v3 -> v4: > Changed gsm_dlci_config field name from 'restart' to 'flags' and introduced > 'GSM_FL_RESTART' to set the restart flag. The patch description was changed > accordingly. This was done as suggested during the review. > The remarked kernel doc compatible field comment is done in patch 2/8. > > Link: https://lore.kernel.org/all/2023042453-dubbed-botany-2ed9@gregkh/ > > diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c > index b411a26cc092..66edcf65a4dd 100644 > --- a/drivers/tty/n_gsm.c > +++ b/drivers/tty/n_gsm.c > @@ -2532,6 +2532,8 @@ static int gsm_dlci_config(struct gsm_dlci *dlci, struct gsm_dlci_config *dc, in > return -EINVAL; > if (dc->k > 7) > return -EINVAL; > + if (dc->flags & ~GSM_FL_RESTART) /* allow future extensions */ > + return -EINVAL; > > /* > * See what is needed for reconfiguration > @@ -2546,6 +2548,8 @@ static int gsm_dlci_config(struct gsm_dlci *dlci, struct gsm_dlci_config *dc, in > /* Requires care */ > if (dc->priority != dlci->prio) > need_restart = true; > + if (dc->flags & GSM_FL_RESTART) > + need_restart = true; > > if ((open && gsm->wait_config) || need_restart) > need_open = true; > diff --git a/include/uapi/linux/gsmmux.h b/include/uapi/linux/gsmmux.h > index eb67884e5f38..958257af05ab 100644 > --- a/include/uapi/linux/gsmmux.h > +++ b/include/uapi/linux/gsmmux.h > @@ -2,10 +2,20 @@ > #ifndef _LINUX_GSMMUX_H > #define _LINUX_GSMMUX_H > > +#include > #include > #include > #include > > +/* > + * flags definition for n_gsm > + * > + * Used by: > + * struct gsm_dlci_config.flags > + */ > +/* Force DLCI channel reset? Always cleared on retrieval. */ I do not understand this comment, sorry. What question are you asking? What happens if it is set? What happens if it is not set? More documentation is always good, especially for new user/kernel apis that are not documented anywhere else. thanks, greg k-h