From: Matthew Wilcox <willy@infradead.org>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: linux-m68k@lists.linux-m68k.org
Subject: Re: clear_bit_unlock_is_negative_byte
Date: Fri, 21 Jul 2023 02:32:01 +0100 [thread overview]
Message-ID: <ZLngEXDdrAKSw+90@casper.infradead.org> (raw)
In-Reply-To: <5e3a36d1-13f0-9cc3-de44-cc045025b290@gmail.com>
On Fri, Jul 21, 2023 at 01:12:48PM +1200, Michael Schmitz wrote:
> Logging the bit nr. and value passed in:
>
> nfhd8: found device with 20971440 blocks (512 bytes)
> cbu_inb memval mismatch: 2004 12005 2005 0
> cbu_inb memval mismatch: 2004 12005 2005 0
> nfhd8: AHDI p1 p2
> cbu_inb memval mismatch: 36 10037 37 0
> cbu_inb memval mismatch: 36 10037 37 0
I'm not quite sure what values you're printing here? And whether
they're hex or decimal. Could you show me the printk string?
> The instruction you need is eori.b, and you'll have to increase the mem
> pointer by 3 bytes. With that change, I see no further mismatches until the
> return values begin to differ once disk access begins:
Ah thanks. The perils of working from Motorola official docs and then
trying to use the GNU assembler ...
> sd 0:0:1:0: [sdb] Preferred minimum I/O size 512 bytes
> cbu_inb retval mismatch: 1 ff 2084 2084 2085 0
> rtc-generic rtc-generic: registered as rtc0
> cbu_inb retval mismatch: 1 ff 2094 2094 2095 0
> ...
> sd 0:0:0:0: [sda] Attached SCSI disk
> probe of 0:0:0:0 returned 0 after 58395182 usecs
> cbu_inb retval mismatch: 1 ff 2094 2094 2095 0
> sdb: RDSK (512) sdb1 (DOS^G)(res 2 spb 2) sdb2 (SFS^B)(res 2 spb 1) sdb3
> (SFS^B)(res 2 spb 2) sdb4 ((res 2 spb 1)
> sdb: p4 size 18446744071971831216 extends beyond EOD, enabling native
> capacity
> cbu_inb retval mismatch: 1 ff 2084 2084 2085 0
>
> (return value from old and new code, value of mem from old and new code,
> original value, bit nr).
OK, so the new code would set the byte to 0xff (that's how Sxx works).
But it's returning a bool, so that shouldn't matter. 2084/2084/2085
would make sense; one of the two functions has cleared the bottom bit.
> Bit 7 was already set before xor, and wasn't cleared. I suspect that's why
> the return value is no longer 1?
Ah, it's not supposed to be cleared. The way this works is that bit 0
is the lock bit; if someone's waiting on the folio, they set bit 7. If
bit 7 is set when we clear bit 0, we look on the wait queue. If there's
nobody on the wait queue, we clear bit 7.
So ... I think you've fixed it!
next prev parent reply other threads:[~2023-07-21 1:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 19:27 clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-20 22:37 ` clear_bit_unlock_is_negative_byte Michael Schmitz
2023-07-21 1:12 ` clear_bit_unlock_is_negative_byte Michael Schmitz
2023-07-21 1:32 ` Matthew Wilcox [this message]
2023-07-21 1:43 ` clear_bit_unlock_is_negative_byte Michael Schmitz
2023-07-21 17:03 ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-21 22:07 ` clear_bit_unlock_is_negative_byte Michael Schmitz
2023-07-22 6:24 ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-22 14:45 ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-22 15:26 ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-22 15:38 ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-21 6:34 ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-21 8:57 ` clear_bit_unlock_is_negative_byte Brad Boyer
2023-07-21 9:18 ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-21 11:59 ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-21 12:52 ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-21 20:29 ` clear_bit_unlock_is_negative_byte Brad Boyer
2023-07-22 3:42 ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-22 23:49 ` clear_bit_unlock_is_negative_byte Brad Boyer
2023-07-23 1:08 ` clear_bit_unlock_is_negative_byte Michael Schmitz
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=ZLngEXDdrAKSw+90@casper.infradead.org \
--to=willy@infradead.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=schmitzmic@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