qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
	Andrew Randrianasulu <randrianasulu@gmail.com>,
	Amit Singh Tomar <amit.tomar@freescale.com>
Subject: Re: [PATCH] hw/i2c/mpc_i2c.c: Fix mmio region size
Date: Mon, 22 Jul 2024 23:12:45 +0200	[thread overview]
Message-ID: <daad7f23-92f0-4b8f-b0c6-a1e8510f3702@linaro.org> (raw)
In-Reply-To: <5ccba9c4-50ec-7d55-4d34-14a925662563@eik.bme.hu>

On 22/7/24 12:16, BALATON Zoltan wrote:
> On Mon, 22 Jul 2024, Philippe Mathieu-Daudé wrote:
>> +Amit & Andrew
>>
>> On 22/7/24 00:55, BALATON Zoltan wrote:
>>> The last register of this device is at offset 0x14 occupying 8 bits so
>>> to cover it the mmio region needs to be 0x15 bytes long. Also correct
>>> the name of the field storing this register value to match the
>>> register name.
>>>
>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>> ---
>>>   hw/i2c/mpc_i2c.c | 8 ++++----
>>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>>
>>> @@ -329,7 +329,7 @@ static void mpc_i2c_realize(DeviceState *dev, 
>>> Error **errp)
>>>       MPCI2CState  *i2c = MPC_I2C(dev);
>>>       sysbus_init_irq(SYS_BUS_DEVICE(dev), &i2c->irq);
>>>       memory_region_init_io(&i2c->iomem, OBJECT(i2c), &i2c_ops, i2c,
>>> -                          "mpc-i2c", 0x14);
>>> +                          "mpc-i2c", 0x15);
>>
>> Personally I'm not a big fan of non-pow2 regions, so I'd have picked
>> 0x20 or 0x100 where the 2nd i2c controller starts. Amit, what do you
> 
> Coverung unused areas isn't a good idea because that would omit invalid 
> read/write warnings when those are enabled so it's harder to catch 
> unimplemented registers that way. So 0x100 is definitely overkill, 0x20 
> could be acceptable as other regs are also covering some unused area 
> after them but is also unnecessary when we can cover exactly the area 
> where the register is.

Yeah. I'm queuing this patch via hw-misc, thanks.


      reply	other threads:[~2024-07-22 21:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21 22:55 [PATCH] hw/i2c/mpc_i2c.c: Fix mmio region size BALATON Zoltan
2024-07-22  8:08 ` Philippe Mathieu-Daudé
2024-07-22 10:16   ` BALATON Zoltan
2024-07-22 21:12     ` Philippe Mathieu-Daudé [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=daad7f23-92f0-4b8f-b0c6-a1e8510f3702@linaro.org \
    --to=philmd@linaro.org \
    --cc=amit.tomar@freescale.com \
    --cc=balaton@eik.bme.hu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=randrianasulu@gmail.com \
    /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).