Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30697050rwd; Thu, 6 Jul 2023 09:23:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlEjAF1ZXtK4595soo1y2OF8uRceIz6z4a8o0hLbU/MhTK6RqCIDeB1VIw/e9I5bEGCFUR7i X-Received: by 2002:aca:909:0:b0:3a3:a78a:1751 with SMTP id 9-20020aca0909000000b003a3a78a1751mr2000290oij.55.1688660584007; Thu, 06 Jul 2023 09:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688660583; cv=none; d=google.com; s=arc-20160816; b=u0Rc5rMPvsznf0Swk/cHnlgBUri37cA7xUDz13Cl+6O3zmP8PkUJHQt5dW8kNP2qJB UexlUvppnq/jT0xVc5ukvj/uw5fskW1oVARB3NAn6R7b6exaFMb+HnFpCoeGyRhVYoPP CKILoUMS9zvfb8QTLbJ2K8WNYiMHR6fgTluisUiSUplhRRK32Yg9N+fi4KAloED6/7iy eY6vS2HUDcIFxhbPEvxT9hKXSo3HV00BYNIKfGU/P4UHLkEi62CCmnAaKT9LNgoz4+p9 PBOthkxejdPKBRuyCxfnXMNGmMgAxD0eNyNWPld1R2JFnXV72FQ5rcwVII5Aue6zinQ9 xkdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=kP3pF+XOxlc4Qv9/UJTQvZ314wf1LITEQ/lD6q6M3cs=; fh=YeXz+1KxjtmIJ2FnnkDVYI2d4IZTZoo+VZlnvxcKhWY=; b=bRLIhj2zgEK9zRs0g9sqyzCMhhPqBsxC4P0CQ8SsJ87VqKaCqw7GZ9+ZosRN+dzryQ psr5z4nh8un/m/a4f0HI41FmR31Yo5HHzGaBje+e+uJLSj5J7jF5NUxuexyev2w877sW pPp4fKdGVU1OyPG7YjkJ2goR2RDcSFEiT3I96EVMD1P6NvSAIRGtczX7r1qhWpiaF1rM 2Z4eL4rAysSCRaTN6RJwjcQfernM8PfVhWXod99L38LzEr1ix43ahU1oRFC04nwPgfsU pIzdIenoK+t2VXkRqJSsZ6ydCjcfXq21hV20nl5tWnWRR8J91scPtngu72Fq+4ywASgK 6wpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gf7JwHUD; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q143-20020a632a95000000b0055ba8970e7dsi1785372pgq.677.2023.07.06.09.22.48; Thu, 06 Jul 2023 09:23:03 -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=@gmail.com header.s=20221208 header.b=gf7JwHUD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233179AbjGFQD7 (ORCPT + 99 others); Thu, 6 Jul 2023 12:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjGFQD6 (ORCPT ); Thu, 6 Jul 2023 12:03:58 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 151E1DC; Thu, 6 Jul 2023 09:03:57 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-5774098f16eso11415367b3.0; Thu, 06 Jul 2023 09:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688659436; x=1691251436; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=kP3pF+XOxlc4Qv9/UJTQvZ314wf1LITEQ/lD6q6M3cs=; b=gf7JwHUDdQKlrqMaznOBPRjtILjUVDkaFMzAsovbd6ohVdpY6MbEtFQWKIRWoXCNKk T7PsTZ+oU5EETlfYxSm1t39vfALhQjOhfQXc8mTo7BPkxSNr6xL815JSq6zeCvkRNcrK Y7r+2ptw+2E1kophi1fPakut7byn6u7zbVgDEZMvI+bVCzJRbYFhk30j3HL2ID1RO0xX bbdl8n2ct/G3IXphx99hhYXH19VSkqaRLvLBlNAc0T++ZSESJn3bHrUFhnFHK4O8Ghfi oNzdsF3oSI2IDq/ESRAcjEvCm34Z2+7ssOnX9JZgL908OMjEPazKeIbH7c4Jjcf/z06I nc4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688659436; x=1691251436; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kP3pF+XOxlc4Qv9/UJTQvZ314wf1LITEQ/lD6q6M3cs=; b=IDCMvcq9UCTkaMYTzkVY4fy8YqUnszCXZePm5FQbqLgp49m6+QwGF3Mbsorcfedffu jDfASSVpsBlx4dECZw52cJQjrv3gX4ok9tsFwX+zobwPkeX999nNwNhlDgdRblhGeAmH ddxse6YdpY6Ew/ksqCHRPiFfYpEFhbxrpF/3Xd1pmoY1xlfGRrWGcihQkG3S+vfsbR5H xbYPp1ydHjSkS+pz9RFNS6JInmpWzCH4XB+7l2e7218aGNFpNaYiZveQA+9YHtFG3Yx8 Jx07FIalkj+U/YzMz4oLAme/4jnBLfV30PusWi5jMaBiDPFDrGBQO1b2YhdFizRFMnqw aY3A== X-Gm-Message-State: ABy/qLY7t5Rn2K1gQxJvb3H19UrtKbSb6H0aAenpcHGcXEuhoRHD1MMS 6Ql0sV6a4bshN2lQ9adm7C0= X-Received: by 2002:a25:aa28:0:b0:c10:7a9f:a96a with SMTP id s37-20020a25aa28000000b00c107a9fa96amr2266065ybi.16.1688659436153; Thu, 06 Jul 2023 09:03:56 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c12-20020a5b014c000000b00c624de0d9absm393124ybp.5.2023.07.06.09.03.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jul 2023 09:03:55 -0700 (PDT) Sender: Guenter Roeck Message-ID: <876f6a08-1850-21cd-83d1-b309e7e1e912@roeck-us.net> Date: Thu, 6 Jul 2023 09:03:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 1/2] watchdog: simatic-ipc-wdt: make IO region access of one model muxed Content-Language: en-US To: Henning Schild , Hans de Goede , Mark Gross , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: Wim Van Sebroeck , Jean Delvare , linux-watchdog@vger.kernel.org, linux-hwmon@vger.kernel.org, Tobias Schaffner , Gerd Haeussler References: <20230706154831.19100-1-henning.schild@siemens.com> <20230706154831.19100-2-henning.schild@siemens.com> From: Guenter Roeck In-Reply-To: <20230706154831.19100-2-henning.schild@siemens.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 7/6/23 08:48, Henning Schild wrote: > The IO region used for the watchdog also hold CMOS battery monitoring > information. Make the access muxed so that a hwmon driver can use the > region as well. > > Signed-off-by: Henning Schild Acked-by: Guenter Roeck > --- > drivers/watchdog/simatic-ipc-wdt.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/watchdog/simatic-ipc-wdt.c b/drivers/watchdog/simatic-ipc-wdt.c > index 6599695dc672..cdc1a2e15180 100644 > --- a/drivers/watchdog/simatic-ipc-wdt.c > +++ b/drivers/watchdog/simatic-ipc-wdt.c > @@ -155,9 +155,8 @@ static int simatic_ipc_wdt_probe(struct platform_device *pdev) > > switch (plat->devmode) { > case SIMATIC_IPC_DEVICE_227E: > - if (!devm_request_region(dev, gp_status_reg_227e_res.start, > - resource_size(&gp_status_reg_227e_res), > - KBUILD_MODNAME)) { > + res = &gp_status_reg_227e_res; > + if (!request_muxed_region(res->start, resource_size(res), res->name)) { > dev_err(dev, > "Unable to register IO resource at %pR\n", > &gp_status_reg_227e_res); > @@ -210,6 +209,10 @@ static int simatic_ipc_wdt_probe(struct platform_device *pdev) > if (wdd_data.bootstatus) > dev_warn(dev, "last reboot caused by watchdog reset\n"); > > + if (plat->devmode == SIMATIC_IPC_DEVICE_227E) > + release_region(gp_status_reg_227e_res.start, > + resource_size(&gp_status_reg_227e_res)); > + > watchdog_set_nowayout(&wdd_data, nowayout); > watchdog_stop_on_reboot(&wdd_data); > return devm_watchdog_register_device(dev, &wdd_data);