qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Rashmica Gupta <rashmica@linux.ibm.com>
To: Peter Delevoryas <pdel@fb.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, clg@kaod.org,
	andrew@aj.id.au
Subject: Re: [PATCH] hw/gpio/aspeed_gpio: Fix QOM pin property
Date: Wed, 18 May 2022 17:31:05 +1000	[thread overview]
Message-ID: <09776fe6d855338ace01e57dc780c107b8f635bf.camel@linux.ibm.com> (raw)
In-Reply-To: <20220502080827.244815-1-pdel@fb.com>

On Mon, 2022-05-02 at 01:08 -0700, Peter Delevoryas wrote:
> I was setting gpioV4-7 to "1110" using the QOM pin property handler
> and
> noticed that lowering gpioV7 was inadvertently lowering gpioV4-6 too.
> 
>     (qemu) qom-set /machine/soc/gpio gpioV4 true
>     (qemu) qom-set /machine/soc/gpio gpioV5 true
>     (qemu) qom-set /machine/soc/gpio gpioV6 true
>     (qemu) qom-get /machine/soc/gpio gpioV4
>     true
>     (qemu) qom-set /machine/soc/gpio gpioV7 false
>     (qemu) qom-get /machine/soc/gpio gpioV4
>     false
> 
> An expression in aspeed_gpio_set_pin_level was using a logical NOT
> operator instead of a bitwise NOT operator:
> 
>     value &= !pin_mask;
> 
> The original author probably intended to make a bitwise NOT
> expression
> "~", but mistakenly used a logical NOT operator "!" instead. Some
> programming languages like Rust use "!" for both purposes.
> 
> Fixes: 4b7f956862dc ("hw/gpio: Add basic Aspeed GPIO model for
> AST2400 and
> AST2500")
> Signed-off-by: Peter Delevoryas <pdel@fb.com>


Oops! Thanks for catching this. The tests look good.




  parent reply	other threads:[~2022-05-18  7:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02  8:08 [PATCH] hw/gpio/aspeed_gpio: Fix QOM pin property Peter Delevoryas
2022-05-02 15:09 ` Cédric Le Goater
2022-05-02 16:02   ` Peter Delevoryas
2022-05-18  7:31 ` Rashmica Gupta [this message]
2022-05-18 15:08   ` Peter Delevoryas

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=09776fe6d855338ace01e57dc780c107b8f635bf.camel@linux.ibm.com \
    --to=rashmica@linux.ibm.com \
    --cc=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=pdel@fb.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).