mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: David Miller <davem@davemloft.net>
Cc: kuba@kernel.org, evgreen@chromium.org, subashab@codeaurora.org,
	cpratapa@codeaurora.org, bjorn.andersson@linaro.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 5/5] net: ipa: warn if gsi_trans structure is too big
Date: Thu, 11 Jun 2020 07:58:00 -0500	[thread overview]
Message-ID: <448830d1-c19e-b8d6-169a-a114baae133f@linaro.org> (raw)
In-Reply-To: <20200610.163658.2043816131147701638.davem@davemloft.net>

On 6/10/20 6:36 PM, David Miller wrote:
> From: Alex Elder <elder@linaro.org>
> Date: Wed, 10 Jun 2020 14:53:32 -0500
> 
>> When the DEBUG_SPINLOCK and DEBUG_LOCK_ALLOC config options are
>> enabled, sizeof(raw_spinlock_t) grows considerably (from 4 bytes
>> to 56 bytes currently).  As a consequence the size of the gsi_trans
>> structure exceeds 128 bytes, and this triggers a BUILD_BUG_ON()
>> error.
>>
>> These are useful configuration options to enable, so rather than
>> causing a build failure, just issue a warning message at run time
>> if the structure is larger than we'd prefer.
>>
>> Signed-off-by: Alex Elder <elder@linaro.org>
> 
> Please fix the problem or prevent the build of this module in such
> configurations since obviously it will fail to load successfully.

It will not fail to load; this really shouldn't have been treated as
a BUG to begin with.  The condition can be detected at build time but
I'm not aware of a BUILD_WARN_ON() (which would probably break the
build anyway).  The check should at least have remained under the
control of IPA_VALIDATE, because it's really there for my benefit
so I'm told if the structure grows unexpectedly.

Your pushback on this has made me think a bit more about how much
of a problem this really is though, so I'll omit this last patch
in version 2 of this series that I will post today.  Then after a
little more consideration I'll post a revised version of this one
(or not).

Thanks.

					-Alex

> It is completely unexpected for something to fail at run time that
> could be detected at build time.
> 


      reply	other threads:[~2020-06-11 12:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 19:53 [PATCH net 0/5] net: ipa: endpoint configuration fixes Alex Elder
2020-06-10 19:53 ` [PATCH net 1/5] net: ipa: program metadata mask differently Alex Elder
     [not found]   ` <202006110832.hKzHUsMH%lkp@intel.com>
2020-06-11 19:18     ` Alex Elder
2020-06-10 19:53 ` [PATCH net 2/5] net: ipa: fix modem LAN RX endpoint id Alex Elder
2020-06-10 19:53 ` [PATCH net 3/5] net: ipa: program upper nibbles of sequencer type Alex Elder
2020-06-10 19:53 ` [PATCH net 4/5] net: ipa: header pad field only valid for AP->modem endpoint Alex Elder
2020-06-10 19:53 ` [PATCH net 5/5] net: ipa: warn if gsi_trans structure is too big Alex Elder
2020-06-10 23:36   ` David Miller
2020-06-11 12:58     ` Alex Elder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=448830d1-c19e-b8d6-169a-a114baae133f@linaro.org \
    --to=elder@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=cpratapa@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=evgreen@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=subashab@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®