Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2294931pxb; Wed, 9 Feb 2022 15:25:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyu3bh/hKNgfX0uqFlpO/uhsTKJrjtcnP4FhnhcD4RurwKID4zti8W3T7H83j9yC5R+iIcC X-Received: by 2002:a63:924c:: with SMTP id s12mr3828744pgn.257.1644449126532; Wed, 09 Feb 2022 15:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644449126; cv=none; d=google.com; s=arc-20160816; b=Uds9LenrdXWPT1T5Bzrwt9ECV7dG64DdfzoLF1ViadDgf630LwvuH2+MbMRtVujM+d JL7K/s3owv00CDbk1FtIp3LlNOp6v6c4qbCDGQ3n/nsv4Gy1Ug513WLIyqSQ5t+iRCI3 AAz0sHaUI+P7QCnqqwN4r+8htgN0by9C6nvyDN9Nh1C4DVdTai7UUUjKdnYnYyTqBYTY /S3KnVL9cl1xetoD/lJMzB8hxJtCi+786RO6iGnqxsuoJ1O7ISQn0XiU6oQcsrF1PerI 5WiG2mDtxfuDVOtkPsWXFSD0XdUIoVuibbrCgyJ9BWQmI1/2mNkG0R4RggWbJTI8d4tP 2bKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=tRKCiiRHceiLRy+NxeZhLe5Cq39TXay5X0Sl0G0+3k0=; b=fcf6vVKkOqfFOusYbY2AorF/EoBOlqa+iw0L27tksm+jtqmcOaRCGpkVU9fVIikC4J 5jPNUWNBfOaJkPpGFmUw5X2rgYf1VG+TaV5cFkoxCg+LWfwTVh25bjo/lNrdvdE1uJFY xJWNq1f/qqbFXBVxSmFJrbE3TM7/xALTbWWxQh8Uq4LlaNVRk9tBr5kD3VCsw+oEA5/x mQ5TvE0FfxhDLe7AjSHO4Qs1j1rIBE9tpnP1nn0HKPrcCpOXtSO6u0nO5VxGbxTtS2rO c2pdghktOVx2rZxr5YIqHD7q5oOnSmfWimWOFilN7nho0ixJvw/rL2OgrtKrm3fQzzuw hcGg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e70si17004254pgc.682.2022.02.09.15.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 15:25:26 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0BE39E054845; Wed, 9 Feb 2022 15:19:49 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236738AbiBIW5V (ORCPT + 99 others); Wed, 9 Feb 2022 17:57:21 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236730AbiBIW5U (ORCPT ); Wed, 9 Feb 2022 17:57:20 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0791E04FF0E; Wed, 9 Feb 2022 14:57:17 -0800 (PST) Received: from mail-wr1-f50.google.com ([209.85.221.50]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MJFpj-1ncUka4Bwp-00Kg3E; Wed, 09 Feb 2022 23:57:16 +0100 Received: by mail-wr1-f50.google.com with SMTP id k1so6462532wrd.8; Wed, 09 Feb 2022 14:57:15 -0800 (PST) X-Gm-Message-State: AOAM531OxbqUDbiD8ccEUA6VLQ5DtT2saq1TFCuWx+hNsGSz0C0UgMO8 9Rpy7XZpSVSNUwmaSi46bjAW7lkKdUPxKguXHvM= X-Received: by 2002:a05:6000:178d:: with SMTP id e13mr3797888wrg.317.1644447435616; Wed, 09 Feb 2022 14:57:15 -0800 (PST) MIME-Version: 1.0 References: <20211218165258.16716-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20211218165258.16716-3-prabhakar.mahadev-lad.rj@bp.renesas.com> <042a2183-3f04-088c-1861-656de870337d@gmail.com> <7c47ce67-88ee-9cba-3356-a530b0d3e657@gmail.com> <9a07be5a-914b-cec9-f6bc-8c1b0ecef766@gmail.com> In-Reply-To: <9a07be5a-914b-cec9-f6bc-8c1b0ecef766@gmail.com> From: Arnd Bergmann Date: Wed, 9 Feb 2022 23:56:59 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] i2c: sh_mobile: Use platform_get_irq_optional() to get the interrupt To: Sergei Shtylyov Cc: Arnd Bergmann , Geert Uytterhoeven , Lad Prabhakar , Rob Herring , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list , Chris Brandt , Wolfram Sang , Linux I2C , linux-rpi-kernel , Linux ARM , Linux Kernel Mailing List , Linux-Renesas , Prabhakar , Linux-sh list Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:iz4osL0LS/CVwD/e5yrQnoMN5iG7QTanvYybME2u+hzIbUJrl8k SXJurOPxymVZf+kuK3k8lwyHGylgPOYeAGSXatMOAxPCIn96aBYoB4Qgh2cQIHjghA7uNsp UlcLVhcoGpZBirw9Yo12SkJK453F/fRkQ3tcAtNgRBleprYmqdtKHE+f4xjX36ThU14tpGz /Kk+J+w4EtklWFEXlJajQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:fsFsCFBlECc=:RkXJd5cyMagMVbYd1HFAmX VPWo5iFnBW6yuIUnu0wlIx01Lur2D9szeda7iwfPXy7gavOpIk7L2jPgXaUG3Y8B9JzWlsODo cwXN/TavqXTZH7rwWN93xxWnpiBEW44Ybf+z4Eo48byU9A6wu2YyfZTiTC94pI6JzNgT2xziL vMXnntK6A8Ux1xd4x3aEWGJZa3giFHe0Aso5TgtNUuPs66YmVFuXTGtGV91SEmmYpe4+hH8bA sboyRG8ztwE++qAnoK1BMmWTcuwf3bOQfJHUkwReJzcJeRlkePAmEq6dK29wwGXGk82RsFj2Z lEeWhOSgWm3YyhdKJinVBOhBbsaimilPafvScJ0Pgb5LapmR4LgWOTykyWMOpGipsUueI7mkO 9N5Uu6xG8jcpysphDIBupP/z74J0K2k19ZpBjO+6PeWMvXisR1RswYs4EM30khVjjKFAdW3+1 q7pczo1+T6NFnREnTdo/80fnIhgMZsCWxSy3L9GVosl6SSebQQOoarSeKxrmmgG8QKA6okuCL gAfYEGDLoUfJZZzo/73cbZ3t0oLoxZF31aGYD7J2+1hTg9jWm/cxc5LXYwgZQZLJS3QFHOA9l ediB0FUmDK3BlRtuxtkfAXHbO02+kBaESaYTCxbXQRo7blTcinhhuxnXWi3kFbEKIA9yrpbgX bKOewf6sDaEaKBxOc8+EWDZJk/9hj5r8kVGMAxHkkn8Lr9Sxv3T5/kWfP7JdrSW7IdPY= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,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 Wed, Feb 9, 2022 at 5:08 PM Sergei Shtylyov wrote: > On 2/9/22 7:02 PM, Arnd Bergmann wrote: > > > > + shlr2 r4 > > + shlr r4 > > + mov r4, r0 ! save vector->jmp table offset for later > > + > > + shlr2 r4 ! vector to IRQ# conversion > > + add #-0x10, r4 > > + > > + cmp/pz r4 ! is it a valid IRQ? > > + bt 10f > > > > gets the vector (0x200 for this device), shifts it five bits to 0x10, > > and subtracts 0x10, > > then branches to do_IRQ if the interrupt number is non-zero, otherwise it goes > > through the exception_handling_table. > > The SH4 manual I found on my disk (have it from MontaVista times) tells me cmp/pz > sets T if Rn is >= 0, then bt branches if T = 1. So I do think the code is correct. > One more thing: the board code for those boards was added in 2011, we can assume > it was working back then, right? :-_ Indeed, this does make more sense, I had not realized that the numbers could get negative here. Arnd