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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC693C433E0 for ; Tue, 12 Jan 2021 08:16:29 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 087CE22D2C for ; Tue, 12 Jan 2021 08:16:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 087CE22D2C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1kzEqc-0002ox-6p; Tue, 12 Jan 2021 03:16:14 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kzEqa-0002os-Lp for kernelnewbies@kernelnewbies.org; Tue, 12 Jan 2021 03:16:12 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 4B8AD1C51; Tue, 12 Jan 2021 03:16:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 12 Jan 2021 03:16:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm2; bh=q lDtu/s0F/nATUfqd3p9bUjKbTEc00nmUW/zpIqhF2U=; b=hvWnZ5oqYrgDrbyPT NwabbCK95LVLUm9Ce/O7tZYvmS46xnHbzVVy6BEZbwlAQS7LXalC+zg8oyr6YlW7 8XpGxrNhjS8uhFEKVnHh7lpkSbtUsQ9pNSnD1Pce9i6rJlp0gmfbXwxu4e16V29G j3m2BRi/Vw9+yuZD77UY+y+thsGBNslC8lz3uG3nc0PSz+BwMYoG7opzrjUhT4nF IlmnaawT8UdfLTruHmbZJ/VN8og1qRc/eNYSwKsvCQhvw/uCSYyvAN9zrmLRTqf8 iHw6qGja6xr/BkEIT1EyqqJQ+75cCjHCJiaqvGgOPyWhZHP+EmRSka1zUL9MEcxl dVobA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=qlDtu/s0F/nATUfqd3p9bUjKbTEc00nmUW/zpIqhF 2U=; b=qHA55TnM0kg0oJjueC34S3NhPw6NPVYF3HHKrUfjtVu/A31lRvYu5hZ9s k8BUIJW9zSlhIr61HnIYMXYtV/tMAkdByvNzOFuv2YhQzASWDKfSTEFDsLj05EiM 9oe4XmzA/PcYYNmJ3E96vqB+GtBNMtMuaWJwg8IF9EPXXXRGpjsaGblwBrIctlUU RR+DUMhwnCjZWnLcFGeFuPi0WMb26lVLKUWQbkm5fA/RNdJkUkPDwo6xFC5bGaUm cunfuDU8zKmvhsZiaDys+kfZ0TASLTyb3R9SxJhr4l3lydw1I62x3bbVBUVgfgZh DpM9MAaIvEXTbeTIhkWlimSBAPmPw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdehvddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpefirhgv ghcumffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpeevtd eileeuteeggefgueefhfevgfdttefgtefgtddvgeejheeiuddvtdekffehffenucfkphep keefrdekiedrjeegrdeigeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id 6A0631080059; Tue, 12 Jan 2021 03:16:10 -0500 (EST) Date: Tue, 12 Jan 2021 09:16:08 +0100 From: Greg KH To: Jorge Fernandez Monteagudo Subject: Re: How to replace set_fs(KERNEL_DS) for a kernel 5.10.x module driver version Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: "kernelnewbies@kernelnewbies.org" X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: kernelnewbies-bounces@kernelnewbies.org On Tue, Jan 12, 2021 at 07:39:37AM +0000, Jorge Fernandez Monteagudo wrote: > >> Hi all, this is my first post in this mailing list... I hope to find a= n answer. I've post the question in stackoverflow with the same tittle with= no answers yet. Since then, I've been able to reduce the demo kernel modul= e to minimum in order to show but I see. The minimum kernel module code is = attached at the end. > >> = > >> My kernel module was working ok up to kernel 5.10.x. My kernel module = adds a layer above the cdc-acm class driver to use all the infrastructure t= his driver because the hardware it controls has a ttyACMx device. The minim= um kernel module code attached shows how I open the ttyACMx device and try = to set the baudrate. Once the device is opened I use the unlocked_ioctl fun= ction with TCSETS to set the new device properties. = > >> = > >>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =3D fd->f_op->unlocke= d_ioctl(fd, TCSETS, (unsigned long int) &newtio); > = > >Ick, why do all of this from the kernel and not just do it from > >userspace? > > > >Do you have a pointer to the source of your whole module so we can help > >with solving the root problem and not mess with this specific > >implementation which is not the correct thing to do at all. > = > Hi Greg! > = > Well, I can summarize as technological debt :( = > I have to maintain an old code and I've been succesful until now with > minimal changes... Is there no way to overcome this? There might be, again, do you have a pointer to your full source for the module? thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies