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=-0.5 required=3.0 tests=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 CA8DDC8300C for ; Thu, 30 Apr 2020 11:21:31 +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 8DB852076D for ; Thu, 30 Apr 2020 11:21:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="IPQtf96v"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gVjtr9p5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DB852076D 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.92.3) (envelope-from ) id 1jU7FU-0003L6-LF; Thu, 30 Apr 2020 07:21:00 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jU7FR-0003Kl-Nk for kernelnewbies@kernelnewbies.org; Thu, 30 Apr 2020 07:20:58 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4067F5C00B8; Thu, 30 Apr 2020 07:20:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 30 Apr 2020 07:20:53 -0400 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:in-reply-to; s=fm3; bh=Ugh9/2Yg55yQIJTuGpmmrqeO8lm bsPCvBFISrzrpjHg=; b=IPQtf96vHz1DnfplUCkTQ2TT8fKJtMtO+CBs2NAk4at PcSkoKwOlad795Cf1Wj/IP0XrHcdnwExC0WRGPBZ/VYKsTs7DFzc8eDA+xTeuwU5 R/lgpyX6ITJ9C/wDJrZSMZr/pwMCPEBJdt6mQNtIw1Sy9VL+HlSe3wBUEhN9PeYh t8J1v/JPq3V0dSHIxWG2rhs7DNGql+ubr8qqcwgBO4771a/nrMw9ftatpQr/Qs1+ y+Z0PQ9Zi0kEKpRJWQQhik/DM6YIoBQi3vbiPXKB9xj+4b0W2EKaM0duFdQ8hWfU YbYxreWGqxNiZA5UnfKvkJP/7xnIGMH8C7AZT1vfXig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm2; bh=Ugh9/2 Yg55yQIJTuGpmmrqeO8lmbsPCvBFISrzrpjHg=; b=gVjtr9p5PMU3xMYaCWnmot c/AkpoV0UZBXU/rEh2W58GGnQFDUZKCCnO/Opv6FUCLtuCjtNC9H6nB38l2NR+OX v8qLUcq2zWbVi2VVzPJYAOfscU+7o8UXUXw6UGBCbBHX/Zr8t0UpLVTxbhawGb82 ywvevpwJux+o5NxTpqyegzH56J5b9E9b17tVZZibEUoedzEqk07RKvF+FXCw5Zl3 PcsZ7Qdbk4qZJLIpO5DVRLwFziX73lV7klM/aCL5+9eR0KQ6sPFLH1dn0fv8d12T triykkLG7ieORRS0G0M82rxauDCLBX/DjA8M9COq7X+1Qr9mkbvrodhX4xvSxpRQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrieehgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghgucfm jfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepveeuheejgf ffgfeivddukedvkedtleelleeghfeljeeiueeggeevueduudekvdetnecukfhppeekfedr keeirdekledruddtjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 4C1DC3065F1E; Thu, 30 Apr 2020 07:20:51 -0400 (EDT) Date: Thu, 30 Apr 2020 13:20:47 +0200 From: Greg KH To: Tomek The Messenger Subject: Re: how to perform i2c transaction with disabled irq? Message-ID: <20200430112047.GA2945793@kroah.com> 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="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Thu, Apr 30, 2020 at 01:11:06PM +0200, Tomek The Messenger wrote: > Hi > If I don't have disabled irqs I can use API i2c_smbus_write_byte in order > to perform i2c transaction. > But how to make i2c transaction if I have disabled irq? Is any built-in > function which lets such operation, where there is some polling implemented? > The background is that I do i2c transaction in restart handler (some i2c > transaction to hot swap controller) in order to reset board. And linux > before entering restart handler list disable interrupts. There is a > function to enable back interrupts but in company in which I am working > engineers reviewed it and said "it is not allowed, restart must be > performed when interrupts are disabled". Ask the engineers how you are supposed to use an interrupt driven device with interrupts disabled. good luck! greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies